1/* Blackbaud ISD Custom Javascript 2==================================================================== 3Client: East Stroudsburg University 4Author(s): Mark Hillard 5Product(s): BBNC 6Created: 05/20/2018 7Updated: 07/20/2018 8 9 10CHANGELOG 11==================================================================== 1205/08/2018: Added functionality for card tables (callouts on home page) 1305/08/2018: Added slideshow functionality for infographics 1405/09/2018: Added mini donation form functionality 1505/09/2018: Added social sharing functionality 1605/20/2018: Added masthead background image management 1705/20/2018: Added mobile navigation and quick search functionality 1806/06/2018: Added payment part helper 1906/19/2018: Removed required field shifting on common form elements 2007/19/2018: Added layout fix for news callouts on tablet screen sizes 2107/20/2018: Added functionality for content callouts (callouts on internal pages) 2202/27/2019: Edited search page location to be the esualumni.org website instead of esu.edu 23 24 25INSTRUCTIONS 26==================================================================== 271. Include this file at the layout level on the very last line. 282. Namespaced functions should be placed in pageInit(), pageRefresh() or pageLoad(), respectively. 293. Every custom function should have its code wrapped in a conditional, checking for the existence (.length !== 0) of the specific part being altered. 30*/ 31 32 33var BBI = BBI || { 34 // update these values when updating changelog 35 Config: { 36 version: 1.7, 37 updated: '07/20/2018', 38 isEditView: !!window.location.href.match('pagedesign'), 39 responsive: true 40 }, 41 42 Defaults: { 43 rootpath: BLACKBAUD.api.pageInformation.rootPath, 44 pageId: BLACKBAUD.api.pageInformation.pageId 45 }, 46 47 Methods: { 48 pageInit: function () { 49 // all functions that run instantly 50 BBI.Methods.addHelperClasses(); 51 52 // runs on partial page refresh 53 Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function () { 54 BBI.Methods.pageRefresh(); 55 }); 56 57 // runs on full page load 58 $(document).ready(function () { 59 BBI.Methods.pageLoad(); 60 }); 61 62 // runs after all page assets are loaded 63 $(window).on('load', function () { 64 BBI.Methods.windowLoad(); 65 }); 66 }, 67 68 // runs on partial page refresh 69 pageRefresh: function () { 70 BBI.Methods.addHelperClasses(); 71 BBI.Methods.responsiveEventRegistrationClassic(); 72 BBI.Methods.hideValidationSummary(); 73 BBI.Methods.hideDateRanges(); 74 BBI.Methods.miniDonationForm(); 75 }, 76 77 // runs on full page load 78 pageLoad: function () { 79 BBI.Methods.hideValidationSummary(); 80 BBI.Methods.mobileNav(); 81 BBI.Methods.quickSearch(); 82 83 // if not in edit view 84 if (!BBI.Config.isEditView) { 85 if ($('table.cardTable').length !== 0) { 86 BBI.Methods.cardTables(); 87 } 88 if ($('table.calloutTable').length !== 0) { 89 BBI.Methods.contentCallouts(); 90 } 91 if ($('#infographics').length !== 0) { 92 BBI.Methods.slickSlides(); 93 } 94 if ($('.miniDonationForm').length !== 0) { 95 BBI.Methods.miniDonationFormFooter(); 96 } 97 if ($('.DonationFormTable').length !== 0) { 98 BBI.Methods.postURL(); 99 } 100 if ($('.socialSharing').length !== 0) { 101 BBI.Methods.socialSharing(); 102 } 103 if (!$('.backgroundImage').is(':empty')) { 104 BBI.Methods.bannerImageBackground(); 105 } 106 } 107 }, 108 109 // runs after all page assets are loaded 110 windowLoad: function () { 111 if ($('.news-callout').length !== 0 && $(window).width() > 479 && $(window).width() <= 800) {
112 BBI.Methods.newsCalloutHeight(); 113 } 114 }, 115 116 addHelperClasses: function () { 117 BBI.Methods.addClassToRequiredInputs(); 118 BBI.Methods.addClassToTextareaLabel(); 119 BBI.Methods.addClassToPaymentPart(); 120 if (BBI.Config.responsive && !BBI.Config.isEditView) { 121 BBI.Methods.addResponsiveClasses(); 122 } 123 }, 124 125 // responsive functions 126 addResponsiveClasses: function () { 127 BBI.Methods.responsiveDonationForm(); 128 BBI.Methods.responsiveEventRegistrationNew(); 129 BBI.Methods.responsivePaymentPart(); 130 BBI.Methods.responsiveSurvey(); 131 BBI.Methods.responsiveUserEmailPreferences(); 132 BBI.Methods.responsiveUserLogin(); 133 134 // check screen width on load/resize event 135 $(window).on('load resize', function () { 136 if ($(window).width() <= 800) { 137 BBI.Methods.responsiveEventCalendar(); 138 } 139 }); 140 }, 141 142 // gets variables and values from URL 143 getUrlVars: function () { 144 var vars = {}; 145 window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) { 146 vars[key] = decodeURIComponent(value.replace(/\+/g, ' ')); 147 }); 148 return vars; 149 }, 150 151 // returns a single value from the URL (pass in name of value) 152 returnQueryValueByName: function (name) { 153 return BLACKBAUD.api.querystring.getQueryStringValue(name); 154 }, 155 156 // fix positioning of part context menu 157 fixPositioning: function () { 158 $('div[id*="_panelPopup"]').appendTo('body'); 159 $('div[id*="_designPaneCloak"]').css({ 160 'top': '0', 161 'left': '0' 162 }); 163 $('.DesignPane').css('position', 'relative'); 164 }, 165 166 // create cookie - pass in name, value and expiration date of cookie 167 // note: setting "days" argument to "0" creates a session cookie 168 createCookie: function (name, value, days) { 169 var expires = ''; 170 if (days) { 171 var date = new Date(); 172 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 173 expires = '; expires=' + date.toUTCString(); 174 } 175 document.cookie = name + '=' + value + expires + '; path=/'; 176 }, 177 178 // read cookie - pass in name of cookie 179 readCookie: function (name) { 180 var nameEQ = name + '='; 181 var ca = document.cookie.split(';'); 182 for (var i = 0; i < ca.length; i++) { 183 var c = ca[i]; 184 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 185 if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length); 186 } 187 return null; 188 }, 189 190 // delete cookie - pass in name of cookie 191 deleteCookie: function (name) { 192 BBI.Methods.createCookie(name, '', -1); 193 }, 194 195 // hide empty validation summary 196 hideValidationSummary: function () { 197 var emptyValidSum = $('.BBFormValidatorSummary:empty'); 198 if (emptyValidSum) { 199 $(emptyValidSum).hide(); 200 } 201 }, 202 203 // mobile navigation 204 mobileNav: function () { 205 // scoped variables 206 var open = $('.nav-button a'), 207 menu = $('#mobile-nav > ul'), 208 bg = $('html, body'); 209 210 // append chevron to every list item that has children 211 menu.find('.parent').append('<a class="open-sub"><span class="down"></span></a>'); 212 213 // fix non-scrolling overflow issue on mobile devices 214 menu.wrap('<div class="overflow"></div>'); 215 $(window).on('load resize', function () { 216 var vph = $(window).height() - 44; // 44px - height of #masthead 217 $('.overflow').css('max-height', vph); 218 }); 219 220 // toggle background scrolling 221 function bgScrolling() { 222 // if menu has toggled class... * 223 if (menu.hasClass('open')) { 224 // * disable background scrolling 225 bg.css({ 226 'overflow-y': 'hidden', 227 'height': 'auto' 228 }); 229 // if menu does not have toggled class... * 230 } else { 231 // * enable background scrolling 232 bg.css({ 233 'overflow-y': 'visible', 234 'height': '100%' 235 }); 236 } 237 } 238 239 // open menu click event 240 open.on('click', function (e) { 241 // prevent default action 242 e.preventDefault(); 243 244 // activate toggles 245 menu.slideToggle(250); 246 menu.toggleClass('open'); 247 248 // toggle menu icon 249 $(this).toggleClass('active'); 250 251 // activate background scrolling 252 bgScrolling(); 253 }); 254 255 // list item click event 256 $('.open-sub').on('click', function (e) { 257 e.preventDefault(); 258 $(this).prev('ul').slideToggle(250); 259 $(this).find('span').toggleClass('up down'); 260 }); 261 }, 262 263 // quick search 264 quickSearch: function () { 265 // scoped variables 266 var input = $('#search > input'), 267 search = $('#search > a'); 268 269 // keypress event (enter key) 270 input.on('keypress', function (e) { 271 if ($(this).val() !== '' && $(this).is(':focus') && e.
271which === 13) { 272 e.preventDefault(); 273 search.click(); 274 } 275 }); 276 277 // click event (perform search) 278 search.on('click', function (e) { 279 e.preventDefault(); 280 if (input.val() !== '') { 281 var param = input.val(), 282 url = 'https://www.esualumni.org/page.aspx?pid=398&txtSearch='; // only update this var 283 window.location = url + param; 284 } 285 }); 286 }, 287 288 cardTables: function () { 289 // convert tables to divs 290 $('table.cardTable').each(function () { 291 $(this).replaceWith($(this).html() 292 .replace(/<tbody/gi, '<div class="card"') 293 .replace(/<tr/gi, '<div class="gutter clearfix"') 294 .replace(/<td/gi, '<div') 295 .replace(/<\/tr>/gi, '</div>') 296 .replace(/<\/td>/gi, '</div>') 297 .replace(/<\/tbody/gi, '<\/div') 298 ); 299 }); 300 301 // loop through each card 302 $('#cards .card').each(function () { 303 var cardCaptionHeight = $(this).find('.cardCaption').innerHeight(); 304 $(this).find('.cardCaption').css('bottom', '-' + cardCaptionHeight + 'px'); 305 }); 306 }, 307 308 contentCallouts: function () { 309 $('table.calloutTable').each(function () { 310 $(this).replaceWith($(this).html() 311 .replace(/<tbody/gi, '<div class="contentCallout"') 312 .replace(/<tr/gi, '<div class="gutter clearfix"') 313 .replace(/<td/gi, '<div') 314 .replace(/<\/tr>/gi, '</div>') 315 .replace(/<\/td>/gi, '</div>') 316 .replace(/<\/tbody/gi, '<\/div') 317 ); 318 }); 319 $('.contentCallout').siblings('p').remove(); 320 $('.contentCallout').each(function () { 321 if ($('.image', this).length > 0) { 322 $(this).addClass('photoBlock'); 323 var backgroundImageSRC = $(this).find('.image p img').attr('src'); 324 $(this).css('background-image', 'url(' + backgroundImageSRC + ')'); 325 $(this).find('.image').remove(); 326 } else { 327 $(this).addClass('contentBlock'); 328 } 329 }); 330 }, 331 332 slickSlides: function () { 333 $('#infographics .slideshow').slick({ 334 dots: false, 335 nextArrow: '<span class="fa fa-chevron-right"></span>', 336 prevArrow: '<span class="fa fa-chevron-left"></span>', 337 infinite: true, 338 draggable: false, 339 speed: 300, 340 slidesToShow: 3, 341 slidesToScroll: 3, 342 responsive: [ 343 { 344 breakpoint: 1350, 345 settings: { 346 slidesToShow: 2, 347 slidesToScroll: 2 348 } 349 }, 350 { 351 breakpoint: 680, 352 settings: { 353 slidesToShow: 1, 354 slidesToScroll: 1 355 } 356 } 357 ] 358 }); 359 }, 360 361 miniDonationFormFooter: function () { 362 var donationFormPath = $('.miniDonationForm .submitButton a').attr('href'); 363 $('.miniDonationForm li').not('.submitButton').on('click', function () { 364 var clickedAmount = $(this).find('a').text(), 365 clickedAmountSplit = clickedAmount.replace('$', ''); 366 $(this).not('.submitButton').addClass('active'); 367 $('.miniDonationForm li').not(this).removeClass('active'); 368 $('.submitButton a').attr("href", donationFormPath + '?referrer=DonationForm' + '&amount=' + clickedAmountSplit); 369 }); 370 }, 371 372 postURL: function () { 373 var giftPre = decodeURI(BBI.Methods.returnQueryValueByName('amount')), 374 referrerPre = decodeURI(BBI.Methods.returnQueryValueByName('referrer')), 375 gift = giftPre.replace(/[^\d\.]/g, ''), 376 referrer = referrerPre.split('+').join(' '); 377 if (referrer) { 378 if (gift) { 379 if ($('input[id*="rdoOther"]').length !== 0) { 380 $('input[id*="rdoOther"]').trigger('click'); 381 } 382 $('input[id*="txtAmount"]').val(gift).attr('value', gift); 383 } 384 } 385 }, 386 387 // social sharing buttons (links and popups) 388 socialSharing: function () { 389 var shareLink = 'http://www.facebook.com/sharer.php?u=' + location.href; 390 var tweetLink = 'http://twitter.com/share?url=' + location.href; 391 392 // facebook 393 $('.socialSharing .share a').each(function () { 394 $(this).attr('href', shareLink); 395 $(this).click(function () { 396 window.open($(this).attr('href'), 'title', 'width=600,height=400'); 397 return false; 398 }); 399 }); 400 401 // twitter 402 $('.socialSharing .tweet a').each(function () { 403 $(this).attr('href', tweetLink); 404 $(this).click(function () { 405 window.open($(this).attr('href'), 'title', 'width=600,height=400'); 406 return false; 407 }); 408 }); 409 }, 410
411 bannerImageBackground: function () { 412 var bgSource = $('.backgroundImage > p > img').attr('src'); 413 $('#masthead').addClass('bg').css('background-image','url(' + bgSource + ')'); 414 }, 415 416 newsCalloutHeight: function () { 417 var heights = $('#news .news-text').map(function () { 418 return $(this).height(); 419 }).get(); 420 var maxHeight = Math.max.apply(null, heights); 421 $('#news .news-text').height(maxHeight); 422 }, 423 424 // adds "required" class to inputs that are required fields 425 addClassToRequiredInputs: function () { 426 // check if we're on a page with a form first 427 if (($('.BBFormTable').length !== 0) || ($('.PaymentPart_FormContainer').length !== 0) || ($('div[id$="ev2wiz"]').length !== 0) || ($('div[id$="formWizard"]').length !== 0)) { 428 // select all required table cell elements, go to their parent(s), find the label/span, and add class 429 var requiredFieldMarkers = $('.BBFormTable .BBFormRequiredFieldMarker, .PaymentPart_FormContainer .BBFormRequiredFieldMarker, .Ev2_RegistrationStepContainer .BBFormRequiredFieldMarker, div[id$="formWizard"] .BBFormRequiredFieldMarker'); 430 $.each(requiredFieldMarkers, function () { 431 if ($(this).css('visibility') !== 'hidden') { 432 $(this).addClass('hiddenRequiredField'); 433 $(this).closest('tr').find('label, span').not('[class*="Checkbox"], [id*="lblSymbol"], [for*="_chkAcknowledge"]').addClass('required'); 434 } 435 }); 436 437 // explict elements 438 $('label[id$="_lblAmountCaption"]').addClass('required'); // amount field (donation form) 439 $('.Ev2_RegistrantFieldCell .BBFormRequiredFieldMarker').each(function () { 440 $(this).parent().find('label').addClass('required'); // each registrant field (event registration 2.0) 441 }); 442 $('.PaymentPart_PersonalInfoContainer .BBFormRequiredFieldMarker').each(function () { 443 $(this).siblings('label, span').addClass('required'); // each registrant field (payment 2.0) 444 }); 445 $('div[id$="formWizard"] .BBFormRequiredFieldMarker').each(function () { 446 if (!$(this)[0].hasAttribute('style')) { 447 $(this).parent().find('label').addClass('required'); // each info field (common form) 448 } 449 }); 450 451 // fix required markers for tribute fields (donation form) 452 var ddTribute = $('select[id$="ddlTribute"]'); 453 var labelTribute = $('label[id$="lblTributeLastName"], label[id$="lblName"], label[id$="lblDescription"]'); 454 if (ddTribute.length !== 0) { 455 $(ddTribute).on('change', function () { 456 if ($(this).val() === '0') { 457 $(labelTribute).removeClass('required'); 458 } else { 459 $(labelTribute).addClass('required'); 460 } 461 }); 462 } 463 } 464 }, 465 466 // add class to label for textarea inputs on div-based forms 467 addClassToTextareaLabel: function () { 468 if ($('.BBDivFieldContainer textarea').prev('label').not('.labelForTextarea').length !== 0) { 469 $('.BBDivFieldContainer textarea').prev('label').addClass('labelForTextarea'); 470 } 471 }, 472 473 // add classes to specific elements on payment part 474 addClassToPaymentPart: function () { 475 if ($('.PaymentPartGrid').length !== 0) { 476 $('.PaymentPartGrid').parent().parent().closest('table').addClass('paymentPart'); 477 $('.PaymentPartClearLink').addClass('button'); 478 } 479 }, 480 481 // bind handler to change event of checkboxes to call separate function to apply/remove classes to/from label when clicked 482 responsiveCheckboxesChangeEvent: function () { 483 $('input[type="checkbox"]').change(BBI.Methods.responsiveCheckboxesAddClass).next('label').addClass('checkboxLabel'); 484 }, 485 486 // dynamic classes added/removed from checkbox labels for mobile treatment 487 responsiveCheckboxesAddClass: function () { 488 $('input[type="checkbox"]').each(function () { 489 if ($(this).attr('checked') === 'checked') { 490 $(this).next('label').addClass('boxChecked'); 491 } else { 492 $(this).next('label').removeClass('boxChecked'); 493 } 494 }); 495 }, 496 497 // bind handler to change event of giving amount radio buttons to call separate function to apply/remove classes to/from labels when clicked/tapped 498 responsiveGivingAmountsChangeEvent: function () { 499 $('table[id$="tblAmount"] input[name$="givingLevels"]').change(BBI.Methods.responsiveGivingAmountsAddClass); 500 }, 501 502 // give class to the giving amount for the radio button that's currently selected 503 responsiveGivingAmountsAddClass: function () { 504 $('table[id$="tblAmount"] input[name$="givingLevels"]').each(function () { 505 if ($(this).is(':checked')) { 506 if ($(this).val() === 'rdoOther') { 507 $(this).siblings('label').eq(0).addClass('boxChecked'); 508 } else { 509 $(this).closest('td').next('td').children('.radioLabel').addClass('boxChecked'); 510 } 511 } else { 512 if ($(this).val() === 'rdoOther') { 513 $(this).siblings('label').eq(0).removeClass('boxChecked'); 514 } else { 515 $(this).closest('td').next('td').children('.radioLabel').removeClass('boxChecked'); 516 } 517 } 518 }); 519 }, 520 521 // bind handler to change event of radio buttons (except giving amounts) to call separate function to apply/remove classes to/from labels when clicked/tapped 522 responsiveRadioButtonChangeEvent: function () { 523 if ($('input[type="radio"]').length) { 524 $('input[type="radio"]').filter(function () { 525 return -1 === this.name.indexOf('givingLevels'); 526 }).change(BBI.Methods.responsiveRadioButtonAddClass).next('label').addClass('radioLabel'); 527 } 528 }, 529 530 // add class to radio button label if its button has been clicked 531 responsiveRadioButtonAddClass: function () { 532 $('input[type="radio"]').filter(function () { 533 return -1 === this.name.indexOf('givingLevels'); 534 }).each(function () { 535 if ($(this).is(':checked')) { 536 $(this).next('label').addClass('boxChecked'); 537 } else { 538 $(this).next('label').removeClass('boxChecked'); 539 } 540 }); 541 }, 542 543 // Donation Form classes and responsive behavior 544 responsiveDonationForm: function () { 545 if ($('.DonationFormTable').length) { 546 // classes that help with targeted styling
547 $('label[id$="lblTxtOnMonthlyQuarterly"]').parent().addClass('labelRecurrenceStartingOn'); 548 $('input[id$="Recurrence_rdoDay"]').parent().parent().addClass('radioRecurrenceDay'); 549 $('select[id$="Recurrence_ddlDayNumber2"]').parent().addClass('inputDayOfMonth'); 550 $('tr[id$="tr_AdvancedRecurringOptions"] > td:nth-child(1)').addClass('emptyTDBelowOnLabel'); 551 $('tr[id$="tr_AdvancedRecurringOptions"] > td:nth-child(2)').addClass('radioRecurrenceDayFrequency'); 552 $('tr[id$="tr_AdvancedRecurringOptions"] > td:nth-child(3)').addClass('inputRecurrenceDayFrequency'); 553 $('tr[id$="Recurrence_trAnnually"] > td').eq(0).addClass('annualRecurrenceTD'); 554 // swap text in weekly and monthly drop-downs 555 $('select[id$="Recurrence_ddlPosition"]').each(function () { 556 $(this).children('option').eq(0).html('1st'); 557 $(this).children('option').eq(1).html('2nd'); 558 $(this).children('option').eq(2).html('3rd'); 559 $(this).children('option').eq(3).html('4th'); 560 }); 561 $('select[id$="Recurrence_ddlDayOfWeek2"]').each(function () { 562 $(this).children('option').eq(0).html('Sun'); 563 $(this).children('option').eq(1).html('Mon'); 564 $(this).children('option').eq(2).html('Tue'); 565 $(this).children('option').eq(3).html('Wed'); 566 $(this).children('option').eq(4).html('Thu'); 567 $(this).children('option').eq(5).html('Fri'); 568 $(this).children('option').eq(6).html('Sat'); 569 }); 570 $('label[for$="Recurrence_ddlDayNumber2"], label[for$="Recurrence_ddlDayOfWeek2"]').each(function () { 571 if ($(this).html().indexOf('of every month') >= 0) { 572 $(this).html('monthly'); 573 } else if ($(this).html().indexOf('of every three months') >= 0) { 574 $(this).html('every 3rd mo.'); 575 } 576 }); 577 // shorter text for corporate and anonymous donations 578 $('input[id$="chkCorporate"] + label').html('Give on behalf of a company'); 579 $('input[id$="chkAnonymous"] + label').html('Give anonymously'); 580 // give giving amount span a class and make it clickable to set giving amount 581 if ($('input[name$="givingLevels"]').length) { 582 $('input[name$="givingLevels"]').each(function () { 583 $(this).closest('td').addClass('givingAmountInputTD').next('td').children('span').eq(0).addClass('givingAmount radioLabel').click(function () { 584 // remove "checked" class from other amount text input table row wrapper 585 $(this).parent().parent().siblings('tr[id$="trOther"]').children('td').removeClass('checked'); 586 // fire click event of the hidden input when the label is clicked 587 $(this).parent().prev('td').find('label').eq(0).click(); 588 if ($('input[id$="txtAmount"]').length) { 589 $('input[id$="txtAmount"]').val(''); 590 } 591 }); 592 }); 593 // give the "Other Amount" label the same classes so that it's styled the same way on mobile devices 594 $('input[name$="givingLevels"][id$="rdoOther"]').next('label').addClass('givingAmount radioLabel'); 595 } 596 // add class to table row wrapper around the "Other Amount" box when the "Other" input's label is clicked 597 if ($('input[id$="txtAmount"]').length) { 598 $('input[id$="rdoOther"]').click(function () { 599 $(this).parent().parent().next('td').addClass('checked'); 600 }); 601 } 602 // nice treatment for checkboxes and radio buttons on mobile devices
603 BBI.Methods.responsiveCheckboxesAddClass(); 604 BBI.Methods.responsiveCheckboxesChangeEvent(); 605 BBI.Methods.responsiveGivingAmountsAddClass(); 606 BBI.Methods.responsiveGivingAmountsChangeEvent(); 607 BBI.Methods.responsiveRadioButtonAddClass(); 608 BBI.Methods.responsiveRadioButtonChangeEvent(); 609 // add "clearfix" class to span that contains company matching gift link 610 if ($('input[id$="chkMGCompany"]').length) { 611 $('input[id$="chkMGCompany"]').parent().addClass('clearfix'); 612 } 613 } 614 }, 615 616 // Event Registration Form (Classic) classes and responsive behavior 617 responsiveEventRegistrationClassic: function () { 618 if ($('.EventTable .EventProgressCell').length) { 619 // treatment of the step navigation 620 $('.EventTable table[id$="tblProgress"] th').each(function (index) { 621 var stepText = $(this).html(); 622 var stepTextSplit = stepText.split('>'); 623 $(this).html('<span class="stepIndex">' + (index + 1) + '</span><span class="stepText">' + stepTextSplit[1] + '</span>'); 624 }); 625 $('.EventTable table[id$="tblProgress"] th').last().addClass('last'); 626 // add class for attribute checklists 627 $('div.LoginFormCheckListContainer').parent().prev('td').addClass('checklistLabelContainer'); 628 $('td.EventItemRegistrantControlCellName').parent().parent().parent().addClass('eventAttributeContainer'); 629 // add class for previous/next button container table 630 $('.EventTable input[id*="StepNavigationTemplateContainerID"]').eq(0).closest('table').addClass('prevNextContainerTable'); 631 $('.EventTable input[id*="StartNavigationTemplateContainerID"]').eq(0).parent().addClass('nextContainerTR'); 632 // nice treatment for checkboxes on mobile devices 633 BBI.Methods.responsiveCheckboxesAddClass(); 634 BBI.Methods.responsiveCheckboxesChangeEvent(); 635 } 636 }, 637 638 // Event Registration Form (2.0) classes and responsive behavior 639 responsiveEventRegistrationNew: function () { 640 if ($('.BBEventRegSequenceMap').length) { 641 // add "clearfix" class where needed 642 $('div.Ev2_PriceTypesHeader, div.Ev2_PriceTypesRow, div.Ev2_SummaryTotal, div.Ev2_RegistrantFieldCell').addClass('clearfix'); 643 // handle showing/hiding of the price validation text 644 $('input[id*="txtQty"]').blur(function () { 645 var $targetSpan = $(this).parent().nextAll('.Ev2_PriceTypeValidatorColumn').children('span.Ev2_Step1QtyValidation'); 646 setTimeout(function () { 647 if ($targetSpan.css('visibility') == 'visible') { 648 $targetSpan.parent().addClass('validationActive'); 649 } else { 650 $targetSpan.parent().removeClass('validationActive'); 651 } 652 }, 500); 653 }); 654 // step 2 - event info associating with event title 655 var i = 0; 656 $('.Ev2_RegistrantsContainer').each(function () { 657 $(this).addClass('ev_' + i); 658 i++; 659 }); 660 $('span[id*="rptPerEventInfo_lblEvTime"]').each(function () { 661 var dvid = $(this).attr('id').split('_'); 662 $(this).parent().prependTo('.ev_' + dvid[6]); 663 }); 664 $('span[id*="rptPerEventInfo_lblEvDate"]').each(function () { 665 var dvid = $(this).attr('id').split('_'); 666 $(this).parent().prependTo('.ev_' + dvid[6]); 667 }); 668 $('div[id*="rptPerEventInfo_litDesc"]').each(function () { 669 var dvid = $(this).attr('id').split('_'); 670 $(this).parent().prependTo('.ev_' + dvid[6]); 671 }); 672 $('span[id*="rptPerEventInfo_lblEvName"]').each(function () { 673 var dvid = $(this).attr('id').split('_'); 674 $(this).parent().prependTo('.ev_' + dvid[6]); 675 }); 676 } 677 }, 678 679 // Payment Part 2.0 responsive behavior 680 responsivePaymentPart: function () { 681 if ($('.PaymentPart_FormContainer').length !== 0) { 682 // nice treatment for checkboxes on mobile devices
683 BBI.Methods.responsiveCheckboxesAddClass(); 684 BBI.Methods.responsiveCheckboxesChangeEvent(); 685 } 686 }, 687 688 // Survey Part classes and responsive behavior 689 responsiveSurvey: function () { 690 if ($('.SurveyQuestionTable').length !== 0) { 691 $('.SurveyQuestionTable td span.BBFormRequiredFieldMarker').parent().next('td').children('span').eq(0).addClass('required'); 692 } 693 }, 694 695 // User Email Preferences classes and responsive behavior 696 responsiveUserEmailPreferences: function () { 697 if ($('.SubscriptionFormTable').length) { 698 // nice treatment for checkboxes on mobile devices 699 BBI.Methods.responsiveCheckboxesAddClass(); 700 BBI.Methods.responsiveCheckboxesChangeEvent(); 701 } 702 }, 703 704 // User Login Part classes and responsive behavior 705 responsiveUserLogin: function () { 706 if ($('.LoginFormTable').length) { 707 // add classes to style table cells with no classes 708 $('.LoginFormTable .BBFieldControlCell').each(function () { 709 $(this).prev('td').addClass('BBFieldCaption'); 710 }); 711 // add class - "rememberLoginContainer" 712 $('label[for$="cbRememberLogin"]').parent().addClass('rememberLoginContainer'); 713 // add class to table that holds validation container 714 $('.LoginFormValidatorSummary').closest('table').addClass('userLoginValidationContainer'); 715 } 716 if ($('tr[id$="trSignInBody"]').length) { 717 // add class to outer part container 718 $('tr[id$="trSignInBody"]').closest('table').addClass('userLoginPart'); 719 // nice treatment for checkboxes on mobile devices 720 BBI.Methods.responsiveCheckboxesAddClass(); 721 BBI.Methods.responsiveCheckboxesChangeEvent(); 722 } 723 }, 724 725 // force Event Calendar to show in list view on mobile devices 726 responsiveEventCalendar: function () { 727 if (($('.EventCalendarPartContainer').length) && ($('.CalendarViewCalendarContainer').length)) { 728 $('input[id$="ImageButtonViewList"]').click(); 729 } else if ($('.EventCalendarPartContainer').length) { 730 $('a.ListViewEventTitle').each(function () { 731 if (!$(this).parent().find('.BBFormSubmitButton').length) { 732 var href = $(this).attr('href'); 733 $(this).parent().append('<a class="BBFormSubmitButton" href="' + href + '">View Details</a>'); 734 } 735 }); 736 } 737 }, 738 739 // remove date range options in Event Calendar list view 740 hideDateRanges: function () { 741 if (($('.EventCalendarPartContainer').length) && ($('.ListViewContainer').length)) { 742 $('select[id$="ddlDateRange"]').find('option:nth-child(2), option:nth-child(3)').hide(); 743 } 744 }, 745 746 // Mini Donation Form style reset 747 miniDonationForm: function () { 748 $('#PageHead link[href*="skyless"]').remove(); 749 $('#PageHead link[href*="DonationCheckoutDisplay"]').remove(); 750 $('#PageHead style[data-href*="skyless"]').remove(); 751 $('#PageHead style[data-href*="DonationCheckoutDisplay"]').remove(); 752 } 753 } 754}; 755 756// run global scripts 757BBI.Methods.pageInit(); 758 759 760/* PLUGINS 761==================================================================== */ 762 763// make it safe to use console.log always 764(function(a){function b(){}for(var c='assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn'.split(','),d;!!(d=c.pop());){a[d]=a[d]||b;}}) 765(function(){try{console.log();return window.console;}catch(a){return (window.console={});}}());
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.