Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
Vettore VettoreVettore
Vettore Vettore Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
Vettore VettoreVettore
Vettore
Vettore
VettoreVettore
Vettore
Vettore
Vettore VettoreVettore
Vettore
Vettore
Vettore
Vettore Vettore Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
Vettore
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){
var sidebar = document.querySelector('.sticky-sidebar'); if(sidebar){ $tresholdContainer = document.querySelector('.main-content-stream'), $mainContent = document.querySelector('.main-content-stream .main-column'), iTopSpacing = 57, // height of shrinked top menu iBottomSpacing = 40; // spacing to bottom of page
console.log(sidebar); var sidebarReset = function () { sidebar.classList.remove('sidebar--fixed'); sidebar.removeAttribute('style'); };
var sidebarFixed = function (top, bottom, width) { sidebar.classList.add('sidebar--fixed'); sidebar.style.top=top; sidebar.style.bottom=bottom; sidebar.style.width=width; } // TODO: we need to add debounce window.addEventListener('scroll', function() { if( !sidebar.classList.contains(':visible') ) {return false;}
var iOffsetTop = sidebar.scrollTop, iHeaderHeight = $tresholdContainer.offset().top, iSidebarHeight = sidebar.offsetHeight, iWindowHeight = document.querySelector(window).offsetHeight, iSidebarWidth = $tresholdContainer.width() - $mainContent.outerWidth - 50;
if( iSidebarHeight + iBottomSpacing + iTopSpacing < iWindowHeight ){ var topTreshold = iHeaderHeight - iOffsetTop; if( topTreshold <= iTopSpacing ){ sidebarFixed(iTopSpacing, 'auto', iSidebarWidth); } else { sidebarReset(); } } else { var bottomTreshold = iHeaderHeight + iSidebarHeight + iBottomSpacing - iWindowHeight; if( bottomTreshold < iOffsetTop ){ sidebarFixed('auto', iBottomSpacing, iSidebarWidth); } else { sidebarReset(); } } }); } window.addEventListener('resize', function(event){ window.scrollTo(window.scrollX, window.scrollY - 1); window.scrollTo(window.scrollX, window.scrollY + 1); }); }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window, document,'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '922014154625678'); fbq('track', 'PageView'); document.addEventListener('consentGranted', function() { // call google analytics // call nielsen // call comscore // call whomever }); }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ let S = document.createElement('script'); S.src = "https://www.laverita.info/static/js/roar/laverita/video.min.js"; document.body.appendChild(S); S.src = "//imasdk.googleapis.com/js/sdkloader/ima3.js"; document.body.appendChild(S); S.src = "/static/js/roar/laverita/video-contrib.min.js"; document.body.appendChild(S); S.src = "/static/js/roar/laverita/videojs.ima.min.js"; document.body.appendChild(S); S.src = "/static/js/roar/laverita/video-yt.min.js"; document.body.appendChild(S); }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ for(var i of document.querySelectorAll('.post-video')){if(i){ i.addEventListener('click',function(){ if (!i.classList.contains("active")) { var vid = "vid-" + new Date().getTime(), video_url= i.attr('data-src'), isS3 = video_url.indexOf("s3.amazonaws.com") > -1, techOrder = isS3 ? '["html5"]' : '["youtube"]', sourceType = isS3 ? '"video/mp4"' : '"video/youtube"', player; var siteUrl = window.location.hostname; var pageUrl = document.location; var description = encodeURIComponent(pageUrl); var refPageUrl = document.referrer; var correlatorVal = Date.now(); i.classList.toggle("active"); i.html(''); player = videojs(vid, {}, function(){ !device.isiOS && this.play(); }); player.ima({ id: vid, adTagUrl: 'https://pubads.g.doubleclick.net/gampad/ads?iu=/150134580/laverita-Preroll&description_url="+description+"&site="+siteUrl+"&url=pageUrl&ref="+refPageUrl+"&env=vp&impl=s&correlator="+correlatorVal+"&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1' }); } }); }}
});
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){
videofunc = function(elem) { if (!elem.classList.contains("active")) { var vid = "vid-" + new Date().getTime(), video_url = elem.attr('data-src'), isS3 = video_url.indexOf("s3.amazonaws.com") > -1, techOrder = isS3 ? '["html5"]' : '["youtube"]', sourceType = isS3 ? '"video/mp4"' : '"video/youtube"', player; var siteUrl = window.location.hostname; var pageUrl = document.location; var description = encodeURIComponent(pageUrl); var refPageUrl = document.referrer; var correlatorVal = Date.now(); elem.toggleClass("active"); elem.html(''); player = videojs(vid, {}, function() { !device.isiOS && elem.play(); }); player.ima({ id: vid, adTagUrl: 'https://pubads.g.doubleclick.net/gampad/ads?iu=/150134580/laverita-Preroll&description_url=" + description + "&site=" + siteUrl + "&url=pageUrl&ref=" + refPageUrl + "&env=vp&impl=s&correlator=" + correlatorVal + "&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1' }); }
}
REBELMOUSE_STDLIB.createElementChangeListener('.post-video', event=>{ event.addEventListener("click", function(){videofunc(event)})} );
/* Ad units before paywall wrapper */
var contentPreview = document.querySelectorAll('.widget__brief');
contentPreview.forEach(function(item) { item.insertAdjacentHTML('afterend', "
"); })
});Vettore