
window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
window.addEventListener('click', function(e){for(const z of document.querySelectorAll('.site-header__menu')){if(z.querySelector('.js--toggle-site-header__menu')){if(z.querySelector('.js--toggle-site-header__menu').contains(e.target)){z.classList.add("site-header__menu--active");}else{z.classList.remove("site-header__menu--active");}}}});
function magictoggle(X){var d = document.querySelector(X);if (d.style.display == '' || d.style.display == 'none') {d.style.display = 'block';} else {d.style.display = 'none'}}
document.querySelector(".js--toggle-sidebar").addEventListener("click", function() {document.querySelector("body").classList.toggle("sidebar--active"); });
for(const w of document.querySelectorAll('.js--toggle-search')){if(w){w.addEventListener('click', function() {magictoggle('.site-header__search-dropdown');});}} if(document.querySelector('.site-header__overlay')){document.querySelector('.site-header__overlay').addEventListener('click', function() {document.querySelector('body').classList.remove('site-header__container--search-open');document.querySelector('.site-header__search-dropdown').style.display='none';document.querySelector('.site-header__overlay').style.display='none';});}
document.querySelector(".site-header__dropdown").addEventListener("click", function (e) { e.stopPropagation();});
if(document.querySelector(".site-header__menu-label--guardaci")){document.querySelector(".site-header__menu-label--guardaci").addEventListener("click", function() {document.querySelector(".site-header__dropdown-item--podcast, .site-header__dropdown-item--video").classList.add("site-header__dropdown-item--hidden");});}
if(document.querySelector(".site-header__dropdown-item--7-7")){document.querySelector(".site-header__dropdown-item--7-7").addEventListener("click", function() {document.querySelector(".site-header__dropdown-item--podcast, .site-header__dropdown-item--video").classList.toggle("site-header__dropdown-item--hidden");});}
window.addEventListener("load", function(){ setTimeout(function(){ putRightURLsOnProfile(); }, 1000); });
function putRightURLsOnProfile(){ let profileURL = document.querySelector(".main-menu-item--my_page a"), profileLink = document.getElementById("dedicated-area-link");
if(profileURL!=null){ profileURL = profileURL.getAttribute('href'); profileLink && profileLink.setAttribute('href', profileURL); } }
});
window.REBELMOUSE_ACTIVE_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_ACTIVE_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_ACTIVE_TASKS_QUEUE.push(function(){
function addParamsAndClass(links,param,classname1, classname2) { for(var i = 0; i < links.length;i++) { links[i].classList.add(classname1); links[i].classList.add(classname2); var hrefLink = links[i].href; links[i].href = hrefLink+param; } } function addListiclesClass() { var allPagePosts = document.querySelectorAll('.posts-wrapper'); var allVideoPosts = document.querySelectorAll('.main-column'); collapsePageVideoListicles(allPagePosts); collapsePageVideoListicles(allVideoPosts); } function collapsePageVideoListicles(allPosts) { if(allPosts != undefined) { for (var i = 0; i < allPosts.length; i++) { if(allPosts[i].querySelector(".widget__show-more")) { allPosts[i].querySelector(".widget__show-more").addEventListener("click",function() { setTimeout( function(){addListiclesClass()} ,200)}); } //custom field //console.log(allPosts[i]); var collapseListicles = allPosts[i].querySelectorAll('.custom-field-collapse-listicles'); if(collapseListicles && collapseListicles.length > 0) { var rebelItem = allPosts[i].getElementsByClassName('rebellt-item'); for (var j = 0; j < rebelItem.length; j++) { rebelItem[j].addEventListener("click", toggleListicleContent); if(!rebelItem[j].classList.contains('collapse-listicle')) { console.log("adding class"); rebelItem[j].classList.add('collapse-listicle'); rebelItem[j].classList.remove('nocollapse-listicle'); }// }// }// } } } function toggleListicleContent(e) { var elesrc = e.srcElement; } setTimeout(function(){addListiclesClass()},500); /*document.addEventListener("DOMContentLoaded", () => { addListiclesClass(); });*/
});
window.REBELMOUSE_ACTIVE_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_ACTIVE_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_ACTIVE_TASKS_QUEUE.push(function(){
function ChangeListener(e,t){const n=new Set([]);document.querySelectorAll(e).forEach(e=>{t(e),n.add(e)}),new MutationObserver(()=>{document.querySelectorAll(e).forEach(e=>{n.has(e)||(t(e),n.add(e))})}).observe(document.body,{childList:!0,subtree:!0})} ChangeListener('a[href="https://www.laverita.info/login"]',function(a){a.setAttribute('href','/st/login')});
});
window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
document.querySelectorAll('.js--toggle-mobile-menu').forEach((a)=>{a.addEventListener('click',(e)=>{document.querySelector('body').classList.toggle('site-header--dropdown-open')})});
});
window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
function ChangeListener(t,n){const o=new Set([]);document.querySelectorAll(t).forEach(e=>{n(e),o.add(e)});const e=new MutationObserver(()=>{const e=document.querySelectorAll(t);e.forEach(e=>{o.has(e)||(n(e),o.add(e))})});e.observe(document.body,{childList:!0,subtree:!0})}
ChangeListener('.infogram-embed',function(e){e.classList.add('nocollapse-listicle');
e.addEventListener('click',function(c){e.classList.toggle('nocollapse-listicle');});
});
});
Comunica il Tuo Dissenso le T-Shirt Ribelli
VISITA ORA
Source link