1/* 2 Main ChurchInsight template Javascript/JQuery file. 3 WARNING - do not edit this file unless you know exactly what you are doing. 4 Better to use the scriptOverRide.js file to add local changes to a template. 5 If you need advice, contact ChurchInsight Support. 6*/ 7 8// This file runs after the web-page has loaded, as there is a "defer" attribute on the <script> tag in the HTML header. 9// The preloaded JQuery version is V1.10.2. 10 11$(document).ready(function () 12{ 'use strict'; 13 14var bSplitFooterAddressAtSecondComma = true; 15 16var PageName; 17function ProcessPageName(sMineType) { 18 PageName = PageName.substring(0, PageName.indexOf('.' + sMineType)); 19 PageName = PageName.replace(/\//g, "_"); // replace all / to _ Have to use \/ to get a / in the reg-ex. The g denotes a global exchange. 20 PageName = PageName + '_' + "aspx"; // make all pages look like aspx pages. 21} 22 23// Work out what page we are on. 24PageName = window.location.pathname.toLowerCase(); // on the root, this have the value "/" 25var bOnLocalMachine = PageName.indexOf(".html") !== -1; 26if (!bOnLocalMachine) { 27 ProcessPageName("aspx"); 28} else { 29 // Assume we are debugging on a local machine. 30 PageName = PageName.substr(PageName.indexOf("/_") + 1); 31 ProcessPageName("html"); 32} 33 34// #################### Define some useful functions ####################### 35 36// We have to put all functions here, as OSX does not allow functions to be inside if statements. 37 38// function to turn a slice name into a selector reference for the corresponding <section> tag 39function GetSectionTagRef(SliceName) { 40 return 'section.' + SliceName + ' '; 41} 42 43var SectionTag, SectionTags; // will be used to hold required slices 44function SectionTagExists(SliceName) { 45 if (SectionTags.hasClass(SliceName)) { 46 SectionTag = SectionTags.filter(GetSectionTagRef(SliceName)); 47 if (SectionTag.length !== 0) { // at least one slice exists, great. You could have more than one in theory. 48 return true; 49 } 50 } 51 SectionTag = undefined; // remove all data. 52 return false; 53} 54 55function GetRefItem(SectionTag, Ref) { 56 if (typeof Ref === "string") { 57 if (Ref === '') { // allows us to return the section tag itself. 58 return SectionTag; 59 } else { 60 return SectionTag.find(Ref); 61 } 62 } else { 63 return Ref; 64 } 65} 66 67// A function to easily set JQuery toggles. 68// SectionTag is a $ variable. 69function ApplyToggleVisibilityOnClick(SectionTag, ClickRef, ToggleRef, iDelay, bShowToggleItemInitially) { 70 71 var ClickItem = GetRefItem(SectionTag, ClickRef); 72 var ToggleItem = GetRefItem(SectionTag, ToggleRef); 73 74 if (bShowToggleItemInitially) { 75 ToggleItem.show(0); 76 } else { 77 ToggleItem.hide(0); 78 } 79 // Note we add a function here. Since we are only using calling function arguements inside the function argument, 80 // variable scoping correctly works. 81 ClickItem.click(function () { 82 ToggleItem.toggle(iDelay); 83 }); 84} 85 86function ApplyHideOnClick(SectionTag, ClickRef, ToHideRef) { 87 88 var ClickItem = GetRefItem(SectionTag, ClickRef); 89 var ToHideItem = GetRefItem(SectionTag, ToHideRef); 90 91 ClickItem.click(function () { 92 ToHideItem.hide(0); 93 }); 94} 95 96// function to test if text exists. 97var sAttrText, sAttrText2, sAttrText3, sAttrText4; // Results come back in these variables. 98var DollarTextarea = $("<textarea/>"); // store this once. 99function TextExists(attrText, bSplit) { 100 101 if (attrText === undefined) {return false;} 102 if (attrText === null) {return false;} 103 104 var TextToProcess = attrText.trim(); 105 if (TextToProcess === '') {return false;} 106 107 // decode the text, so that &lt; becomes < etc. 108 // This works by turning into HTML and then turning back into text. 109 if (TextToProcess.indexOf('&') !== -1) { // we could use the .includes('&') method, but it is quite new, so some browsers can't cope. 110 TextToProcess = DollarTextarea.html(TextToProcess).text(); 111 } 112 if (TextToProcess === '') {return false;} 113 114 sAttrText = ''; // set return values to blank. 115 sAttrText2 = ''; 116 sAttrText3 = ''; 117 sAttrText4 = ''; 118 if (bSplit) { 119 var arrSplitText = TextToProcess.split('*'); 120 sAttrText = arrSplitText[0].trim(); 121 if (arrSplitText.length > 1) {sAttrText2 = arrSplitText[1].trim();} 122 if (arrSplitText.length > 2) {sAttrText3 = arrSplitText[2].trim();} 123 if (arrSplitText.length > 3) {sAttrText4 = arrSplitText[3].trim();} 124 } else { 125 sAttrText = TextToProcess; 126 } 127 128 return (sAttrText + sAttrText2 + sAttrText3 + sAttrText4 !== ''); 129} 130
131// Function to hide a column if it contains no images. 132var SystemSlice; 133function HideDivsIfAllEmpty(ColumnClass) { 134 var ImageWrappers = SystemSlice.find('div.' + ColumnClass); 135 if (ImageWrappers.find('img').length === 0) { // have to use find not children, as img tags can be inside <a> tags. 136 ImageWrappers.hide(0); 137 } 138} 139 140// ################### Slice activation functions go here. ######################### 141 142// All slide shows have the same defaults at present. 143var bAddDarkenedOverlayForSlideShowCaptions = false; 144var SlideShowDefaultButtonText = 'Find out more'; 145 146function ActivateBxSlider(SliceName) { 147 if (SectionTagExists(SliceName)) { // check if slice exists, and load into SectionTag if it does 148 149 var bannerSlides = SectionTag.find('div.bannerSlides'); // use a "find" here, as structure of slices varies. 150 var gallery_ul = bannerSlides.children('ul.gallery_ul'); 151 var ImageList = gallery_ul.find('img'); 152 if (ImageList.length === 0) {return;} // No images, so give up. 153 154 // ul.gallery_ul must be displayed before bx-slider can be applied. 155 // So since we hide it while the page was loading, we show it now. 156 bannerSlides.show(0); // show the slice now. It was hidden by CSS. 157 158 if (ImageList.length > 1) { // carry on as normal. 159 gallery_ul.bxSlider(BxDefaultValues); 160 } else { // Just 1 image, so we don't set up the slider, but do some minor adjustments to help the CSS. 161 gallery_ul.css('margin','0px'); 162 var S = '<div class="bx-wrapper"><div class="bx-viewport"></div></div>'; 163 gallery_ul.wrap(S); 164 } 165 166 // Code to enable user defined text to appear over banner slides. 167 ImageList.each(function() { 168 var ThisImg = $(this); 169 if (TextExists(ThisImg.attr('alt'), true)) { // check if there is any alt text. 170 var DarkenedClass = ''; 171 if (bAddDarkenedOverlayForSlideShowCaptions) {DarkenedClass = ' DarkenedOverlay';} 172 sAttrText = sAttrText.replace(/\\/g,'<br>'); 173 var title = '<div class="slideTitle' + DarkenedClass + '">' + sAttrText + '</div>'; 174 // even if the subtitle text is empty, we keep the div for styling reasons. 175 // If there is a long caption, reduce font weight from bold to normal. 176 var FontStyle = ''; 177 if (sAttrText2.length > 100) {FontStyle = ' style="font-weight:400;" ';} 178 var subtitle = '<div class="slideText' + DarkenedClass + '"' + FontStyle + '>' + sAttrText2 + '</div>'; 179 180 var ButtonLink = ''; 181 var ButtonText = sAttrText3; 182 if (ButtonText === '') {ButtonText = SlideShowDefaultButtonText;} 183 if (ButtonText !== '' && ButtonText !== 'none'){ 184 var ButtonColor = sAttrText4; 185 if (TextExists(ThisImg.parent().attr('href'), false)) { // check for href text. NOTE: sAttrTextX values are reset. 186 187 // add button colour if we have some colour data. 188 // Check for a " character, as that will spoil our HTML. 189 if (ButtonColor !== '' && ButtonColor.indexOf('"') === -1) { 190 ButtonColor = ' style="background-color:' + ButtonColor + ' !important;border-color:' + ButtonColor + ' !important;" '; 191 } 192 193 // build the completed button link. 194 ButtonLink = '<a class="slideButton" href="' + sAttrText + '"' + ButtonColor + '>' + ButtonText + '</a>'; 195 } 196 } 197 198 var caption = '<div class="caption">' + title + subtitle + ButtonLink + '</div>'; 199 $(caption).insertAfter(this); 200 } 201 ThisImg.removeAttr('title'); // remove the title attribute so that pop-up text does not appear. 202 }); 203 } 204} 205 206// ################### Slice activation functions go here. ######################### 207 208// define a function, so we can activate a SlickNav menu in a controlled way. 209var SlickNavBtn, HeaderSlice; 210function ActivateMenu(SliceName) { 211 if (SectionTagExists(SliceName)) { // check if slice exists, and load into SectionTag if it does 212 213 HeaderSlice = SectionTag; 214 var SectionTagRef = GetSectionTagRef(SliceName); 215 var RootMenuDeskTop = SectionTag.children('div.nav-menu').children('ul.root_menu'); 216 217 RootMenuDeskTop.slicknav({ // activate SlickNav for this slice. 218 prependTo: SectionTagRef + '> div.SlickNav_Wrapper', 219 allowParentLinks: true, // Top level items can be links 220 label: 'MENU', 221 // Use hex escape characters here. 222 closedSymbol: '', // a logical OR "V" symbol 223 openedSymbol: '', // a nice up pointing ">" symbol 224 duplicate: bDesktopScreenPossible // only need to duplicate if the desktop menus are needed. 225 }); 226 227 var SlickNavLastItem = SectionTag.find('ul.slicknav_nav > li:last-child'); 228 229 //Add extra links onto the SlickNav menu manually, to replace top-link log-out buttons etc. 230 var ExtraLink_1, ExtraLink_2; 231 if (bUserLoggedIn) { 232 ExtraLink_1 = '<li class="ExtraLink"><a href="/User/Logout.aspx"><i class="icomoon-linear-login"></i>Logout</a></li>'; 233 ExtraLink_2 = '<li class="ExtraLink"><a href="/Admin/Default.aspx"><i class="icomoon-linear-register"></i>Web Office</a></li>'; 234 } else { 235 ExtraLink_1 = '<li class="ExtraLink"><a href="/user/login.aspx"><i class="icomoon-linear-login"></i>Login</a></li>'; 236 ExtraLink_2 = '<li class="ExtraLink"><a href="/User/Registration.aspx"><i class="icomoon-linear-register"></i>Register</a></li>'; 237 } 238 var ExtraLink_3 = '<li class="ExtraLink SearchOpen"><a><i class="icomoon-linear-search"></i>Search</a></li>'; 239 $(ExtraLink_1 + ExtraLink_2 + ExtraLink_3 ).insertAfter(SlickNavLastItem); 240 241 if (bOnTouchDevice && bDesktopScreenPossible) { // have to do more work on menus. 242 // Having made the SlickNav menu - delete what we don't want. 243 SectionTag.children("div.SlickNav_Wrapper").children("div.slicknav_menu").children('ul.slicknav_nav').find('li.SlickNavNotNeeded').remove(); 244 // deactivate the top level <a> tag in the desk-top version so touch-screens work correctly. 245 // The link goes nowhere, but retains all the styling. 246 RootMenuDeskTop.children("li.has_sub_menu").children('a').removeAttr("href"); 247 } 248 249 // Add a close menu icon into slickNav. 250 var SlickNavIcon = SectionTag.find('span.slicknav_icon'); 251 $('<div class="SlickNavCloseIcon"></div>').insertAfter(SlickNavIcon); 252 253 // apply all the visibility on-clicks to make the menu slice work. 254 255 // Find some commonly used items. 256 var SearchOverlay = SectionTag.find("div.search-overlay"); 257 SlickNavBtn = SectionTag.find("a.slicknav_btn"); 258 //var Logo = SectionTag.find("div.logo-container"); 259 260 ApplyToggleVisibilityOnClick(SectionTag, "li.ExtraLink.SearchOpen", SearchOverlay, 0, false);
261 ApplyToggleVisibilityOnClick(SectionTag, "div.top-link-wrapper a:last-child", SearchOverlay, 0, false); 262 ApplyHideOnClick(SectionTag, "a.search-close", SearchOverlay); 263 ApplyHideOnClick(undefined, SlickNavBtn, SearchOverlay); 264 // Toggles for menu-bars and menu-close icons 265 ApplyToggleVisibilityOnClick(undefined, SlickNavBtn, SlickNavIcon, 0, true); // no delay on the toggle. 266 ApplyToggleVisibilityOnClick(SectionTag, SlickNavBtn, "div.SlickNavCloseIcon", 0, false); // no delay on the toggle. 267 268 // Need autocomplete="off" to be added to the search box <input> tag. 269 // This stops horrible browser autocomplete text from appearing. 270 SectionTag.find('div.search_div input').attr("autocomplete","off"); 271 } 272} 273 274function ActivateFooter(SliceName) { 275 if (bSplitFooterAddressAtSecondComma) { 276 if (SectionTagExists(SliceName)) { // check if slice exists, and load into SectionTag if it does 277 // .footer-column-2 can be a div or a span, so just look for the class. 278 var FooterAddress = SectionTag.find('.footer-column-2'); 279 if (FooterAddress.children('*').length === 0) { // only proceed if there are no html tags within this element. 280 if (TextExists(FooterAddress.text(), false)) { 281 var AddressText = sAttrText; 282 if (AddressText.indexOf(',') !== -1) { 283 AddressText = AddressText.replace(/\,/, "¬"); // change first comma 284 if (AddressText.indexOf(',') !== -1) { 285 AddressText = AddressText.replace(/\,/, ",<br>"); // now break at the 2nd comma 286 AddressText = AddressText.replace(/¬/, ","); // put back first comma 287 FooterAddress.html(AddressText); // have to use html() here, as there is a <br> tag. 288 } 289 } 290 } 291 } 292 } 293 } 294} 295 296 function ActivateGallery8(SliceName) { 297 if (SectionTagExists(SliceName)) { // check if slice exists, and load into SectionTag if it does 298 SectionTag.find("div.gallery_8_cards img" ).each(function() { 299 var ThisImg = $(this); 300 if (TextExists(ThisImg.attr('alt'), true)) { // check if there is any alt text. 301 var cardGridTitle = '<div class="gallery_8_title">' + sAttrText + '</div>'; 302 var cardGridCaption = '<div class="gallery_8_caption">' + cardGridTitle + '</div>'; 303 $(cardGridCaption).insertAfter( this ); 304 ThisImg.removeAttr('title'); // remove the title attribute so that pop-up text does not appear. 305 } 306 }); 307 } 308 } 309 310// ########################## Check various conditions ############################# 311 312var bOnTouchDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0); 313var iDeskTopWidth = 992; 314var iMobileScreenAllowence = 64; // Because of other stuff on a screen, you have to assume the browser window could get bigger on a rotation. 315var bDesktopScreenPossible = ((screen.width + iMobileScreenAllowence) >= iDeskTopWidth || (screen.height + iMobileScreenAllowence) >= iDeskTopWidth); 316 317var BodyTag = $('body'); 318var bOnSystemPopupPage = BodyTag.hasClass('system_popup') || (window.location.href.toLowerCase().indexOf('popup=yes') !== -1); 319var bUserLoggedIn = BodyTag.hasClass('logged_in_user'); 320 321SectionTags = BodyTag.find('section'); // Store all the section tags to speed up later code. 322var bOnHomePage = SectionTags.hasClass('slice_SlidesFullWidth'); 323var bOnContentPage = SectionTags.hasClass('slice_content_page'); 324var bOnSystemPage = SectionTags.hasClass('slice_system_page'); 325 326// ####################################### 327// # Menu data changes 328// ####################################### 329 330// We make the required adjustments to the one set of menu HTML on the page, before cloning it and activating all the copies. 331 332var ulModuleRootMenu = BodyTag.find('ul.root_menu'); 333var bMenuPresent = (ulModuleRootMenu.length !== 0); 334if (bMenuPresent) { 335 336 /* remove sub menus from Home */ 337 // We check that the first link actually looks like a "Home" one. 338 // We assume that the home menu (if present) is the first item within a menu. 339 var HomeMenuLi = ulModuleRootMenu.children('li:first-child'); 340 if(HomeMenuLi.children('a').text().trim().toLowerCase() === 'home'){ 341 HomeMenuLi.children('ul').remove(); 342 HomeMenuLi.removeClass('has_sub_menu'); // remove class 343 } 344 345 // remove copies of 1st item elements in dropdown sub-menu. 346 ulModuleRootMenu.find('li.menu_item_level_2:first-child').each(function() { 347 348 var ThisLi = $(this); 349 if(ThisLi.children("a[href^='/MyArea/']").length === 0) { // only if not a link into /MyArea/... 350 351 if(ThisLi.siblings().length === 0) { // no other <li> so it is the only entry 352 var ul = ThisLi.parent(); 353 ul.parent().removeClass('has_sub_menu'); // remove class from the <li> at the level above 354 ul.remove(); // delete whole parent <ul> 355 356 } else { 357 if (bOnTouchDevice && bDesktopScreenPossible) { 358 // On a touch device, the copies of the level one links at the 2nd level have to be kept for the desktop menus. 359 // But in the SlickNav menus, these 2nd level links are not needed. 360 // So we mark the items so we can delete them later, after data is copied into the SlickNav menu. 361 ThisLi.addClass('SlickNavNotNeeded'); // Mark the 2nd level <li> tag. 362 } else { 363 // Not on a touch screen, so Desktop and SlickNav menus will be the structurally the same. 364 ThisLi.remove(); // so just remove this <li> tag 365 } 366 } 367 } 368 }); 369 370 if (bUserLoggedIn) { 371 // Do logged in links 372 var TLW = BodyTag.find('header div.top-link-wrapper'); 373 var Atag = TLW.find('a:first-child'); 374 Atag.attr('href','/user/logout.aspx'); 375 Atag.children('span').text('LOGOUT'); 376 Atag = TLW.find('a:nth-child(2)'); 377 Atag.attr('href','/admin'); 378 Atag.children('span').text('WEB OFFICE'); 379 } 380 381 // ####################################### 382 // # SlickNav menus V1.0.10 383 // ####################################### 384 385 ActivateMenu('slice_Header_D'); 386 387 ActivateFooter("slice_FooterTop_D"); 388 389} // end of if bNeedMenus 390 391// Here do things ONLY needed on a home page. 392if (bOnHomePage) { 393 394 var BxDefaultValues = { 395 mode: 'fade', 396 auto: true, 397 pause: 8000, 398 speed: 500, 399 pager: true, 400 controls: true, 401 preloadImages: 'all', 402 adaptiveHeight:true, 403 touchEnabled: false 404 }; 405 ActivateBxSlider('slice_SlidesFullWidth'); 406 407 ActivateGallery8('slice_Gallery8_L'); 408 409} else if (bOnContentPage) { 410 411 // code to try and make content images work on mobile phones. Set max-width css property is if has not already been set. 412 // If width and height attributes are both set, then the image is compressed horizontally, but that is still better than it overflowing. 413 var ContentImages = BodyTag.find('section.slice_content_page div.ArticleBody img'); 414 ContentImages.each(function() { 415 var Img = $(this); 416 if (Img.css('max-width') === 'none') { 417 Img.css('max-width','100%'); 418 } 419 }); 420 421} else if (bOnSystemPage || bOnSystemPopupPage) { 422 423 /* Possible page types are now: 424 '_calendar_month_aspx' 425 '_media_allmedia_aspx' 426 '_user_registration_aspx' 427 '_user_copyright_aspx' 428 '_user_termsandconditions_aspx' 429 '_user_privacypolicy_aspx' 430 '_user_help_aspx' 431 '_publisher_search_aspx' - this is search results. 432 '_paymentgroup_registration_aspx' 433 '_myarea_walletitem_aspx' 434 */ 435 436 var PageType = PageName; 437 if (SectionTagExists("slice_system_page")) { // check if slice exists, and load into SectionTag if it does 438 SystemSlice = SectionTag; 439 SystemSlice.addClass(PageType); // add class onto <section> tag, so CSS can locate it. 440 } else { 441 BodyTag.addClass(PageType); // add class onto <body> tag, so CSS can locate it. This will apply to various pop-up windows eg shop T&Cs. 442 BodyTag.addClass('system_popup'); // add this in case it is not on. 443 } 444 445 if (PageType === '_media_allmedia_aspx' || PageType === '_publisher_search_aspx') { 446 447 // Add a toggle for the media controls.
448 var MediaControls = SystemSlice.find('div#media_controls'); // these media controls are on the search page too. 449 if (MediaControls.length !== 0) { 450 $('<a class="system_toggle_advanced">Advanced Options</a>').insertBefore(MediaControls); 451 ApplyToggleVisibilityOnClick(SystemSlice, "a.system_toggle_advanced", MediaControls, 0, false); 452 } 453 454 HideDivsIfAllEmpty('media_summary_image'); // Hide some empty columns, if needed. 455 456 if (PageType === '_publisher_search_aspx') { // Extra things to do on the search page. 457 458 HideDivsIfAllEmpty('search_article_image'); // Hide some empty columns, if needed. 459 HideDivsIfAllEmpty('search_event_image'); // Hide some empty columns, if needed. 460 461 // If we have been sent to the search page explicitly then prepare the page for searching. 462 var SearchBox = SystemSlice.find('input[id$="_txtSearchStringTemplate"]'); 463 if (SearchBox.length === 1) { 464 if (SearchBox.val() === 'Activate_Search') { 465 SystemSlice.find('h2').hide(); // hide the search result titles 466 SearchBox.val(''); // Clear the search text box 467 SearchBox.attr('placeholder','Type your search text here'); 468 SearchBox.attr("autocomplete","off"); 469 MediaControls.show(); // make the search controls show. 470 } 471 } 472 473 // If no data is found then, print a message, rather than have a blank page. 474 if (SystemSlice.find('div.system_section').length === 0) { 475 var HTML = '<span>No data found.<br><br>Please use the advanced options to refine your search.</span>'; 476 $(HTML).appendTo(SystemSlice.find('div.system_body')); 477 MediaControls.show(); // make the search controls show. 478 } 479 } 480 } 481 482 // Fix calendar mobile page. Add a class to days we want to hide on the mobile/list view. 483 if (PageType === '_calendar_month_aspx') { 484 var DivToday = SystemSlice.find('div.calendar_day_wrapper_today'); 485 if (DivToday.length !== 0) { // we are on a calendar page with today's date. 486 var NoEvents = SystemSlice.find('div#calendar_no_events'); 487 if (NoEvents.length === 0) { // only bother if there are some events. 488 DivToday.prevAll().addClass('CalendarHideOnListView'); // so we can hide days earlier in the current week. 489 var DivThisWeek = DivToday.parent(); 490 DivThisWeek.prevAll().addClass('CalendarHideOnListView'); // so we can hide earlier weeks. 491 // If no events are visible, then tell the user. 492 var AllDaysInVisibleWeeks = SystemSlice.find('div.calendar_week:not(".CalendarHideOnListView") div.calendar_day_wrapper'); 493 var iDaysVisible = AllDaysInVisibleWeeks.not('.calendar_day_wrapper_empty').not('.CalendarHideOnListView').length; 494 if (iDaysVisible === 0) { 495 $('<div id="calendar_no_events">There are no events in the selected month.</div>').insertAfter(SystemSlice.find('div.calendar')); 496 } 497 } 498 } 499 } 500 501} // end of bOnHomePage or bOnSystemPage if-block 502 503// Corrections for various hardware/browsers 504var P = navigator.platform; 505var bSmallAppleDevice = (P === 'iPhone' || P === 'iPad' || P === 'iPod'); 506//var bAppleDevice = (P === 'MacIntel' || bSmallAppleDevice); 507 508// var UA = navigator.userAgent; 509// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent for details. 510// var bOnSafari = (UA.indexOf('Safari/') !== -1 && UA.indexOf('Chrome/') === -1 && UA.indexOf('Chromium/') === -1); 511 512//alert(P + ' # ' + UA); // DEBUGGING line. 513 514if (bSmallAppleDevice) { 515 // Parallex images are often a mess on small apple devices, so add a tag onto the <body> tag so we can take evasive action. 516 BodyTag.addClass('OnSmallAppleDevice'); 517} 518 519// Sort out login/logout/register/web-office links 520var SB = BodyTag.find('div.HiddenStatusBar'); 521if (SB.length === 1) { 522 if (bUserLoggedIn) { 523 var bWebOfficeActive = (SB.find('a.weboffice_link').length === 1); 524 if (!bWebOfficeActive) { // Need to hide WO links. 525 BodyTag.find('header a[href="/admin"]').hide(); 526 BodyTag.find('header a[href="/Admin/Default.aspx"]').hide(); 527 BodyTag.find('section.slice_FixedSideLinks a[href="/admin"]').hide(); 528 } 529 } else { 530 var SBRL = SB.find('a.register_link'); 531 if (SBRL.length === 0) { // Need to hide the register links. Need TWO versions for case changes. 532 BodyTag.find('header a[href="/User/Registration.aspx"]').hide(); 533 BodyTag.find('header a[href="/user/registration.aspx"]').hide(); 534 BodyTag.find('section.slice_FixedSideLinks a[href="/User/Registration.aspx"]').hide(); 535 BodyTag.find('section.slice_FixedSideLinks a[href="/user/registration.aspx"]').hide(); 536 } else { 537 var RegLink = SBRL.attr('href'); 538 if (RegLink !== "/User/Registration.aspx") { 539 BodyTag.find('header a[href="/User/Registration.aspx"]').attr('href',RegLink); 540 BodyTag.find('header a[href="/user/registration.aspx"]').attr('href',RegLink); 541 BodyTag.find('section.slice_FixedSideLinks a[href="/User/Registration.aspx"]').attr('href',RegLink); 542 BodyTag.find('section.slice_FixedSideLinks a[href="/user/registration.aspx"]').attr('href',RegLink); 543 } 544 } 545 } 546} 547 548// If the screen is resized, then we have to click shut the SlickNav Menu, if it is open. 549var iLastWidth = 0; 550function ShutSlickNav() { 551 var iWidth = window.innerWidth; 552 if (iWidth !== iLastWidth) { // don't run code if it looks like we just have the browser top menu appearing and disappearing. 553 iLastWidth = iWidth; 554 if (bDesktopScreenPossible) { 555 if (SlickNavBtn.hasClass('slicknav_open')){ 556 SlickNavBtn.click(); 557 } 558 } 559 } 560} 561 562window.addEventListener("resize", function(){ShutSlickNav();}, false); 563 564}); 565 566 567 568// Code for alternate T&Cs articles 569$(document).ready(function () 570{ 'use strict'; 571 572 // Debs - set article id number below to be the new T&Cs article for that site 573 var NewTCs = '/Articles/677360/Terms_and_Conditions.aspx'; 574 575 $('footer a#footer_tc').attr('href',NewTCs); 576});
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.