PageSourceSearch

https://mothertreeproject.org/wp-content/cache/min/1/wp-content/pl…/simple-banner.js?ver=1790206103

js mothertreeproject.org collected 2026-09-24 19:26:56 UTC 5,157 bytes, 19 lines download raw bytes

1jQuery(document).ready(function($){const{pro_version_enabled,debug_mode,banner_params}=simpleBannerScriptParams;banner_params.forEach((bannerParams,i)=>{const banner_id=i===0?'':`_${i+1}`;const{simple_banner_text,simple_banner_disabled_page_paths,disabled_on_current_page,close_button_enabled,close_button_expiration,simple_banner_insert_inside_element,simple_banner_prepend_element,keep_site_custom_css,keep_site_custom_js,wp_body_open,wp_body_open_enabled,}=bannerParams;const strings={simpleBanner:`simple-banner${banner_id}`,simpleBannerText:`simple-banner-text${banner_id}`,simpleBannerCloseButton:`simple-banner-close-button${banner_id}`,simpleBannerButton:`simple-banner-button${banner_id}`,simpleBannerScrolling:`simple-banner-scrolling${banner_id}`,simpleBannerSiteCustomCss:`simple-banner-site-custom-css${banner_id}`,simpleBannerSiteCustomJs:`simple-banner-site-custom-js${banner_id}`,simpleBannerHeaderMargin:`simple-banner-header-margin${banner_id}`,simpleBannerHeaderPadding:`simple-banner-header-padding${banner_id}`,simpleBannerClosedCookie:`simplebannerclosed${banner_id}`,}
2const isSimpleBannerTextSet=simple_banner_text&&simple_banner_text!==undefined&&simple_banner_text!=="";const isDisabledByPagePath=simple_banner_disabled_page_paths?simple_banner_disabled_page_paths.split(',').filter(Boolean).some(path=>{const pathname=path.trim();if(pathname.at(0)==='*'&&pathname.at(-1)==='*'){return window.location.pathname.includes(pathname.slice(1,-1))}
3if(pathname.at(0)==='*'){return window.location.pathname.endsWith(pathname.slice(1))}
4if(pathname.at(-1)==='*'){return window.location.pathname.startsWith(pathname.slice(0,-1))}
5return window.location.pathname===pathname}):!1;const isSimpleBannerEnabledOnPage=!pro_version_enabled||(pro_version_enabled&&!disabled_on_current_page&&!isDisabledByPagePath);const isSimpleBannerVisible=isSimpleBannerTextSet&&isSimpleBannerEnabledOnPage;if(isSimpleBannerVisible){if(!wp_body_open||!wp_body_open_enabled){const closeButton=close_button_enabled?`<button aria-label="Close" id="${strings.simpleBannerCloseButton}" class="${strings.simpleBannerButton}">&#x2715;</button>`:'';const prependElement=document.querySelector(simple_banner_insert_inside_element||simple_banner_prepend_element||'body');$(`<div id="${strings.simpleBanner}" class="${strings.simpleBanner}"><div class="${strings.simpleBannerText}"><span>${simple_banner_text}</span></div>${closeButton}</div>`).prependTo(prependElement||'body')}
6const bodyPaddingLeft=$('body').css('padding-left')
7const bodyPaddingRight=$('body').css('padding-right')
8if(bodyPaddingLeft!="0px"){$('head').append(`<style type="text/css" media="screen">.${strings.simpleBanner}{margin-left:-${bodyPaddingLeft};padding-left:${bodyPaddingLeft};}</style>`)}
9if(bodyPaddingRight!="0px"){$('head').append(`<style type="text/css" media="screen">.${strings.simpleBanner}{margin-right:-${bodyPaddingRight};padding-right:${bodyPaddingRight};}</style>`)}
10function scrollClass(){const scroll=document.documentElement.scrollTop;if(scroll>$(`#${strings.simpleBanner}`).height()){$(`#${strings.simpleBanner}`).addClass(strings.simpleBannerScrolling)}
10else{$(`#${strings.simpleBanner}`).removeClass(strings.simpleBannerScrolling)}}
11document.addEventListener("scroll",scrollClass)}
12function closeBanner(){if(!keep_site_custom_css&&document.getElementById(strings.simpleBannerSiteCustomCss))document.getElementById(strings.simpleBannerSiteCustomCss).remove();if(!keep_site_custom_js&&document.getElementById(strings.simpleBannerSiteCustomJs))document.getElementById(strings.simpleBannerSiteCustomJs).remove();if(document.getElementById(strings.simpleBannerHeaderMargin))document.getElementById(strings.simpleBannerHeaderMargin).remove();if(document.getElementById(strings.simpleBannerHeaderPadding))document.getElementById(strings.simpleBannerHeaderPadding).remove();if(document.getElementById(strings.simpleBanner))document.getElementById(strings.simpleBanner).remove()}
13if(isSimpleBannerVisible){const sbCookie=strings.simpleBannerClosedCookie;if(close_button_enabled){if(getCookie(sbCookie)==="true"){closeBanner();setCookie(sbCookie,"true",close_button_expiration)}else{document.getElementById(strings.simpleBannerCloseButton).onclick=function(){closeBanner();setCookie(sbCookie,"true",close_button_expiration)}}}else{if(getCookie(sbCookie)==="true"){document.cookie=`${strings.simpleBannerClosedCookie}=true; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`}}}})
14function setCookie(cname,cvalue,expiration){let d;if(expiration===''||expiration==='0'||parseFloat(expiration)){const exdays=parseFloat(expiration)||0;d=new Date();d.setTime(d.getTime()+(exdays*24*60*60*1000))}else{d=new Date(expiration)}
15const expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/"}
16function getCookie(cname){const name=cname+"=";const decodedCookie=decodeURIComponent(document.cookie);const ca=decodedCookie.split(';');for(let i=0;i<ca.length;i++){let c=ca[i];while(c.charAt(0)==' '){c=c.substring(1)}
17if(c.indexOf(name)==0){return c.substring(name.length,c.length)}}
18return""}
19if(pro_version_enabled&&debug_mode){console.log(simpleBannerScriptParams)}})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.