|  | @@ -72,14 +72,18 @@ export function hideIframeHandler() {
 | 
											
												
													
														|  |  /**
 |  |  /**
 | 
											
												
													
														|  |   * 展示twitter原生发布框
 |  |   * 展示twitter原生发布框
 | 
											
												
													
														|  |   */
 |  |   */
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | 
 |  | +let tweetPublishStore = {
 | 
											
												
													
														|  | 
 |  | +    showPublishDialog : false
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  |  export function showTwitterPublishDialogHandler(publishRes) {
 |  |  export function showTwitterPublishDialogHandler(publishRes) {
 | 
											
												
													
														|  |      let bigBtn = document.querySelector('a[data-testid="SideNav_NewTweet_Button"]');
 |  |      let bigBtn = document.querySelector('a[data-testid="SideNav_NewTweet_Button"]');
 | 
											
												
													
														|  |      if (bigBtn) {
 |  |      if (bigBtn) {
 | 
											
												
													
														|  |          bigBtn.click();
 |  |          bigBtn.click();
 | 
											
												
													
														|  | 
 |  | +        tweetPublishStore.showPublishDialog = true;
 | 
											
												
													
														|  |      } else {
 |  |      } else {
 | 
											
												
													
														|  |          let smallBtn = document.querySelector('a[href="/compose/tweet"]')
 |  |          let smallBtn = document.querySelector('a[href="/compose/tweet"]')
 | 
											
												
													
														|  |          smallBtn && smallBtn.click();
 |  |          smallBtn && smallBtn.click();
 | 
											
												
													
														|  | 
 |  | +        tweetPublishStore.showPublishDialog = true;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      setChromeStorage({ publishData: JSON.stringify(publishRes) })
 |  |      setChromeStorage({ publishData: JSON.stringify(publishRes) })
 | 
											
										
											
												
													
														|  | @@ -172,6 +176,7 @@ function _publishTweetEvent(params, cb) {
 | 
											
												
													
														|  |          publishTweetBtn && publishTweetBtn.addEventListener('click', function () {
 |  |          publishTweetBtn && publishTweetBtn.addEventListener('click', function () {
 | 
											
												
													
														|  |              bindTwitterArt.needBind = true;
 |  |              bindTwitterArt.needBind = true;
 | 
											
												
													
														|  |              bindTwitterArt.postId = params.postId;
 |  |              bindTwitterArt.postId = params.postId;
 | 
											
												
													
														|  | 
 |  | +            tweetPublishStore.showPublishDialog = false;
 | 
											
												
													
														|  |              // checkIsShowReSend(dialog, params);
 |  |              // checkIsShowReSend(dialog, params);
 | 
											
												
													
														|  |              cb && cb()
 |  |              cb && cb()
 | 
											
												
													
														|  |          });
 |  |          });
 | 
											
										
											
												
													
														|  | @@ -187,10 +192,18 @@ function onClosePublishDialogHandle(dom, params) {
 | 
											
												
													
														|  |                   for(let i = 0; i < btnArr.length; i++) {
 |  |                   for(let i = 0; i < btnArr.length; i++) {
 | 
											
												
													
														|  |                       let btn = btnArr[i];
 |  |                       let btn = btnArr[i];
 | 
											
												
													
														|  |                       btn.addEventListener('click', function() {
 |  |                       btn.addEventListener('click', function() {
 | 
											
												
													
														|  | 
 |  | +                        tweetPublishStore.showPublishDialog = false;
 | 
											
												
													
														|  |                          let taskLuckdropId = JSON.parse(params.postBizData).taskLuckdropId;
 |  |                          let taskLuckdropId = JSON.parse(params.postBizData).taskLuckdropId;
 | 
											
												
													
														|  |                          noticeBindTweet({ postId: params.postId, taskLuckdropId});
 |  |                          noticeBindTweet({ postId: params.postId, taskLuckdropId});
 | 
											
												
													
														|  |                       })
 |  |                       })
 | 
											
												
													
														|  |                   }
 |  |                   }
 | 
											
												
													
														|  | 
 |  | +             } else {
 | 
											
												
													
														|  | 
 |  | +                 setTimeout(() => {
 | 
											
												
													
														|  | 
 |  | +                    let dialog = document.querySelector('div[role="dialog"]');
 | 
											
												
													
														|  | 
 |  | +                    if(!dialog) {
 | 
											
												
													
														|  | 
 |  | +                        tweetPublishStore.showPublishDialog = false;
 | 
											
												
													
														|  | 
 |  | +                    }
 | 
											
												
													
														|  | 
 |  | +                 }, 800)
 | 
											
												
													
														|  |               }
 |  |               }
 | 
											
												
													
														|  |          }, 1000)
 |  |          }, 1000)
 | 
											
												
													
														|  |       })
 |  |       })
 | 
											
										
											
												
													
														|  | @@ -316,25 +329,24 @@ function _addIframe() {
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -function addPublishTipsIframe({ srcContent }) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +function addPublishTipsIframe(params = {}) {
 | 
											
												
													
														|  | 
 |  | +    let {time = 1000} = params;
 | 
											
												
													
														|  |      setTimeout(() => {
 |  |      setTimeout(() => {
 | 
											
												
													
														|  |          let dialog = document.querySelector('div[role="dialog"]').querySelector('div[role="dialog"]')
 |  |          let dialog = document.querySelector('div[role="dialog"]').querySelector('div[role="dialog"]')
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          if (dialog) {
 |  |          if (dialog) {
 | 
											
												
													
														|  | -            let right = dialog.offsetLeft - 15 - 266, top = window.innerHeight * 0.05 + dialog.offsetHeight - 60 - 160;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -            top = top - 80 > 0 ? top - 80 : 0;
 |  | 
 | 
											
												
													
														|  | 
 |  | +            let right = dialog.offsetLeft - 15 - 266;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |              let iframe = document.createElement('iframe');
 |  |              let iframe = document.createElement('iframe');
 | 
											
												
													
														|  |              iframe.id = 'de-publish-tips'
 |  |              iframe.id = 'de-publish-tips'
 | 
											
												
													
														|  |              iframe.src = chrome.runtime.getURL('/iframe/publish-tips.html');
 |  |              iframe.src = chrome.runtime.getURL('/iframe/publish-tips.html');
 | 
											
												
													
														|  | -            iframe.style.cssText = `border: medium none; width:270px;height:500px;position: fixed; right: ${right}px; top: ${top}px;z-index: -1`
 |  | 
 | 
											
												
													
														|  | 
 |  | +            iframe.style.cssText = `border: medium none; width:270px;height:500px;position: fixed; right: ${right}px; top: 5%;z-index: -1`
 | 
											
												
													
														|  |              let iframeContent = document.getElementById('de-publish-tips');
 |  |              let iframeContent = document.getElementById('de-publish-tips');
 | 
											
												
													
														|  |              if (!iframeContent) {
 |  |              if (!iframeContent) {
 | 
											
												
													
														|  |                  dialog.appendChild(iframe)
 |  |                  dialog.appendChild(iframe)
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -    }, 1000)
 |  | 
 | 
											
												
													
														|  | 
 |  | +    }, time)
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  export function noticeBindTweet(params) {
 |  |  export function noticeBindTweet(params) {
 | 
											
										
											
												
													
														|  | @@ -519,6 +531,14 @@ function addSliderNavDeBtn(isSmall = false) {
 | 
											
												
													
														|  |  function onWindowResize() {
 |  |  function onWindowResize() {
 | 
											
												
													
														|  |      window.onresize = throttle(function () {
 |  |      window.onresize = throttle(function () {
 | 
											
												
													
														|  |          try {
 |  |          try {
 | 
											
												
													
														|  | 
 |  | +            if(tweetPublishStore.showPublishDialog) {
 | 
											
												
													
														|  | 
 |  | +                let dialog = document.querySelector('div[role="dialog"]');
 | 
											
												
													
														|  | 
 |  | +                let dePublishTips = document.getElementById('de-publish-tips');
 | 
											
												
													
														|  | 
 |  | +                if(dialog && !dePublishTips) {
 | 
											
												
													
														|  | 
 |  | +                    addPublishTipsIframe({time: 0});
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +            
 | 
											
												
													
														|  |              if (window.innerWidth < 1273) {
 |  |              if (window.innerWidth < 1273) {
 | 
											
												
													
														|  |                  let bigBtn = document.querySelector('#de-btn');
 |  |                  let bigBtn = document.querySelector('#de-btn');
 | 
											
												
													
														|  |                  bigBtn && bigBtn.remove();
 |  |                  bigBtn && bigBtn.remove();
 | 
											
										
											
												
													
														|  | @@ -800,8 +820,18 @@ export function onTweetReplyClick(params) {
 | 
											
												
													
														|  |  function onReplyDialogOpen(params, iframe) {
 |  |  function onReplyDialogOpen(params, iframe) {
 | 
											
												
													
														|  |      setTimeout(() => {
 |  |      setTimeout(() => {
 | 
											
												
													
														|  |          let dialog = document.querySelector('div[role="dialog"]');
 |  |          let dialog = document.querySelector('div[role="dialog"]');
 | 
											
												
													
														|  | 
 |  | +        let replyBtn; 
 | 
											
												
													
														|  | 
 |  | +        
 | 
											
												
													
														|  |          if (dialog) {
 |  |          if (dialog) {
 | 
											
												
													
														|  | -            let replyBtn = dialog.querySelector('div[data-testid="toolBar"]').querySelector('div[data-testid="tweetButton"]');
 |  | 
 | 
											
												
													
														|  | 
 |  | +            replyBtn = dialog.querySelector('div[data-testid="toolBar"]').querySelector('div[data-testid="tweetButton"]');
 | 
											
												
													
														|  | 
 |  | +        } else {
 | 
											
												
													
														|  | 
 |  | +            dialog = document.querySelector('main[role="main"]');
 | 
											
												
													
														|  | 
 |  | +            if(dialog) {
 | 
											
												
													
														|  | 
 |  | +                replyBtn = dialog.querySelector('div[data-testid="tweetButton"]');
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        if(dialog && replyBtn) {
 | 
											
												
													
														|  |              replyBtn.addEventListener('click', function () {
 |  |              replyBtn.addEventListener('click', function () {
 | 
											
												
													
														|  |                  let eleList = dialog.querySelector('div[contenteditable="true"]').querySelectorAll('span[data-text="true"]');
 |  |                  let eleList = dialog.querySelector('div[contenteditable="true"]').querySelectorAll('span[data-text="true"]');
 | 
											
												
													
														|  |                  reportReplyResult(eleList, params, () => {
 |  |                  reportReplyResult(eleList, params, () => {
 |