PageSourceSearch

https://www.pixelcrayons.com/blog/wp-content/themes/pxlblog-v2/assets/js/script.js?ver=1789712528

js pixelcrayons.com collected 2026-09-25 21:01:24 UTC 6,803 bytes, 210 lines download raw bytes

1
2
3/*Sticy TOC Script*/
4
5var $window = window,
6	buyerGiude = document.getElementById("stickytoc");
7if (buyerGiude) {
8	var stickybuyers = document.getElementById("vcb-col-left"),
9		buyersAns = document.getElementById("vcb-col-right");
10	window.addEventListener("scroll", function() {
11		if (screen.width > 991) {
12			var e = buyersAns.getBoundingClientRect().top + window.scrollY;
13			document.documentElement.scrollTop > e - 10 ? stickybuyers.classList.add("sticky") : stickybuyers.classList.remove("sticky");
14			var t = buyersAns.offsetHeight;
15			t += parseInt(window.getComputedStyle(buyersAns).getPropertyValue("margin-top"));
16			var n = e + (t += parseInt(window.getComputedStyle(buyersAns).getPropertyValue("margin-bottom")));
17			document.documentElement.scrollTop + (stickybuyers.offsetHeight + 20) > n ? stickybuyers.classList.add("btomfixed") : stickybuyers.classList.remove("btomfixed");
18		} else stickybuyers.classList.remove("sticky"), stickybuyers.classList.remove("btomfixed");
19	});
20}
21
22
23//popup script//
24var contentPopup = document.getElementById('contentPopup');
25var btn = document.getElementById("myBtn");
26var span = document.getElementsByClassName("close")[0];
27if (btn) {
28	btn.onclick = function() {
29		contentPopup.style.display = "block";
30	}
31}
32if (span) {
33	span.onclick = function() {
34		contentPopup.style.display = "none";
35	}
36}
37
38
39window.onclick = function(event) {
40	if (event.target == contentPopup) {
41		contentPopup.style.display = "none";
42	}
43}
44
45
46var newsletterPopup = document.getElementById('newsletterPopup');
47let btn2 = document.getElementById("myBtn2");
48
49if (btn2) {
50	btn2.onclick = function() {
51		newsletterPopup.style.display = "block";
52	}
53}
54
55
56function closeNewsLetter(elm) {
57	let clelm = document.getElementById(elm);
58	clelm.style.display = "none";
59}
60
61
62window.onclick = function(event) {
63	if (event.target == newsletterPopup) {
64		newsletterPopup.style.display = "none";
65	}
66}
67
68
69
70
71//Category select script//
72
73function setoptValue( val, label, input, parent_col, url){
74window.location.href = url;
75}
76function apnSelect(target){
77let divTarget   = document.getElementById( target );
78let arrow       = divTarget.getElementsByClassName('arw-btn');
79let select      = divTarget.getElementsByClassName('in-optionscat');   
80arrow[0].classList.toggle('rotate');
81select[0].classList.toggle('open-close');
82}
83
84/* Intent Popup */
85const CookieService = {
86    setCookie(name, value, days) {
87        let expires = '';
88        if(days){
89            const date = new Date();
90            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
91            expires = '; expires=' + date.toUTCString();
92        }
93        document.cookie = name + '=' + (value || '')  + expires + ';';
94    },
95
96    getCookie(name){
97        const cookies = document.cookie.split(';');
98        for (const cookie of cookies) {
99            if (cookie.indexOf(name + '=') > -1) {
100                return cookie.split('=')[1];
101            }
102        }
103        return null;
104    }
105};
106
107const exit = e => {
108    const shouldExit =
109        [...e.target.classList].includes('exit-intent-popup') || // user clicks on mask
110        e.target.className === 'close' || // user clicks on the close icon
111        e.keyCode === 27; // user hits escape
112
113    if (shouldExit) {
114        document.querySelector('.exit-intent-popup').classList.remove('visible');
115    }
116};
117const mouseEvent = e => {
118    const shouldShowExitIntent = 
119        !e.toElement && 
120        !e.relatedTarget &&
121        e.clientY < 10;
122
123    if (shouldShowExitIntent){
124        document.removeEventListener('mouseout', mouseEvent);
125        document.querySelector('.exit-intent-popup').classList.add('visible');
126        CookieService.setCookie('exitIntentShown', true, 30);
127    }
128}
129
130var intPopupElm = document.getElementById("intentPopup");
131if( intPopupElm ){
132    if (!CookieService.getCookie('exitIntentShown')) {
133        setTimeout(() => {
134            document.addEventListener('mouseout', mouseEvent);
135            document.addEventListener('keydown', exit);
136            document.querySelector('.exit-intent-popup').addEventListener('click', exit);
137        }, 0);
138    }    
139}
140
141function closeIntPopUp(elm, subFld = false){
142  let divTarget   = document.getElementById(elm);
143  divTarget.classList.remove('visible');
144  if( subFld === true ){
145    document.getElementById('myBtn2').click();
146  }
147}
148
149function load_author_posts( e, author_id ){
150  var clickCounter  = e.getAttribute("data-counter");
151  let ajaxUrl       = e.getAttribute("data-ajax-url");
152  if( e.classList.contains('no-more-posts') ) return false;
153
154  const moreBtn     = document.getElementById("showmoreposts");
155  moreBtn.innerHTML = "Loading...";
156  var xhttp     = new XMLHttpRequest();
157  xhttp.open("POST", ajaxUrl+'?action=get_author_posts', true);
158  xhttp.setRequestHeader("Content-Type", "application/json");
159  xhttp.onreadystatechange = function() {
160    if( this.readyState == 4 && this.status == 200 ){
161      let response = JSON.parse(this.responseText);
162      console.log( response );      
163      document.getElementById("auth-posts").insertAdjacentHTML('beforeend',response.auth_posts);
164      if( response.have_more === true ){
165        clickCounter++;
166        e.setAttribute("data-counter", clickCounter);
167        moreBtn.innerHTML = "Show More Posts";  
168      }else{
169        moreBtn.innerHTML = "No More Posts";
170        e.classList.add('no-more-posts');
171      }
172      
173    }
174  };  
175  xhttp.send(JSON.stringify({'author_id':author_id, 'paged': parseInt(e.getAttribute("data-counter"))}) );
176}
177
178
179function switchCat( tab_ul, tabcon, e ){
180    let TabElms = document.getElementById(tab_ul).querySelectorAll('li');
181    TabElms.forEach(function(elm){
182        elm.classList.remove("active");
183    });
184    e.classList.add("active");
185    let TabElmc = document.getElementById(tab_ul).querySelectorAll('.tabc-elm');
186    TabElmc.forEach(function(elm){
187        elm.classList.remove("active");
188    });
189    document.getElementById(tabcon).classList.add("active");
190    let viewElm = document.getElementById(tab_ul).getElementsByClassName("view-all-link")[0];
191    viewElm.setAttribute('href', e.dataset.link);
192}
193
194function _playYTmedia(video){
195    let iframe = document.getElementById("gen-video");
196    let ipopup = document.getElementById("gen-vpopup");
197    iframe.setAttribute('src', video+"?autoplay=1");
198    setTimeout(function(){        
199        ipopup.style.display = "block";    
200    }, 200);
201    
202}
203
204
205function closeGenVideo(){
206    let iframe = document.getElementById("gen-video");
207    let ipopup = document.getElementById("gen-vpopup");
208    iframe.setAttribute('src', "");    
209    ipopup.style.display = "none";
210}

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.