PageSourceSearch

https://x-atelier.pt/wp-content/themes/xatelier-2024/library/js/general.js

js x-atelier.pt collected 2026-10-04 05:10:20 UTC 24,262 bytes, 734 lines download raw bytes

1$(window).on("beforeunload", function () {
2  $("body").hide();
3  $(window).scrollTop(0);
4});
5
6if (!sessionStorage.alreadyClicked) {
7  sessionStorage.alreadyClicked = 1;
8  $("body").fadeIn(500);
9  $("#loader").delay(1500).fadeOut(250);
10} else {
11  $("body").fadeIn(500);
12  $("#loader").css("display", "none");
13}
14
15$(document).ready(function () {
16  var height = $(window).height();
17
18  $("#x-atelier").click(function (e) {
19    e.preventDefault();
20    //  $(document).animate({scrollTop: height},'3000');
21    //$(document).scrollTop($(window).height());
22    $("body,html").animate(
23      {
24        scrollTop: $(window).height(),
25      },
26      3000
27    );
28    setTimeout(function () {
29      enableScroll();
30    }, 3002);
31
32    disableScroll();
33  });
34
35  // left: 37, up: 38, right: 39, down: 40,
36  // spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36
37  var keys = { 37: 1, 38: 1, 39: 1, 40: 1 };
38
39  function preventDefault(e) {
40    e.preventDefault();
41  }
42
43  function preventDefaultForScrollKeys(e) {
44    if (keys[e.keyCode]) {
45      preventDefault(e);
46      return false;
47    }
48  }
49
50  // modern Chrome requires { passive: false } when adding event
51  var supportsPassive = false;
52  try {
53    window.addEventListener(
54      "test",
55      null,
56      Object.defineProperty({}, "passive", {
57        get: function () {
58          supportsPassive = true;
59        },
60      })
61    );
62  } catch (e) {}
63
64  var wheelOpt = supportsPassive ? { passive: false } : false;
65  var wheelEvent =
66    "onwheel" in document.createElement("div") ? "wheel" : "mousewheel";
67
68  // call this to Disable
69  function disableScroll() {
70    window.addEventListener("DOMMouseScroll", preventDefault, false); // older FF
71    window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop
72    window.addEventListener("touchmove", preventDefault, wheelOpt); // mobile
73    window.addEventListener("keydown", preventDefaultForScrollKeys, false);
74  }
75
76  // call this to Enable
77  function enableScroll() {
78    window.removeEventListener("DOMMouseScroll", preventDefault, false);
79    window.removeEventListener(wheelEvent, preventDefault, wheelOpt);
80    window.removeEventListener("touchmove", preventDefault, wheelOpt);
81    window.removeEventListener("keydown", preventDefaultForScrollKeys, false);
82  }
83
84  $(".clearfix").masonry({
85    itemSelector: ".image",
86
87    columnWidth: ".image",
88    percentPosition: true,
89  });
90
91  // $('a[href*=#]').each(function () {
92  //     $(this).attr('href', $(this).attr('href').replace('#', '#_'));
93  // });
94
95  // // scrollTo if #_ found
96  // hashname = window.location.hash.replace('#_', '');
97  // // find element to scroll to (<a name=""> or anything with particular id)
98  // elem = $('a[name="' + hashname + '"],#' + hashname);
99
100  $("body").show();
101
102  $(document).on("click", 'a[href^="#"]', function (event) {
103    if ($("body").hasClass("home")) {
104      event.preventDefault();
105      var ID = $(this).attr("href");
106      var top = $(ID).attr("top");
107      console.log(ID + " + " + top);
108      $(document).scrollTop(top);
109      console.log($(window).scrollTop());
110
111      var backColor = $(this).attr("data-backgroundcolor");
112      $("#menu-projects-desktop").find(".active").removeClass("active");
113      $(this).addClass("active");
114      $("#menu-projects-desktop").css("background-color", backColor);
115      curtainReveal();
116    }
117  });
118
119  setTimeout(function () {
120    $(".mobile-loader").css("opacity", "0");
121  }, 1050);
122
123  $.fn.isInViewport = function () {
124    // var elementTop = $(this).offset().top - $('#menu-projects-desktop').outerHeight();
125    // var elementBottom = elementTop + $(this).outerHeight(true);
126    // var viewportTop = $(window).scrollTop();
127    // var viewportBottom = viewportTop + $(window).height();
128    // return elementBottom > viewportTop && elementTop < viewportTop;
129
130    var elementTop =
131      $(this).offset().top - $("#menu-projects-desktop").outerHeight();
132    var elementBottom = elementTop + $(this).outerHeight(true);
133    var viewportTop = $(window).scrollTop();
134    var viewportBottom = viewportTop + $(window).height();
135    return viewportTop > elementTop;
136  };
137
138  changeColorMenu();
139
140  if ($("body").hasClass("page-id-42") || $("body").hasClass("page-id-1050")) {
141    $("#menu-projects-desktop").find(".active").removeClass("active");
142    $("#menu-projects-desktop").find(".information").addClass("active");
143  }
144  if ($("body").hasClass("page-id-134") || $("body").hasClass("page-id-1054")) {
145    $("#menu-projects-desktop").find(".active").removeClass("active");
146    $("#menu-projects-desktop").find(".menu-archive").addClass("active");
147  }
148  function changeColorMenu() {
149    if (
150      $(window).scrollTop() <
151      $(window).height() - $("#menu-projects-desktop").outerHeight()
152    ) {
153      $("#menu-projects-desktop").find(".active").removeClass("active");
154      $("#menu-projects-desktop").find(".x-atelier").addClass("active");
155      $("#menu-projects-desktop").css("background-color", "#fff");
156    } else {
157      $(".stf").each(function () {
158        if ($(this).isInViewport() && $(this).hasClass("inview")) {
159          var currentID = $(this).attr("id");
160          var currentIDs = "." + currentID;
161          var backColor = $("#menu-projects-desktop")
162            .find(currentIDs)
163            .attr("data-backgroundcolor");
164          $("#menu-projects-desktop").find(".active").removeClass("active");
165          $("#menu-projects-desktop").find(currentIDs).addClass("active");
166          $("#menu-projects-desktop").css("background-color", backColor);
167          //console.log('FIRST: changeColorMenu ' + currentID);
168        } else if ($(this).isInViewport()) {
169          var currentID = $(this).attr("id");
170          var currentIDs = "." + currentID;
171          var backColor = $("#menu-projects-desktop")
172            .find(currentIDs)
173            .attr("data-backgroundcolor");
174          $("#menu-projects-desktop").find(".active").removeClass("active");
175          $("#menu-projects-desktop").find(currentIDs).addClass("active");
176          $("#menu-projects-desktop").css("background-color", backColor);
177          // console.log('SECOND : changeColorMenu ' + currentID);
178        } else {
179          $("#menu-projects-desktop").find(currentIDs).removeClass("active");
180        }
181      });
182
183      // $('.project-container').each(function() {
184      //   if ($(this).isInViewport()){
185      //      console.log('in view: ' + $(this).attr('id'));
186      //   }
187      //   if ($(this).isInViewport() && $(this).hasClass('inview')) {
188
189      //     var currentID = $(this).attr('id');
190      //     var currentIDs = '.' + currentID;
191      //     var backColor = $('#menu-projects-desktop').find(currentIDs).attr("data-backgroundcolor");
192      //     $('#menu-projects-desktop').find('.active').removeClass('active');
193      //     $('#menu-projects-desktop').find(currentIDs).addClass('active');
194      //     $('#menu-projects-desktop').css("background-color",backColor);
195      //      console.log('changeColorMenu ' + currentID);
196      //   } else {
197      //     $('#menu-projects-desktop').find(currentIDs).removeClass('active');
198      //     //console.log('else  ' + currentID);
199      //   }
200      // });
201      // $('.project-containerr').each(function() {
202      //   if ($(this).isInViewport()){
203      //      console.log('in view: ' + $(this).attr('id'));
204      //   }
205      //     if ($(this).isInViewport() && $(this).hasClass('inview') ) {
206
207      //       var currentID = $(this).attr('id');
208      //       var currentIDs = '.' + currentID;
209      //       var backColor = $('#menu-projects-desktop').find(currentIDs).attr("data-backgroundcolor");
210      //       $('#menu-projects-desktop').find('.active').removeClass('active');
211      //       $('#menu-projects-desktop').find(currentIDs).addClass('active');
212      //       $('#menu-projects-desktop').css("background-color",backColor);
213      //       console.log('changeColorMenu ' + currentID);
214      //     } else {
215      //       $('#menu-projects-desktop').find(currentIDs).removeClass('active');
216      //       // console.log('else  ' + currentID);
217      //     }
218      //   });
219    }
220  }
221
222  function curtainPosition() {
223    var winHeight = $(window).height();
224    //var overviewOffs = $('#overview').offset().top;
225    var bottomOverview =
226      winHeight +
227      $("#overview").outerHeight(true) -
228      $(window).height() -
229      $(window).width() * 0.045;
230
231    $("#overview").css("position", "absolute");
232    $("#overview").css("top", winHeight);
233    $("#overview").attr("top", winHeight);
234    $("#overview").attr("trigger", bottomOverview);
235
236    var outerHeight = 0;
237    $(".project-container").each(function () {
238      outerHeight += $(this).outerHeight(true);
239    });
240    var botttt =
241      $("#overview").outerHeight(true) + outerHeight + $(window).height();
242    $("#information").css("position", "absolute");
243    $("#information").css("top", botttt);
244    $("#information").attr("top", botttt);
245
246    // var outerHeight = 0;
247    $(".project-container").each(function () {
248      var outerHeight = 0;
249      $(this)
250        .prevAll(".project-container")
251        .each(function () {
252          outerHeight += $(this).outerHeight(true) - $(window).width() * 0.045;
253        });
254      var botttt =
255        $("#overview").outerHeight(true) -
256        $(window).width() * 0.045 +
257        outerHeight +
258        $(window).height();
259      $(this).css("position", "absolute");
260      $(this).css("top", botttt);
261      $(this).attr("top", botttt);
262
263      var offsetSTF = $(this).attr("top");
264      offsetSTF = parseFloat(offsetSTF);
265      var outerhh = $(this).outerHeight(true) - $(window).width() * 0.045;
266      outerhh = parseFloat(outerhh);
267      var pointderupture = offsetSTF + outerhh - winHeight;
268      $(this).attr("trigger", pointderupture);
269    });
270  }
271
272  var currentPos = $(window).scrollTop();
273  var winHeight = $(window).height();
274
275  //$('.stf').last().removeClass('stf');
276
277  function curtainReveal() {
278    //console.log("curtain reveal");
279    currentPos = $(window).scrollTop();
280    $(".stf:not(:last)").each(function () {
281      var offsetSTF = $(this).attr("top");
282      offsetSTF = parseFloat(offsetSTF);
283      var outerhh = $(this).outerHeight(true);
284      outerhh = parseFloat(outerhh);
285      var iD = $(this).attr("id");
286      var pointderupture = $(this).attr("trigger");
287
288      var divTop = -outerhh + winHeight + $(window).width() * 0.045;
289
290      if (currentPos > pointderupture) {
291        $(this).css("position", "fixed");
292        $(this).css("top", divTop);
293        $(this).removeClass("inview");
294        //   console.log("FIX " +iD);
295      } else {
296        $(this).css("position", "absolute");
297        $(this).addClass("inview");
298        $(this).css("top", offsetSTF);
299        //   console.log("defix " +iD);
300      }
301    });
302  }
303
304  var elem = window.location.hash.substr(1);
305  if (elem) {
306    curtainPosition();
307    var top = $("#" + elem).offset().top;
308    console.log(top);
309    $(document).scrollTop(top);
310
311    curtainReveal();
312    changeColorMenu();
313    //window.location.replace('https://x-atelier.pt/');
314    //window.location = 'https://x-atelier.pt/';
315    window.history.pushState("", "", " ");
316  }
317
318  if ($("body").hasClass("home")) {
319    curtainPosition();
320    curtainReveal();
321  }
322
323  $(window).resize(
324    _.debounce(function () {
325      if ($("body").hasClass("home")) {
326        curtainPosition();
327        curtainReveal();
328        changeColorMenu();
329      }
330      //console.log('resized');
331    }, 500)
332  );
333
334  $(function () {
335    if ($("body").hasClass("home")) {
336      $(window).on("scroll", _.throttle(scrollTest, 50));
337      function scrollTest() {
338        changeColorMenu();
339        if ($(window).scrollTop() > $(window).height() * 2) {
340          curtainReveal();
341        }
342      }
343    }
344  });
345
346  $(".mobile-information-menu").click(function () {
347    if ($(".menu-mobile").hasClass("active")) {
348      closeDialog();
349      $(".menu-mobile").removeClass("active");
350    } else {
351      $(".menu-mobile").addClass("active");
352      showDialog();
353    }
354  });
355
356  $(".mobile-information-menu").click(function () {
357    if ($("#informations").hasClass("active")) {
358      $("#informations").removeClass("active");
359    } else {
360      $("#informations").addClass("active");
361    }
362  });
363
364  if ($(window).width() < 768) {
365    window.addEventListener("scroll", () => {
366      document.documentElement.style.setProperty(
367        "--scroll-y",
368        `${window.scrollY}px`
369      );
370    });
371
372    function showDialog() {
373      const scrollY =
374        document.documentElement.style.getPropertyValue("--scroll-y");
375      const body = document.body;
376      body.style.position = "fixed";
377      body.style.top = `-${scrollY}`;
378    }
379
380    function closeDialog() {
381      const body = document.body;
382      const scrollY = body.style.top;
383      body.style.position = "";
384      body.style.top = "";
385      window.scrollTo(0, parseInt(scrollY || "0") * -1);
386    }
387  }
388
389  //////////  I PHONE INFINITE SCROLL //////////
390
391  // function loadNextPost(posttobelinked) {
392  //   canBeLoaded = false;
393  //   var nextPostId = $(".single-project-container").last().attr("next-post-id");
394  //   console.log("nextPostId " + nextPostId);
395
396  //   var ourRequest = new XMLHttpRequest();
397  //   ourRequest.open(
398  //     "GET",
399  //     "https://x-atelier.local/wp-json/wp/v2/posts/" + nextPostId + ""
400  //   );
401  //   ourRequest.onload = function () {
402  //     if (ourRequest.status >= 200 && ourRequest.status < 400) {
403  //       var data = JSON.parse(ourRequest.responseText);
404  //       console.log(data);
405  //       loadnextpostHTML(data);
406  //     } else {
407  //       console.log("We connected to the server, but it returned an error.");
408  //     }
409  //   };
410  //   ourRequest.onerror = function () {
411  //     console.log("Connection error");
412  //   };
413  //   ourRequest.send();
414  // }
415
416  // function loadnextpostHTML(postsData) {
417  //   var nextPostId = $(".single-project-container").last().attr("data-id");
418
419  //   $.ajax({
420  //     url: postsData.link,
421  //     type: "POST",
422  //     beforeSend: function (data) {
423  //       canBeLoaded = false;
424  //       console.log("test");
425  //     },
426  //     success: function (data) {
427  //       //console.log(data);
428  //       console.log(postsData.id + " " + nextPostId);
429  //       if (postsData.id != nextPostId) {
430  //         console.log("TTTTTTT");
431  //         $(".single-project-container")
432  //           .last()
433  //           .after(
434  //             '<div id="id-' +
435  //               postsData.id +
436  //               '" class="single-project-container next"  data-background-color="' +
437  //               postsData.acf.background_color +
438  //               '" id="id-' +
439  //               postsData.id +
440  //               '" data-id="' +
441  //               postsData.id +
442  //               '" next-post-id="' +
443  //               postsData.next_post +
444  //               '" prev-post-id="' +
445  //               postsData.previous_post +
446  //               '">'
447  //           );
448  //         $(".single-project-container")
449  //           .last()
450  //           .append(
451  //             $(data)
452  //               .find("#id-" + postsData.id)
453  //               .html()
454  //           );
455  //         var newdiv = $("#id-" + postsData.id);
456  //         lazySizes.init();
457  //         console.log("test2");
458  //         canBeLoaded = true;
459  //       }
460  //     },
461  //   });
462  // }
463
464  function logAllPosts() {
465    var allPostsUrl = "/wp-json/wp/v2/posts?lang=pt"; // Adjust the number if you have more than 100 posts
466
467    var xhr = new XMLHttpRequest();
468    xhr.open("GET", allPostsUrl);
469    xhr.onload = function () {
470      if (xhr.status >= 200 && xhr.status < 400) {
471        var posts = JSON.parse(xhr.responseText);
472        console.log("Total Posts: " + posts.length);
473
474        posts.forEach(function (post) {
475          console.log(
476            "Post ID: " + post.id + " - Title: " + post.title.rendered
477          );
478        });
479      } else {
480        console.log("Failed to load posts. Status: " + xhr.status);
481      }
482    };
483    xhr.onerror = function () {
484      console.log("Connection error");
485    };
486    xhr.send();
487  }
488
489  // Call the function to log all posts
490  logAllPosts();
491
492  // function loadNextPost() {
493  //   var nextPostId = $(".single-project-container").last().attr("next-post-id");
494  //   console.log("Fetching next post with ID: " + nextPostId);
495  //   console.log("https://x-atelier.local/wp-json/wp/v2/posts/" + nextPostId);
496  //   var ourRequest = new XMLHttpRequest();
497  //   ourRequest.open(
498  //     "GET",
499  //     "https://x-atelier.local/wp-json/wp/v2/posts/" + nextPostId
500  //   );
501  //   ourRequest.onload = function () {
502  //     if (ourRequest.status >= 200 && ourRequest.status < 400) {
503  //       var data = JSON.parse(ourRequest.responseText);
504  //       console.log("Fetched post data:", data);
505  //       loadNextPostHTML(data);
506  //     } else {
507  //       console.log("Error fetching post. Status: " + ourRequest.status);
508  //     }
509  //   };
510  //   ourRequest.onerror = function () {
511  //     console.log("Connection error");
512  //   };
513  //   ourRequest.send();
514  // }
515
516  // function loadNextPost() {
517  //   canBeLoaded = false;
518  //   var nextPostId = $(".single-project-container").last().attr("next-post-id");
519  //   console.log("Fetching next post with ID: " + nextPostId);
520  //   console.log("https://x-atelier.local/wp-json/wp/v2/posts/" + nextPostId);
521  //   var ourRequest = new XMLHttpRequest();
522  //   ourRequest.open(
523  //     "GET",
524  //     "https://x-atelier.local/wp-json/wp/v2/posts/" + nextPostId
525  //   );
526  //   ourRequest.onload = function () {
527  //     if (ourRequest.status >= 200 && ourRequest.status < 400) {
528  //       var data = JSON.parse(ourRequest.responseText);
529  //       console.log("Fetched post data:", data);
530  //       loadNextPostHTML(data);
531  //     } else {
532  //       console.log("Error fetching post. Status: " + ourRequest.status);
533  //     }
534  //   };
535  //   ourRequest.onerror = function () {
536  //     console.log("Connection error");
537  //   };
538  //   ourRequest.send();
539  // }
540
541  // function loadNextPostHTML(postsData) {
542  //   var lastPostId = $(".single-project-container").last().attr("data-id");
543
544  //   if (!postsData || postsData.id == lastPostId) {
545  //     console.log("No new post to load or duplicate post detected.");
546  //     return;
547  //   }
548
549  //   console.log("Loading post ID:", postsData.id);
550  //   console.log("Previous last post ID:", lastPostId);
551
552  //   $.ajax({
553  //     url: postsData.link,
554  //     type: "GET", // Using GET since we're retrieving content
555  //     beforeSend: function () {
556  //       canBeLoaded = false;
557  //       console.log("Loading next post...");
558  //     },
559  //     success: function (data) {
560  //       // Check if the new post ID is the same as the last loaded post ID
561  //       if (postsData.id != lastPostId) {
562  //         console.log("Appending new post...");
563
564  //         // Create and append the new post container
565  //         var newPostDiv = $(
566  //           '<div id="id-' +
567  //             postsData.id +
568  //             '" class="single-project-container next" data-background-color="' +
569  //             postsData.acf.background_color +
570  //             '" data-id="' +
571  //             postsData.id +
572  //             '" next-post-id="' +
573  //             postsData.next_post +
574  //             '" prev-post-id="' +
575  //             postsData.previous_post +
576  //             '"></div>'
577  //         );
578  //         $(".single-project-container").last().after(newPostDiv);
579
580  //         // Append the new post content inside the new container
581  //         newPostDiv.append(
582  //           $(data)
583  //             .find("#id-" + postsData.id)
584  //             .html()
585  //         );
586
587  //         // Reinitialize lazy loading
588  //         lazySizes.init();
589
590  //         console.log("Post loaded successfully.");
591  //         canBeLoaded = true;
592  //       } else {
593  //         console.log("No new post loaded, duplicate detected.");
594  //       }
595  //     },
596  //     error: function (jqXHR, textStatus, errorThrown) {
597  //       console.log("Failed to load post: " + textStatus);
598  //     },
599  //   });
600  // }
601
602  function loadNextPost(posttobelinked) {
603    canBeLoaded = false;
604
605    // Get the next post ID from the last loaded post
606    var nextPostId = $(".single-project-container").last().attr("next-post-id");
607    console.log("nextPostId " + nextPostId);
608
609    if (!nextPostId) {
610      console.log("No next post ID found.");
611      return;
612    }
613
614    var ourRequest = new XMLHttpRequest();
615    ourRequest.open("GET", "/wp-json/wp/v2/posts/" + nextPostId);
616    ourRequest.onload = function () {
617      if (ourRequest.status >= 200 && ourRequest.status < 400) {
618        var data = JSON.parse(ourRequest.responseText);
619        console.log(data);
620        loadNextPostHTML(data);
621      } else {
622        console.log("Connected to the server, but it returned an error.");
623      }
624    };
625    ourRequest.onerror = function () {
626      console.log("Connection error");
627    };
628    ourRequest.send();
629  }
630
631  function loadNextPostHTML(postsData) {
632    var lastPostId = $(".single-project-container").last().attr("data-id");
633
634    if (!postsData || postsData.id == lastPostId) {
635      console.log("No new post to load or duplicate post detected.");
636      return;
637    }
638
639    $.ajax({
640      url: postsData.link,
641      type: "GET", // Use GET instead of POST since you're retrieving content
642      beforeSend: function () {
643        canBeLoaded = false;
644        console.log("Loading next post...");
645      },
646      success: function (data) {
647        console.log(postsData.id + " " + lastPostId);
648
649        // Ensure the new post is different from the last loaded post
650        if (postsData.id != lastPostId) {
651          console.log("Appending new post...");
652
653          // Append the new post container
654          var newPostDiv = $(
655            '<div id="id-' +
656              postsData.id +
657              '" class="single-project-container next" data-background-color="' +
658              postsData.acf.background_color +
659              '" data-id="' +
660              postsData.id +
661              '" next-post-id="' +
662              postsData.next_post +
663              '" prev-post-id="' +
664              postsData.previous_post +
665              '"></div>'
666          );
667          $(".single-project-container").last().after(newPostDiv);
668
669          // Append the new post content inside the new container
670          newPostDiv.append(
671            $(data)
672              .find("#id-" + postsData.id)
673              .html()
674          );
675
676          // Reinitialize lazy loading
677          lazySizes.init();
678
679          console.log("Post loaded successfully.");
680          canBeLoaded = true;
681        } else {
682          console.log("No new post loaded.");
683        }
684      },
685      error: function (jqXHR, textStatus, errorThrown) {
686        console.log("Failed to load post: " + textStatus);
687      },
688    });
689  }
690
691  function changeBackSingleColor() {
692    $(".single-project-container").each(function () {
693      if (
694        $(window).scrollTop() > $(this).offset().top &&
695        $(window).scrollTop() < $(this).offset().top + $(this).outerHeight(true)
696      ) {
697        var lepost = $(this).attr("data-id");
698        //changeUrlTitle(lepost);
699      }
700      if (
701        $(window).scrollTop() > $(this).offset().top - 120 &&
702        $(window).scrollTop() <
703          $(this).offset().top + $(this).outerHeight(true) - 120
704      ) {
705        var color = $(this).attr("data-background-color");
706        $(this).addClass("active");
707        $("body").css("background-color", color);
708        $(".menu-mobile").css("background-color", color);
709      } else {
710        $(this).removeClass("active");
711        // $(this).find('.iphone-single-project-information').removeClass("open");
712      }
713    });
714  }
715
716  changeBackSingleColor();
717
718  var canBeLoaded = true;
719
720  $(window).scroll(function () {
721    //$("html, body").stop();
722    if ($("body").hasClass("single")) {
723      changeBackSingleColor();
724      // console.log($(window).scrollTop() + " > " + ($(document).height() - $(window).height()*4) )
725      if (
726        $(window).scrollTop() >=
727          $(document).height() - $(window).height() * 6 &&
728        canBeLoaded == true
729      ) {
730        // loadNextPost();
731      }
732    }
733  });
734});

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.