1//#region Cookies 2function setCookie(name, value, days) 3{ 4 //console.log('setCookie(' + name + ',' + value + ',' + days + ')'); 5 var expires = ''; 6 if (days) 7 { 8 if (days > 400) days = 399; 9 var date = new Date(); 10 date.setTime(date.getTime() + days*24*60*60*1000); 11 expires = '; expires='+date.toUTCString(); 12 //console.log('setCookie: ' + name + '=' + value + expires); 13 } 14 document.cookie = name + '=' + value + expires + '; path=/'; 15} 16function getCookie(name) 17{ 18 var nameEQ = name + '='; 19 var ca = document.cookie.split(';'); 20 for (var i = 0; i < ca.length; i++) 21 { 22 var c = ca[i]; 23 while (c.charAt(0)===' ') c = c.substring(1,c.length); 24 if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length,c.length); 25 } 26 return null; 27} 28function deleteCookie(name) { setCookie(name, '', -1); } 29//#endregion Cookies 30 31//#region Media Query Triggers 32function CheckQuery() 33{ 34 var z = $('html').css('z-index'); 35 if (z < 600) 36 { 37 $('html') 38 .addClass('mobile') 39 .removeClass('tablet') 40 .removeClass('desktop') 41 .removeClass('large'); 42 } 43 else if (z < 992) 44 { 45 $('html') 46 .removeClass('mobile') 47 .addClass('tablet') 48 .removeClass('desktop') 49 .removeClass('large'); 50 } 51 else 52 { 53 $('html') 54 .removeClass('mobile') 55 .removeClass('tablet') 56 .addClass('desktop'); 57 if (z < 1200) $('html').addClass('large'); 58 else $('html').removeClass('large'); 59 } 60} 61//#endregion Media Query Triggers 62 63//#region New Window Links 64function InitNewWinLink($Link) 65{ 66 var $Parent = $Link.parent(); 67 68 //don't handle sharing links 69 if (!($Parent.hasClass('Facebook') || $Parent.hasClass('Twitter') || $Parent.hasClass('GooglePlus') || $Parent.hasClass('Pinterest'))) 70 { 71 //add a notice to the title attribute 72 if ($Link.attr('title') === '') { $Link.attr('title', '(new window)'); } 73 else { $Link.attr('title', $Link.attr('title') + ' (new window)'); } 74 75 //add the click event 76 $Link.click(function (e) 77 { 78 if (!e) e = window.event; 79 if (e.shiftKey || e.ctrlKey || e.altKey) return; 80 window.open($Link.attr('href')); 81 return false; 82 }); 83 } 84} 85//#endregion New Window Links 86 87//#region Collapsable Navbar 88 89$.fn.CollapseNavbar = function() 90{ 91 var $navBar = $(this); 92 var $trigger = $($navBar.data('trigger')); 93 if ($navBar.hasClass('in')) 94 { 95 // console.log('Uncheck Hamburger'); 96 $trigger.prop('checked', false); 97 // console.log('Collapse Navbar'); 98 $navBar.collapse('hide'); 99 } 100} 101 102//#endregion Collapsable Navbar 103 104$(document).ready(function() 105{ 106 var $body = $('#body'); 107 108 //#region ======Media Query Triggers for jQuery====================================================== 109 // run test on initial page load 110 CheckQuery(); 111 112 // run test on resize of the window 113 $(window).resize(CheckQuery); 114 //#endregion Media Query Triggers 115 116 //#region ======Collapsable Navbar====================================================== 117 // make sure collapsable navbar is closed on page load 118 var $mainMenu = $('#Menu'); 119 var $mainTrigger = $('#NavTrigger'); 120 121 $mainMenu 122 //save the trigger for later 123 .data('trigger', $mainTrigger) 124 //sync the hamburger icon after the menu is opened 125 .on('shown.bs.collapse', function() 126 { 127 // console.log('Menu Shown'); 128 if ($mainTrigger.prop('checked') === false) 129 { 130 // console.log('Check Hamburger'); 131 $mainTrigger.prop('checked', true); 132 } 133 }) 134 //sync the hamburger icon after the menu is closed 135 .on('hidden.bs.collapse', function() 136 { 137 // console.log('Menu Hidden: ' + $mainTrigger.prop('checked')); 138 if ($mainTrigger.prop('checked') === true) 139 { 140 // console.log('Uncheck Hamburger'); 141 $mainTrigger.prop('checked', false); 142 } 143 }) 144 //make sure the menu is closed on page load
145 .CollapseNavbar(); 146 147 //close the menu when the page is scrolled or when the page is 148 //unloaded in case the back button is clicked to come back to this page 149 $(window).on('scroll unload', function() 150 { 151 //console.log('Window Scrolled or Unloaded'); 152 $mainMenu.CollapseNavbar(); 153 }); 154 155 //close the menu when anything outside of the main header is clicked 156 $('body > form > main, body > form > footer').click(function(e) 157 { 158 // console.log('Main/Footer Clicked'); 159 $mainMenu.CollapseNavbar(); 160 }); 161 162 //#endregion Collapsable Navbar 163 164 //#region ======Scroll Detection====================================================== 165 if ('IntersectionObserver' in window && 166 'IntersectionObserverEntry' in window && 167 'intersectionRatio' in window.IntersectionObserverEntry.prototype) 168 { 169 let observer = new IntersectionObserver(entries => 170 { 171 if (entries[0].boundingClientRect.y < 0) 172 { 173 $body 174 .removeClass('at-top') 175 .addClass('is-scrolled'); 176 } 177 else 178 { 179 $body 180 .removeClass('is-scrolled') 181 .addClass('at-top'); 182 } 183 }); 184 observer.observe(document.querySelector('#scroll-trigger')); 185 } 186 //#endregion Scroll Detection 187 188 //#region ======Internal link scrolling====================================================== 189 //scroll the page instead of jumping for internal links 190 $body.on('click', 'a[href*="#"]:not(.StaffDir .QuickLinks a)', function (e) 191 { 192 //console.log(this.pathname + '===' + window.location.pathname); 193 if (this.pathname === window.location.pathname) 194 { 195 e.preventDefault(); 196 var strHash = this.hash; 197 198 if (strHash === '' || strHash === '#') 199 { 200 return true; 201 } 202 else if (strHash === '#top') 203 { 204 //no need for offset when scrolling to top 205 $.scrollTo($('#top'), 'fast', { left: 0, top: 0 }); 206 207 //don't add #top to the url 208 //window.location.hash = ''; 209 } 210 else 211 { 212 //handle all other internal links 213 214 //check if the target is a tab in an accordion 215 var $anchor = $(strHash); 216 if ($anchor.hasClass('tab')) 217 { 218 var $button = $anchor.find('button'); 219 if ($button.hasClass('collapsed')) 220 { 221 var $accordion = $($button.data('parent')); 222 var $others = $accordion.find('.tab button').not($button); 223 224 $others.each(function() 225 { 226 $(this).addClass('collapsed'); 227 $($(this).data('target')).removeClass('in'); 228 }); 229 $button.removeClass('collapsed'); 230 $($button.data('target')).addClass('in').css('height','auto'); 231 } 232 } 233 234 $.scrollTo(strHash, 'medium', { axis: 'y', offset: { left: 0, top: -90 } }); 235 window.location.hash = strHash; 236 } 237 238 return false; 239 } 240 else 241 { 242 return true; 243 } 244 }); 245 //#endregion End internal link scrolling 246 247 //#region ======Create newWin Links====================================================== 248 $('a.newWin').not('.Video').each(function () 249 { 250 var $Link = $(this); 251 InitNewWinLink($Link); 252 }); 253 //#endregion Create newWin Links 254 255 //#region ======Google Analytics Events================================================= 256 $('.ga-events').each(function () 257 { 258 //use onclick to make sure this handler executes before any existing jquery click handlers 259 $(this).get(0).onclick = function () 260 { 261 var $Source = $(this); 262 var strCategory = $Source.data('ga-category'); 263 var strAction = $Source.data('ga-action'); 264 var strLabel = $Source.data('ga-label'); 265 var strValue = $Source.data('ga-value'); 266 var strToggle = $Source.data('ga-toggle'); 267 268 if (typeof strValue === 'undefined' || strValue === '') { strValue = 1; } 269 270 //special case for faq toggles 271 if (strToggle === 'faq') 272 { 273 if ($Source.hasClass('collapsed')) 274 strAction = 'show'; 275 else 276 strAction = 'hide'; 277 } 278 279 //send the event to Google Analytics 280 console.log('Send GA Event: ' + strCategory + ', ' + strAction + ', ' + strLabel + ', ' + strValue) 281 //ga('create', 'UA-2320212-1', 'auto', 'UATracker'); 282 //ga('create', 'G-B33NNZ85YS', 'auto', 'GA4Tracker'); 283 //ga('UATracker.send', 'event', strCategory, strAction, strLabel, strValue, { transport: 'beacon' }); 284 //ga('GA4Tracker.send', 'event', strCategory, strAction, strLabel, strValue, { transport: 'beacon' }); 285 gtag('event', strAction, { 'event_category': strCategory, 'event_label': strLabel, 'value:': strValue });
286 }; 287 }); 288 $(document).on('click', '.ga-social', function () 289 { 290 var $Source = $(this); 291 var strNetwork = $Source.data('ga-network'); 292 var strAction = $Source.data('ga-action'); 293 var strTarget = $Source.data('ga-target'); 294 295 ga('send', 'social', strNetwork, strAction, strTarget); 296 }); 297 //#endregion Google Analytics Events 298}); 299 300//#region ======RefTagger====================================================== 301//console.log('Initialize RefTagger'); 302var refTagger = 303{ 304 settings: 305 { 306 bibleReader: 'bible.faithlife', 307 bibleVersion: 'NASB', 308 convertHyperlinks: true, 309 dropShadow: true, 310 roundCorners: true, 311 noSearchClassNames: ['noRefTag','date','video','room','content-hero','opportunity-whenwhere'], 312 noSearchTagNames: ['h1','h2','h3','h4','h5','h6','a','figcaption'], 313 socialSharing: ['twitter','facebook'], 314 tooltipStyle: 'light', 315 tagChapters: true, 316 customStyle: 317 { 318 heading: 319 { 320 backgroundColor: '#3f7aa9', 321 color: '#f3f3f3', 322 fontSize: '16px' 323 }, 324 body: 325 { 326 color: '#363436', 327 fontSize: '16px', 328 fontWeight: '500', 329 moreLink: { color: '#3f7aa9' } 330 } 331 } 332 } 333}; 334(function(d, t) 335{ 336 var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; 337 g.src = '//api.reftagger.com/v2/RefTagger.js'; 338 s.parentNode.insertBefore(g, s); 339}(document, 'script')); 340//#endregion RefTagger
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.