|
@@ -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';
|