1/** 2 * jQuery.browser.mobile 3 * 4 * jQuery.browser.mobile will be true if the browser is a mobile device 5 * 6 **/ 7(function (a) { (jQuery.browser = jQuery.browser || {}).mobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)) })(navigator.userAgent || navigator.vendor || window.opera); 8 9function underConstructions() { 10 alert("Under construction!"); 11} 12//Pollyfills: 13if (!Array.prototype.findIndex) { 14 Array.prototype.findIndex = function (predicate) { 15 if (this == null) { 16 throw new TypeError('Array.prototype.findIndex called on null or undefined'); 17 } 18 if (typeof predicate !== 'function') { 19 throw new TypeError('predicate must be a function'); 20 } 21 var list = Object(this); 22 var length = list.length >>> 0; 23 var thisArg = arguments[1]; 24 var value; 25 for (var i = 0; i < length; i++) { 26 value = list[i]; 27 if (predicate.call(thisArg, value, i, list)) { 28 return i; 29 } 30 } 31 return -1; 32 }; 33} 34if (!Array.prototype.find) { 35 Array.prototype.find = function (predicate) { 36 if (this == null) { 37 throw new TypeError('Array.prototype.find called on null or undefined'); 38 } 39 if (typeof predicate !== 'function') { 40 throw new TypeError('predicate must be a function'); 41 } 42 var list = Object(this); 43 var length = list.length >>> 0; 44 var thisArg = arguments[1]; 45 var value; 46 for (var i = 0; i < length; i++) { 47 value = list[i]; 48 if (predicate.call(thisArg, value, i, list)) { 49 return value; 50 } 51 } 52 return undefined; 53 }; 54} 55//participant-form serialize into object for ajax call 56//https://stackoverflow.com/a/36793891 57$.fn.serializeObject = function () { 58 var arrayData, objectData; 59 arrayData = this.serializeArray(); 60 objectData = {}; 61 $.each(arrayData, function () { 62 this.value = !this.value ? '' : this.value; 63 processObject(objectData, this.name, this.value); 64 }); 65 return objectData; 66}; 67function processObject(obj, key, value) { 68 if (key.indexOf('.') != -1) { 69 var attrs = key.split('.'); 70 var tx = obj;
71 for (var i = 0; i < attrs.length - 1; i++) { 72 var isArray = attrs[i].indexOf('[') != -1; 73 var isNestedArray = isArray && (i != attrs.length - 1); 74 var nestedArrayIndex = null; 75 if (isArray) { 76 nestedArrayIndex = attrs[i].substring(attrs[i].indexOf('[') + 1, attrs[i].indexOf(']')); 77 attrs[i] = attrs[i].substring(0, attrs[i].indexOf('[')); 78 if (tx[attrs[i]] == undefined) { 79 tx[attrs[i]] = []; 80 } 81 tx = tx[attrs[i]]; 82 if (isNestedArray) { 83 if (tx[nestedArrayIndex] == undefined) { 84 tx[nestedArrayIndex] = {}; 85 } 86 tx = tx[nestedArrayIndex]; 87 } 88 } else { 89 if (tx[attrs[i]] == undefined) { 90 tx[attrs[i]] = {}; 91 } 92 tx = tx[attrs[i]]; 93 } 94 } 95 processObject(tx, attrs[attrs.length - 1], value); 96 } else { 97 var finalArrayIndex = null; 98 if (key.indexOf('[') != -1) { 99 finalArrayIndex = key.substring(key.indexOf('[') + 1, key.indexOf(']')); 100 key = key.substring(0, key.indexOf('[')); 101 } 102 if (finalArrayIndex == null) { 103 obj[key] = value; 104 } else { 105 if (obj[key] == undefined) { 106 obj[key] = []; 107 } 108 obj[key][finalArrayIndex] = value; 109 } 110 } 111} 112var _string = { 113 isNullOrEmpty: function (obj) { 114 return obj === null || obj === ''; 115 }, 116}; 117var _object = { 118 isUndefined: function (obj) { 119 return typeof (obj) === 'undefined'; 120 }, 121 isEmpty: function (obj) { 122 if (obj == null) return true; 123 if (obj.length > 0) return false; 124 if (obj.length === 0) return true; 125 if (typeof obj !== "object") return true; 126 for (var key in obj) { 127 if (hasOwnProperty.call(obj, key)) return false; 128 } 129 return true; 130 }, 131 isNull: function (obj) { 132 return obj === null; 133 }, 134 isNullOrUndefined: function (obj) { 135 return this.isUndefined(obj) || this.isNull(obj); 136 }, 137 isArray: function (obj) { 138 return Object.prototype.toString.call(obj) === '[object Array]'; 139 }, 140 IsDate: function (obj) { 141 return obj instanceof Date && Object.prototype.toString.call(obj) === '[object Date]'; 142 }, 143 isjQuery: function (obj) { 144 return !_object.isNullOrUndefined(obj) && typeof $ !== 'undefined' && obj instanceof $; 145 }, 146 isFunction: function (obj) { 147 return !_object.isNullOrUndefined(obj) && typeof obj === 'function'; 148 }, 149 arrayToString: function (obj, separator) { 150 if (!this.isArray(obj)) { 151 return ''; 152 } 153 return obj.join(separator); 154 }, 155 isString: function (obj) { 156 return typeof obj === "string"; 157 } 158}; 159function processSuccesResult(response, successCallBack, errorFunc, finallyFunc, commonErrorMessage, timeout, dontShowMessage) { 160 if (!_object.isNullOrUndefined(response) && response.Success) { 161 if (typeof successCallBack === 'function') { 162 successCallBack(response.Data); 163 } 164 } else { 165 if (typeof errorFunc === 'function') { 166 errorFunc(response.Data); 167 } 168 169 if (!dontShowMessage) { 170 var message = _string.isNullOrEmpty(response.Message) ? commonErrorMessage : response.Message; 171 if (message) { 172 displayBarNotification(message, "error", timeout || 60000); 173 } 174 } 175 176 if (response.RedirectUrl) { 177 window.location.href = response.RedirectUrl; 178 } 179 } 180 if (typeof finallyFunc === 'function') { 181 finallyFunc(response.Data); 182 } 183} 184function showServerNotResponseError(e1, e2, e3) { 185 console.log(e1); 186 console.log(e2); 187 console.log(e3); 188 displayBarNotification(reservationRegister.messages.serverNotResponsed, "error", 60000); 189} 190//check: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith#Polyfill 191if (!String.prototype.endsWith) { 192 String.prototype.endsWith = function (search, this_len) { 193 if (this_len === undefined || this_len > this.length) { 194 this_len = this.length; 195 } 196 return this.substring(this_len - search.length, this_len) === search; 197 }; 198} 199function showThrobber(display, delay) { 200 if (display) { 201 $(".throbber").show(); 202 }
202 else if (typeof delay === 'number') { 203 window.setTimeout(function () { 204 $(".throbber").hide(); 205 }, delay); 206 //$(".throbber").hide(delay); 207 } else { 208 $(".throbber").hide(); 209 } 210} 211//date to local string pollyfill 212if (!Date.prototype.toLocalISOString) { 213 (function () { 214 function pad(number) { 215 if (number < 10) { 216 return '0' + number; 217 } 218 return number; 219 } 220 Date.prototype.toLocalISOString = function () { 221 return this.getFullYear() + 222 '-' + pad(this.getMonth() + 1) + 223 '-' + pad(this.getDate()) + 224 'T' + pad(this.getHours()) + 225 ':' + pad(this.getMinutes()) + 226 ':' + pad(this.getSeconds()) + 227 '.' + (this.getMilliseconds() / 1000).toFixed(3).slice(2, 5) + 228 'Z'; 229 }; 230 }()); 231} 232// note: IE Polyfill 233(function () { 234 if (typeof window.CustomEvent === "function") return false; 235 function CustomEvent(event, params) { 236 params = params || { bubbles: false, cancelable: false, detail: null }; 237 var evt = document.createEvent('CustomEvent'); 238 evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); 239 return evt; 240 } 241 window.CustomEvent = CustomEvent; 242})(); 243$(document).on("click", ".dropdown > button", function () { 244 $(".dropdown-content").hide(); 245 $(this).siblings(".dropdown-content").show(); 246}); 247window.onclick = function (e) { 248 if (!e.target.matches('.dropdown > button')) { 249 $(".dropdown-content").hide(); 250 } 251}; 252function confirmation(message, callback) { 253 if (confirm(message)) { 254 callback(); 255 } 256} 257// note: IE polyfill, see: https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill 258if (!Element.prototype.matches) { 259 Element.prototype.matches = Element.prototype.msMatchesSelector || 260 Element.prototype.webkitMatchesSelector; 261} 262 263/** 264 * Returns the week number for this date. dowOffset is the day of week the week 265 * "starts" on for your locale - it can be from 0 to 6. If dowOffset is 1 (Monday), 266 * the week returned is the ISO 8601 week number. 267 * @param int dowOffset 268 * @return int 269 */ 270Date.prototype.getWeek = function (dowOffset) { 271 /*getWeek() was developed by Nick Baicoianu at MeanFreePath: http://www.meanfreepath.com */ 272 273 dowOffset = typeof (dowOffset) == 'int' ? dowOffset : 0; //default dowOffset to zero 274 var newYear = new Date(this.getFullYear(), 0, 1); 275 var day = newYear.getDay() - dowOffset; //the day of week the year begins on 276 day = (day >= 0 ? day : day + 7); 277 var daynum = Math.floor((this.getTime() - newYear.getTime() - 278 (this.getTimezoneOffset() - newYear.getTimezoneOffset()) * 60000) / 86400000) + 1; 279 var weeknum; 280 //if the year starts before the middle of a week 281 if (day < 4) { 282 weeknum = Math.floor((daynum + day - 1) / 7) + 1; 283 if (weeknum > 52) { 284 nYear = new Date(this.getFullYear() + 1, 0, 1); 285 nday = nYear.getDay() - dowOffset; 286 nday = nday >= 0 ? nday : nday + 7; 287 /*if the next year starts before the middle of 288 the week, it is week #1 of that year*/ 289 weeknum = nday < 4 ? 1 : 53; 290 } 291 } 292 else { 293 weeknum = Math.floor((daynum + day - 1) / 7); 294 } 295 return weeknum; 296}; 297 298// note: load script by appending script tag to body, if it's not present on the page 299function loadScriptIfNotPresent(scriptSrc) { 300 var list = document.getElementsByTagName('script'), 301 present = false; 302 303 for (var i = 0; i < list.length; i++) { 304 if (list[i].src === scriptSrc) { 305 flag = true; 306 break; 307 } 308 } 309 if (!present) { 310 var tag = document.createElement('script'); 311 tag.src = scriptSrc; 312 document.getElementsByTagName('body')[0].appendChild(tag); 313 } 314} 315 316var loader = { 317 loadWaiting: false,
318 setLoadWaiting: function (selector, disabled) { 319 $(selector).css('position', 'relative'); 320 $(selector).append('<div class="ajax-loading"><div class="ajax-loading-block-window"></div></div>'); 321 loader.loadWaiting = true; 322 if (disabled) { 323 $(selector).addClass('disabled'); 324 } 325 }, 326 resetLoadWaiting: function (selector) { 327 $(selector).find('.ajax-loading').remove(); 328 loader.loadWaiting = false; 329 $(selector).removeClass('disabled'); 330 }, 331}; 332 333var common = { 334 adminHeaderLinksSelector: "", 335 headerLinksSelector: "", 336 init: function (options) { 337 this.adminHeaderLinksSelector = options.adminHeaderLinksSelector || "#admin-header-links"; 338 this.headerLinksSelector = options.headerLinksSelector || "#header-links"; 339 }, 340 //ntree 341 adminHeaderLinks: function (url) { 342 $.ajax({ 343 cache: false, 344 url: url, 345 type: 'get', 346 data: null, 347 success: function (response) { 348 processSuccesResult(response, function (data) { 349 $(common.adminHeaderLinksSelector).replaceWith(data.InnerHtml); 350 }, function () { 351 console.error(response.Message); 352 }); 353 354 }, 355 error: function (error) { 356 console.error(error); 357 } 358 }); 359 }, 360 headerLinks: function (url) { 361 $.ajax({
362 cache: false, 363 url: url, 364 type: 'get', 365 data: null, 366 success: function (response) { 367 processSuccesResult(response, function (data) { 368 $(common.headerLinksSelector).replaceWith(data.InnerHtml); 369 370 let eventToRaise = new CustomEvent('commonHeaderLinks'); 371 document.dispatchEvent(eventToRaise); 372 }, function () { 373 console.error(response.Message); 374 }); 375 }, 376 error: function (error) { 377 console.error(error); 378 } 379 }); 380 }, 381 euCookieLaw: function (url) { 382 $.ajax({ 383 cache: false, 384 url: url, 385 type: 'get', 386 data: null, 387 success: function (response) { 388 processSuccesResult(response, function (data) { 389 if (data && data.InnerHtml) { 390 $("body").append(data.InnerHtml); 391 } 392 }, function () { 393 console.error(response.Message); 394 }); 395 396 }, 397 error: function (error) { 398 console.error(error); 399 } 400 }); 401 }, 402 getCurrentCustomer: function (url) { 403 $.ajax({
404 cache: false, 405 url: url, 406 type: 'get', 407 data: null, 408 success: function (response) { 409 processSuccesResult(response, function (data) { 410 _customerId = data.Id; 411 _customerGuid = data.CustomerGuid; 412 }, function () { 413 console.error(response.Message); 414 }); 415 416 }, 417 error: function (error) { 418 console.error(error); 419 } 420 }); 421 } 422} 423 424// CSRF (XSRF) security 425function addAntiForgeryTokenString(dataStr) { 426 //if the object is undefined, create a new one. 427 if (typeof dataStr !== 'string') { 428 dataStr = ''; 429 } 430 //add token 431 var tokenInput = $('input[name=__RequestVerificationToken]'); 432 if (tokenInput.length) { 433 var token = '__RequestVerificationToken=' + tokenInput.val(); 434 435 // add token if not exists 436 if (dataStr.indexOf(token) <= 0) { 437 438 if (dataStr.length > 0) 439 dataStr += '&'; 440 441 dataStr += token; 442 } 443 } 444 return dataStr; 445} 446 447function appendAntiForgeryToken(formData) { 448 let tokenInput = $('input[name=__RequestVerificationToken]'); 449 if (!tokenInput.length) 450 return formData; 451 452 formData = formData || new FormData(); 453 formData.append("__RequestVerificationToken", tokenInput.val()); 454 return formData; 455} 456 457function getAntiForgeryToken() { 458 let tokenInput = $('input[name=__RequestVerificationToken]'); 459 if (!tokenInput.length) 460 return null; 461 462 return { 463 name: "__RequestVerificationToken", 464 value: tokenInput.val() 465 }; 466} 467function convertUTCDateToLocalDate(date) { 468 var newDate = new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000); 469 470 var offset = date.getTimezoneOffset() / 60; 471 var hours = date.getHours(); 472 473 newDate.setHours(hours - offset); 474 475 return newDate; 476} 477 478function isValidDate(date) { 479 return date instanceof Date && !isNaN(date); 480}
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.