1 line
9.3 KiB
JavaScript
1 line
9.3 KiB
JavaScript
(function(a,b){if(typeof define==="function"&&define.amd){define(b)}else{a.logo=b()}}(typeof self!=="undefined"?self:this,function(){var d="";function o(){}function c(){var q=null;try{q=(window.baidu&&window.baidu.mobads&&window.baidu.mobads.Sdk)||(window.parent&&parent.baidu&&parent.baidu.mobads&&parent.baidu.mobads.Sdk)}catch(r){}return q}function f(r,q){var s=document.createElement("div");s.innerHTML=q;var t=document.createDocumentFragment();for(;s.childNodes.length>0;){t.appendChild(s.childNodes[0])}r.appendChild(t)}function b(r,q,s){if(r.addEventListener){r.addEventListener(q,s,false)}else{if(r.attachEvent){r.attachEvent("on"+q,s)}}}function e(q){if(q.stopPropagation){q.stopPropagation()}else{window.event.cancelBubble=true}if(q.preventDefault){q.preventDefault()}return false}function n(s){var r=null;var q=[];for(r in s){if(s.hasOwnProperty(r)){q.push(r+"="+encodeURIComponent(s[r]))}}return q.join("&")}function i(q,s){var t=s.type;if(t==="treatment"){var r=q.querySelector(".logo-container");r.style.cssText="opacity:0.5"}}function k(r,q){r.style.position="relative";var s=r.querySelector(".logo-container");s.classList.add("new-logo-container");s.style.cssText="background: transparent;";s.style.width="100%";var v=r.querySelector(".logo-con-wrapper");v.style.cssText="display: inline-block; height: 16px; background: transparent";var u=r.querySelector(".logo-close-img");var t=r.querySelector(".logo-link");if(q){u.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAAAXNSR0IArs4c6QAAARVJREFUOBF9kzGWwjAMRGNKOEdSc6G9xzahoOIe1LkLPe1egW3DfOHxcxIHv6dne2Y0lkTo5nkeOi9dJp9Xuyntt0PmnnnvO6FHJ+g8BgCI3ATgDTAAMwBEysxd7E9K6d9pFqYKwAJhVCDxL5zL4nxRQF4VfXbuKGC0nYiyECimEBS0OmTBwBOntQOkcOr5ixwEFkEqJnbIugtPphdeWq67iOpFPut5hCDbxbCw1d1ucVm8aYFFjJrfubyJgJUFLwSj7m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qibib2V9RjLdLu1+EnPwQ9+t5TCdYn5/0/plW9eo9J3VrTOX3vAtA2bZ2HZhsbaV/pYvdM4+FvTK2tR7QhkM8vx+f8/9p6rz6CfoDMqmacF0gB4F3ViTmRZxGdiiBut5wwVgpsuOzpWJoL9tOkADaOfagynz4C6YrQnO/NuL6Dg8i9JkEiNnHzeBaan0R9vN6WPHQmQfhCVOrOI+dA7qgL8+7Aezj1TaBGnNR/wFnLF2tkpyVvuFRG2VxUz0k5tsd0pdzZdBL6gD2ilT8N+C2WC2JuqmSp8uCNvDVevwP5VhZ0gOD1XG5Kcz2ROgv4Abgf7HIH6Azo9E20O/rYnOhHaxa+teUFO2kbkvSSG53Yf+SENfiBQ83DkSD6N6ALRLzBJfxgcCq9FvN0FEOZtYGdpUDr2INJGht0QrIhW/g1rk9I2Xok9kBpyGcvgKlXAdVoLdapMmR1sMC5IKMxCQtzvcAt20kxq6jk6vPz1i9gtqG09/SO6d3QAAAABJRU5ErkJggg==";u.style.cssText="position: absolute; right: 0; margin: 0; padding: 4px; opacity: 0.3; background: #000000;";v.style.background="#000000";v.style.opacity="0.3";t.style.cssText="width: 24px; height: 8px; margin: 4px"}else{u.src="https://render-server.cdn.bcebos.com/static/images/20210525/d5443f3a0c9fe8456beb5f50eb08ed60.png";t.src="https://render-server.cdn.bcebos.com/static/images/spring_festival/ad-logo.png";u.style.cssText="position: absolute; right: 0; margin: 0; padding: 4px";t.style.cssText="width: 24px; height: 8px"}}function j(u){u=u||{};var r=u.logoUrl||"https://union.baidu.com";var s=document.getElementById(u.containerId||"container");var v=u.containerId;var D=document.getElementById(u.feedbackParentId||"container");var w=!u.hideClose&&D;var C=u.closeDirect;var x=u.deviceType>1?" logo-mobile-container":"";var y=u.exps||{};var z=u.newLogoExps;var t=y["rs_logo"]||{};var B=u.isDarkLogo||false;if(s===null){return}var q=['<div class="logo-container'+x+'">','<a href="'+r+'" target="_blank" class="logo-con-wrapper">','<img class="logo-link" ','src="data:image/png;base64,iVBORw0K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z4C6YrQnO/NuL6Dg8i9JkEiNnHzeBaan0R9vN6WPHQmQfhCVOrOI+dA7qgL8+7Aezj1TaBGnNR/wFnLF2tkpyVvuFRG2VxUz0k5tsd0pdzZdBL6gD2ilT8N+C2WC2JuqmSp8uCNvDVevwP5VhZ0gOD1XG5Kcz2ROgv4Abgf7HIH6Azo9E20O/rYnOhHaxa+teUFO2kbkvSSG53Yf+SENfiBQ83DkSD6N6ALRLzBJfxgcCq9FvN0FEOZtYGdpUDr2INJGht0QrIhW/g1rk9I2Xok9kBpyGcvgKlXAdVoLdapMmR1sMC5IKMxCQtzvcAt20kxq6jk6vPz1i9gtqG09/SO6d3QAAAABJRU5ErkJggg==" />',"</a>",a(w),"</div>"].join("");i(s,t);f(s,q);if(z){k(s,B)}if(!w){return}var A=l(D.clientWidth,D.clientHeight);f(D,A);m(u.trackingInfo,C,s);g()}function a(q){if(!q){return""}return['<div class="gap"></div>','<a href="javascript:;" id="logo-close-btn">','<img class="logo-close-img" ','src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAAAXNSR0IArs4c6QAAARVJREFUOBF9kzGWwjAMRGNKOEdSc6G9xzahoOIe1LkLPe1egW3DfOHxcxIHv6dne2Y0lkTo5nkeOi9dJp9Xuyntt0PmnnnvO6FHJ+g8BgCI3ATgDTAAMwBEysxd7E9K6d9pFqYKwAJhVCDxL5zL4nxRQF4VfXbuKGC0nYiyECimEBS0OmTBwBOntQOkcOr5ixwEFkEqJnbIugtPphdeWq67iOpFPut5hCDbxbCw1d1ucVm8aYFFjJrfubyJgJUFLwSj7mdFTLF+H+F6SU93TJ1mHtHlCmwa7WnKmHipJQLX8osb84XBR7sxAt4kWrsxaFSBln6bJsWgkXj1QL9x/kfs9uhS2VtGgIOCbz4+vjph74w25wxv9VjxEc3jX7MAAAAASUVORK5CYII=" />',"</a>"].join("")}function l(s,q){var t=(q-250>0)?30:0;var r=320;if(s<320&&s>159){r=160}else{if(s<160){r=80}}var u=r<160?"feedback-container fd-small":"feedback-container";var v=h(s,q);return['<div id="feedback-container" class="'+u+'">','<div id="reason-content" class="reason-content" data-reason-num="'+v.length+'" style="width:'+r+"px;padding-top:"+t+'px;">','<div class="intro">反馈意见:</div>',v.join(""),'<a class="fb-btn-cancel" href="javascript:;">返回</a>',"</div>",'<div id="thx-content" class="thx-content">',"<h5>感谢您的反馈!</h5>","<p>您的反馈已记录,我们将努力改善您的浏览体验。</p>","</div>","</div>"].join("")}function h(r,q){var t=['<a href="javascript:;" data-value="1" class="reason-item">视觉干扰</a>','<a href="javascript:;" data-value="2" class="reason-item">内容不宜</a>','<a href="javascript:;" data-value="3" class="reason-item">不感兴趣</a>','<a href="javascript:;" data-value="0" class="reason-item">其他原因</a>'];function s(){var u=parseInt(Math.random()*3,10);return[t[u],t[3]]}if(r<160&&q<106){return[]}if(r>=80&&q>=106&&r<160&&q<168){return s()}if(r>=160&&q>=76&&r<320&&q<106){return s()}return t}function m(s,w,r){var v=document.getElementById("logo-close-btn");var u=document.getElementById("feedback-container");var q=document.getElementById("reason-content");var t=document.getElementById("thx-content");b(v,"click",function(x){var z=c();if(z&&w){z.onAdPlayEnd();p(s,0);return}if(window.parent&&window.postMessage&&window.parent.postMessage&&window.JSON&&JSON.stringify){var y={type:1,tuid:d,msg:"click"};parent.postMessage(JSON.stringify(y),"*")}return e(x)});b(u,"click",function(x){x=x||window.event;var y=x.target||x.srcElement;if(!(y&&y.getAttribute)){return}if(y.getAttribute("data-value")!=null){p(s,y.getAttribute("data-value"));q.style.display="none";t.style.display="block";setTimeout(function(){t.style.display="none"},2000);setTimeout(function(){var A=c();if(A){A.onAdPlayEnd()}else{if(window.parent&&window.postMessage&&window.parent.postMessage&&window.JSON&&JSON.stringify){var z={type:1,tuid:d,msg:"click"};parent.postMessage(JSON.stringify(z),"*")}}},2000)}if(y.className==="fb-btn-cancel"){u.style.display="none"}return e(x)})}function p(s,t){var r="https://eclick.baidu.com/close_feedback.jpg?";s=s||{};s.reasonid=t;s._=(new Date()).getTime();r=r+n(s);var q=document.createElement("img");q.onerror=o;q.src=r}function g(){if(window.parent&&window.postMessage&&window.parent.postMessage){var q=function(t){try{var u=JSON.parse(t.data);if(u&&u.type===1){d=u.tuid;var s={type:1,msg:"ok",tuid:d};window.parent.postMessage(JSON.stringify(s),"*")}}catch(r){}};if(window.addEventListener){window.addEventListener("message",q,false)}else{if(window.attachEvent){window.attachEvent("onmessage",q)}}}}return{init:j}})); |