stockbot-buyvm/tests/data/stock_files/order.min.js

2 lines
49 KiB
JavaScript
Raw Permalink Normal View History

2023-12-02 19:49:13 +00:00
function hasProductDomainLookupEnded(e,t){domainLookupCallCount++,domainLookupCallCount==e&&(t.removeAttr("disabled").removeClass("disabled"),jQuery('input[name="domainoption"]').iCheck("enable"))}function hasDomainLookupEnded(){domainLookupCallCount++,3==domainLookupCallCount&&jQuery("#btnCheckAvailability").removeAttr("disabled").removeClass("disabled")}function recalctotals(){jQuery("#orderSummaryLoader").is(":visible")||jQuery("#orderSummaryLoader").fadeIn("fast"),jQuery("#orderSummaryLoaderMob").is(":visible")||jQuery("#orderSummaryLoaderMob").fadeIn("fast");var e=Math.floor(1e6*Math.random()+1);window.lastSliderUpdateRequestId=e;var t=WHMCS.http.jqClient.post("cart.php","ajax=1&a=confproduct&calctotal=true&"+jQuery("#frmConfigureProduct").serialize());t.done(function(t){e==window.lastSliderUpdateRequestId&&(jQuery("#producttotal").html(t),jQuery("#producttotalmob").html(t))}),t.always(function(){jQuery("#orderSummaryLoader").delay(500).fadeOut("slow"),jQuery("#orderSummaryLoaderMob").delay(500).fadeOut("slow"),$("#sticky-sidebar").stickySidebar("updateSticky")})}function recalculateRenewalTotals(){jQuery("#orderSummaryLoader").is(":visible")||jQuery("#orderSummaryLoader").fadeIn("fast");var e=Math.floor(1e6*Math.random()+1);window.lastSliderUpdateRequestId=e,jQuery.get(WHMCS.utils.getRouteUrl("/cart/domain/renew/calculate")).done(function(t){e===window.lastSliderUpdateRequestId&&(jQuery("#producttotal").html(t.body),jQuery("#producttotalmob").html(t.body))}).always(function(){jQuery("#orderSummaryLoader").delay(500).fadeOut("slow"),jQuery("#orderSummaryLoaderMob").delay(500).fadeOut("slow")})}function removeItem(e,t){jQuery("#inputRemoveItemType").val(e),jQuery("#inputRemoveItemRef").val(t),jQuery("#modalRemoveItem").modal("show")}function selectDomainPeriodInCart(e,t,a,n){var i=jQuery("#orderSummaryLoader"),r=jQuery("#orderSummaryLoaderMob");i.fadeIn("fast"),r.fadeIn("fast"),console.log(n),jQuery("[name='"+e+"Pricing']").html(t+"/"+a+n+' <span class="caret"></span>'),jQuery("[name='"+e+"Price']").html(t);var o=jQuery.post(window.location.pathname,{domain:e,period:a,a:"updateDomainPeriod",token:csrfToken});o.done(function(e){e.domains.forEach(function(e){jQuery("[name='"+e.domain+"Price']").parent("div").find(".renewal-price").html(e.renewprice+e.shortYearsLanguage).end()}),jQuery("#subtotal").html(e.subtotal),e.promotype&&jQuery("#discount").html(e.discount),e.taxrate&&jQuery("#taxTotal1").html(e.taxtotal),e.taxrate2&&jQuery("#taxTotal2").html(e.taxtotal2);var t=jQuery("#recurring"),a=jQuery("#recurringMob");t.find("li").not(".faded").hide().end(),a.find("li").not(".faded").hide().end(),e.totalrecurringannually&&(jQuery("#recurringAnnually").show().find(".item-value").html(e.totalrecurringannually),jQuery("#recurringMobAnnually").show().find(".item-value").html(e.totalrecurringannually)),e.totalrecurringbiennially&&(jQuery("#recurringBiennially").show().find(".item-value").html(e.totalrecurringbiennially),jQuery("#recurringMobBiennially").show().find(".item-value").html(e.totalrecurringbiennially)),e.totalrecurringmonthly&&(jQuery("#recurringMonthly").show().find(".item-value").html(e.totalrecurringmonthly),jQuery("#recurringMobMonthly").show().find(".item-value").html(e.totalrecurringmonthly)),e.totalrecurringquarterly&&(jQuery("#recurringQuarterly").show().find(".item-value").html(e.totalrecurringquarterly),jQuery("#recurringMobQuarterly").show().find(".item-value").html(e.totalrecurringquarterly)),e.totalrecurringsemiannually&&(jQuery("#recurringSemiAnnually").show().find(".item-value").html(e.totalrecurringsemiannually),jQuery("#recurringMobSemiAnnually").show().find(".item-value").html(e.totalrecurringsemiannually)),e.totalrecurringtriennially&&(jQuery("#recurringTriennially").show().find(".item-value").html(e.totalrecurringtriennially),jQuery("#recurringMobTriennially").show().find(".item-value").html(e.totalrecurringtriennially)),jQuery("#totalDueToday").html(e.total),jQuery("#totalDueTodayMob").html(e.total)}),o.always(function(){i.delay(500).fadeOut("slow"),r.delay(500).fadeOut("slow")})}function validat
var e=jQuery(this).attr("data-domain"),t=jQuery('button[data-domain="'+e+'"]'),a=jQuery(this).attr("data-whois"),n=jQuery(this).hasClass("product-domain"),i=jQuery("#btnDomainContinue"),r=jQuery("#resultDomain"),o=jQuery("#resultDomainPricingTerm");t.attr("disabled","disabled").each(function(){jQuery(this).css("width",jQuery(this).outerWidth())});var d=jQuery(this).parents(".spotlight-tlds").length>0||jQuery(this).parents(".suggested-domains").length>0?1:0;jQuery.post(window.location.pathname,{a:"addToCart",domain:e,token:csrfToken,whois:a,sideorder:d},"json").done(function(a){if(t.find("span.to-add").hide(),"added"==a.result){t.find("span.added").show().parent().removeClass("btn-info").addClass("btn-primary").end(),$("body").addClass("is-actions"),n||t.removeAttr("disabled").addClass("checkout").closest(".list-group-item").addClass("added"),r.length&&!r.val()&&(r.val(e),o.val(a.period).attr("name","domainsregperiod["+e+"]"),i.length>0&&i.is(":disabled")&&i.removeAttr("disabled"));var d=parseInt(jQuery("#cartItemCount").text()),s=d+1;jQuery("#cartItemCount").html(s).addClass("badge--primary")}else t.find("span.unavailable").show()})}}),$("#frmProductDomainSelections").on("submit",function(){var e=parseInt(jQuery("#cartItemCount").text()),t=e+1;jQuery("#cartItemCount").html(t).addClass("badge--primary")}),jQuery("#frmDomainChecker").submit(function(e){e.preventDefault(),jQuery("#DomainSearchResults").addClass("hidden"),jQuery(".domain-pricing").hide();var t=jQuery("#frmDomainChecker"),a=jQuery("#inputDomain"),n=jQuery("#domainSuggestions"),i=jQuery("#divDynamicRecaptcha"),r=jQuery("#inputCaptcha");if(domainLookupCallCount=0,!a.val())return a.tooltip("show"),void a.focus();if(a.tooltip("hide"),jQuery("#captchaContainer").length)validate_captcha(t);else{i.tooltip("hide"),r.tooltip("hide"),jQuery("#btnCheckAvailability").attr("disabled","disabled").addClass("disabled"),jQuery(".domain-lookup-result").addClass("hidden"),jQuery(".domain-lookup-loader").removeClass("hidden"),jQuery("html, body").animate({scrollTop:$(".domain-lookup-loader").offset().top-150},500),n.find("li").addClass("hidden").end(),n.find(".clone").remove().end(),jQuery("div.panel-footer.more-suggestions").addClass("hidden").find("a").removeClass("hidden").end().find("span.no-more").addClass("hidden"),jQuery(".btn-add-to-cart").removeAttr("disabled").find("span").hide().end().find("span.to-add").show(),jQuery(".suggested-domains").removeClass("hidden");var o=jQuery.post(WHMCS.utils.getRouteUrl("/domain/check"),t.serialize()+"&type=domain","json"),d=jQuery.post(WHMCS.utils.getRouteUrl("/domain/check"),t.serialize()+"&type=spotlight","json"),s=jQuery.post(WHMCS.utils.getRouteUrl("/domain/check"),t.serialize()+"&type=suggestions","json");o.done(function(e){"object"==typeof e&&0!=e.result.length&&jQuery.each(e.result,function(t,a){var n=null,i=jQuery("#primaryLookupResult"),r=i.find(".domain-available"),o=i.find(".domain-price"),d=i.find(".domain-contact-support"),s=i.find(".domain-unavailable"),l=i.find(".domain-invalid"),u=i.find(".domain-error");if(i.find(".btn-add-to-cart").removeClass("checkout"),i.removeClass("hidden").show(),!e.result.error&&a.isValidDomain)n=a.pricing,s.hide(),d.hide(),l.hide(),u.hide(),a.isAvailable&&"string"!=typeof n?(a.preferredTLDNotAvailable&&s.show().find("strong").html(a.originalUnavailableDomain),r.show().find("strong").html(a.domainName),o.show().find(".price").html(n[Object.keys(n)[0]].register).end().find("button").attr("data-domain",a.idnDomainName)):(r.hide(),o.hide(),d.hide(),s.show().find("strong").html(a.domainName),"string"==typeof n&&"ContactUs"==n&&d.show());else{r.hide(),o.hide(),s.hide(),d.hide(),l.hide(),u.hide();var c=l.find("span.domain-length-restrictions"),h=!1;c.hide(),a.minLength>0&&a.maxLength>0?(c.find(".min-length").html(a.minLength).end().find(".max-length").html(a.maxLength).end(),c.show()):e.result.error&&(u.find(".message-text").html(e.result.error),u.show(),h=!0),h||l.show()}})}).always(function(){hasDomainLookupEnded()}),d.done(function(e){"object"!=typeof e||0==e.result.length||e.result.error?jQuery