You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
5.2 KiB

2 years ago
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};!function(n,t){function e(n,t){Object.getOwnPropertyNames(n).forEach(function(o){void 0!==t[o]&&null!==t[o]&&("object"===_typeof(t[o])&&"contentEl"!==o?e(n[o],t[o]):n[o]=t[o])},null)}function o(){var t=n.scrollY,e=t/100,o=setInterval(function(){t-=e,n.scrollTo(0,t),t<=0&&clearInterval(o)},10)}function s(){var e=t.createElement("div");if(e.innerHTML=m,c.contentEl.appendChild(e),c.goTop.isShow){var s=function(){n.scrollY>=a?i.classList.remove("go-top-hide"):i.classList.add("go-top-hide")},i=t.querySelector("a.option-box[data-type='gotop']"),a=n.outerHeight,l=t.body.scrollHeight;s(),n.addEventListener("scroll",s,!1),n.addEventListener("resize",function(){a=n.outerHeight,l=t.body.scrollHeight,s()}),i.addEventListener("click",o,!1)}if(c.cs.isShow){t.querySelector("a.option-box[data-type='cs']").addEventListener("click",function(){null!==c.cs.clickFun?c.cs.clickFun():n.open(c.cs.clickUrl,"_blank")},!1)}if(c.help.isShow){t.querySelector("a.option-box[data-type='cs']").addEventListener("click",function(){null!==c.help.clickFun?c.help.clickFun():n.open(c.help.clickUrl,"_blank")},!1)}if(c.guide.isShow){t.querySelector("a.option-box[data-type='guide']").addEventListener("click",function(){null!==c.guide.clickFun?c.guide.clickFun():n.open(c.guide.clickUrl,"_blank")},!1)}}var c=(location.protocol.substr(0,4),{url:"https://g.csdnimg.cn/side-toolbar/3.0",opinion:{isShow:!1},qr:{isShow:!0,btnImgSrc:"https://g.csdnimg.cn/side-toolbar/3.0/images/qr.png",data:[{imgSrc:"https://g.csdnimg.cn/side-toolbar/3.0/images/qr_wechat.png",desc:"关注公众号"},{imgSrc:"https://g.csdnimg.cn/side-toolbar/3.0/images/qr_app.png",desc:"下载APP"}]},cs:{isShow:!0,btnImgSrc:"https://g.csdnimg.cn/side-toolbar/3.0/images/kefu.png",clickUrl:"https://csdn.s2.udesk.cn/im_client/?web_plugin_id=29181",clickFun:null},help:{isShow:!1,btnImgSrc:"https://g.csdnimg.cn/side-toolbar/3.0/images/bangzhucopy.png",clickUrl:"",clickFun:null},report:{isShow:!1,btnImgSrc:"https://g.csdnimg.cn/side-toolbar/3.0/images/jubaocopy.png"},goTop:{isShow:!0,btnImgSrc:"https://g.csdnimg.cn/side-toolbar/3.0/images/fanhuidingbucopy.png"},guide:{isShow:!1,btnImgSrc:"https://g.csdnimg.cn/side-toolbar/3.0/images/guide.png",clickUrl:"https://blogdev.blog.csdn.net/article/details/108241158",clickFun:null},theme:"white",contentEl:t.body,afterFinished:null}),i={options:{},goTop:o};void 0===n.csdn&&(n.csdn={}),n.csdn.sideToolbar=Object.assign(i,n.csdn.sideToolbar);var a=n.csdn.sideToolbar.options;!function(){e(c,a)}(),function(n){var e=t.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=n,t.getElementsByTagName("head")[0].appendChild(e)}(c.url+"/side-toolbar.css");var l="",r="",d="",p="",g="",u="",h="";if(c.opinion.isShow&&(l='\n <a class="option-box" data-type="feedback">\n <img src="'+c.opinion.btnImgSrc+'" alt="" srcset="">\n <span class="show-txt">意见<br>反馈</span>\n </a>\n '),c.guide.isShow&&(r='\n <a class="option-box" data-type="guide">\n <img src="'+c.guide.btnImgSrc+'" alt="" srcset="">\n <span class="show-txt">新手<br>引导</span>\n </a>\n '),c.qr.isShow){var b="";c.qr.data.forEach(function(n){b+='\n <div class="qr-item-box">\n <img src="'+n.imgSrc+'" alt="'+n.desc+'">\n <p class="desc">'+n.desc+"</p>\n </div>\n "}),d='\n <a class="option-box no—h" data-type="app">\n <img src="'+c.qr.btnImgSrc+'" alt="" srcset="">\n <span class="show-txt">手机看</span>\n <div class="app-qr-box">\n <div class="bg-box">\n '+b+"\n </div>\n </div>\n </a>\n "}c.cs.isShow&&(p='\n <a class="option-box" data-type="cs">\n <img src="'+c.cs.btnImgSrc+'" alt="" srcset="">\n <span class="show-txt">客服</span>\n </a>\n '),c.help.isShow&&(g='\n <a class="option-box" data-type="help">\n <img src="'+c.help.btnImgSrc+'"