1(function ($) { 2 $(document).ready(function () { 3 $(document).on("keydown", function (e) { 4 if (e.target.value) { 5 if ((e.metaKey || e.ctrlKey) && (String.fromCharCode(e.which).toLowerCase() === 'b')) { 6 $(e.target).val(convertToCyrill(e.target.value)); 7 } 8 if ((e.metaKey || e.ctrlKey) && (String.fromCharCode(e.which).toLowerCase() === 'l')) { 9 $(e.target).val(convertToLatin(e.target.value)); 10 } 11 } 12 }); 13 14 $('.toggle-password').click(function () { 15 var input = $($(this).data("toggle")); 16 $(this).toggleClass("glyphicon-eye-open glyphicon-eye-close"); 17 if (input.attr("type") === "password") { 18 input.attr("type", "text"); 19 } else { 20 input.attr("type", "password"); 21 } 22 }); 23 $('table.sticky-head').floatThead(); 24 $('.checkbo').addClass('checkbo-ready').checkBo(); 25 setFocusToSearch(); 26 setDeleteButton(); 27 setConfirmAction(); 28 //setTrashButton(); 29 $('input[type="checkbox"].icheckbox').iCheck({ 30 checkboxClass: 'icheckbox_flat-blue', 31 radioClass: 'iradio_flat-blue' 32 }); 33 34 $('input[type="radio"].icheckbox').iCheck({ 35 checkboxClass: 'icheckbox_flat-blue', 36 radioClass: 'iradio_flat-blue' 37 }); 38 $('.mobile-phone').formatter({ 39 'pattern': '+(998) {{99}} {{999}}-{{99}}-{{99}}', 40 'persistent': true 41 }); 42 43 $('.landline-phone').formatter({ 44 'pattern': '+(0) {{999}} {{999}}-{{99}}-{{99}}', 45 'persistent': true 46 }); 47 48 var $loading = $('#loader').hide(); 49 var $scrollTop = 0; 50 $(document) 51 .ajaxStart(function () { 52 //$scrollTop = $(document).scrollTop() 53 //$loading.show(); 54 }) 55 .ajaxStop(function () { 56 $loading.hide(); 57 //$(window).scrollTop($scrollTop) 58 $('input[type="checkbox"].icheckbox').iCheck({ 59 checkboxClass: 'icheckbox_flat-blue', 60 radioClass: 'iradio_flat-blue' 61 }); 62 $('.checkbo:not([class*="checkbo-ready"])').checkBo(); 63 }) 64 65 $('[data-toggle="tooltip"]').tooltip(); 66 }); 67 $(document).on('ready pjax:success', function () { 68 //setFocusToSearch(); 69 setDeleteButton(); 70 $('.selectable-row tr').on('click', function () { 71 //$(this).find('.checkbox input:first-child').click(); 72 }); 73 $('input[type="checkbox"].icheckbox').iCheck({ 74 checkboxClass: 'icheckbox_flat-blue', 75 radioClass: 'iradio_flat-blue' 76 }); 77 if (typeof $.fn.theiaStickySidebar === 'function') { 78 $('.sticky-sidebar').theiaStickySidebar({ 79 additionalMarginTop: 20 + parseInt($('.sticky-sidebar').data('padding')), 80 additionalMarginBottom: 20 81 }); 82 } 83 setSameHeight(); 84 $('table.sticky-head').floatThead(); 85 $('[data-toggle="tooltip"]').tooltip() 86 }); 87 $(document).on('expanded.pushMenu', function () { 88 Cookies.set('sm_menu', '0'); 89 }); 90 $(document).on('collapsed.pushMenu', function () { 91 Cookies.set('sm_menu', '1'); 92 }); 93 if (typeof $.fn.theiaStickySidebar === 'function') { 94 $('.sticky-sidebar').theiaStickySidebar({ 95 additionalMarginTop: 20 + parseInt($('.sticky-sidebar').data('padding')), 96 additionalMarginBottom: 20 97 }); 98 } 99 setSameHeight(); 100})(jQuery); 101 102function setSameHeight() { 103 if (document.width < 762) return; 104 105 $('.sh-parent').each(function () { 106 var items = $(this).find('.sh'); 107 var max = 0; 108 items.each(function () { 109 if (max < $(this).height()) { 110 max = $(this).height(); 111 } 112 }); 113 $(this).find('.sh').height(max); 114 }) 115} 116 117function setDeleteButton() { 118 $('.btn-delete').on('click', function () { 119 let m = $(this).data('message'); 120 if (confirm(m !== undefined && m.length > 0 ? $(this).data('message') : globalMessages.deleteItem)) { 121 if ($(this).attr('action').length > 0) { 122 document.location.href = $(this).attr('action'); 123 } else { 124 return true; 125 } 126 } 127 return false;
128 }); 129} 130 131function sortTable(elementContainer, link) { 132 $(elementContainer).sortable({ 133 handle: '.sort_handle', 134 update: function (event, ui) { 135 var checked = []; 136 137 $(elementContainer + " tr").each(function (index, element) { 138 checked.push($(element).data('key')); 139 }); 140 141 if (checked.length > 0) { 142 var data = {}; 143 data.data = checked; 144 data._csrf = $('input[name="_csrf"]').val(); 145 $.post(link, data, function () { 146 }) 147 } 148 } 149 }); 150} 151 152function showErrorToast(message) { 153 toastr.error(message, null, { 154 "closeButton": false, 155 "debug": false, 156 "newestOnTop": false, 157 "progressBar": false, 158 "positionClass": "toast-bottom-right", 159 "preventDuplicates": false, 160 "onclick": null, 161 "showDuration": "300", 162 "hideDuration": "1000", 163 "timeOut": "100000", 164 "extendedTimeOut": "1000", 165 "showEasing": "swing", 166 "hideEasing": "linear", 167 "showMethod": "fadeIn", 168 "hideMethod": "fadeOut" 169 }); 170} 171 172function showSuccessToast(message) { 173 toastr.success(message, null, { 174 "closeButton": false, 175 "debug": false, 176 "newestOnTop": false, 177 "progressBar": false, 178 "positionClass": "toast-bottom-right", 179 "preventDuplicates": false, 180 "onclick": null, 181 "showDuration": "300", 182 "hideDuration": "1000", 183 "timeOut": "100000", 184 "extendedTimeOut": "1000", 185 "showEasing": "swing", 186 "hideEasing": "linear", 187 "showMethod": "fadeIn", 188 "hideMethod": "fadeOut" 189 }); 190} 191 192function showInfoToast(message) { 193 toastr.info(message, null, { 194 "closeButton": false, 195 "debug": false, 196 "newestOnTop": false, 197 "progressBar": false, 198 "positionClass": "toast-bottom-right", 199 "preventDuplicates": false, 200 "onclick": null, 201 "showDuration": "300", 202 "hideDuration": "1000", 203 "timeOut": "100000", 204 "extendedTimeOut": "1000", 205 "showEasing": "swing", 206 "hideEasing": "linear", 207 "showMethod": "fadeIn", 208 "hideMethod": "fadeOut" 209 }); 210} 211 212function setTrashButton() { 213 $('.btn-trash').on('click', function () { 214 if (confirm('Are you sure move to trash?')) { 215 if ($(this).attr('action').length > 0) { 216 document.location.href = $(this).attr('action'); 217 } else { 218 return true; 219 } 220 } 221 return false; 222 }); 223} 224 225function setConfirmAction() { 226 $('.btn-confirm').on('click', function () { 227 if (confirm($(this).data('message') !== undefined ? $(this).data('message') : 'Are you sure do this action?')) { 228 if ($(this).data('action') && $(this).data('action').length > 0) { 229 document.location.href = $(this).data('action'); 230 } else { 231 return true; 232 } 233 } 234 return false; 235 }); 236} 237 238function setFocusToSearch() { 239 var input = $("input[name*='[search]'][type='text']"); 240 if (input == undefined) { 241 input = $('#data-grid-filters input[type=\"text\"]:first'); 242 } 243 if (input != undefined && input.length > 0) { 244 input.focus().delay(1000).val(input.val()); 245 document.getElementById(input.attr('id')).setSelectionRange(100, 100); 246 } 247} 248 249function convertToSlug(Text) { 250 Text = cyrlat(Text.toLowerCase()); 251 return Text 252 .replace(/[^\w _\-]+/g, '') 253 .replace(/ +/g, '-'); 254} 255 256function convertToCyrill(Text) { 257 Text = latcyr(Text); 258 return Text; 259} 260 261function latcyr(text) { 262 text = text.replace(/Yu/g, "Ю"); 263 text = text.replace(/yu/g, "Ñ"); 264 text = text.replace(/Ya/g, "Я"); 265 text = text.replace(/ya/g, "Ñ"); 266 text = text.replace(/Ch/g, "Ч"); 267 text = text.replace(/ch/g, "Ñ"); 268 text = text.replace(/Sh/g, "Ш"); 269 text = text.replace(/sh/g, "Ñ"); 270 text = text.replace(/Sh/g, "Щ"); 271 text = text.replace(/sh/g, "Ñ"); 272 text = text.replace(/Yo/g, "Ð"); 273 text = text.replace(/yo/g, "Ñ"); 274 text = text.replace(/G`/g, "Ò"); 275 text = text.replace(/g`/g, "Ò"); 276 text = text.replace(/G'/g, "Ò"); 277 text = text.replace(/g'/g, "Ò"); 278 text = text.replace(/O`/g, "Ð"); 279 text = text.replace(/o`/g, "Ñ"); 280 text = text.replace(/O'/g, "Ð"); 281 text = text.replace(/o'/g, "Ñ"); 282 text = text.replace(/A/g, "Ð"); 283 text = text.replace(/a/g, "а"); 284 text = text.replace(/B/g, "Ð"); 285 text = text.replace(/b/g, "б"); 286 text = text.replace(/V/g, "Ð"); 287 text = text.replace(/v/g, "в"); 288 text = text.replace(/G/g, "Ð"); 289 text = text.replace(/g/g, "г"); 290 text = text.replace(/D/g, "Ð"); 291 text = text.replace(/d/g, "д"); 292 text = text.replace(/E/g, "Ð"); 293 text = text.replace(/e/g, "е"); 294 text = text.replace(/J/g, "Ð"); 295 text = text.replace(/j/g, "ж"); 296 text = text.replace(/Z/g, "Ð"); 297 text = text.replace(/z/g, "з"); 298 text = text.replace(/I/g, "Ð"); 299 text = text.replace(/i/g, "и"); 300 text = text.replace(/Y/g, "Ð"); 301 text = text.replace(/y/g, "й"); 302 text = text.replace(/K/g, "Ð"); 303 text = text.replace(/k/g, "к"); 304 text = text.replace(/L/g, "Ð"); 305 text = text.replace(/l/g, "л"); 306 text = text.replace(/M/g, "Ð"); 307 text = text.replace(/m/g, "м"); 308 text = text.replace(/N/g, "Ð"); 309 text = text.replace(/n/g, "н"); 310 text = text.replace(/O/g, "Ð"); 311 text = text.replace(/o/g, "о"); 312 text = text.replace(/P/g, "Ð"); 313 text = text.replace(/p/g, "п"); 314 text = text.replace(/R/g, "Ð "); 315 text = text.replace(/r/g, "Ñ"); 316 text = text.replace(/S/g, "С"); 317 text = text.replace(/s/g, "Ñ"); 318 text = text.replace(/T/g, "Т"); 319 text = text.replace(/t/g, "Ñ"); 320 text = text.replace(/U/g, "У"); 321 text = text.replace(/u/g, "Ñ"); 322 text = text.replace(/F/g, "Ф"); 323 text = text.replace(/f/g, "Ñ"); 324 text = text.replace(/X/g, "Ð¥"); 325 text = text.replace(/x/g, "Ñ "); 326 text = text.replace(/C/g, "Ц"); 327 text = text.replace(/c/g, "Ñ"); 328 text = text.replace(/E/g, "Ð"); 329 text = text.replace(/e/g, "Ñ"); 330 text = text.replace(/H/g, "Ò²"); 331 text = text.replace(/h/g, "Ò³"); 332 text = text.replace(/Q/g, "Ò"); 333 text = text.replace(/q/g, "Ò"); 334 text = text.replace(/[`']/g, "Ñ"); 335 336 return text; 337} 338 339function showErrorMessage(message) { 340 toastr.error(message, '', { 341 "closeButton": false, 342 "debug": false, 343 "newestOnTop": false, 344 "progressBar": false, 345 "positionClass": "toast-bottom-right", 346 "preventDuplicates": false, 347 "onclick": null, 348 "showDuration": "300", 349 "hideDuration": "1000", 350 "timeOut": "10000", 351 "extendedTimeOut": "1000", 352 "showEasing": "swing", 353 "hideEasing": "linear", 354 "showMethod": "fadeIn", 355 "hideMethod": "fadeOut" 356 }); 357} 358 359function showSuccessMessage(message) { 360 toastr.success(message, '', { 361 "closeButton": false, 362 "debug": false, 363 "newestOnTop": false, 364 "progressBar": false, 365 "positionClass": "toast-bottom-right", 366 "preventDuplicates": false, 367 "onclick": null, 368 "showDuration": "300", 369 "hideDuration": "1000", 370 "timeOut": "10000", 371 "extendedTimeOut": "1000", 372 "showEasing": "swing", 373 "hideEasing": "linear", 374 "showMethod": "fadeIn", 375 "hideMethod": "fadeOut" 376 }); 377} 378 379function convertToLatin(Text) { 380 Text = cyrlat(Text); 381 return Text; 382} 383 384function cyrlat(text) { 385 text = text.replace(/Ю/g, "Yu"); 386 text = text.replace(/Ñ/g, "yu"); 387 text = text.replace(/Ñе/g, "yuye"); 388 text = text.replace(/Я/g, "Ya"); 389 text = text.replace(/Ñ/g, "ya"); 390 text = text.replace(/Ч/g, "Ch"); 391 text = text.replace(/Ñ/g, "ch"); 392 text = text.replace(/Ш/g, "Sh"); 393 text = text.replace(/Ñ/g, "sh"); 394 text = text.replace(/Щ/g, "Sh"); 395 text = text.replace(/Ñ/g, "sh"); 396 text = text.replace(/Ð/g, "Yo"); 397 text = text.replace(/Ñе/g, "yoye"); 398 text = text.replace(/Ñ/g, "yo"); 399 text = text.replace(/Ò/g, "G'"); 400 text = text.replace(/Ò/g, "g'"); 401 text = text.replace(/Ð/g, "O'"); 402 text = text.replace(/Ñ/g, "o'"); 403 text = text.replace(/Ð/g, "A"); 404 text = text.replace(/а/g, "a"); 405 text = text.replace(/ае/g, "aye"); 406 text = text.replace(/Ð/g, "B"); 407 text = text.replace(/б/g, "b"); 408 text = text.replace(/Ð/g, "V"); 409 text = text.replace(/в/g, "v"); 410 text = text.replace(/Ð/g, "G"); 411 text = text.replace(/г/g, "g"); 412 text = text.replace(/Ð/g, "D"); 413 text = text.replace(/д/g, "d"); 414 text = text.replace(/Ð/g, "E"); 415 text = text.replace(/е/g, "e"); 416 text = text.replace(/Ð/g, "J"); 417 text = text.replace(/ж/g, "j"); 418 text = text.replace(/Ð/g, "Z"); 419 text = text.replace(/з/g, "z"); 420 text = text.replace(/Ð/g, "I"); 421 text = text.replace(/и/g, "i"); 422 text = text.replace(/ие/g, "iye"); 423 text = text.replace(/Ð/g, "Y"); 424 text = text.replace(/й/g, "y"); 425 text = text.replace(/Ð/g, "K"); 426 text = text.replace(/к/g, "k"); 427 text = text.replace(/Ð/g, "L"); 428 text = text.replace(/л/g, "l"); 429 text = text.replace(/Ð/g, "M"); 430 text = text.replace(/м/g, "m"); 431 text = text.replace(/Ð/g, "N"); 432 text = text.replace(/н/g, "n"); 433 text = text.replace(/Ð/g, "O"); 434 text = text.replace(/о/g, "o"); 435 text = text.replace(/ое/g, "oye"); 436 text = text.replace(/Ð/g, "P"); 437 text = text.replace(/п/g, "p"); 438 text = text.replace(/Ð /g, "R"); 439 text = text.replace(/Ñ/g, "r"); 440 text = text.replace(/С/g, "S"); 441 text = text.replace(/Ñ/g, "s"); 442 text = text.replace(/Т/g, "T"); 443 text = text.replace(/Ñ/g, "t"); 444 text = text.replace(/У/g, "U"); 445 text = text.replace(/Ñ/g, "u"); 446 text = text.replace(/Ñе/g, "uye"); 447 text = text.replace(/Ф/g, "F"); 448 text = text.replace(/Ñ/g, "f"); 449 text = text.replace(/Ð¥/g, "X"); 450 text = text.replace(/Ñ /g, "x"); 451 text = text.replace(/Ц/g, "C"); 452 text = text.replace(/Ñ/g, "c"); 453 text = text.replace(/Ð/g, "E"); 454 text = text.replace(/Ñ/g, "e"); 455 text = text.replace(/Ò²/g, "H"); 456 text = text.replace(/Ò³/g, "h"); 457 text = text.replace(/Ò/g, "Q"); 458 text = text.replace(/Ò/g, "q"); 459 460 return text; 461} 462 463var decodeEntities = (function () { 464 // this prevents any overhead from creating the object each time 465 var element = document.createElement('div'); 466 467 function decodeHTMLEntities(str) { 468 if (str && typeof str === 'string') { 469 // strip script/html tags 470 str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, ''); 471 str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, ''); 472 element.innerHTML = str; 473 str = element.textContent; 474 element.textContent = ''; 475 } 476 477 return str; 478 } 479 480 return decodeHTMLEntities; 481})();
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.