1/** 2 * NukeViet Content Management System 3 * @version 4.x 4 * @author VINADES.,JSC <[email protected]> 5 * @copyright (C) 2009-2021 VINADES.,JSC. All rights reserved 6 * @license GNU/GPL version 2 or any later version 7 * @see https://github.com/nukeviet The NukeViet CMS GitHub project 8 */ 9 10var myTimerPage = "", 11 myTimersecField = "", 12 gEInterval, 13 tip_active = !1, 14 ftip_active = !1, 15 tip_autoclose = !0, 16 ftip_autoclose = !0, 17 winX = 0, 18 winY = 0, 19 oldWinX = 0, 20 oldWinY = 0, 21 cRangeX = 0, 22 cRangeY = 0, 23 docX = 0, 24 docY = 0, 25 brcb = $('.breadcrumbs-wrap'), 26 siteMenu = $("#menu-site-default"), 27 NVIsMobileMenu = false, 28 reCapIDs = []; 29 30function winResize() { 31 oldWinX = winX; 32 oldWinY = winY; 33 winX = $(window).width(); 34 winY = $(window).height(); 35 docX = $(document).width(); 36 docY = $(document).height(); 37 cRangeX = Math.abs(winX - oldWinX); 38 cRangeY = Math.abs(winY - oldWinY); 39} 40 41function fix_banner_center() { 42 var a = Math.round((winX - 1330) / 2); 43 0 <= a ? ($("div.fix_banner_left").css("left", a + "px"), $("div.fix_banner_right").css("right", a + "px"), a = Math.round((winY - $("div.fix_banner_left").height()) / 2), 0 >= a && (a = 0), $("div.fix_banner_left").css("top", a + "px"), a = Math.round((winY - $("div.fix_banner_right").height()) / 2), 0 >= a && (a = 0), $("div.fix_banner_right").css("top", a + "px"), $("div.fix_banner_left").show(), $("div.fix_banner_right").show()) : ($("div.fix_banner_left").hide(), $("div.fix_banner_right").hide()) 44} 45 46function timeoutsesscancel() { 47 $("#timeoutsess").slideUp("slow", function() { 48 clearInterval(myTimersecField); 49 myTimerPage = setTimeout(function() { 50 timeoutsessrun() 51 }, nv_check_pass_mstime) 52 }) 53} 54 55function timeoutsessrun() { 56 clearInterval(myTimerPage); 57 $("#secField").text("60"); 58 $("#timeoutsess").show(); 59 var b = (new Date).getTime(); 60 myTimersecField = setInterval(function() { 61 var a = (new Date).getTime(); 62 a = 60 - Math.round((a - b) / 1E3); 63 0 <= a ? $("#secField").text(a) : -3 > a && (clearInterval(myTimersecField), $(window).unbind(), $.ajax({ 64 type: "POST", 65 cache: !1, 66 url: nv_base_siteurl + "index.php?" + nv_lang_variable + "=" + nv_lang_data + "&" + nv_name_variable + "=users&" + nv_fc_variable + "=logout", 67 data: "nv_ajax_login=1&system=1" 68 }).done(function() { 69 location.reload(); 70 })); 71 }, 1E3); 72} 73 74// locationReplace 75function locationReplace(url) { 76 var uri = window.location.href.substr(window.location.protocol.length + window.location.hostname.length + 2); 77 if (url != uri && history.pushState) { 78 history.pushState(null, null, url) 79 } 80} 81 82function checkWidthMenu() { 83 NVIsMobileMenu = (theme_responsive && "absolute" == $("#menusite").css("position")); 84 NVIsMobileMenu ? ( 85 $("li.dropdown ul", siteMenu).removeClass("dropdown-menu").addClass("dropdown-submenu"), 86 $("li.dropdown a", siteMenu).addClass("dropdown-mobile"), 87 $("ul li a.dropdown-toggle", siteMenu).addClass("dropdown-mobile"), 88 $("li.dropdown ul li a", siteMenu).removeClass("dropdown-mobile") 89 ) : ( 90 $("li.dropdown ul", siteMenu).addClass("dropdown-menu").removeClass("dropdown-submenu"), 91 $("li.dropdown a", siteMenu).removeClass("dropdown-mobile"), 92 $("li.dropdown ul li a", siteMenu).removeClass("dropdown-mobile"), 93 $("ul li a.dropdown-toggle", siteMenu).removeClass("dropdown-mobile") 94 ) 95} 96 97function checkAll(a) { 98 $(".checkAll", a).is(":checked") ? $(".checkSingle", a).not(":disabled").each(function() { 99 $(this).prop("checked", !0) 100 }) : $(".checkSingle", a).not(":disabled").each(function() { 101 $(this).prop("checked", !1) 102 }); 103 return !1 104} 105 106function checkSingle(a) { 107 var b = 0, 108 c = 0; 109 $(".checkSingle", a).each(function() { 110 $(this).is(":checked") ? b++ : c++ 111 }); 112 0 != b && 0 == c ? $(".checkAll", a).prop("checked", !0) : $(".checkAll", a).prop("checked", !1); 113 return !1 114} 115 116function tipHide() { 117 $("[data-toggle=tip]").attr("data-click", "y").removeClass("active"); 118 $("#tip").hide(); 119 tip_active = !1; 120 tipAutoClose(!0) 121} 122 123function ftipHide() { 124 $("[data-toggle=ftip]").attr("data-click", "y").removeClass("active"); 125 $("#ftip").hide(); 126 ftip_active = !1; 127 ftipAutoClose(!0) 128} 129 130function tipAutoClose(a) { 131 !0 != a && (a = !1); 132 tip_autoclose = a 133} 134 135function ftipAutoClose(a) { 136 !0 != a && (a = !1); 137 ftip_autoclose = a 138} 139 140function tipShow(a, b, callback) { 141 tip_active && tipHide(); 142 ftip_active && ftipHide(); 143 $("[data-toggle=tip]").removeClass("active"); 144 $(a).attr("data-click", "n").addClass("active"); 145 if (typeof callback != "undefined") { 146 $("#tip").attr("data-content", b).show("fast", function() {
147 if (callback == "recaptchareset") { 148 if ($('[data-toggle=recaptcha]', this).length) { 149 reCaptcha2Recreate(this); 150 "undefined" != typeof grecaptcha ? reCaptcha2OnLoad() : reCaptcha2ApiLoad() 151 } else if ($("[data-recaptcha3]", this).length) { 152 "undefined" != typeof grecaptcha ? reCaptcha3OnLoad() : reCaptcha3ApiLoad() 153 } 154 } else if (typeof window[callback] === "function") { 155 window[callback]() 156 } 157 }); 158 } else { 159 $("#tip").attr("data-content", b).show("fast"); 160 } 161 tip_active = 1; 162} 163 164function ftipShow(a, b, callback) { 165 if ($(a).is(".qrcode") && "no" == $(a).attr("data-load")) { 166 return qrcodeLoad(a), !1; 167 } 168 tip_active && tipHide(); 169 ftip_active && ftipHide(); 170 $("[data-toggle=ftip]").removeClass("active"); 171 $(a).attr("data-click", "n").addClass("active"); 172 if (typeof callback != "undefined") { 173 $("#ftip").attr("data-content", b).show("fast", function() { 174 if (callback == "recaptchareset") { 175 if ($('[data-toggle=recaptcha]', this).length) { 176 reCaptcha2Recreate(this); 177 "undefined" != typeof grecaptcha ? reCaptcha2OnLoad() : reCaptcha2ApiLoad() 178 } else if ($("[data-recaptcha3]", this).length) { 179 "undefined" != typeof grecaptcha ? reCaptcha3OnLoad() : reCaptcha3ApiLoad() 180 } 181 } else if (typeof window[callback] === "function") { 182 window[callback]() 183 } 184 }); 185 } else { 186 $("#ftip").attr("data-content", b).show("fast"); 187 } 188 ftip_active = 1; 189}; 190 191function openID_load(a) { 192 tip_active && tipHide(); 193 ftip_active && ftipHide(); 194 nv_open_browse($(a).attr("href"), "NVOPID", 550, 500, "resizable=no,scrollbars=1,toolbar=no,location=no,titlebar=no,menubar=0,location=no,status=no"); 195 return !1 196} 197 198function openID_result() { 199 var resElement = $("#openidResult"); 200 resElement.fadeIn(); 201 setTimeout(function() { 202 if (resElement.data('redirect') != '') { 203 window.location.href = resElement.data('redirect'); 204 } else if (resElement.data('result') == 'success') { 205 location.reload(); 206 } else { 207 resElement.hide(0).html('').data('result', '').data('redirect', ''); 208 } 209 }, 5000); 210} 211 212// QR-code 213function qrcodeLoad(a) { 214 var b = new Image, 215 c = $(a).data("img"); 216 $(b).on('load', function() { 217 $(c).attr("src", b.src); 218 $(a).attr("data-load", "yes").click() 219 }); 220 b.src = nv_base_siteurl + "index.php?second=qr&u=" + encodeURIComponent($(a).data("url")) 221}; 222 223// Switch tab 224function switchTab(a) { 225 if ($(a).is(".current")) { 226 return !1; 227 } 228 var b = $(a).data("switch").split(/\s*,\s*/), 229 c = $(a).data("obj"); 230 $(c + " [data-switch]").removeClass("current"); 231 $(a).addClass("current"); 232 $(c + " " + b[0]).removeClass("hidden"); 233 for (i = 1; i < b.length; i++) { 234 $(c + " " + b[i]).addClass("hidden") 235 } 236}; 237 238//Form Ajax-login 239function loginForm(redirect) { 240 if (nv_is_user == 1) { 241 return !1; 242 } 243 if (redirect != '') { 244 redirect = '&nv_redirect=' + redirect; 245 } 246 $.ajax({ 247 type: 'POST', 248 url: nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=users&' + nv_fc_variable + '=login' + redirect, 249 cache: !1, 250 data: '&nv_ajax=1', 251 dataType: "html" 252 }).done(function(a) { 253 modalShow('', a, 'recaptchareset') 254 }); 255 return !1 256} 257 258 259// ModalShow 260function modalShow(a, b, callback) { 261 "" != a && 'undefined' != typeof a && $("#sitemodal .modal-content").prepend('<div class="modal-header"><h2 class="modal-title">' + a + '</h2></div>'); 262 $("#sitemodal").find(".modal-title").html(a); 263 $("#sitemodal").find(".modal-body").html(b); 264 var scrollTop = false; 265 if (typeof callback != "undefined") { 266 if (callback == "recaptchareset") { 267 scrollTop = $(window).scrollTop(); 268 $('#sitemodal').on('show.bs.modal', function() { 269 if ($('[data-toggle=recaptcha]', this).length) { 270 reCaptcha2Recreate(this); 271 "undefined" != typeof grecaptcha ? reCaptcha2OnLoad() : reCaptcha2ApiLoad() 272 } else if ($("[data-recaptcha3]", this).length) { 273 "undefined" != typeof grecaptcha ? reCaptcha3OnLoad() : reCaptcha3ApiLoad() 274 } 275 }); 276 } 277 } 278 if (scrollTop) { 279 $("html,body").animate({ 280 scrollTop: 0 281 }, 200, function() { 282 $("#sitemodal").modal({ 283 backdrop: "static" 284 }); 285 }); 286 $('#sitemodal').on('hide.bs.modal', function() { 287 $("html,body").animate({ 288 scrollTop: scrollTop 289 }, 200); 290 }); 291 } else { 292 $("#sitemodal").modal({ 293 backdrop: "static" 294 }); 295 } 296 $('#sitemodal').on('hidden.bs.modal', function() {
297 $("#sitemodal .modal-content").find(".modal-header").remove(); 298 }); 299} 300 301function modalShowByObj(a, callback) { 302 var b = $(a).attr("title"), 303 c = $(a).html(); 304 modalShow(b, c, callback) 305} 306 307// Breadcrumbs 308function nvbreadcrumbs() { 309 if (brcb.length) { 310 var g = $(".display", brcb).innerWidth() - 40, 311 b = $(".breadcrumbs", brcb), 312 h = $(".temp-breadcrumbs", brcb), 313 e = $(".subs-breadcrumbs", brcb), 314 f = $(".show-subs-breadcrumbs", brcb), 315 a = [], 316 c = !1; 317 h.find("a").each(function() { 318 a.push([$(this).attr("title"), $(this).attr("href")]); 319 }); 320 b.html(""); 321 e.html(""); 322 for (i = a.length - 1; 0 <= i; i--) { 323 if (!c) { 324 var d = 0; 325 b.prepend('<li id="brcr_' + i + '"><a href="' + a[i][1] + '"><span>' + a[i][0] + "</span></a></li>"); 326 b.find("li").each(function() { 327 d += $(this).outerWidth(!0); 328 }); 329 d > g && (c = !0, $("#brcr_" + i, b).remove()); 330 } 331 c && e.append('<li><a href="' + a[i][1] + '"><span><em class="fa fa-long-arrow-up"></em> ' + a[i][0] + "</span></a></li>"); 332 } 333 c ? f.removeClass("hidden") : f.addClass("hidden"); 334 } 335} 336 337function showSubBreadcrumbs(a, b) { 338 b.preventDefault(); 339 b.stopPropagation(); 340 var c = $(".subs-breadcrumbs", brcb); 341 $("em", a).is(".fa-angle-right") ? $("em", a).removeClass("fa-angle-right").addClass("fa-angle-down") : $("em", a).removeClass("fa-angle-down").addClass("fa-angle-right"); 342 c.toggleClass("open"); 343 $(document).on("click", function() { 344 $("em", a).is(".fa-angle-down") && ($("em", a).removeClass("fa-angle-down").addClass("fa-angle-right"), c.removeClass("open")); 345 }); 346} 347 348// Hide Cookie Notice Popup 349function cookie_notice_hide() { 350 nv_setCookie(nv_cookie_prefix + '_cn', '1', 365); 351 $(".cookie-notice").hide() 352} 353 354// Change Captcha 355function change_captcha(a) { 356 if ($('[data-toggle=recaptcha]').length) { 357 "undefined" != typeof grecaptcha ? reCaptcha2OnLoad() : reCaptcha2ApiLoad() 358 } else if ($("[data-recaptcha3]").length) { 359 "undefined" != typeof grecaptcha ? reCaptcha3OnLoad() : reCaptcha3ApiLoad() 360 } 361 362 if ($("img.captchaImg").length) { 363 $("img.captchaImg").attr("src", nv_base_siteurl + "index.php?scaptcha=captcha&nocache=" + nv_randomPassword(10)); 364 "undefined" != typeof a && "" != a && $(a).val(""); 365 } 366 return !1 367} 368 369function isRecaptchaCheck() { 370 if (nv_recaptcha_sitekey == '') return 0; 371 return (nv_recaptcha_ver == 2 || nv_recaptcha_ver == 3) ? nv_recaptcha_ver : 0 372} 373 374function reCaptcha2Recreate(obj) { 375 $('[data-toggle=recaptcha]', $(obj)).each(function() { 376 var callFunc = $(this).data('callback'), 377 pnum = $(this).data('pnum'), 378 btnselector = $(this).data('btnselector'), 379 size = ($(this).data('size') && $(this).data('size') == 'compact') ? 'compact' : ''; 380 var id = "recaptcha" + (new Date().getTime()) + nv_randomPassword(8); 381 if (callFunc) { 382 $(this).replaceWith('<div id="' + id + '" data-toggle="recaptcha" data-callback="' + callFunc + '" data-size="' + size + '"></div>'); 383 } else { 384 $(this).replaceWith('<div id="' + id + '" data-toggle="recaptcha" data-pnum="' + pnum + '" data-btnselector="' + btnselector + '" data-size="' + size + '"></div>') 385 } 386 }) 387} 388 389var reCaptcha2OnLoad = function() { 390 $('[data-toggle=recaptcha]').each(function() { 391 var id = $(this).attr('id'), 392 callFunc = $(this).data('callback'), 393 size = ($(this).data('size') && $(this).data('size') == 'compact') ? 'compact' : ''; 394 395 if (typeof window[callFunc] === 'function') { 396 if (typeof reCapIDs[id] === "undefined") { 397 reCapIDs[id] = grecaptcha.render(id, { 398 'sitekey': nv_recaptcha_sitekey, 399 'type': nv_recaptcha_type, 400 'size': size, 401 'callback': callFunc 402 }) 403 } else { 404 grecaptcha.reset(reCapIDs[id]) 405 } 406 } else { 407 var pnum = parseInt($(this).data('pnum')), 408 btnselector = $(this).data('btnselector'), 409 btn = $('#' + id), 410 k = 1; 411 412 for (k; k <= pnum; k++) { 413 btn = btn.parent(); 414 } 415 btn = $(btnselector, btn); 416 if (btn.length) { 417 btn.prop('disabled', true); 418 } 419 420 if (typeof reCapIDs[id] === "undefined") { 421 reCapIDs[id] = grecaptcha.render(id, { 422 'sitekey': nv_recaptcha_sitekey, 423 'type': nv_recaptcha_type, 424 'size': size, 425 'callback': function() { 426 reCaptcha2Callback(id, false) 427 }, 428 'expired-callback': function() { 429 reCaptcha2Callback(id, true) 430 }, 431 'error-callback': function() { 432 reCaptcha2Callback(id, true) 433 } 434 }) 435 } else { 436 grecaptcha.reset(reCapIDs[id]) 437 } 438 } 439 }) 440} 441 442var reCaptcha2Callback = function(id, val) { 443 var btn = $('#' + id), 444 pnum = parseInt(btn.data('pnum')), 445 btnselector = btn.data('btnselector'), 446 k = 1; 447 for (k; k <= pnum; k++) { 448 btn = btn.parent(); 449 } 450 btn = $(btnselector, btn); 451 if (btn.length) { 452 btn.prop('disabled', val); 453 } 454} 455 456// reCaptcha v2 load 457var reCaptcha2ApiLoad = function() { 458 if (isRecaptchaCheck() == 2) { 459 var a = document.createElement("script"); 460 a.type = "text/javascript"; 461 a.src = "//www.google.com/recaptcha/api.js?hl=" + nv_lang_interface + "&onload=reCaptcha2OnLoad&render=explicit"; 462 document.getElementsByTagName("head")[0].appendChild(a) 463 } 464} 465 466// reCaptcha v3: reCaptcha3OnLoad 467var reCaptcha3OnLoad = function() { 468 grecaptcha.ready(function() { 469 $("[data-recaptcha3]").length && (clearInterval(gEInterval), grecaptcha.execute(nv_recaptcha_sitekey, { 470 action: "formSubmit" 471 }).then(function(a) { 472 $("[data-recaptcha3]").each(function() { 473 if ($("[name=g-recaptcha-response]", this).length) $("[name=g-recaptcha-response]", this).val(a); 474 else { 475 var b = $('<input type="hidden" name="g-recaptcha-response" value="' + a + '"/>'); 476 $(this).append(b) 477 } 478 }) 479 }), gEInterval = setTimeout(function() { 480 reCaptcha3OnLoad() 481 }, 12E4)) 482 }) 483} 484 485// reCaptcha v3 API load 486var reCaptcha3ApiLoad = function() { 487 if (isRecaptchaCheck() == 3) { 488 var a = document.createElement("script"); 489 a.type = "text/javascript"; 490 a.src = "//www.google.com/recaptcha/api.js?render=" + nv_recaptcha_sitekey + "&onload=reCaptcha3OnLoad"; 491 document.getElementsByTagName("head")[0].appendChild(a) 492 } 493} 494 495$(function() { 496 winResize(); 497 fix_banner_center(); 498 499 // Modify all empty link 500 $('a[href="#"], a[href=""]').on("click", function(e) { 501 e.preventDefault(); 502 }); 503 504 // Add rel="noopener noreferrer nofollow" to all external links 505 $('a[href^="http"]').not('a[href*="' + location.hostname + '"]').not('[rel*=dofollow
505]').attr({ 506 target: "_blank", 507 rel: "noopener noreferrer nofollow" 508 }); 509 510 // Smooth scroll to top 511 $("#totop,#bttop,.bttop").click(function() { 512 $("html,body").animate({ 513 scrollTop: 0 514 }, 800); 515 return !1 516 }); 517 518 //Search form 519 $(".headerSearch button").on("click", function() { 520 if ("n" == $(this).attr("data-click")) { 521 return !1; 522 } 523 $(this).attr("data-click", "n"); 524 var a = $(".headerSearch input"), 525 c = a.attr("maxlength"), 526 b = strip_tags(a.val()), 527 d = $(this).attr("data-minlength"); 528 a.parent().removeClass("has-error"); 529 "" == b || b.length < d || b.length > c ? (a.parent().addClass("has-error"), a.val(b).focus(), $(this).attr("data-click", "y")) : window.location.href = $(this).attr("data-url") + rawurlencode(b); 530 return !1 531 }); 532 $(".headerSearch input").on("keypress", function(a) { 533 13 != a.which || a.shiftKey || (a.preventDefault(), $(".headerSearch button").trigger("click")) 534 }); 535 536 // Show messger timeout login users 537 nv_is_user && (myTimerPage = setTimeout(function() { 538 timeoutsessrun() 539 }, nv_check_pass_mstime)); 540 541 // Show confirm message on leave, reload page 542 $("form.confirm-reload").change(function() { 543 $(window).bind("beforeunload", function() { 544 return nv_msgbeforeunload 545 }) 546 }); 547 548 // Tooltip 549 $(".form-tooltip").tooltip({ 550 selector: "[data-toggle=tooltip]", 551 container: "body" 552 }); 553 $("[data-rel='tooltip'][data-content!='']").removeAttr("title").tooltip({ 554 container: "body", 555 html: !0, 556 title: function() { 557 return ("" == $(this).data("img") || !$(this).data("img") ? "" : '<img class="img-thumbnail pull-left" src="' + $(this).data("img") + '" width="90" />') + $(this).data("content") 558 } 559 }); 560 561 // Change site lang 562 $(".nv_change_site_lang").change(function() { 563 document.location = $(this).val() 564 }); 565 566 // Xá» lý menu bootstrap nếu có 567 if (siteMenu.length) { 568 $(".dropdown .caret", siteMenu).on('click', function(e) { 569 if (NVIsMobileMenu) { 570 e.preventDefault(); 571 var cMenu = $(this).parent().parent(); 572 var cMenuOpen = cMenu.is('.open'); 573 $(".dropdown", siteMenu).removeClass("open"); 574 if (!cMenuOpen) { 575 cMenu.addClass("open"); 576 } 577 } 578 }); 579 580 $(".dropdown", siteMenu).hover(function() { 581 if (!NVIsMobileMenu) { 582 $(this).addClass("open"); 583 } 584 }, function() { 585 if (!NVIsMobileMenu) { 586 $(this).removeClass("open"); 587 } 588 }); 589 590 $("a", siteMenu).hover(function() { 591 $(this).attr("rel", $(this).attr("title")); 592 $(this).removeAttr("title") 593 }, function() { 594 $(this).attr("title", $(this).attr("rel")); 595 $(this).removeAttr("rel") 596 }); 597 } 598 599 //Tip + Ftip 600 $("[data-toggle=collapse]").click(function() { 601 tipHide(); 602 ftipHide(); 603 }); 604 605 $(document).on("keydown", function(a) { 606 27 === a.keyCode && (tip_active && tip_autoclose && tipHide(), ftip_active && ftip_autoclose && ftipHide()) 607 }); 608 609 $(document).on("click", function() { 610 tip_active && tip_autoclose && tipHide(); 611 ftip_active && ftip_autoclose && ftipHide() 612 }); 613 614 $("#tip, #ftip").on("click", function(a) { 615 a.stopPropagation() 616 }); 617 618 $("[data-toggle=tip], [data-toggle=ftip]").click(function() { 619 var a = $(this).attr("data-target"), 620 d = $(a).html(), 621 b = $(this).attr("data-toggle"), 622 c = "tip" == b ? $("#tip").attr("data-content") : $("#ftip").attr("data-content"); 623 var callback = $(this).data("callback"); 624 a != c ? ("" != c && $('[data-target="' + c + '"]').attr("data-click", "y"), "tip" == b ? ($("#tip .bg").html(d), tipShow(this, a, callback)) : ($("#ftip .bg").html(d), ftipShow(this, a, callback))) : "n" == $(this).attr("data-click") ? "tip" == b ? tipHide() : ftipHide() : "tip" == b ? tipShow(this, a) : ftipShow(this, a); 625 return !1 626 }); 627 628 // Google map 629 if ($('.company-address').length) { 630 $('.company-map-modal').on('shown.bs.modal', function() { 631 var iframe = $(this).find('iframe'); 632 if (!iframe.data('loaded')) { 633 iframe.attr('src', iframe.data('src')); 634 iframe.data('loaded', true); 635 } 636 }); 637 }; 638 639 // maxLength for textarea 640 $("textarea").on("input propertychange", function() { 641 var a = $(this).prop("maxLength"); 642 if (!a || "number" != typeof a) { 643 var a = $(this).attr("maxlength"), 644 b = $(this).val(); 645 b.length > a && $(this).val(b.substr(0, a)) 646 } 647 }); 648 649 //Alerts 650 $("[data-dismiss=alert]").on("click", function() { 651 $(this).is(".close") && $(this).parent().remove() 652 }); 653 654 //OpenID 655 $("#openidBt").on("click", function() { 656 openID_result(); 657 return !1 658 }); 659 660 //Change Localtion 661 $("[data-location]").on("click", function() { 662 if (window.location.origin + $(this).data("location") != window.location.href) { 663 locationReplace($(this).data("location")) 664 } 665 }); 666 667 // Chá»n giao diá»n 668 $('[data-toggle="nvchoosetheme"]').on('change', function() { 669 $.ajax({ 670 type: 'POST', 671 url: nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=nv-choose-theme', 672 cache: false, 673 data: { 674 theme: $(this).val(), 675 tokend: $(this).data('tokend') 676 }, 677 dataType: "html" 678 }).done(function() { 679 location.reload(); 680 }); 681 }); 682 683 // Báºt hiá»u ứng CSS3 684 $('body').addClass('enable-animate'); 685}); 686 687// Fix bootstrap multiple modal 688$(document).on({ 689 'show.bs.modal': function() { 690 var zIndex = 1040 + (10 * $('.modal:visible').length); 691 $(this).css('z-index', zIndex); 692 setTimeout(function() { 693 $('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack'); 694 }, 0); 695 }, 696 'hidden.bs.modal': function() { 697 if ($('.modal:visible').length > 0) { 698 setTimeout(function() { 699 $(document.body).addClass('modal-open'); 700 }, 0); 701 } 702 } 703}, '.modal'); 704 705$(window).on("resize", function() { 706 winResize(); 707 fix_banner_center(); 708 nvbreadcrumbs();
709 //if (150 < cRangeX || 150 < cRangeY) tipHide(), ftipHide() 710}); 711 712// Load Social script - lasest 713$(window).on('load', function() { 714 nvbreadcrumbs(); 715 (0 < $(".fb-like").length) && (1 > $("#fb-root").length && $("body").append('<div id="fb-root"></div>'), function(a, b, c) { 716 var d = a.getElementsByTagName(b)[0]; 717 var fb_app_id = ($('[property="fb:app_id"]').length > 0) ? '&appId=' + $('[property="fb:app_id"]').attr("content") : ''; 718 var fb_locale = ($('[property="og:locale"]').length > 0) ? $('[property="og:locale"]').attr("content") : ((nv_lang_data == "vi") ? 'vi_VN' : 'en_US'); 719 a.getElementById(c) || (a = a.createElement(b), a.id = c, a.src = "//connect.facebook.net/" + fb_locale + "/all.js#xfbml=1" + fb_app_id, d.parentNode.insertBefore(a, d)); 720 }(document, "script", "facebook-jssdk")); 721 0 < $(".twitter-share-button").length && function() { 722 var a = document.createElement("script"); 723 a.type = "text/javascript"; 724 a.src = "//platform.twitter.com/widgets.js"; 725 var b = document.getElementsByTagName("script")[0]; 726 b.parentNode.insertBefore(a, b); 727 }(); 728 0 < $(".zalo-share-button, .zalo-follow-only-button, .zalo-follow-button, .zalo-chat-widget").length && function() { 729 var a = document.createElement("script"); 730 a.type = "text/javascript"; 731 a.src = "//sp.zalo.me/plugins/sdk.js"; 732 var b = document.getElementsByTagName("script")[0]; 733 b.parentNode.insertBefore(a, b); 734 }(); 735 if ($('[data-toggle=recaptcha]').length) { 736 reCaptcha2ApiLoad() 737 } else if ($("[data-recaptcha3]").length) { 738 reCaptcha3ApiLoad() 739 } 740});
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.