1 2//******************** General ********************// 3// allow jquery to work across asp.net ajax postbacks 4var prm = Sys.WebForms.PageRequestManager.getInstance(); 5 6function clickButton(e, buttonid) { 7 var evt = e ? e : window.event; 8 var bt = document.getElementById(buttonid); 9 if (bt) { 10 if (evt.keyCode == 13) { 11 bt.click(); 12 return false; 13 } 14 } 15} 16 17//Maintain Scroll Position on postback 18window.scrollTo = function (x, y) { 19 return true; 20} 21 22//Disable Enter Key 23{ 24 $('.noEnterSubmit').keypress(function (e) { 25 if (e.which == 13) e.preventDefault(); 26 }); 27} 28 29$(window).bind("pageshow", function (event) { 30 if (event.originalEvent.persisted) { 31 window.location.reload() 32 } 33}); 34 35//Show a Hint 36$(".hintFire").filter(function (index) { 37 $(this).click(function () { 38 $(this).parent().parent().find('.hintWrapper').css("display", "block"); 39 }); 40}); 41 42$('.uk-close').click(function () { 43 $(this).parent().parent().hide(); 44}); 45 46 47//***** Menu *****// 48 49$('#menuToggle').click(function (e) { 50 e.preventDefault(); 51 if ($('body').hasClass('menuOpen')) { 52 $('body').removeClass('menuOpen'); 53 } 54 else { 55 $('body').addClass('menuOpen'); 56 } 57}); 58 59//***** LoginPanel *****// 60 61$('#memberImg, #memberIni, #memberIco').click(function (e) { 62 63 e.preventDefault(); 64 65 if ($('body').hasClass('LOGGEDIN')) { 66 67 if ($('body').hasClass('loginPanelVisible')) { 68 $('body').removeClass('loginPanelVisible') 69 } 70 71 else { 72 $('body').addClass('loginPanelVisible'); 73 } 74 } 75 76}); 77 78//******************** Stuff that must run on postback ********************// 79 80prm.add_pageLoaded(pageLoaded); 81function pageLoaded() { 82 83 //***** Error Scroll *****// 84 if ($("#ctl00_ErrorUpdatePanel").find(".uk-alert").length > 0) { 85 $('html, body').animate({ 86 scrollTop: $("#ezMain").offset().top 87 }, 1000); 88 } 89 90 //***** Android Date Fix *****// 91 $('.SessionDatePicker').prop('readOnly', true); 92 93 //***** Login *****// 94 $('#btnForgottenPassword').click(function () { 95 $('#pnlForgottenPassword').slideToggle('slow'); 96 return false; 97 }); 98 99 //***** Party Hints *****// 100 $('.hintWrapper').each(function () { 101 a = $(this).find('p').html(); 102 if (a.trim()) { 103 $(this).parent().find('.hintFire').css("display", "block"); 104 } 105 }); 106 107 //Dont show booking wrapper until page has loaded 108 $(".bookingWrapper").delay(2000).fadeIn('slow'); 109 setTimeout(function () { 110 $('.bookingLoad').fadeOut('fast', function () { 111 $(".bookingWrapper").css('visibility', 'visible'); 112 }); 113 }, 2000); 114 115 //***** Jump Bookings *****// 116 $('.spacesFree').filter(function (index) { 117 spaces = parseInt(this.innerHTML); 118 if (spaces > 1) { 119 $(this).parent().parent().parent().find('.fullBadge').css("display", "block"); 120 } 121 122 else if (spaces > 0 && spaces < 20) { 123 $(this).parent().parent().parent().find('.lowBadge').css("display", "block"); 124 } 125 }); 126 127 //***** Classes *****// 128 129 // Need to change text from Your Details to Participant Details 130 $('.classesDetailsPage #yourDetailsTxt').html('Participant Details'); 131 132 //Set the low spaces number 133 var lowSpacesValue = 10; 134 135 $(".classSelectFire").click(function (e) { 136 if ($(this).find('.blocked').html() == "blocked") { 137 e.preventDefault(); 138 } 139 else { 140 $(this).next('.classOverlay').css("display", "flex"); 141 } 142 }); 143 144 $(".closeClass").click(function () { 145 $(this).parent().parent().parent().css("display", "none"); 146 }); 147 148 $(".classOverlay").click(function () { 149 $(this).css("display", "none"); 150 }); 151 152 $('.classPlaces').filter(function (index) { 153 var spaces = parseInt($(this).find('span').html().replace(/[^\d\.]/g, '')); 154 if (spaces < 1 || isNaN(spaces)) { 155 $(this).addClass('classFull'); 156 $(this).parent().parent().parent().find('.joinWaitingList').css("display", "block"); 157 $(this).parent().parent().parent().find('.spacesAvailable').css("display", "none"); 158 } 159
160 else if (spaces > 0 && spaces < lowSpacesValue) { 161 $(this).addClass('classLow'); 162 $(this).parent().parent().parent().find('.spacesAvailable').css("display", "none"); 163 $(this).parent().parent().parent().find('.classLowWarning').css("display", "block"); 164 } 165 166 if ($(this).parent().find('.blocked').html() == "blocked") { 167 $(this).parent().parent().find('.blockedOverlay').css('display', 'block'); 168 } 169 }); 170 171 // next / prev 172 window.setInterval(function () { 173 if ($('#classCalendarDesktop li:first-of-type').hasClass('uk-active')) { 174 $('#weekPrev').css('display', 'none'); 175 $('#weekNext').css('display', 'block'); 176 } 177 178 else { 179 $('#weekPrev').css('display', 'block'); 180 } 181 182 if ($('#classCalendarDesktop li:last-of-type').hasClass('uk-active')) { 183 $('#weekPrev').css('display', 'block'); 184 $('#weekNext').css('display', 'none'); 185 } 186 187 else { 188 $('#weekNext').css('display', 'block'); 189 } 190 }, 100); 191 192 // Filter show 193 $('#filterToggle').click(function () { 194 if ($('body').hasClass('filterActive')) { 195 $('body').removeClass('filterActive'); 196 } 197 198 else { 199 $('body').addClass('filterActive'); 200 } 201 }) 202 203 //***** Voucher Msg Count *****// 204 205 $('.custMsg').each(function () { 206 207 var count = $(this).val().length; 208 209 $(this).keydown(function (e) { 210 211 count = (300 - $(this).val().length); 212 213 $(this).parent().find('.count').text(count); 214 215 if (count < 10) { 216 $(this).parent().find('.count').addClass('uk-text-warning'); 217 } 218 219 else { 220 $(this).parent().find('.count').removeClass('uk-text-warning'); 221 } 222 223 if (count < 1 && e.keyCode !== 8) { 224 e.preventDefault(); 225 $(this).parent().find('.count').text(0); 226 } 227 228 else { 229 return true; 230 } 231 }); 232 233 if (count > 0) { 234 count = 300 - count; 235 $(this).parent().parent().find('.count').text(count); 236 237 if (count < 10) { 238 $(this).parent().find('.count').addClass('uk-text-warning'); 239 } 240 else { 241 $(this).parent().find('.count').removeClass('uk-text-warning'); 242 } 243 } 244 245 }); 246 247 //***** Custom Grid *****// 248 249 var max_width = 0; 250 var widest_div; 251 252 $('.timeSlot').each(function () { 253 a = $(this).find('.bookButton'); 254 b = $(this).find('.time').html(); 255 c = parseInt($(this).find('.spaces').html()); 256 $(a).append("<i class='uk-icon uk-icon-clock-o'></i> " + b + "<span class='spaceNum'>" + c + " </span>"); 257 }); 258 259 $('.spaceNum').each(function (index) { 260 spaces = $(this).html(); 261 spaces = spaces.replace(' ', ''); 262 spaces = parseInt(spaces); 263 if (spaces == 0) { 264 $(this).parent().parent().addClass('uk-hidden'); 265 } 266 }); 267 268 $('.bookButton').click(function (e) { 269 if ($(this).hasClass('Full')) { 270 e.preventDefault(); 271 } 272 }); 273 274 $('#timeSlots').addClass('showSlots'); 275 276 $(document).ready(function () { 277 setTimeout( 278 function () { 279 $('body').addClass('loaded'); 280 }, 1000); 281 }); 282}
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.