1var VrApp = function () { 2 3 var _token; 4 var _identity; 5 6 var setOAuthToken = function (t) { 7 _token = t; 8 }; 9 10 var getOAuthToken = function () { 11 return _token; 12 }; 13 14 var setUserIdentity = function (t) { 15 _identity = t; 16 }; 17 18 var getUserIdentity = function () { 19 return _identity; 20 }; 21 22 return { 23 setOAuthToken: function (token) { 24 setOAuthToken(token); 25 }, 26 getOAuthToken: function () { 27 return getOAuthToken(); 28 }, 29 setUserIdentity: function (token) { 30 setUserIdentity(token); 31 }, 32 getUserIdentity: function () { 33 return getUserIdentity(); 34 }, 35 getCrfAttributeName: function () { 36 return $('meta[name="csrf-param"]').attr('content'); 37 }, 38 getCrfToken: function () { 39 return $('meta[name="csrf-token"]').attr('content'); 40 } 41 } 42}(); 43 44/** 45 * MyAjax 46 * @return \Object 47 */ 48var MyAjax = { 49 addLoader: function () { 50 try { 51 KTApp.blockPage(); 52 KTApp.blockPage(); 53 } catch (Error) { 54 } 55 }, 56 removeLoader: function () { 57 try { 58 KTApp.unblockPage(); 59 } catch (Error) { 60 } 61 } 62}; 63 64/** 65 * System Class 66 * @type Object System 67 */ 68var System = { 69 encN: 5, 70 objectLength: function (obj) { 71 var result = 0; 72 for (var prop in obj) { 73 if (obj.hasOwnProperty(prop)) { 74 result++; 75 } 76 } 77 return result; 78 }, 79 log: function (message) { 80 try { 81 console.log(message); 82 } catch (e) { 83 //alert(message); 84 } 85 }, 86 decodeTxt: function (s) { 87 // DECODES AND UNESCAPES ALL TEXT. 88 var s1 = unescape(s.substr(0, s.length - 1)); 89 var t = ''; 90 for (var i = 0; i < s1.length; i++) 91 t += String.fromCharCode(s1.charCodeAt(i) - s.substr(s.length - 1, 1)); 92 return unescape(t); 93 }, 94 encodeTxt: function (s) { 95 // ENCODES, IN UNICODE FORMAT, ALL TEXT AND THEN ESCAPES THE OUTPUT 96 s = escape(s); 97 var ta = new Array(); 98 for (var i = 0; i < s.length; i++) 99 ta[i] = s.charCodeAt(i) + this.encN; 100 return "" + escape(eval("String.fromCharCode(" + ta + ")")) + this.encN; 101 }, 102 strPad: function (input, pad_length, pad_string, pad_type) { // Pad a string to a certain length with another string 103 var half = '', pad_to_go; 104 var str_pad_repeater = function (s, len) { 105 var collect = '', i; 106 while (collect.length < len) 107 collect += s; 108 collect = collect.substr(0, len); 109 return collect; 110 }; 111 112 if (pad_type != 'STR_PAD_LEFT' && pad_type != 'STR_PAD_RIGHT' && pad_type != 'STR_PAD_BOTH') { 113 pad_type = 'STR_PAD_RIGHT'; 114 } 115 if ((pad_to_go = pad_length - input.length) > 0) { 116 if (pad_type == 'STR_PAD_LEFT') { 117 input = str_pad_repeater(pad_string, pad_to_go) + input; 118 } else if (pad_type == 'STR_PAD_RIGHT') { 119 input = input + str_pad_repeater(pad_string, pad_to_go); 120 } else if (pad_type == 'STR_PAD_BOTH') { 121 half = str_pad_repeater(pad_string, Math.ceil(pad_to_go / 2)); 122 input = half + input + half; 123 input = input.substr(0, pad_length); 124 } 125 } 126 return input; 127 }, 128 replaceAll: function (find, replace, str) { 129 return str.replace(new RegExp(find, 'g'), replace); 130 }, 131 hex2rgba: function (hex, opacity) { 132 //extract the two hexadecimal digits for each color 133 var patt = /^#([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})$/; 134 var matches = patt.exec(hex); 135 136 //convert them to decimal 137 var r = parseInt(matches[1], 16); 138 var g = parseInt(matches[2], 16); 139 var b = parseInt(matches[3], 16); 140 141 //create rgba string 142 var rgba = "rgba(" + r + "," + g + "," + b + "," + opacity + ")"; 143 144 //return rgba colour 145 return rgba; 146 }, 147 removeProtocol: function (path) { 148 if (path) { 149 path = path.replace('http:', ''); 150 path = path.replace('https:', ''); 151 } 152 return path; 153 } 154}; 155 156var Translations = function () { 157 var _items = []; 158 159 var push = function (item) { 160 _items[item] = item; 161 }; 162 163 var get = function (item) { 164 return typeof _items[item] != 'undefined' ? _items[item] : item; 165 }; 166 167 return { 168 push: function (item) { 169 push(item); 170 }, 171 get: function (item) { 172 return get(item); 173 } 174 }; 175}(); 176 177if (typeof kvBs4InitForm == 'undefined') { 178 var kvBs4InitForm = function () { 179 return true 180 }; 181}
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.