', {
error: function (e) { _ne.remove(); },
afterWrite: function (e) {},
done: function(e) {}
});
}(_e));
};
function getBrowserSize() {
return size = {
width: window.innerWidth || document.body.clientWidth,
height: window.innerHeight || document.body.clientHeight
}
}
var size = getBrowserSize();
function adaptInit( customSelector ) {
var customSelector = ( customSelector === undefined || !customSelector ) ? '': customSelector + ' ';
var imgsinpub = document.querySelectorAll( customSelector + '.article-entry img');
var tablesinpub = document.querySelectorAll( customSelector + '.article-entry table');
catLink(true);
var allinks = document.querySelectorAll('.article-infeed a');
[].forEach.call(allinks, function(link) {
if( link.href.match('3dnews.ru') && link.href.match('mc-container') && document.querySelector('.body-full') == null ) {
urlparts = link.href.split('/');
urlhash = urlparts[3].split('#');
link.href = '/'+urlhash[0]+'/#'+urlhash[0];
}
if( link.href.match('related-grid') )
link.removeAttribute('target');
});
[].forEach.call(imgsinpub, function(img) {
img.removeAttribute('width');
img.removeAttribute('height');
});
/*[].forEach.call(tablesinpub, function(table) {
var wrapper = document.createElement('div');
table.style.cssText = "";
wrapper.className = "table_wrapperInText";
table.parentNode.insertBefore(wrapper, table);
wrapper.appendChild(table);
});*/
[].forEach.call(tablesinpub, function(table) {
table.setAttribute('style', '');
if( table.querySelector('thead tr') ) {
header = table.querySelector('thead tr').innerHTML;
table.querySelector('thead').remove();
var wrapper = document.createElement('div');
table.style.cssText = "";
var newRow = table.insertRow(0);
newRow.innerHTML = header;
wrapper.className = "table_wrapperInText";
table.parentNode.insertBefore(wrapper, table);
wrapper.appendChild(table);
}
});
}
function catLink( status ) {
if( document.querySelector('.section-title') != null && document.querySelectorAll('.entry-body') != null && document.querySelectorAll('.entry-body').length == 1 ) {
return false;
var catHeader = document.querySelector('.section-title');
var catTitle = (catHeader.innerText || catHeader.textContent);
var catHeader = document.querySelector('.section-title');
var catTitle = (catHeader.innerText || catHeader.textContent);
catHeader.innerHTML = status ? ''+catTitle+'' : catTitle;
}
}
function updateNextHitTop( id ){
if(window._endebug && window.console) console.log( '[ '+id+' ] updateNextHitTop: ' + _infitityNextHit );
next_pub_hitline = document.querySelector('#next-pub-hitline-'+id);
window._infitityNextHit = getRelativeClientRect( next_pub_hitline ).top;
updatePubCoord(id)
}
function updatePubCoord( id ){
_startY = getRelativeClientRect( document.querySelector('#next-infinity-pub-' + id) ).top+105;
_endY = getRelativeClientRect( document.querySelector('#bottom-border-' + id) ).top-105;
if(window._endebug && window.console) console.log( '[ '+id+' ] updatePubCoord: ' + _startY + ', ' + _endY );
infinityFeedPubsCoord[ id ] = { _startY, _endY };
}
function updatePubCoordAll() {
var listPubs = Object.keys(infinityFeedPubsCoord);
for(var k in infinityFeedPubsCoord) {
if( k == mainPubId ) {
firstInfinityPubId = listPubs[ 0 ];
_endY = getRelativeClientRect( document.querySelector('#next-infinity-pub-' + firstInfinityPubId) ).top+105;
infinityFeedPubsCoord[ mainPubId ] = { '_startY': 0, '_endY': _endY };
} else
updatePubCoord( k );
}
}
function checkPubOnView( id ) {
scrolled = window.pageYOffset || document.documentElement.scrollTop;
pubcoord = infinityFeedPubsCoord[ id ];
return ( scrolled > pubcoord['_startY'] && scrolled
' );
if( infinityFeedAllAdsDone.indexOf( id ) == -1 ) {
infinityFeedAllAdsDone.push( id );
if(window._endebug && window.console) console.log('[ '+id+' ] renderPub->infinityPubRenderAllAds()');
// реклама только каждую 4ю новость
if( infinityAdsCounter > 0 && infinityAdsCounter%4 == 0 )
setTimeout( function(){ infinityPubRenderAllAds( id ); }, 600 );
else
$('#next-infinity-pub-body-'+id+' .ad').hide();
infinityAdsCounter++;
}
if(window._endebug && window.console) console.log('[ '+id+' ] renderPub->updateNextHitTop()');
updateNextHitTop(id);
_infitityNextPid = next_pub_hitline.dataset.id;
// основная публикация
if( !infinityFeedLoadedPubsData[ id ] )
infinityFeedLoadedPubsData[ id ] = data;
// предзагруженные
if( data['preloadPubs'] ) {
for(var k in data['preloadPubs'])
if( !infinityFeedLoadedPubsData[k] )
infinityFeedLoadedPubsData[k] = data['preloadPubs'][k];
}
}
function sr_reloadGgAdsBanner( renderto, adclient, adslot, style = '', inlineStyle = '', adblock = false ) {
if( window.adsbygoogle == undefined ) {
t = document.getElementsByTagName("script")[0];
s = document.createElement("script");
s.type = "text/javascript";
s.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
s.async = true;
t.parentNode.insertBefore(s, t);
}
if( window.reloadGgAdCounter == undefined )
reloadGgAdCounter = 0;
var rand = reloadGgAdCounter - 0.5 + Math.random() * (9999999999 - reloadGgAdCounter + 1)
newBlockNum = Math.round(rand);
newRenderTo = 'ggAds_' + adclient + '_' + newBlockNum;
document.getElementById( renderto ).innerHTML = '';
var _div = document.createElement('ins');
_div.id = newRenderTo;
_div.setAttribute('style', inlineStyle);
_div.classList.add('adsbygoogle');
_div.dataset.adClient = adclient;
_div.dataset.adSlot = adslot;
document.getElementById(renderto).appendChild(_div);
setTimeout( function(){
(adsbygoogle = window.adsbygoogle || []).push({});
}, 350 );
if( adblock ) {
setTimeout( function(){
if( document.getElementById(newRenderTo).clientHeight < 40 )
document.getElementById(renderto).innerHTML = adblock;
}, 1350 );
}
reloadGgAdCounter++;
}
allGoogleAdsLoaded = 0;
function lazyLoadGoogleAds() {
if( window.adsbygoogle == undefined ) {
t = document.getElementsByTagName("script")[0];
s = document.createElement("script");
s.type = "text/javascript";
s.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
s.async = true;
t.parentNode.insertBefore(s, t);
}
needGoogleAdsLoad = 0;
var allgoogleads = document.querySelectorAll('.adsbygoogle');
[].forEach.call(allgoogleads, function(aditem) {
if( aditem.dataset.adsbygoogleStatus == undefined )
needGoogleAdsLoad = 1;
});
if( needGoogleAdsLoad > 0 ) {
setTimeout( function(){
(adsbygoogle = window.adsbygoogle || []).push({});
}, 450 );
}
else
allGoogleAdsLoaded = 1;
}
function renderAdfoxAds( id ) {
// если расстояние больше двух экранов - не загружать объявления, триггеер на скролл для повторной загрузки
//if( checkDisplaysToElement('#next-infinity-pub-976887'+id, 2) ) - render
hold_id = id;
if(window._endebug && window.console) console.log('[ '+id+' ] renderAdfoxAds()');
var adzoneggads = document.querySelectorAll('#pub_' + id + ' .ggads');
[].forEach.call(adzoneggads, function(ggad) {
ggdata = ggad.getAttribute('set').split('718');
sr_reloadGgAdsBanner( ggad.getAttribute('id'), 'ca-pub-'+ggdata[1], ggdata[2], ggdata[0]);
});
//lazyLoadGoogleAds();
var adzonesresp = document.querySelectorAll('#pub_' + id + ' .adfox_ads');
[].forEach.call(adzonesresp, function(radz) {
id = radz.attributes[0].nodeValue;
slot = radz.attributes[2].nodeValue;
if( readyadsadfox.indexOf(id) == -1 && id != undefined ) {
readyadsadfox.push( id );
tmp = Object.assign({}, adfoxOriginalSlots[ slot ]);
tmp[ 'code' ] = id;
window.Ya.headerBidding.pushAdUnits( tmp );
(function(w, n) {
w[n] = w[n] || [];
w[n].push({
ownerId: 323017,
containerId: id,
params: {
pp: 'bowr',
ps: 'dntn',
p2: 'hfkp',
puid1: ''
},
onLoad: function(data) { /*document.getElementById(id).innerHTML = '';*/ },
onRender: function() { },
onError: function(error) { },
onStub: function() { }
});
})(window, 'adfoxAsyncParams');
}
});
updateNextHitTop( hold_id );
setTimeout( function(){ updateNextHitTop( _infitityCurrentPid ); updateNextHitTop( hold_id ); }, 1700 );
}
function mobileVersionAdapt( status, change ) {
//if( document.querySelector('.icon-group') && document.location.href.search('974568') == -1 ) return;
if( status ) {
holdads = [];
readyadsadfox = [];
mobilev = changemob = true;
adaptInit();
var adzonesresp = document.querySelectorAll('.resp-ad-zone');
var adzones = document.querySelectorAll('.ad-zone');
[].forEach.call(adzonesresp, function(radz) {
zoneid = radz.attributes[3].nodeValue;
if( document.querySelector('.czone_' + zoneid) != null && document.querySelector('.czone_' + zoneid).innerHTML == '' && readyadsresp.indexOf(zoneid) == -1) {
if( !$('#disable_czone_' + zoneid )[0] )
customZoneLoad(zoneid);
readyadsresp.push( zoneid );
}
});
[].forEach.call(adzones, function(adz) {
holdads.push( adz.attributes[3].nodeValue );
});
} else {
catLink(false);
changemob = true;
mobilev = false;
fetchQuestions();
//_newsPopupWidget('#hardware-news');
enableYoutubePlayer();
holdads.forEach(function(zoneid, i, arr) {
if( document.querySelector('.czone_' + zoneid) != null && document.querySelector('.czone_' + zoneid).innerHTML == '' && readyads.indexOf(zoneid) == -1) {
customZoneLoad(zoneid);
readyads.push( zoneid );
}
});
// удаляем мобильные объявления
var adzonesresp = document.querySelectorAll('.resp-ad-zone');
var adzones = document.querySelectorAll('.ad-zone');
[].forEach.call(adzonesresp, function(radz) {
radz.parentNode.removeChild( radz );
});
}
}
window.addEventListener("resize", function(event) {
if( document.querySelector('.icon-group') ) return;
var size = getBrowserSize();
//alert(size.width);
(size.width < 799) ? mobileVersionAdapt( true, true ) : mobileVersionAdapt( false, true );
});
if( size.width < 799 ) {
if( window.adUnits != undefined ) {
adfoxOriginalSlots = [];
for(var i in adUnits)
if( adUnits[i]['code'] && adUnits[i]['code'] != undefined )
adfoxOriginalSlots[ adUnits[i]['code'] ] = adUnits[i];
}
mobileVersionAdapt( true, false );
}
Nacon скоро покажет нового ?Терминатора?, GreedFall II, Test Drive Unlimited Solar Crown и не только — где и когда смотреть Nacon Connect 2024
轉(zhuǎn)載請注明來自阿拉善凱拓戶外,本文標(biāo)題:《Nacon скоро покажет нового ?Терминатора?, GreedFall II, Test Drive Unlimited Solar Crown и не только — где и когда смотреть Nacon Connect 2024》
百度分享代碼,如果開啟HTTPS請參考李洋個人博客
每一天,每一秒,你所做的決定都會改變你的人生!