\””,frameborder:”0″,marginheight:”0″,marginwidth:”0″,scrollbars:”no”,scrolling:”no”});var h=(new Date).getTime(),p=n.iframe+”&isFloat=”+i+”&nocache=”+h;d&&(p+=”&width=”+d);var v=s.loadIframeContent(p);if(v.then(function(n){f.appendChild(l);var t=l;t=t.contentWindow?t.contentWindow:t.contentDocument,t&&t.document&&(t.document.write(n),t.document.close()),c()},function(){u()}),n.url){var g=document.createElement(“a”);w(g,{href:n.url,target:”_blank”}),m(g,{display:”block”,boxSizing:”content-box”,position:”absolute”,top:”0″,left:”0″,right:”0″,bottom:”0″}),m(f,{position:”relative”}),f.appendChild(g)}return f},this.getDomElement=function(){return n},this.hasFloatPart=function(){return”a-4.1-vip”===o||”4.1-vip”===o},this.isLoaded=function(){return f}},o=function(){var n={},t=this,o=new e,r=0,a=[],c={},u={},s=function(){var n=[];return a.forEach(function(t){t.isVisible()&&n.push(t)}),n},d=function(){var n=[];return a.forEach(function(t){t.isVisible()||n.push(t)}),n},f=function(n){var t=[];return a.forEach(function(e){e.isVisible()&&e.getRelation()===n&&t.push(e)}),t};this.clearEventStatus=function(n){u[n]=!1},this.fireEvent=function(n){u[n]=!0,c[n]&&c[n]()},this.on=function(n,t){c[n]=t,u[n]&&c[n]()},this.add=function(t,e,o,c){var u=document.getElementById(t),s=u.dataset d=n[e]||!1;if(d&&!s.adplaceInited){var f=0;a.forEach(function(n){n.getId()==o+”-”+e&&f++});var l=new i(u,d.width+d.width_unit,d.height+d.height_unit,e,c,o,r+f,d.banners);a.push(l),s.adplaceInited=!0}},this.init=function(t){n=t,this.increaseViewCount()},this.increaseViewCount=function(){r=o.get(“c”),r||(r=Math.floor(100*Math.random())+1),r++,o.set(“c”,r)},this.update=function(){return new Promise(function(n,e){var i=s(),o=d();t.clearEventStatus(“allShowed”);var r=function(){t.fireEvent(“allShowed”),n()};a.forEach(function(n){n.clearGuestBanners()}),o.forEach(function(n){var t=n.getRelation(),e=n.getId(),o=!1;if(i.forEach(function(n){n.getId()===e&&(o=!0)}),t&&!o){var r=n.getBanners(),a=f(n.getRelation());for(var c in r)if(r.hasOwnProperty(c)){var u=c%a.length,s=r[c],d=a[u];d&&d.addGuestBanner(s)}}});var c=function(){var n=[];a.forEach(function(t){t.isVisible()&&!t.isLoaded()&&n.push(t.show())}),Promise.all(n).then(r,r)},u=0,l=0,h=0,p=function(n,t,e){n>.5*t&&t===e?c():t===e&&r()};a.forEach(function(n){n.isVisible()&&n.isOnScreen()&&!n.isLoaded()&&(u++,n.show().then(function(){l++,h++,p(l,h,u)},function(){h++,p(l,h,u)}))}),u||c()})},this.getAdplaces=function(){return a}},r=new o;n.config&&(r.init(n.config),delete n.config),n.places&&(n.places.forEach(function(n){r.add(n.id,n.name,n.realm,n.rel)}),delete n.places,n.add=function(n,t,e,i){r.add(n,t,e,i)},n.init=function(n){r.init(n)},n.update=function(){return r.update()},n.getAdplaces=function(){return r.getAdplaces()},n.onAllShowed=function(n){r.on(“allShowed”,n)},n.inited=!0}(window.lazyAdaptiveIc=window.lazyAdaptiveIc||{}); lazyAdaptiveIc.update();
No comments:
Post a Comment