瀏覽代碼

[edit][v1.1.1]

zhangwei 2 年之前
父節點
當前提交
8420504eca

+ 22 - 11
src/logic/content/twitter.js

@@ -27,7 +27,7 @@ let fixProfileTabAutoTimer = null;
 
 let pin_login = false
 function twitterPinLogin() {
-    if(pin_login){
+    if (pin_login) {
         return
     }
     pin_login = true
@@ -482,7 +482,7 @@ export const _setPublishContent = throttle(function (content, time = 1000) {
 }, 800);
 
 
-const setDialogPublishContent =  throttle(function (content) {
+const setDialogPublishContent = throttle(function (content) {
     setTimeout(() => {
         let inputEle = document.querySelector('div[role="dialog"]').querySelector('div[contenteditable="true"]');
         const dataTransfer = new DataTransfer();
@@ -491,7 +491,7 @@ const setDialogPublishContent =  throttle(function (content) {
             clipboardData: dataTransfer,
             bubbles: true
         });
-        if(inputEle) {
+        if (inputEle) {
             inputEle.dispatchEvent(event);
         }
     }, 300)
@@ -873,7 +873,7 @@ export function init() {
     if (where) {
         return
     }
-    
+
     if (window.location.host.includes('twitter.com')) {
         showNFTCard()
         showNFTGroupIcon()
@@ -1331,7 +1331,7 @@ const TwitterLikeAPI = (tweet_Id) => {
 }
 
 export const TwitterApiUserByScreenName = (params) => {
-    let {screen_name} = params;
+    let { screen_name } = params;
     axios.get(`https://twitter.com/i/api/graphql/mCbpQvZAw6zu_4PvuAUVVQ/UserByScreenName?variables=%7B%22screen_name%22%3A%22${screen_name}%22%2C%22withSafetyModeUserFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%7D`, {
         headers: {
             "accept": "*/*",
@@ -1349,9 +1349,9 @@ export const TwitterApiUserByScreenName = (params) => {
             "x-twitter-auth-type": "OAuth2Session",
             "x-twitter-client-language": "en"
         },
-    }).then(function(response){
-        chrome.runtime.sendMessage({ actionType: "CONTENT_API_GET_TWEET_USER_INFO_RES", data: response.data.data || {}  }, () => { })
-    }).catch(function (response){
+    }).then(function (response) {
+        chrome.runtime.sendMessage({ actionType: "CONTENT_API_GET_TWEET_USER_INFO_RES", data: response.data.data || {} }, () => { })
+    }).catch(function (response) {
     });
 }
 
@@ -1425,6 +1425,7 @@ export const publishNFTTweetPost = ({ postId, srcContent, groupId }) => {
     textContent = textContent.replaceAll('⬇️', '')
     textContent = textContent.replaceAll('Join', '')
     textContent = textContent.replaceAll('Now:', '')
+    textContent = textContent.trim()
 
     let formData = {
         groupId,
@@ -1461,6 +1462,16 @@ export const setTwitterTextarea = (params, num = 5) => {
         document.execCommand("insertText", false, '');
         setTimeout(() => {
             document.execCommand("insertText", false, params.srcContent);
+            // 光标定位到起始位置
+            setTimeout(() => {
+                inputEle.focus();
+                let sel = window.getSelection()
+                let range = document.createRange()
+                range.setStart(inputEle, 0)
+                range.setEnd(inputEle, 0)
+                sel.removeAllRanges()
+                sel.addRange(range);
+            }, 0)
             publishNFTTweetEvent(params, bindTwitterArtMethod)
         }, 1000)
     } else {
@@ -1518,7 +1529,7 @@ export const showGroupTip = () => {
 export const hideBuyNFT = () => {
     let iframe = document.querySelector('#nftProjectId')
     iframe.style.display = 'none'
-    iframe.src =''
+    iframe.src = ''
 }
 
 export const showBuyNFT = ({ nft_project_Id }) => {
@@ -1917,7 +1928,7 @@ export const selectGroupTab = () => {
 };
 
 export const groupTipsSelectGroupTab = (params = {}) => {
-    if(params.type =='btn') {
+    if (params.type == 'btn') {
         let groupTab = getGroupTabNode();
         if (groupTab) {
             let line = groupTab.querySelector('#de-tab-line');
@@ -2236,7 +2247,7 @@ const fixProfileTabAutoSwitch = () => {
 export const setTabGroupIframeStyle = (params) => {
     let iframeContent = getGroupTabContentNode();
     if (iframeContent) {
-        let htmlHeight =  document.querySelector('html').offsetHeight;
+        let htmlHeight = document.querySelector('html').offsetHeight;
         let primaryColumnHeightn = document.querySelector('div[data-testid="primaryColumn"]').offsetHeight;
         let height = primaryColumnHeightn > htmlHeight ? primaryColumnHeightn : htmlHeight;
         iframeContent.style.height = height + 'px';

+ 1 - 1
src/view/iframe/group-card/card.vue

@@ -12,7 +12,7 @@
                     <div style="display: flex; align-items: center;">
                         <img :src="require('@/assets/svg/icon-user.svg')"
                             style="width:16px;height:16px; margin-right: 5px;" alt="" />
-                        <span style="color: #fff;">{{ state.data.memberCount }} Member</span>
+                        <span style="color: #fff;">{{ state.data.memberCount }} Members</span>
                     </div>
                     <div style="display: flex; align-items: center; margin-left: 17px;">
                         <img :src="require('@/assets/svg/icon-messgae.svg')"

+ 1 - 1
src/view/iframe/nft/group-card.vue

@@ -12,7 +12,7 @@
                     <div class="opt">
                         <label>
                             <img src="../../../assets/svg/icon-nft-member.svg" />
-                            <span>{{ detail.memberCount }} Member</span>
+                            <span>{{ detail.memberCount }} Members</span>
                         </label>
                         <label>
                             <img src="../../../assets/svg/icon-nft-post.svg" />

+ 1 - 2
src/view/iframe/red-packet/luck-draw.vue

@@ -2,7 +2,7 @@
 <template>
     <div class="content">
         <!-- global-tip -->
-        <!-- <global-tip :type="'1'"></global-tip> -->
+        <global-tip :type="'1'"></global-tip>
         <!-- open -->
         <div v-show="state.status == 'opened'" class="opened">
 
@@ -430,7 +430,6 @@ import { getSetting, putSetting } from '@/http/user'
 import { getFrontConfig } from "@/http/account";
 import { getInviteGuildInfo } from "@/http/discordApi";
 import GlobalTip from '@/view/components/global-tip.vue'
-import { formItemValidateStates } from "element-plus";
 var moment = require('moment');
 
 let discordAuthorizeRequired = false;