/* FILE ARCHIVED ON 20:32:04 May 6, 2019 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 20:08:06 Oct 5, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /********************************************** Blackbaud Design Custom JavaScript *********************************************** Client: UNT Author(s): Chris Martin Product(s): BBNC Created: YYYY-MM-DD *********************************************** CHANGE LOG *********************************************** **********************************************/ BBI = { UNT: { bbnc: { // generic functions and params that typically don't need editing generic: { // namespace for debug functions and values debug: { isEditView: !!window.location.href.match('pagedesign') // boolean that tells whether we're in page edit mode }, // all functions inside this wrapper function will fire on each full page load pageLoad: function(){ BBI.UNT.bbnc.generic.checkWindowInitialSize(); $(window).resize(BBI.UNT.bbnc.specific.windowResizeFunctions); $(window).scroll(BBI.UNT.bbnc.specific.scrollFunctions); }, // all functions inside this wrapper function will fire on each full AND partial page load paneRefresh: function(){ BBI.UNT.bbnc.generic.checkWindowInitialSize(); BBI.UNT.bbnc.generic.checkEditView(); BBI.UNT.bbnc.generic.addClassToEmptyTableCells(); BBI.UNT.bbnc.generic.responsiveDonationForm(); BBI.UNT.bbnc.generic.addClassToRequiredInputs(); BBI.UNT.bbnc.generic.responsiveUserLogin(); BBI.UNT.bbnc.generic.responsiveUserEmailPreferences(); BBI.UNT.bbnc.generic.responsiveEventRegistrationNew(); BBI.UNT.bbnc.generic.responsiveEventRegistrationClassic(); BBI.UNT.bbnc.generic.responsivePaymentPart(); BBI.UNT.bbnc.generic.addClassToTextareaLabel(); BBI.UNT.bbnc.generic.responsiveSurvey(); }, // Re-checks isEditView against template design view: checkEditView: function() { if (!BBI.UNT.bbnc.generic.debug.isEditView) { BBI.UNT.bbnc.generic.debug.isEditView = window.location.href.match('templatedesigner'); } }, // code that runs only the first time window size is calculated after a page load checkWindowInitialSize: function() { // calculate scroll bar width if any browser other than Safari... if (!((navigator.userAgent.indexOf('Safari') != -1) && (navigator.userAgent.indexOf('Chrome') == -1))) { BBI.UNT.bbnc.specific.params.scrollBarWidth = window.innerWidth - $("body").width(); } // if tablet size... if (($(window).width() < BBI.UNT.bbnc.specific.params.breakBelow1 - BBI.UNT.bbnc.specific.params.scrollBarWidth) && ($(window).width() >= BBI.UNT.bbnc.specific.params.breakBelow2 - BBI.UNT.bbnc.specific.params.scrollBarWidth)) { BBI.UNT.bbnc.specific.goTabletOnce(); BBI.UNT.bbnc.specific.goTabletAlways(); // else if phone size... } else if ($(window).width() < BBI.UNT.bbnc.specific.params.breakBelow2 - BBI.UNT.bbnc.specific.params.scrollBarWidth){ BBI.UNT.bbnc.specific.goPhoneOnce(); BBI.UNT.bbnc.specific.goPhoneAlways(); // otherwise, must be desktop size... } else { BBI.UNT.bbnc.specific.goDesktopOnce(); BBI.UNT.bbnc.specific.goDesktopAlways(); } BBI.UNT.bbnc.specific.params.oldWidth = $(window).width(); }, // code that fires each time the window is resized or device orientation rotated checkWindowSize: function() { // calculate scroll bar width if any browser other than Safari... if (!((navigator.userAgent.indexOf('Safari') != -1) && (navigator.userAgent.indexOf('Chrome') == -1))) { BBI.UNT.bbnc.specific.params.scrollBarWidth = window.innerWidth - $("body").width(); } // if moving into tablet size from either phone or desktop size... if (($(window).width() < BBI.UNT.bbnc.specific.params.breakBelow1 - BBI.UNT.bbnc.specific.params.scrollBarWidth) && ($(window).width() >= BBI.UNT.bbnc.specific.params.breakBelow2 - BBI.UNT.bbnc.specific.params.scrollBarWidth) && ((BBI.UNT.bbnc.specific.params.oldWidth >= BBI.UNT.bbnc.specific.params.breakBelow1 - BBI.UNT.bbnc.specific.params.scrollBarWidth) || (BBI.UNT.bbnc.specific.params.oldWidth < BBI.UNT.bbnc.specific.params.breakBelow2 - BBI.UNT.bbnc.specific.params.scrollBarWidth))) { BBI.UNT.bbnc.specific.goTabletOnce(); BBI.UNT.bbnc.specific.goTabletAlways(); } // if currently @ tablet size but resizing within tablet size... else if (($(window).width() < BBI.UNT.bbnc.specific.params.breakBelow1 - BBI.UNT.bbnc.specific.params.scrollBarWidth) && ($(window).width() >= BBI.UNT.bbnc.specific.params.breakBelow2 - BBI.UNT.bbnc.specific.params.scrollBarWidth)) { BBI.UNT.bbnc.specific.goTabletAlways(); } // if moving into phone size from anything greater than phone size... else if (($(window).width() < BBI.UNT.bbnc.specific.params.breakBelow2 - BBI.UNT.bbnc.specific.params.scrollBarWidth) && (BBI.UNT.bbnc.specific.params.oldWidth >= BBI.UNT.bbnc.specific.params.breakBelow2 - BBI.UNT.bbnc.specific.params.scrollBarWidth)){ BBI.UNT.bbnc.specific.goPhoneOnce(); BBI.UNT.bbnc.specific.goPhoneAlways(); } // if currently @ phone size but resizing within phone size... else if ($(window).width() < BBI.UNT.bbnc.specific.params.breakBelow2 - BBI.UNT.bbnc.specific.params.scrollBarWidth){ BBI.UNT.bbnc.specific.goPhoneAlways(); } // if moving to desktop size from anything smaller... else if (($(window).width() >= BBI.UNT.bbnc.specific.params.breakBelow1 - BBI.UNT.bbnc.specific.params.scrollBarWidth) && (BBI.UNT.bbnc.specific.params.oldWidth < BBI.UNT.bbnc.specific.params.breakBelow1 - BBI.UNT.bbnc.specific.params.scrollBarWidth)) { BBI.UNT.bbnc.specific.goDesktopOnce(); BBI.UNT.bbnc.specific.goDesktopAlways(); } // othersize must be moving from desktop to desktop size... else { BBI.UNT.bbnc.specific.goDesktopAlways(); } BBI.UNT.bbnc.specific.params.oldWidth = $(window).width(); }, // bind handler to top level mobile menu button