PageSourceSearch

https://thescubaguide.com/wp-content/cache/autoptimize/js/autoptim…?ver=7.1.2&fver=20231210043211

js thescubaguide.com collected 2026-10-02 14:21:03 UTC 3,160 bytes, 19 lines download raw bytes

1(function(){let rtocList=[];let lastScrollY=0;let lastBodyClientHeight=0;let sidebar_rtoc_wrapper=document.querySelector('.sidebar #rtoc-mokuji-widget-wrapper');if(!sidebar_rtoc_wrapper){sidebar_rtoc_wrapper=document.querySelector('.widget #rtoc-mokuji-widget-wrapper');}
2if(!sidebar_rtoc_wrapper){sidebar_rtoc_wrapper=document.querySelector('.c-widget #rtoc-mokuji-widget-wrapper');}
3if(!sidebar_rtoc_wrapper){sidebar_rtoc_wrapper=document.querySelector('#scrollad #rtoc-mokuji-widget-wrapper');}
4if(!sidebar_rtoc_wrapper){sidebar_rtoc_wrapper=document.querySelector('#sideBarTracking #rtoc-mokuji-widget-wrapper');}
5if(!sidebar_rtoc_wrapper){sidebar_rtoc_wrapper=document.querySelector('#sidebar1 #rtoc-mokuji-widget-wrapper');}
6if(sidebar_rtoc_wrapper){sidebar_rtoc_wrapper.classList.add('rtoc-sidebar-contents');}else{return;}
7function rtoc_init(){rtocList=[];rtocParentList=[];if(sidebar_rtoc_wrapper==null){return;}
8const itemList=sidebar_rtoc_wrapper.querySelectorAll('a');const itemAllList=sidebar_rtoc_wrapper.querySelectorAll('.level-1 > .rtoc-item > a');for(let i=0;i<itemList.length;i++){const a=itemList[i];const linkAnker=a.href.substring(a.href.lastIndexOf('#'));const itemElement=document.querySelector(decodeURI(linkAnker));if(itemElement!=null){let top=itemElement.offsetTop;let parent=itemElement.offsetParent;while(parent!=null){top+=parent.offsetTop;parent=parent.offsetParent;}
9rtocList.push({top:top,bottom:1e30,itemdom:a.parentElement});if(i>0){if(rtocList[i]){rtocList[i-1].bottom=rtocList[i].top;}}}}
10for(let i=0;i<itemAllList.length;i++){const a=itemAllList[i];const linkAnker=a.href.substring(a.href.lastIndexOf('#'));const itemAllElement=document.querySelector(decodeURI(linkAnker));let top=itemAllElement.offsetTop;let parent=itemAllElement.offsetParent;while(parent!=null){top+=parent.offsetTop;parent=parent.offsetParent;}
11rtocParentList.push({top:top,bottom:1e30,itemdom:a.parentElement});if(i>0){rtocParentList[i-1].bottom=rtocParentList[i].top;}}}
12rtoc_init();function rtocUpdateSection(scrollY){if(document.body.clientHeight!==lastBodyClientHeight){rtoc_init();}
13for(let sec of rtocList){sec.itemdom.classList.remove('rtoc-current');}
14for(let sec of rtocParentList){sec.itemdom.classList.remove('rtoc-show');}
15for(let i=0;i<rtocList.length;i++){const sec=rtocList[i];if(sec.top<=scrollY&&scrollY<sec.bottom){sec.itemdom.classList.add('rtoc-current');break;}}
16for(let i=0;i<rtocParentList.length;i++){const sec=rtocParentList[i];if(sec.top<=scrollY&&scrollY<sec.bottom){sec.itemdom.classList.add('rtoc-show');break;}}}
17function widgetScroll(hiddenDOM){const highlightContents=sidebar_rtoc_wrapper.querySelector('.rtoc-current');if(!highlightContents)return;}
18let ticking=false;const scrollHeight=sidebar_rtoc_wrapper.querySelector('.rtoc-mokuji').scrollHeight;const displayHeight=sidebar_rtoc_wrapper.querySelector('.rtoc-mokuji').offsetHeight;document.addEventListener('scroll',function(){lastScrollY=window.scrollY;if(ticking===false){window.requestAnimationFrame(function(){rtocUpdateSection(lastScrollY+300);ticking=false;});ticking=true;}
19if(scrollHeight>displayHeight){widgetScroll(scrollHeight-displayHeight);}});})();

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.