1var dataLayer = dataLayer || []; // ga4 Ecommerce 2var anotherPops = $("[data-cloudpop='upgrade']"); 3var activeAcloud = $("[data-cloudpop='active']"); 4var ub = "http://www.ubackup.com/"; 5var apiHost = "https://www.ubackup.com/ss"; 6// var apiHost = "http://192.168.0.59:8433/ss-yii2"; 7var loadHtml = ""; 8var reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; 9var lang = __gc.showCurrentLang(); 10var langtxt = { 11 en: { 12 month: [ 13 "Jan", 14 "Feb", 15 "Mar", 16 "Apr", 17 "May", 18 "Jun", 19 "Jul", 20 "Aug", 21 "Sept", 22 "Oct", 23 "Nov", 24 "Dec", 25 ], 26 }, 27 de: { 28 month: [ 29 "Jan", 30 "Feb", 31 "März", 32 "Apr", 33 "Mai", 34 "Jun", 35 "Jul", 36 "Aug", 37 "Sept", 38 "Okt", 39 "Nov", 40 "Dez", 41 ], 42 complex: ["Tag", "Tagen"], 43 }, 44 es: { 45 month: [ 46 "de enero", 47 "de febrero", 48 "de marzo", 49 "de abril", 50 "de mayo", 51 "de junio", 52 "de julio", 53 "de agosto", 54 "de septiembre", 55 "de octubre", 56 "de noviembre", 57 "de diciembre", 58 ], 59 complex: ["dÃa", "dÃas"], 60 }, 61 fr: { 62 month: [ 63 "janv", 64 65 "févr", 66 67 "mars ", 68 69 "avr ", 70 71 "mai ", 72 73 "juin", 74 75 "juill", 76 77 "août", 78 79 "sept", 80 81 "oct", 82 83 "nov", 84 85 "déc", 86 ], 87 complex: ["jour", "jours"], 88 }, 89 it: { 90 month: [ 91 " Gennaio ", 92 93 " Febbraio ", 94 95 " Marzo ", 96 97 " Aprile ", 98 99 " Maggio ", 100 101 " Giugno ", 102 103 " Luglio ", 104 105 " Agosto ", 106 107 " Settembre ", 108 109 " Ottobre ", 110 111 " Novembre ", 112 113 " Dicembre ", 114 ], 115 }, 116 jp: { 117 month: [ 118 "1æ", 119 120 "2æ", 121 122 "3æ", 123 124 "4æ", 125 126 "5æ", 127 128 "6æ", 129 130 "7æ", 131 132 "8æ", 133 134 "9æ", 135 136 "10æ ", 137 138 "11æ ", 139 140 "12æ ", 141 ], 142 }, 143 tw: { 144 month: [ 145 "1æ", 146 147 "2æ", 148 149 "3æ", 150 151 "4æ", 152 153 "5æ", 154 155 "6æ", 156 157 "7æ", 158 159 "8æ", 160 161 "9æ", 162 163 "10æ", 164 165 "11æ", 166 167 "12æ", 168 ], 169 }, 170 cn: { 171 month: [ 172 "1æ", 173 174 "2æ", 175 176 "3æ", 177 178 "4æ", 179 180 "5æ", 181 182 "6æ", 183 184 "7æ", 185 186 "8æ", 187 188 "9æ", 189 190 "10æ", 191 192 "11æ", 193 194 "12æ", 195 ], 196 }, 197}; 198var current_langtxt = langtxt[lang] ? langtxt[lang] : langtxt["en"]; 199var priceSym = { 200 USD: "$", 201 EUR: "â¬", 202 TWD: "NT$", 203 JPY: "å", 204}; 205var moneySettings = { 206 USD: { 207 symbol: "$", 208 decimal: ".", 209 thousand: ",", 210 precision: 2, 211 }, 212 EUR: { 213 symbol: "â¬", 214 decimal: ",", 215 thousand: ".", 216 precision: 2, 217 }, 218 TWD: { 219 symbol: "NT$", 220 decimal: ".", 221 thousand: ",", 222 precision: 0, 223 }, 224 JPY: { 225 symbol: "å", 226 decimal: ".", 227 thousand: ",", 228 precision: 0, 229 }, 230 CNY: { 231 symbol: "ï¿¥", 232 decimal: ".", 233 thousand: ",", 234 precision: 2, 235 }, 236 DEF: { 237 decimal: ".", 238 thousand: ",", 239 precision: 2, 240 }, 241}; 242var productIdWithCloud = ["242762", "242764", "242765", "242766", "242767"]; 243var __aomeiCloudPopup = { 244 requestUrl: apiHost + "/account/index", 245 application: "https://system.cbackup.com/api", 246 // application: 'https://test_ab_user.cbackup.com/api', 247 forgetEmail: null, 248 autoCreateAomeiAccountAjax(cartParam) { 249 $.ajax({
250 type: "POST", 251 url: this.requestUrl, 252 data: { 253 m: "auto-create-account", 254 }, 255 beforeSend: function () { 256 $(".loading").show(); 257 $(this).css("cursor", "not-allowed"); 258 }, 259 success: function (res) { 260 var response = JSON.parse(res); 261 if (parseInt(response.code) != 200) { 262 $(".response-err-msg").show().html(response.msg); 263 } else { 264 layer.closeAll(); 265 window.location.href = cartParam + "&el=" + response.data.el; 266 } 267 }, 268 complete: function () { 269 $(".loading").hide(); 270 $(this).css("cursor", "pointer"); 271 }, 272 }); 273 }, 274 autoCreateAomeiAccount() { 275 var cartParam = $("#url-param").val(); 276 if (anotherPops.length > 0) { 277 var purchaseEncryptEmail = __methods.geUserinfoCookie("purchase-encrypt"); 278 var reg_encrypt = __methods.geUserinfoCookie("reg-encrypt"); 279 var userinfo = __methods.geUserinfoCookie("userinfo"); 280 if (reg_encrypt == "none" && purchaseEncryptEmail != "none") { 281 if (userinfo.split("/")[1] != "yrl") { 282 window.location.href = cartParam + "&el=" + purchaseEncryptEmail; 283 } else { 284 $.cookie(pageName + "-sendemail", purchaseEncryptEmail); 285 __methods.getPopPrice(); 286 layer.closeAll(); 287 } 288 } else { 289 this.autoCreateAomeiAccountAjax(cartParam); 290 } 291 } else { 292 this.autoCreateAomeiAccountAjax(cartParam); 293 } 294 }, 295 296 /** 297 * [Object] options 298 * [string] options.html 299 * [string] options.width 300 * [function] options.callBack 301 */ 302 popUp(options) { 303 layer.closeAll(); 304 layer.open({ 305 title: false, 306 closeBtn: options.closeButton ?? 1, 307 type: 1, 308 anim: -1, 309 area: [options.width, options.height], 310 shadeClose: false, 311 content: options.html, 312 scrollbar: false, 313 isOutAnim: false, 314 success: function (layero, index) { 315 options.callBack && options.callBack(index); 316 }, 317 }); 318 }, 319 320 buyAomeiCloud: function () { 321 var _this = this; 322 $.get( 323 "/resource/acloud-pop/translate/pop-" + 324 (__gc.showCurrentLang() === "en" ? "" : __gc.showCurrentLang() + "-") + 325 "html.js", 326 function () { 327 $.get("/acloud-pop/pop.css"); 328 var urlParams = window.location.search; 329 var paramPos = urlParams.indexOf("cart="); 330 var cartParam = urlParams.substring(paramPos + 5); 331 if ( 332 parseInt(urlParams.indexOf("para")) != -1 && 333 parseInt(urlParams.indexOf("cart")) != -1 334 ) { 335 window.location.href = cartParam; 336 } 337 338 if (parseInt(urlParams.indexOf("para")) == -1) { 339 loadHtml = popupHtml.pop2(); 340 $("body").on("click", "[data-param-url]", function () { 341 var $this = $(this); 342 $("body").after( 343 '<input type="hidden" id="url-param" value="' + 344 $(this).attr("data-param-url") + 345 '">' 346 ); 347 348 // æ·»å ga4 Ecommerce 349 $(this).attr("data-ga4-temporary") && 350 $("#url-param").attr( 351 "data-ga4-temporary", 352 $(this).attr("data-ga4-temporary") 353 ); 354 // end ga4 355 356 if ($this.attr("data-pop") == "acloud") { 357 _this.popUp({ 358 html: loadHtml, 359 width: "500px", 360 height: "496px", 361 callBack: function () { 362 var requestUrl = __aomeiCloudPopup.requestUrl; 363 var cartParam = $("#url-param").val(); 364 $("#signupForm").validate({ 365 rules: { 366 email: { 367 required: true, 368 email: true, 369 maxlength: 64, 370 }, 371 password: { 372 required: true, 373 minlength: 6, 374 maxlength: 64, 375 }, 376 }, 377 submitHandler: function (form) { 378 var submitBtn = $("#regSubmitBtn"); 379 $(".response-err-msg").hide(); 380 381 $.ajax({
382 type: "POST", 383 url: requestUrl, 384 data: 385 $(form).serialize() + 386 "&lang=" + 387 __gc.showCurrentLang(), 388 beforeSend: function () { 389 $(".loading").show(); 390 submitBtn 391 .attr("disabled", "disabled") 392 .css("cursor", "not-allowed"); 393 }, 394 success: function (res) { 395 var response = JSON.parse(res), 396 email = $("#email").val(); 397 if (parseInt(response.code) != 200) { 398 if ( 399 response.showCaptcha != undefined && 400 response.showCaptcha == 1 && 401 $.trim(email) != "" 402 ) { 403 $(".layui-layer-content").css("height", "525px"); 404 $("#password").closest(".row").addClass("mb-20"); 405 $("#code") 406 .closest(".row") 407 .removeClass("display-none"); 408 $(".captcha-img img").attr( 409 "src", 410 __aomeiCloudPopup.application + 411 "/userab/rest/regNewCaptcha?email=" + 412 email 413 ); 414 } 415 $(".response-err-msg").show().html(response.msg); 416 } else { 417 $("#layerPop").html(""); 418 layer.closeAll(); 419 __aomeiCloudPopup.purchaseOn( 420 cartParam, 421 response.data.el, 422 submitBtn 423 ); 424 } 425 }, 426 complete: function () { 427 $(".loading").hide(); 428 submitBtn 429 .removeAttr("disabled") 430 .css("cursor", "pointer"); 431 }, 432 }); 433 }, 434 }); 435 436 var emailVal = $("#email").val(); 437 if ( 438 $.trim(emailVal) == "" || 439 $.trim(emailVal) == null || 440 !reg.test(emailVal) 441 ) { 442 $("#reg-send").css("cursor", "not-allowed"); 443 // $("#reg-send").css("cursor", "not-allowed").off("click"); 444 } 445 __aomeiCloudPopup.sendEmail(); 446 }, 447 }); 448 } else { 449 // if ($.cookie("currentProductType") == "yearly") { 450 // __aomeiCloudPopup.purchaseOn( 451 // $(this).data("param-url"), 452 // window.localStorage.getItem("currentProductEmail"), 453 // $(this) 454 // ); 455 // } else { 456 // __aomeiCloudPopup.purchaseOn( 457 // $(this).data("param-url"), 458 // __gc.getUrlParam("em"), 459 // $(this) 460 // ); 461 // } 462 __aomeiCloudPopup.purchaseOn( 463 $(this).data("param-url"), 464 window.localStorage.getItem("currentProductEmail"), 465 $(this) 466 ); 467 } 468 }); 469 } else { 470 $("body").on("click", "[data-param-url]", function () { 471 var $this = $(this); 472 if ($this.attr("data-pop") == "acloud") { 473 var para = $(this).attr("data-param-url"); 474 window.location.href = para; 475 } 476 }); 477 } 478 } 479 ); 480 }, 481 checkEmailInfo: function () { 482 var email = __aomeiCloudPopup.getQueryString("em"); 483 if (email) { 484 $.ajax({
485 type: "POST", 486 url: apiHost + "/email/check", 487 data: { em: email }, 488 success: function (response) { 489 if (response.code == 200) { 490 $("[data-param-url]").removeAttr("data-pop"); 491 window.localStorage.setItem( 492 "currentProductEmail", 493 response.data.el 494 ); 495 } else { 496 window.localStorage.removeItem("currentProductEmail"); 497 } 498 }, 499 }); 500 } 501 }, 502 getQueryString: function (name) { 503 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); 504 var r = window.location.search.substring(1).match(reg); 505 if (r != null) return encodeURIComponent(r[2]); 506 return null; 507 }, 508 curCount: 60, 509 SetRemainTime(_this, type) { 510 var resetSend = $("#reg-send,#reset-send"); 511 if (_this.curCount == 1) { 512 window.clearInterval(InterValObj); 513 _this.sendEmail(type); 514 resetSend 515 .css("cursor", "pointer") 516 .removeAttr("disabled") 517 .html(popupHtml.translate.sendEmail); 518 resetSend.closest(".send").css("background", "#137DF5"); 519 _this.curCount = 60; 520 } else { 521 _this.curCount--; 522 $(".ic-captcha .button-loading").hide(); 523 resetSend 524 .css("cursor", "not-allowed") 525 .attr("disabled", "disabled") 526 .off("click") 527 .html( 528 popupHtml.translate.sendingEmail.replace("{time}", _this.curCount) 529 ); 530 resetSend.closest(".send").css("background", "#7b7b7b"); 531 } 532 }, 533 // click sendEmail button 534 // type: If it is "forget", otherwise, send mail for registration 535 sendEmail(type) { 536 var regSend = $("#reg-send,#reset-send"); 537 var errMsg = $(".response-err-msg"); 538 var _this = this; 539 // really send email event 540 function sendEmailEvent(emailVal, type) { 541 $.ajax({
542 type: "POST", 543 url: _this.requestUrl, 544 data: { 545 email: emailVal, 546 m: type !== "forget" ? "reg-send-captcha" : "reset-send-captcha", 547 lang: __gc.showCurrentLang(), 548 }, 549 success: function (res) { 550 _this.curCount = 60; 551 var response = JSON.parse(res); 552 if (response.code != 200) { 553 $(".response-err-msg").html(response.msg); 554 } 555 }, 556 }); 557 } 558 559 function debounce(func, wait, immediate) { 560 var timeout; 561 return function () { 562 var context = this, 563 args = arguments; 564 var later = function () { 565 timeout = null; 566 if (!immediate) func.apply(context, args); 567 }; 568 var callNow = immediate && !timeout; 569 clearTimeout(timeout); 570 timeout = setTimeout(later, wait); 571 callNow && func.apply(context, args); 572 }; 573 } 574 575 function sendToEmail() { 576 var emailVal = $("input[name=email]").val(); 577 var reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; 578 if ($("#reg-send,#reset-send").css("cursor") !== "not-allowed") { 579 $.ajax({
580 type: "POST", 581 url: _this.requestUrl, 582 data: { 583 email: emailVal, 584 m: "check-email", 585 lang: __gc.showCurrentLang(), 586 }, 587 beforeSend: function () { 588 // InterValObj = window.setInterval(function () { 589 // _this.SetRemainTime(_this, type); 590 // }, 1000); 591 if (type === "forget") { 592 $("#reset-send") 593 .attr("disabled", "disabled") 594 .css("cursor", "not-allowed"); 595 $(".ic-captcha .button-loading").show(); 596 } 597 }, 598 success: function (res) { 599 var response = JSON.parse(res); 600 if (type === "forget") { 601 // forget password code=400 is true 602 if (response.code == 400) { 603 InterValObj = window.setInterval(function () { 604 _this.SetRemainTime(_this, type); 605 }, 1000); 606 sendEmailEvent(emailVal, type); 607 } else { 608 $(".button-loading").hide(); 609 $("#reset-send") 610 .removeAttr("disabled") 611 .css("cursor", "pointer"); 612 errMsg.show().html(popupHtml.translate.notRegisteredEmail); 613 } 614 } else { 615 // register code=200 is true 616 if (response.code == 200) { 617 InterValObj = window.setInterval(function () { 618 _this.SetRemainTime(_this, type); 619 }, 1000); 620 sendEmailEvent(emailVal, type); 621 } else { 622 errMsg.show().html(response.msg); 623 } 624 } 625 }, 626 // complete:function (){ 627 // $(".ic-captcha .button-loading").hide(); 628 // } 629 }); 630 } 631 } 632 regSend.on("click", debounce(sendToEmail, 1000, true)); 633 }, 634 635 refreshCaptcha(type = 1) { 636 //type=1 for register 637 //type=2 for login 638 var emailVal = $("#email").val(); 639 var host = "https://system.cbackup.com/api"; 640 var url = 641 type == 1 642 ? host + "/userab/rest/regNewCaptcha" 643 : "userab/rest/loginCaptcha"; 644 if ($.trim(emailVal) != "") { 645 $(".captcha-img img").attr( 646 "src", 647 url + "?email=" + emailVal + "&r=" + Math.random() 648 ); 649 } 650 }, 651 652 purchaseOn(param, el, elem) { 653 $('[data-cont="loading"]').show(); 654 var hasPage = /(upgrade-setup.html)|(upgrade.html)/.test(window.location.pathname); 655 if ($.cookie("currentProductType") == "yearly" && hasPage) { 656 // $.cookie("currentProductEmail", el); 657 window.localStorage.setItem("currentProductEmail", el); 658 __aomeiCloudPopup.upgradeYearly("true", elem); 659 } else { 660 $('[data-cont="loading"]').hide(); 661 662 // æ·»å ga4 Ecommerce 663 if ($("#url-param").attr("data-ga4-temporary")) { 664 var options = JSON.parse($("#url-param").attr("data-ga4-temporary")); 665 dataLayer.push({ 666 event: options.eventName, 667 ecommerce: { 668 items: options.item, 669 }, 670 }); 671 } 672 // end ga4 673 674 window.location.href = param + "&el=" + el; 675 } 676 }, 677 salenum: function (a, b) { 678 var txtNum = ""; 679 var precision = 1000000; 680 681 if (a !== 0 && b !== 0) { 682 var result = (Number(a) * precision) / (Number(b) * precision); 683 txtNum = Math.round(result * 100) + '%'; 684 } else { 685 txtNum = "0%"; 686 } 687 688 return txtNum; 689 }, 690 formatPrice: function (number, priceId) { 691 number = number || 0; 692 var places = ""; 693 var symbol = ""; 694 var thousand = ""; 695 var decimal = ""; 696 if (moneySettings[priceId] != undefined) { 697 places = moneySettings[priceId].precision; 698 symbol = moneySettings[priceId].symbol; 699 thousand = moneySettings[priceId].thousand; 700 decimal = moneySettings[priceId].decimal; 701 } else { 702 places = moneySettings.DEF.precision; 703 symbol = priceId; 704 thousand = moneySettings.DEF.thousand; 705 decimal = moneySettings.DEF.decimal; 706 } 707 708 places = !isNaN((places = Math.abs(places))) ? places : 2; 709 symbol = symbol !== undefined ? symbol : "$"; 710 thousand = thousand || ","; 711 decimal = decimal || "."; 712 var negative = number < 0 ? "-" : "", 713 i = parseInt((number = Math.abs(+number || 0).toFixed(places)), 10) + "", 714 j = (j = i.length) > 3 ? j % 3 : 0; 715 var formatPrice = ""; 716 if (priceId == "EUR" || priceId == "JPY") { 717 formatPrice = 718 negative + 719 (j ? i.substr(0, j) + thousand : "") + 720 i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousand) + 721 (places 722 ? decimal + 723 Math.abs(number - i) 724 .toFixed(places) 725 .slice(2) 726 : "") + 727 symbol; 728 } else { 729 formatPrice = 730 symbol + 731 negative + 732 (j ? i.substr(0, j) + thousand : "") + 733 i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousand) + 734 (places 735 ? decimal + 736 Math.abs(number - i) 737 .toFixed(places) 738 .slice(2) 739 : ""); 740 } 741 return formatPrice; 742 }, 743 timestampToTime: function (time) { 744 var date = new Date(time); 745 var Y = date.getFullYear(); 746 var M = parseFloat( 747 date.getMonth() + 1 < 10 ? date.getMonth() + 1 : date.getMonth() + 1 748 ); 749 var D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate(); 750 var nextFormatTime = ""; 751 switch (lang) { 752 case "jp": 753 case "tw": 754 case "cn": 755 nextFormatTime = Y + "å¹´" + current_langtxt.month[M - 1] + D + "æ¥"; 756 break; 757 case "de": 758 nextFormatTime = 759 D + "." + " " + current_langtxt.month[M - 1] + "." + " " + Y; 760 break; 761 case "es": 762 nextFormatTime = 763 D + " " + current_langtxt.month[M - 1] + " " + "de" + " " + Y; 764 break; 765 case "fr": 766 nextFormatTime = D + " " + current_langtxt.month[M - 1] + " " + " " + Y; 767 break; 768 case "it": 769 nextFormatTime = D + " " + current_langtxt.month[M - 1] + " " + " " + Y; 770 break; 771 default: 772 nextFormatTime = current_langtxt.month[M - 1] + " " + D + "," + " " + Y; 773 break; 774 } 775 return nextFormatTime; 776 }, 777 GetQueryString: function (name) { 778 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); 779 var r = window.location.search.substr(1).match(reg); 780 if (r != null) return decodeURIComponent(r[2]); 781 return null; 782 }, 783 784 // show yearly upgrade info 785 upgradeYearly: function (preview, ele) { 786 // $("[data-pop='acloud']").addClass("btn-isloading"); 787 ele.addClass("btn-isloading"); 788 $.ajax({
789 type: "POST", 790 url: apiHost + "/subscription/upgrade-item?preview=" + preview, 791 data: { 792 to: $.cookie("currentProductId"), 793 group: "AB", 794 email: window.localStorage.getItem("currentProductEmail"), 795 // license: __aomeiCloudPopup.GetQueryString("sn"), 796 license: $.cookie("sn"), 797 }, 798 success: successCallback, 799 error: errorCallback, 800 complete: completeCallback, 801 }); 802 803 function successCallback(res) { 804 if (res.code == 200 && res.data != "") { 805 var dataInfo = res.data; 806 if (dataInfo.AlignmentCustomerGrossPrice == "0") { 807 $(".popup").show(); 808 $(".popup-did").show().siblings().hide(); 809 return false; 810 } 811 var todayPercentage = __aomeiCloudPopup.salenum( 812 dataInfo.AlignmentCustomerVatPrice, 813 dataInfo.AlignmentCustomerNetPrice 814 ); 815 var nextPercentage = __aomeiCloudPopup.salenum( 816 dataInfo.NextBillingCustomerVatPrice, 817 dataInfo.NextBillingCustomerNetPrice 818 ); 819 var todayNoVatPrice = __aomeiCloudPopup.formatPrice( 820 dataInfo.AlignmentCustomerGrossPrice, 821 dataInfo.PriceCurrencyId 822 ); 823 var todayHasVatPrice = __aomeiCloudPopup.formatPrice( 824 dataInfo.AlignmentCustomerNetPrice, 825 dataInfo.PriceCurrencyId 826 ); 827 var todayAllPrice = __aomeiCloudPopup.formatPrice( 828 dataInfo.Price.SinglePriceGross, 829 dataInfo.PriceCurrencyId 830 ); 831 var todayVatPrice = __aomeiCloudPopup.formatPrice( 832 dataInfo.AlignmentCustomerVatPrice, 833 dataInfo.PriceCurrencyId 834 ); 835 var nextNoVatPrice = __aomeiCloudPopup.formatPrice( 836 dataInfo.NextBillingCustomerGrossPrice, 837 dataInfo.PriceCurrencyId 838 ); 839 var nextHasVatPrice = __aomeiCloudPopup.formatPrice( 840 dataInfo.NextBillingCustomerNetPrice, 841 dataInfo.PriceCurrencyId 842 ); 843 var nextAllPrice = __aomeiCloudPopup.formatPrice( 844 dataInfo.Price.SinglePriceGross, 845 dataInfo.PriceCurrencyId 846 ); 847 var nextVatPrice = __aomeiCloudPopup.formatPrice( 848 dataInfo.NextBillingCustomerVatPrice, 849 dataInfo.PriceCurrencyId 850 ); 851 852 var payTpye = dataInfo.PaymentInfo.PaymentType; 853 var payNum = dataInfo.PaymentInfo.CardLastFourDigits; 854 var changePayUrl = dataInfo.ChangePaymentSubscriptionUrl; 855 if (preview == "true") { 856 var pop7Height; 857 pop7Height = 858 __gc.showCurrentLang() == "es" || __gc.showCurrentLang() == "fr" 859 ? "714px" 860 : "690px"; 861 __aomeiCloudPopup.popUp({ 862 html: popupHtml.pop7(), 863 width: "800px", 864 height: pop7Height, 865 }); 866 $("body") 867 .find('span[data-pname="1"]') 868 .html(" " + $.cookie("upgradeProduct")); 869 if ( 870 $.inArray($.cookie("currentProductId"), productIdWithCloud) != -1 871 ) { 872 $('span[data-pcloud="1"]').show(); 873 } 874 } else { 875 __aomeiCloudPopup.popUp({ 876 html: popupHtml.pop8(), 877 width: "560px", 878 height: "539px", 879 closeButton: 0, 880 }); 881 } 882 var $changeEle = $('[data-yearly-pop="txt"]'); 883 // nocloud 884 if ($.cookie("checkCloud") == "false") { 885 todayAllPrice = __aomeiCloudPopup.formatPrice( 886 dataInfo.NextBillingCustomerGrossPrice, 887 dataInfo.PriceCurrencyId 888 ); 889 nextAllPrice = __aomeiCloudPopup.formatPrice( 890 dataInfo.NextBillingCustomerGrossPrice, 891 dataInfo.PriceCurrencyId 892 ); 893 } 894 $("[data-yearly-pop='today-saleprice']").text(todayNoVatPrice); 895 $("[data-yearly-pop='today-totalprice']").text(todayAllPrice); 896 $("[data-yearly-pop='today-taxprice']").text(todayVatPrice); 897 $("[data-yearly-pop='today-percentage']").text(todayPercentage);
898 $("[data-yearly-pop='today-hasvatprice']").text(todayHasVatPrice); 899 // time 900 $("[data-yearly-pop='upgrade-time']").text( 901 __aomeiCloudPopup.timestampToTime(new Date().getTime() + 31536000000) 902 ); 903 $("[data-yearly-pop='nextyear-saleprice']").text(nextNoVatPrice); 904 // $changeEle.eq(7).text(nextNoVatPrice); 905 $("[data-yearly-pop='nextyear-totalprice']").text(nextAllPrice==nextNoVatPrice?'':nextAllPrice); 906 $("[data-yearly-pop='nextyear-taxprice']").text(nextVatPrice); 907 $("[data-yearly-pop='nextyear-percentage']").text(nextPercentage); 908 $("[data-yearly-pop='nextyear-hasvatprice']").text(nextHasVatPrice); 909 $("[data-yearly-pop='current-paytpye']").text(payTpye); 910 if ( 911 $.inArray(payTpye, [ 912 "Visa", 913 "MasterCard", 914 "American Express", 915 "JCB", 916 ]) != -1 917 ) { 918 $("[data-yearly-pop='current-paynum']").text(payNum); 919 } else { 920 $("[data-yearly-pop='omit-numbers']").hide(); 921 $("[data-yearly-pop='current-paynum']").hide(); 922 } 923 924 $("[data-yearly-pop='changepayurl']").attr("href", changePayUrl); 925 $("#layerPop").html(""); 926 } else { 927 // alert(res.message); 928 if (preview == "true") { 929 var pop10Height; 930 pop10Height = $.inArray(__gc.showCurrentLang(), [ 931 "de", 932 "fr", 933 "es", 934 "it", 935 ]) 936 ? "565px" 937 : "540px"; 938 __aomeiCloudPopup.popUp({ 939 html: popupHtml.pop10(), 940 width: "560px", 941 height: pop10Height, 942 }); 943 } else { 944 __aomeiCloudPopup.popUp({ 945 html: popupHtml.pop9(), 946 width: "560px", 947 height: "487px", 948 }); 949 } 950 } 951 } 952 953 function errorCallback(res) {} 954 955 function completeCallback(res) { 956 $('[data-cont="loading"]').hide(); 957 ele.removeClass("btn-isloading"); 958 } 959 }, 960 getCloudSnInfo: function (sn, em, where) { 961 $.ajax({
962 url: apiHost + "/license/get-info-with-license", 963 type: "POST", 964 data: { 965 license: sn, 966 em: em, 967 }, 968 success: successCallback, 969 error: errorCallback, 970 complete: completeCallback, 971 }); 972 function successCallback(res) { 973 if (res.code == "200") { 974 let allSourceTxt = __cloudMethods.comBinAtion(res.data); 975 __cloudMethods.changeHide(allSourceTxt); 976 // console.log(allSourceTxt); 977 } 978 __cloudMethods.changHidePop(res.code, res.data, where); 979 } 980 function errorCallback(xhr, status) {} 981 function completeCallback(res) { 982 $("[data-cont='loading']").hide(); 983 } 984 }, 985}; 986$(function () { 987 __aomeiCloudPopup.checkEmailInfo(); 988 if ($.inArray(__gc.showCurrentLang(), ["pt","pl","nl","ar","id","ru"]) == -1) { 989 __aomeiCloudPopup.buyAomeiCloud(); 990 } 991 992 // $("body").on("click", ".pop-box-1 .continue, .account", function () { 993 // __aomeiCloudPopup.autoCreateAomeiAccount(); 994 // }); 995 996 // regist 997 $("body").on("click", ".pop-register", function () { 998 if (typeof InterValObj != "undefined") window.clearInterval(InterValObj); 999 __aomeiCloudPopup.forgetEmail = null; // reset forgetEmail 1000 var loadHtm = popupHtml.pop2(); 1001 $("#layerPop").html(""); 1002 __aomeiCloudPopup.popUp({ 1003 html: loadHtm, 1004 width: "500px", 1005 height: "496px", 1006 callBack: function () { 1007 var requestUrl = __aomeiCloudPopup.requestUrl; 1008 var cartParam = $("#url-param").val(); 1009 $("#signupForm").validate({ 1010 rules: { 1011 nickname: { 1012 required: true, 1013 minlength: 3, 1014 maxlength: 64, 1015 }, 1016 email: { 1017 required: true, 1018 email: true, 1019 maxlength: 64, 1020 }, 1021 code: { 1022 required: true, 1023 }, 1024 password: { 1025 required: true, 1026 minlength: 6, 1027 maxlength: 64, 1028 }, 1029 }, 1030 submitHandler: function (form) { 1031 var submitBtn = $("#regSubmitBtn"); 1032 $(".response-err-msg").hide(); 1033 1034 $.ajax({
1035 type: "POST", 1036 url: requestUrl, 1037 data: $(form).serialize() + "&lang=" + __gc.showCurrentLang(), 1038 beforeSend: function () { 1039 $(".loading").show(); 1040 submitBtn 1041 .attr("disabled", "disabled") 1042 .css("cursor", "not-allowed"); 1043 }, 1044 success: function (res) { 1045 var response = JSON.parse(res); 1046 if (parseInt(response.code) != 200) { 1047 $(".response-err-msg").show().html(response.msg); 1048 } else { 1049 layer.closeAll(); 1050 __aomeiCloudPopup.purchaseOn( 1051 cartParam, 1052 response.data.el, 1053 submitBtn 1054 ); 1055 } 1056 }, 1057 complete: function () { 1058 $(".loading").hide(); 1059 submitBtn.attr("disabled", "false").css("cursor", "pointer"); 1060 }, 1061 }); 1062 }, 1063 }); 1064 1065 var emailVal = $("#email").val(); 1066 if ( 1067 $.trim(emailVal) == "" || 1068 $.trim(emailVal) == null || 1069 !reg.test(emailVal) 1070 ) { 1071 $("#reg-send").css("cursor", "not-allowed"); 1072 // $("#reg-send").css("cursor", "not-allowed").off("click"); 1073 } 1074 __aomeiCloudPopup.sendEmail(); 1075 }, 1076 }); 1077 }); 1078 1079 // login 1080 $("body").on("click", ".pop-login", function () { 1081 if (typeof InterValObj != "undefined") window.clearInterval(InterValObj); 1082 var loadHtml = popupHtml.pop3(); 1083 var pop3Height; 1084 pop3Height = __gc.showCurrentLang() == "fr" ? "510px" : "496px"; 1085 $("#layerPop").html(""); 1086 __aomeiCloudPopup.popUp({ 1087 html: loadHtml, 1088 width: "500px", 1089 height: pop3Height, 1090 callBack: function (index) { 1091 var requestUrl = __aomeiCloudPopup.requestUrl; 1092 var cartParam = $("#url-param").val(); 1093 if (__aomeiCloudPopup.forgetEmail) { 1094 // After resetting the password successfully 1095 $("#loginForm #email").val(__aomeiCloudPopup.forgetEmail); 1096 } 1097 $("#loginForm").validate({ 1098 rules: { 1099 email: { 1100 required: true, 1101 email: true, 1102 maxlength: 64, 1103 }, 1104 password: { 1105 required: true, 1106 minlength: 6, 1107 maxlength: 64, 1108 }, 1109 }, 1110 submitHandler: function (form) { 1111 var submitBtn = $("#loginSubmitBtn"); 1112 $(".response-err-msg").hide(); 1113 $.ajax({
1114 type: "POST", 1115 url: requestUrl, 1116 data: $(form).serialize() + "&lang=" + __gc.showCurrentLang(), 1117 beforeSend: function () { 1118 $(".loading").show(); 1119 submitBtn 1120 .attr("disabled", "disabled") 1121 .css("cursor", "not-allowed"); 1122 }, 1123 success: function (res) { 1124 var response = JSON.parse(res), 1125 email = $("#email").val(); 1126 if (parseInt(response.code) != 200) { 1127 $(".response-err-msg").show().html(response.msg); 1128 if ( 1129 response.showCaptcha != undefined && 1130 response.showCaptcha == 1 && 1131 $.trim(email) != "" 1132 ) { 1133 // $("label.ic-captcha") 1134 // .parents(".row") 1135 // .removeClass("display-none"); 1136 1137 layer.style(index, { 1138 height: "545px", 1139 }); 1140 $("#password").closest(".row").addClass("mb-20"); 1141 $("#code").closest(".row").removeClass("display-none"); 1142 // console.log( 1143 // __aomeiCloudPopup.application + 1144 // "/userab/rest/loginCaptcha?email=" + 1145 // email 1146 // ); 1147 $(".captcha-img img").attr( 1148 "src", 1149 __aomeiCloudPopup.application + 1150 "/userab/rest/loginCaptcha?email=" + 1151 email 1152 ); 1153 } 1154 } else { 1155 __aomeiCloudPopup.purchaseOn( 1156 cartParam, 1157 response.data.el, 1158 submitBtn 1159 ); 1160 layer.closeAll(); 1161 } 1162 }, 1163 complete: function () { 1164 $(".loading").hide(); 1165 submitBtn.removeAttr("disabled").css("cursor", "pointer"); 1166 }, 1167 }); 1168 }, 1169 }); 1170 }, 1171 }); 1172 }); 1173 1174 // forget password 1175 $("body").on("click", ".pop-forget", function () { 1176 __aomeiCloudPopup.forgetEmail = null; // reset foregetEmail 1177 var loadHtm = popupHtml.pop4(); 1178 $("#layerPop").html(""); 1179 1180 __aomeiCloudPopup.popUp({ 1181 html: loadHtm, 1182 width: "500px", 1183 height: "506px", 1184 callBack: function () { 1185 var requestUrl = __aomeiCloudPopup.requestUrl; 1186 if ( 1187 $.trim(emailVal) == "" || 1188 $.trim(emailVal) == null || 1189 !reg.test(emailVal) 1190 ) { 1191 $("#reg-send").css("cursor", "not-allowed"); 1192 } 1193 $("#resetForm").validate({ 1194 rules: { 1195 email: { 1196 required: true, 1197 email: true, 1198 maxlength: 64, 1199 }, 1200 code: { 1201 required: true, 1202 }, 1203 password: { 1204 required: true, 1205 minlength: 6, 1206 maxlength: 64, 1207 }, 1208 confirm_password: { 1209 minlength: 6, 1210 equalTo: "#new_password", 1211 }, 1212 }, 1213 submitHandler: function (form) { 1214 var submitBtn = $("#resetSubmitBtn"); 1215 var errMsg = $(".response-err-msg"); 1216 errMsg.hide(); 1217 var emailVal = $("#email").val(); 1218 1219 $.ajax({
1220 type: "POST", 1221 url: requestUrl, 1222 data: $(form).serialize() + "&lang=" + __gc.showCurrentLang(), 1223 beforeSend: function () { 1224 $(".loading").show(); 1225 submitBtn 1226 .attr("disabled", "disabled") 1227 .css("cursor", "not-allowed"); 1228 }, 1229 success: function (res) { 1230 var response = JSON.parse(res); 1231 if (parseInt(response.code) != 200) { 1232 errMsg.show(); 1233 errMsg.html(response.msg); 1234 } else { 1235 __aomeiCloudPopup.curCount = 60; 1236 var emailVal = $("#email").val(); 1237 __aomeiCloudPopup.forgetEmail = emailVal; 1238 $(".pop-login").trigger("click"); 1239 } 1240 }, 1241 complete: function () { 1242 $(".loading").hide(); 1243 submitBtn.removeAttr("disabled").css("cursor", "pointer"); 1244 }, 1245 }); 1246 }, 1247 }); 1248 1249 var emailVal = $("#email").val(); 1250 if ( 1251 $.trim(emailVal) == "" || 1252 $.trim(emailVal) == null || 1253 !reg.test(emailVal) 1254 ) { 1255 $("#reset-send").css("cursor", "not-allowed").off("click"); 1256 } 1257 __aomeiCloudPopup.sendEmail("forget"); 1258 }, 1259 }); 1260 }); 1261 1262 // Verify email format 1263 $("body").on("input propertychange", "#email", function () { 1264 var inputEmail = $(this).val(); 1265 var reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; 1266 var regSend = $("#reg-send,#reset-send"); 1267 if ( 1268 $.trim(inputEmail) != "" && 1269 $.trim(inputEmail) != null && 1270 reg.test(inputEmail) 1271 ) { 1272 regSend.css("cursor", "pointer").css("pointer-events", "auto"); 1273 } else { 1274 regSend.css("cursor", "not-allowed").css("pointer-events", "none"); 1275 } 1276 }); 1277 1278 $("body").on("focus", ".row input", function () { 1279 $(".response-err-msg").text(""); 1280 }); 1281 1282 // refresh 1283 $("body").on("click", ".pop-box-2 .captcha-img img", function () { 1284 __aomeiCloudPopup.refreshCaptcha(); 1285 }); 1286 1287 //confirm to upgrade 1288 $("body").on("click", "a[data-confirm='upgrade']", function () { 1289 $(this).addClass("btn-isloading"); 1290 __aomeiCloudPopup.upgradeYearly("false", $(this)); 1291 }); 1292 1293 if ($.inArray(__gc.showCurrentLang(), ["en","pt","pl","nl","ar","id","ru"]) == -1) { 1294 $.get("/acloud-pop/assets/lib/messages_" + __gc.showCurrentLang() + ".js"); 1295 } 1296});
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.