|
@@ -2,6 +2,7 @@ import { getChromeStorage, setChromeStorage, LANDING_PAGE } from '@/uilts/chrome
|
|
|
import { throttle } from '@/uilts/help'
|
|
|
import { getTtwitterRequestToken, twitterLogin } from '../server/twitter.js'
|
|
|
import { srcPublishSuccess } from '@/http/publishApi'
|
|
|
+import Report from "@/logcenter/log"
|
|
|
|
|
|
let dom = {};
|
|
|
|
|
@@ -200,11 +201,23 @@ function _publishTweetEvent(contentStr, cb) {
|
|
|
function _addDeNetEditBtn(parent, dom, isClick = false) {
|
|
|
setTimeout(() => {
|
|
|
if (parent && parent.parentNode) {
|
|
|
+ Report.reportLog({
|
|
|
+ pageSource: Report.pageSource.mainPage,
|
|
|
+ businessType: Report.businessType.buttonView,
|
|
|
+ objectType: Report.objectType.buttonSecond
|
|
|
+ });
|
|
|
parent.parentNode.insertBefore(dom, parent.nextElementSibling);
|
|
|
} else {
|
|
|
setTimeout(() => {
|
|
|
parent = _getScheduleDom(isClick);
|
|
|
- parent && parent.parentNode && parent.parentNode.insertBefore(dom, parent.nextElementSibling);
|
|
|
+ if(parent && parent.parentNode) {
|
|
|
+ Report.reportLog({
|
|
|
+ pageSource: Report.pageSource.mainPage,
|
|
|
+ businessType: Report.businessType.buttonView,
|
|
|
+ objectType: Report.objectType.buttonSecond
|
|
|
+ });
|
|
|
+ parent.parentNode.insertBefore(dom, parent.nextElementSibling);
|
|
|
+ }
|
|
|
}, 1000)
|
|
|
}
|
|
|
})
|
|
@@ -385,12 +398,14 @@ function _createBtnDom(port) {
|
|
|
style.innerHTML = "#de-btn:hover{opacity: .9;};@-webkit-keyframes load{from{ transform: rotate(0deg);} to{transform: rotate(360deg);}}";
|
|
|
document.getElementsByTagName('head').item(0).appendChild(style);
|
|
|
|
|
|
+ // 左侧大屏按钮
|
|
|
let deBtn = document.createElement('span');
|
|
|
// const shadowDiv = document.createElement('div');
|
|
|
deBtn.innerHTML = '<span>DeNet</span>';
|
|
|
deBtn.id = 'de-btn';
|
|
|
deBtn.style.cssText = 'width:90%;height: 52px;text-align:center;line-height:52px;margin-bottom: 4px;margin-top: 4px;background: linear-gradient(274.8deg, #FF9900 -3.69%, #BD00FF 69.71%, #00F0FF 122.65%);color:#fff;font-size:17px;font-weight:700;border-radius:100px;cursor: pointer;display: flex;align-items: center;justify-content: center;';
|
|
|
|
|
|
+ // 编辑框内按钮
|
|
|
const deBtn1 = document.createElement('img');
|
|
|
let src = require("@/assets/img/icon-gift-pack.png");
|
|
|
const smallDeBtnStyle = 'width:20px;height: 20px;cursor: pointer;marign-left:4px;margin-right:4px';
|
|
@@ -403,21 +418,37 @@ function _createBtnDom(port) {
|
|
|
deBtn2.style.cssText = smallDeBtnStyle;
|
|
|
deBtn2.src = "@/assets/img/icon-gift-pack.png"
|
|
|
|
|
|
+ // 小屏按钮
|
|
|
const deBtn3 = document.createElement('img');
|
|
|
deBtn3.id = 'de-btn3'
|
|
|
deBtn3.src = require("@/assets/logo/128.png");
|
|
|
deBtn3.style.cssText = 'width:52px;height: 52px;margin-top:20px;cursor: pointer;';
|
|
|
|
|
|
deBtn.addEventListener('click', () => {
|
|
|
+ Report.reportLog({
|
|
|
+ pageSource: Report.pageSource.mainPage,
|
|
|
+ businessType: Report.businessType.buttonClick,
|
|
|
+ objectType: Report.objectType.buttonMain
|
|
|
+ });
|
|
|
_deNetBtnClick(port);
|
|
|
})
|
|
|
deBtn1.addEventListener('click', () => {
|
|
|
+ Report.reportLog({
|
|
|
+ pageSource: Report.pageSource.mainPage,
|
|
|
+ businessType: Report.businessType.buttonClick,
|
|
|
+ objectType: Report.objectType.buttonSecond
|
|
|
+ });
|
|
|
_deNetBtnClick(port);
|
|
|
})
|
|
|
deBtn2.addEventListener('click', () => {
|
|
|
_deNetBtnClick(port);
|
|
|
})
|
|
|
deBtn3.addEventListener('click', () => {
|
|
|
+ Report.reportLog({
|
|
|
+ pageSource: Report.pageSource.mainPage,
|
|
|
+ businessType: Report.businessType.buttonClick,
|
|
|
+ objectType: Report.objectType.buttonMain
|
|
|
+ });
|
|
|
_deNetBtnClick(port);
|
|
|
})
|
|
|
dom.deBtn = deBtn;
|
|
@@ -433,12 +464,22 @@ function addSliderNavDeBtn(isSmall = false) {
|
|
|
let deBtn = document.getElementById('de-btn');
|
|
|
if (bigDom && !deBtn) {
|
|
|
bigDom.appendChild(dom.deBtn);
|
|
|
+ Report.reportLog({
|
|
|
+ pageSource: Report.pageSource.mainPage,
|
|
|
+ businessType: Report.businessType.buttonView,
|
|
|
+ objectType: Report.objectType.buttonMain
|
|
|
+ });
|
|
|
}
|
|
|
} else {
|
|
|
let smallDom = document.querySelector('h1[role]').parentNode.parentNode;
|
|
|
let deBtn3 = document.getElementById('de-btn3');
|
|
|
if (smallDom && !deBtn3) {
|
|
|
smallDom.appendChild(dom.deBtn3);
|
|
|
+ Report.reportLog({
|
|
|
+ pageSource: Report.pageSource.mainPage,
|
|
|
+ businessType: Report.businessType.buttonView,
|
|
|
+ objectType: Report.objectType.buttonMain
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -495,6 +536,9 @@ function bindTwitterArtMethod({ postId, twitterId }) {
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
+ Report.reportLog({
|
|
|
+ objectType: Report.objectType.tweetPostBinded
|
|
|
+ });
|
|
|
bindTwitterArt.needBind = false;
|
|
|
bindTwitterArt.postId = '';
|
|
|
bindTwitterArt.isBindIng = false;
|