1jQuery.fn.nextInArray = function (element) { 2 var nextId = 0; 3 for (var i = 0; i < this.length; i++) { 4 if (this[i] == element) { 5 nextId = i + 1; 6 break; 7 } 8 } 9 if (nextId > this.length - 1) nextId = 0; 10 return this[nextId]; 11}; 12jQuery.fn.clearForm = function () { 13 return this.each(function () { 14 var type = this.type, 15 tag = this.tagName.toLowerCase(); 16 if (tag == 'form') return jQuery(':input', this).clearForm(); 17 if (type == 'text' || type == 'password' || tag == 'textarea') this.value = ''; 18 else if (type == 'checkbox' || type == 'radio') this.checked = false; 19 else if (tag == 'select') this.selectedIndex = -1; 20 }); 21}; 22jQuery.fn.tagName = function () { 23 return this.get(0).tagName; 24}; 25jQuery.fn.exists = function () { 26 return jQuery(this).length > 0 ? true : false; 27}; 28function isNumber(val) { 29 return /^\d+/.test(val); 30} 31function pushDataToParam(data, pref) { 32 pref = pref ? pref : ''; 33 var res = []; 34 for (var key in data) { 35 var name = pref && pref != '' ? pref + '[' + key + ']' : key; 36 if (typeof data[key] === 'array' || typeof data[key] === 'object') { 37 res = jQuery.merge(res, pushDataToParam(data[key], name)); 38 } else { 39 res.push(name + '=' + data[key]); 40 } 41 } 42 return res; 43} 44jQuery.fn.serializeAnythingUms = function (addData) { 45 var toReturn = []; 46 var els = jQuery(this).find(':input').get(); 47 jQuery.each(els, function () { 48 if (this.name && !this.disabled && (this.checked || /select|textarea/i.test(this.nodeName) || /text|hidden|password/i.test(this.type))) { 49 var val = jQuery(this).val(); 50 toReturn.push(encodeURIComponent(this.name) + '=' + encodeURIComponent(val)); 51 } 52 }); 53 if (typeof addData != 'undefined') { 54 toReturn = jQuery.merge(toReturn, pushDataToParam(addData)); 55 } 56 return toReturn.join('&').replace(/%20/g, '+'); 57}; 58jQuery.fn.serializeAssoc = function () { 59 var data = []; 60 jQuery.each(this.serializeArray(), function (key, obj) { 61 var a = obj.name.match(/(.*?)\[(.*?)\]/); 62 if (a !== null) { 63 var subName = a[1]; 64 var subKey = a[2]; 65 if (!data[subName]) data[subName] = []; 66 if (data[subName][subKey]) { 67 if (jQuery.isArray(data[subName][subKey])) { 68 data[subName][subKey].push(obj.value); 69 } else { 70 data[subName][subKey] = []; 71 data[subName][subKey].push(obj.value); 72 } 73 } else { 74 data[subName][subKey] = obj.value; 75 } 76 } else { 77 if (data[obj.name]) { 78 if (jQuery.isArray(data[obj.name])) { 79 data[obj.name].push(obj.value); 80 } else { 81 data[obj.name] = []; 82 data[obj.name].push(obj.value); 83 } 84 } else { 85 data[obj.name] = obj.value; 86 } 87 } 88 }); 89 return data; 90}; 91function str_replace(haystack, needle, replacement) { 92 var temp = haystack.split(needle); 93 return temp.join(replacement); 94} 95/** 96 * @see php html::nameToClassId($name) method 97 **/ 98function nameToClassId(name) { 99 return str_replace(str_replace(name, ']', ''), '[', ''); 100} 101function strpos(haystack, needle, offset) { 102 var i = haystack.indexOf(needle, offset); // returns -1 103 return i >= 0 ? i : false; 104} 105function extendUms(Child, Parent) { 106 var F = function () {}; 107 F.prototype = Parent.prototype; 108 Child.prototype = new F(); 109 Child.prototype.constructor = Child; 110 Child.superclass = Parent.prototype; 111} 112function toeRedirect(url) { 113 document.location.href = url; 114} 115function toeReload(url) { 116 if (url) { 117 toeRedirect(url); 118 } else document.location.reload(); 119} 120jQuery.fn.toeRebuildSelect = function (data, useIdAsValue, val) { 121 if (jQuery(this).tagName() == 'SELECT' && typeof data == 'object') { 122 if (jQuery(data).length > 0) { 123 if (typeof val == 'undefined') val = false; 124 if (jQuery(this).children('option').length) { 125 jQuery(this).children('option').remove(); 126 } 127 if (typeof useIdAsValue == 'undefined') useIdAsValue = false; 128 var selected = ''; 129 for (var id in data) { 130 selected = ''; 131 if (val && ((useIdAsValue && id == val) || data[id] == val)) selected = 'selected'; 132 jQuery(this).append('<option value="' + (useIdAsValue ? id : data[id]) + '" ' + selected + '>
132' + data[id] + '</option>'); 133 } 134 } 135 } 136}; 137/** 138 * We will not use just jQUery.inArray because it is work incorrect for objects 139 * @return mixed - key that was found element or -1 if not 140 */ 141function toeInArray(needle, haystack) { 142 if (typeof haystack == 'object') { 143 for (var k in haystack) { 144 if (haystack[k] == needle) return k; 145 } 146 } else if (typeof haystack == 'array') { 147 return jQuery.inArray(needle, haystack); 148 } 149 return -1; 150} 151jQuery.fn.setReadonly = function () { 152 jQuery(this).addClass('toeReadonly').attr('readonly', 'readonly'); 153}; 154jQuery.fn.unsetReadonly = function () { 155 jQuery(this).removeClass('toeReadonly').removeAttr('readonly', 'readonly'); 156}; 157jQuery.fn.getClassId = function (pref, test) { 158 var classId = jQuery(this).attr('class'); 159 classId = classId.substr(strpos(classId, pref + '_')); 160 if (strpos(classId, ' ')) classId = classId.substr(0, strpos(classId, ' ')); 161 classId = classId.split('_'); 162 classId = classId[1]; 163 return classId; 164}; 165function toeTextIncDec(textFieldId, inc) { 166 var value = parseInt(jQuery('#' + textFieldId).val()); 167 if (isNaN(value)) value = 0; 168 if (!(inc < 0 && value < 1)) { 169 value += inc; 170 } 171 jQuery('#' + textFieldId).val(value); 172} 173 174/** 175 * Make first letter of string in upper case 176 * @param str string - string to convert 177 * @return string converted string - first letter in upper case 178 */ 179function toeStrFirstUp(str) { 180 str += ''; 181 var f = str.charAt(0).toUpperCase(); 182 return f + str.substr(1); 183} 184function URLToArray(url) { 185 var request = {}; 186 var url = url.toString(); 187 var pairs = url.substring(url.indexOf('?') + 1).split('&'); 188 for (var i = 0; i < pairs.length; i++) { 189 if (!pairs[i]) continue; 190 var pair = pairs[i].split('='); 191 request[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); 192 } 193 return request; 194} 195function ArrayToURL(array) { 196 var pairs = []; 197 for (var key in array) if (array.hasOwnProperty(key)) pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(array[key])); 198 return pairs.join('&'); 199} 200function parseStr(str, array) { 201 // http://kevin.vanzonneveld.net 202 // + original by: Cagri Ekin 203 // + improved by: Michael White (http://getsprink.com) 204 // + tweaked by: Jack 205 // + bugfixed by: Onno Marsman 206 // + reimplemented by: stag019 207 // + bugfixed by: Brett Zamir (http://brett-zamir.me) 208 // + bugfixed by: stag019 209 // + input by: Dreamer 210 // + bugfixed by: Brett Zamir (http://brett-zamir.me) 211 // + bugfixed by: MIO_KODUKI (http://mio-koduki.blogspot.com/) 212 // + input by: Zaide (http://zaidesthings.com/) 213 // + input by: David Pesta (http://davidpesta.com/) 214 // + input by: jeicquest 215 // + improved by: Brett Zamir (http://brett-zamir.me) 216 // % note 1: When no argument is specified, will put variables in global scope. 217 // % note 1: When a particular argument has been passed, and the returned value is different parse_str of PHP. For example, a=b=c&d====c 218 // * example 1: var arr = {}; 219 // * example 1: parse_str('first=foo&second=bar', arr); 220 // * results 1: arr == { first: 'foo', second: 'bar' } 221 // * example 2: var arr = {}; 222 // * example 2: parse_str('str_a=Jack+and+Jill+didn%27t+see+the+well.', arr); 223 // * results 2: arr == { str_a: "Jack and Jill didn't see the well." } 224 // * example 3: var abc = {3:'a'}; 225 // * example 3: parse_str('abc[a][b]["c"]=def&abc[q]=t+5'); 226 // * results 3: JSON.stringify(abc) === '{"3":"a","a":{"b":{"c":"def"}},"q":"t 5"}'; 227 var strArr = String(str).replace(/^&/, '').replace(/&$/, '').split('&'), 228 sal = strArr.length, 229 i, 230 j, 231 ct, 232 p, 233 lastObj, 234 obj, 235 lastIter, 236 undef, 237 chr, 238 tmp, 239 key, 240 value, 241 postLeftBracketPos, 242 keys, 243 keysLen, 244 fixStr = function (str) { 245 return decodeURIComponent(str.replace(/\+/g, '%20')); 246 }; 247 // Comented by Alexey Bolotov 248 /* 249 if (!array) { 250 array = this.window; 251 }*/ 252 if (!array) { 253 array = {}; 254 } 255 256 for (i = 0; i < sal; i++) { 257 tmp = strArr[i].split('='); 258 key = fixStr(tmp[0]); 259 value = tmp.length < 2 ? '' : fixStr(tmp[1]); 260 261 while (key.charAt(0) === ' ') { 262 key = key.slice(1); 263 } 264 if (key.indexOf('\x00') > -1) { 265 key = key.slice(0, key.indexOf('\x00')); 266 } 267 if (key && key.charAt(0) !== '[') { 268 keys = []; 269 postLeftBracketPos = 0; 270 for (j = 0; j < key.length; j++) { 271 if (key.charAt(j) === '[' && !postLeftBracketPos) { 272 postLeftBracketPos = j + 1; 273 } else if (key.charAt(j) === ']') { 274 if (postLeftBracketPos) { 275 if (!keys.length) { 276 keys.push(key.slice(0, postLeftBracketPos - 1)); 277 } 278 keys.push(key.substr(postLeftBracketPos, j - postLeftBracketPos)); 279 postLeftBracketPos = 0; 280 if (key.charAt(j + 1) !== '[') { 281 break; 282 } 283 } 284 } 285 } 286 if (!keys.length) { 287 keys = [key]; 288 } 289 for (j = 0; j < keys[0].length; j++) {
290 chr = keys[0].charAt(j); 291 if (chr === ' ' || chr === '.' || chr === '[') { 292 keys[0] = keys[0].substr(0, j) + '_' + keys[0].substr(j + 1); 293 } 294 if (chr === '[') { 295 break; 296 } 297 } 298 299 obj = array; 300 for (j = 0, keysLen = keys.length; j < keysLen; j++) { 301 key = keys[j].replace(/^['"]/, '').replace(/['"]$/, ''); 302 lastIter = j !== keys.length - 1; 303 lastObj = obj; 304 if ((key !== '' && key !== ' ') || j === 0) { 305 if (obj[key] === undef) { 306 obj[key] = {}; 307 } 308 obj = obj[key]; 309 } else { 310 // To insert new dimension 311 ct = -1; 312 for (p in obj) { 313 if (obj.hasOwnProperty(p)) { 314 if (+p > ct && p.match(/^\d+$/g)) { 315 ct = +p; 316 } 317 } 318 } 319 key = ct + 1; 320 } 321 } 322 lastObj[key] = value; 323 } 324 } 325 return array; 326} 327 328function toeListableUms(params) { 329 this.params = jQuery.extend({}, params); 330 this.table = jQuery(this.params.table); 331 this.paging = jQuery(this.params.paging); 332 this.perPage = this.params.perPage; 333 this.list = this.params.list; 334 this.count = this.params.count; 335 this.page = this.params.page; 336 this.pagingCallback = this.params.pagingCallback; 337 var self = this; 338 339 this.draw = function (list, count) { 340 this.table.find('tr').not('.umsExample, .umsTblHeader').remove(); 341 var exampleRow = this.table.find('.umsExample'); 342 for (var i in list) { 343 var newRow = exampleRow.clone(); 344 for (var key in list[i]) { 345 var element = newRow.find('.' + key); 346 if (element.length) { 347 var valueTo = element.attr('valueTo'); 348 if (valueTo) { 349 var newValue = list[i][key]; 350 var prevValue = element.attr(valueTo); 351 if (prevValue) newValue = prevValue + ' ' + newValue; 352 element.attr(valueTo, newValue); 353 } else element.html(list[i][key]); 354 } 355 } 356 newRow.removeClass('umsExample').show(); 357 this.table.append(newRow); 358 } 359 if (this.paging) { 360 this.paging.html(''); 361 if (count && count > list.length && this.perPage) { 362 for (var i = 1; i <= Math.ceil(count / this.perPage); i++) { 363 var newPageId = i - 1, 364 newElement = newPageId == this.page ? jQuery('<b/>') : jQuery('<a/>'); 365 if (newPageId != this.page) { 366 newElement.attr('href', '#' + newPageId).click(function () { 367 if (self.pagingCallback && typeof self.pagingCallback == 'function') { 368 self.pagingCallback(parseInt(jQuery(this).attr('href').replace('#', ''))); 369 return false; 370 } 371 }); 372 } 373 newElement.addClass('toePagingElement').html(i); 374 this.paging.append(newElement); 375 if (i % 20 == 0 && i) this.paging.append('<br />'); 376 } 377 } 378 } 379 }; 380 if (this.list) this.draw(this.list, this.count); 381} 382 383function setCookieUms(c_name, value, exdays) { 384 var exdate = new Date(); 385 exdate.setDate(exdate.getDate() + exdays); 386 var value_prepared = ''; 387 if (typeof value == 'array' || typeof value == 'object') { 388 value_prepared = '_JSON:' + JSON.stringify(value); 389 } else { 390 value_prepared = value; 391 } 392 var c_value = escape(value_prepared) + (exdays == null ? '' : '; expires=' + exdate.toUTCString()) + '; path=/'; 393 document.cookie = c_name + '=' + c_value; 394} 395 396function getCookieUms(name) { 397 var parts = document.cookie.split(name + '='); 398 if (parts.length == 2) { 399 var value = unescape(parts.pop().split(';').shift()); 400 if (value.indexOf('_JSON:') === 0) { 401 value = JSON.parse(value.split('_JSON:').pop()); 402 } 403 return value; 404 } 405 return null; 406} 407 408function delCookieUms(name) { 409 document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 410} 411 412function callUserFuncArray(cb, parameters) { 413 // http://kevin.vanzonneveld.net 414 // + original by: Thiago Mata (http://thiagomata.blog.com) 415 // + revised by: Jon Hohle 416 // + improved by: Brett Zamir (http://brett-zamir.me) 417 // + improved by: Diplom@t (http://difane.com/) 418 // + improved by: Brett Zamir (http://brett-zamir.me) 419 // * example 1: call_user_func_array('isNaN', ['a']); 420 // * returns 1: true 421 // * example 2: call_user_func_array('isNaN', [1]); 422 // * returns 2: false 423 var func; 424 425 if (typeof cb === 'string') { 426 func = typeof this[cb] === 'function' ? this[cb] : (func = new Function(null, 'return ' + cb)()); 427 } else if (Object.prototype.toString.call(cb) === '[object Array]') { 428 func = typeof cb[0] == 'string' ? eval(cb[0] + "['" + cb[1] + "']") : (func = cb[0][cb[1]]); 429 } else if (typeof cb === 'function') { 430 func = cb; 431 } 432 433 if (typeof func !== 'function') { 434 throw new Error(func + ' is not a valid function'); 435 } 436 437 return typeof cb[0] === 'string' ? func.apply(eval(cb[0]), parameters) : typeof cb[0] !== 'object' ? func.apply(null, parameters) : func.apply(cb[0], parameters); 438} 439jQuery.fn.zoom = function (level) { 440 jQuery(this).data('zoom', level); 441 return jQuery(this).css({ 442 /* 'zoom': level // Didn't worked correctly for mobiles 443 ,*/ '-moz-transform': 'scale(' + level + ')', 444 '-moz-transform-origin': 'center center', 445 '-o-transform': 'scale(' + level + ')', 446 '-o-transform-origin': 'center center', 447 '-webkit-transform': 'scale(' + level + ')', 448 '-webkit-transform-origin': 'center center', 449 transform: 'scale(' + level + ')', 450 'transform-origin': 'center center', 451 }); 452}; 453jQuery.fn.rotate = function (deg) { 454 return jQuery(this).css({ 455 '-moz-transform': 'rotate(' + deg + 'deg)', 456 '-webkit-transform': 'rotate(' + deg + 'deg)', 457 '-o-transform': 'rotate(' + deg + 'deg)', 458 '-ms-transform': 'rotate(' + deg + 'deg)', 459 transform: 'rotate(' + deg + 'deg)', 460 }); 461}; 462jQuery.fn.scrollWidth = function () { 463 var inner = document.createElement('p'); 464 inner.style.width = '100%'; 465 inner.style.height = '200px'; 466 467 var outer = document.createElement('div'); 468 outer.style.position = 'absolute'; 469 outer.style.top = '0px'; 470 outer.style.left = '0px'; 471 outer.style.visibility = 'hidden'; 472 outer.style.width = '200px'; 473 outer.style.height = '150px'; 474 outer.style.overflow = 'hidden'; 475 outer.appendChild(inner); 476 477 document.body.appendChild(outer); 478 var w1 = inner.offsetWidth; 479 outer.style.overflow = 'scroll'; 480 var w2 = inner.offsetWidth; 481 if (w1 == w2) w2 = outer.clientWidth; 482 483 document.body.removeChild(outer); 484 485 return w1 - w2; 486}; 487/** 488 * Retrive worumsess attach ID from image, using img classes 489 * @param {htmlObj} img Image to get ID from 490 */ 491function toeGetImgAttachId(img) { 492 var classesStr = jQuery(img).attr('class'), 493 aid = 0; 494 if (classesStr && classesStr != '') { 495 var matches = classesStr.match(/wp-image-(\d+)/); 496 if (matches && matches[1]) { 497 aid = parseInt(matches[1]); 498 } 499 } 500 return aid;
501} 502function toeGetHashParams() { 503 var hashArr = window.location.hash.split('#'), 504 res = []; 505 for (var i in hashArr) { 506 if (hashArr[i] && hashArr[i] != '') { 507 res.push(hashArr[i]); 508 } 509 } 510 return res; 511} 512/*Replace text in DOM functions*/ 513// Reusable generic function 514function traverseElement(el, regex, textReplacerFunc, to) { 515 // script and style elements are left alone 516 if (!/^(script|style)$/.test(el.tagName)) { 517 var child = el.lastChild; 518 while (child) { 519 if (child.nodeType == 1) { 520 traverseElement(child, regex, textReplacerFunc, to); 521 } else if (child.nodeType == 3) { 522 textReplacerFunc(child, regex, to); 523 } 524 child = child.previousSibling; 525 } 526 } 527} 528 529// This function does the replacing for every matched piece of text 530// and can be customized to do what you like 531function textReplacerFunc(textNode, regex, to) { 532 textNode.data = textNode.data.replace(regex, to); 533} 534 535// The main function 536function replaceWords(html, words) { 537 var container = document.createElement('div'); 538 container.innerHTML = html; 539 540 // Replace the words one at a time to ensure each one gets matched 541 for (var replace in words) { 542 traverseElement(container, new RegExp(replace, 'g'), textReplacerFunc, words[replace]); 543 } 544 return container.innerHTML; 545} 546/*****/ 547function toeSelectText(element) { 548 var doc = document, 549 text = jQuery(element).get(0), 550 range, 551 selection; 552 if (doc.body.createTextRange) { 553 //ms 554 range = doc.body.createTextRange(); 555 range.moveToElementText(text); 556 range.select(); 557 } else if (window.getSelection) { 558 //all others 559 selection = window.getSelection(); 560 range = doc.createRange(); 561 range.selectNodeContents(text); 562 selection.removeAllRanges(); 563 selection.addRange(range); 564 } 565} 566jQuery.fn.animationDuration = function (seconds, isMili) { 567 if (isMili) { 568 seconds = parseFloat(seconds) / 1000; 569 } 570 var secondsStr = seconds + 's'; 571 return jQuery(this).css({ 572 'webkit-animation-duration': secondsStr, 573 '-moz-animation-duration': secondsStr, 574 '-o-animation-duration': secondsStr, 575 'animation-duration': secondsStr, 576 }); 577}; 578/** 579 * Convert Date string (in common - mm/dd/yyyy) - to miliseconds 580 * @param {string} strDate date string 581 * @return {int} miliseconds 582 */ 583function umsStrToMs(strDate) { 584 var dateHours = strDate.split(' '); 585 if (dateHours.length == 2) { 586 strDate = dateHours[0] + ' '; 587 var hms = dateHours[1].split(':'); 588 589 for (var i = 0; i < 3; i++) { 590 strDate += hms[i] ? hms[i] : '00'; 591 if (i < 2) strDate += ':'; 592 } 593 } 594 var date = new Date(str_replace(strDate, '-', '/')), 595 res = 0; 596 if (date) { 597 res = date.getTime(); 598 } 599 return res; 600} 601function twoArraysContainSameValue(arr1, arr2) { 602 return arr2.some(function (v) { 603 return arr1.indexOf(v) >= 0; 604 }); 605} 606// Simulates PHP's date function 607Date.prototype.format = function (e) { 608 var t = ''; 609 var n = Date.replaceChars; 610 for (var r = 0; r < e.length; r++) { 611 var i = e.charAt(r); 612 if (r - 1 >= 0 && e.charAt(r - 1) == '\\') { 613 t += i; 614 } else if (n[i]) { 615 t += n[i].call(this); 616 } else if (i != '\\') { 617 t += i; 618 } 619 } 620 return t; 621}; 622Date.replaceChars = { 623 shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 624 longMonths: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 625 shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 626 longDays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], 627 d: function () { 628 return (this.getDate() < 10 ? '0' : '') + this.getDate(); 629 }, 630 D: function () { 631 return Date.replaceChars.shortDays[this.getDay()]; 632 }, 633 j: function () { 634 return this.getDate(); 635 }, 636 l: function () { 637 return Date.replaceChars.longDays[this.getDay()]; 638 }, 639 N: function () { 640 return this.getDay() + 1; 641 }, 642 S: function () { 643 return this.getDate() % 10 == 1 && this.getDate() != 11 ? 'st' : this.getDate() % 10 == 2 && this.getDate() != 12 ? 'nd' : this.getDate() % 10 == 3 && this.getDate() != 13 ? 'rd' : 'th'; 644 }, 645 w: function () { 646 return this.getDay(); 647 }, 648 z: function () { 649 var e = new Date(this.getFullYear(), 0, 1); 650 return Math.ceil((this - e) / 864e5); 651 }, 652 W: function () { 653 var e = new Date(this.getFullYear(), 0, 1); 654 return Math.ceil(((this - e) / 864e5 + e.getDay() + 1) / 7); 655 }, 656 F: function () { 657 return Date.replaceChars.longMonths[this.getMonth()];
658 }, 659 m: function () { 660 return (this.getMonth() < 9 ? '0' : '') + (this.getMonth() + 1); 661 }, 662 M: function () { 663 return Date.replaceChars.shortMonths[this.getMonth()]; 664 }, 665 n: function () { 666 return this.getMonth() + 1; 667 }, 668 t: function () { 669 var e = new Date(); 670 return new Date(e.getFullYear(), e.getMonth(), 0).getDate(); 671 }, 672 L: function () { 673 var e = this.getFullYear(); 674 return e % 400 == 0 || (e % 100 != 0 && e % 4 == 0); 675 }, 676 o: function () { 677 var e = new Date(this.valueOf()); 678 e.setDate(e.getDate() - ((this.getDay() + 6) % 7) + 3); 679 return e.getFullYear(); 680 }, 681 Y: function () { 682 return this.getFullYear(); 683 }, 684 y: function () { 685 return ('' + this.getFullYear()).substr(2); 686 }, 687 a: function () { 688 return this.getHours() < 12 ? 'am' : 'pm'; 689 }, 690 A: function () { 691 return this.getHours() < 12 ? 'AM' : 'PM'; 692 }, 693 B: function () { 694 return Math.floor(((((this.getUTCHours() + 1) % 24) + this.getUTCMinutes() / 60 + this.getUTCSeconds() / 3600) * 1e3) / 24); 695 }, 696 g: function () { 697 return this.getHours() % 12 || 12; 698 }, 699 G: function () { 700 return this.getHours(); 701 }, 702 h: function () { 703 return ((this.getHours() % 12 || 12) < 10 ? '0' : '') + (this.getHours() % 12 || 12); 704 }, 705 H: function () { 706 return (this.getHours() < 10 ? '0' : '') + this.getHours(); 707 }, 708 i: function () { 709 return (this.getMinutes() < 10 ? '0' : '') + this.getMinutes(); 710 }, 711 s: function () { 712 return (this.getSeconds() < 10 ? '0' : '') + this.getSeconds(); 713 }, 714 u: function () { 715 var e = this.getMilliseconds(); 716 return (e < 10 ? '00' : e < 100 ? '0' : '') + e; 717 }, 718 e: function () { 719 return 'Not Yet Supported'; 720 }, 721 I: function () { 722 var e = null; 723 for (var t = 0; t < 12; ++t) { 724 var n = new Date(this.getFullYear(), t, 1); 725 var r = n.getTimezoneOffset(); 726 if (e === null) e = r; 727 else if (r < e) { 728 e = r; 729 break; 730 } else if (r > e) break; 731 } 732 return (this.getTimezoneOffset() == e) | 0; 733 }, 734 O: function () { 735 return (-this.getTimezoneOffset() < 0 ? '-' : '+') + (Math.abs(this.getTimezoneOffset() / 60) < 10 ? '0' : '') + Math.abs(this.getTimezoneOffset() / 60) + '00'; 736 }, 737 P: function () { 738 return (-this.getTimezoneOffset() < 0 ? '-' : '+') + (Math.abs(this.getTimezoneOffset() / 60) < 10 ? '0' : '') + Math.abs(this.getTimezoneOffset() / 60) + ':00'; 739 }, 740 T: function () { 741 var e = this.getMonth(); 742 this.setMonth(0); 743 var t = this.toTimeString().replace(/^.+ \(?([^\)]+)\)?$/, '$1'); 744 this.setMonth(e); 745 return t; 746 }, 747 Z: function () { 748 return -this.getTimezoneOffset() * 60; 749 }, 750 c: function () { 751 return this.format('Y-m-d\\TH:i:sP'); 752 }, 753 r: function () { 754 return this.toString(); 755 }, 756 U: function () { 757 return this.getTime() / 1e3; 758 }, 759};
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.