Server IP : 213.176.29.180 / Your IP : 3.23.101.75 Web Server : Apache System : Linux 213.176.29.180.hostiran.name 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64 User : webtaragh ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/webtaragh/public_html/whmcs/assets/js/whmcs/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
function getRecommendationColors(hex,percentage){var hex=tinycolor(hex),text=tinycolor("fff"),brightness=Math.round(100*Math.min(hex.getBrightness()/255));return brightness<25?hex.lighten(25-brightness):75<brightness&&hex.darken(brightness-75),(brightness=hex.clone().darken(percentage)).isLight()&&(text=tinycolor("000")),[hex.toHexString(),brightness.toHexString(),text.toHexString()]}function setRecommendationColors(){var colors;jQuery(".product-recommendations .product-recommendation").each(function(){var element=jQuery(this),primaryColor=element.data("color");0<primaryColor.length&&null!=primaryColor.match(/^#[0-9A-Fa-f]{3,6}$/gi)||(primaryColor="#9abb3a"),colors=getRecommendationColors(primaryColor,15),element.css("border-color",colors[0]),jQuery(".btn-add",element).css("background-color",colors[0]),jQuery(".expander",element).css("color",colors[0]),jQuery(".price",element).css("color",colors[1]),jQuery(".text",element).css({color:colors[2]}),jQuery(".arrow",element).css({"background-color":colors[1],color:colors[2]})})}function displayRecommendations(postUrl,postData,postForce){var deferredObject=jQuery.Deferred(),hasRecommendations=jQuery("#divProductHasRecommendations").data("value"),modal=jQuery("#recommendationsModal"),shoppingCartBtn=jQuery(".cart-btn .badge");return postForce||hasRecommendations?(jQuery('.cart-body button[type="submit"] i').removeClass("fa-arrow-circle-right").addClass("fa-spinner fa-spin"),WHMCS.http.jqClient.jsonPost({url:postUrl,data:postData,success:function(data){data.success&&data.href?(modal.on("hide.bs.modal",function(){return window.location=data.href,!1}),jQuery("#btnContinueRecommendationsModal",modal).attr("href",data.href).click(function(){jQuery("span",this).removeClass("w-hidden hidden")}),jQuery(".modal-body",modal).html("").html(data.html),setRecommendationColors(),modal.modal("show"),jQuery("i.fa-spinner.fa-spin:visible").removeClass("fa-spinner fa-spin").addClass("fa-check-circle"),shoppingCartBtn.text(data.count)):!data.success&&data.href?window.location=data.href:deferredObject.resolve(!1)},error:function(){deferredObject.resolve(!1)}})):deferredObject.resolve(!1),deferredObject.promise()}jQuery(document).ready(function(){jQuery("#main-body").on("click",".product-recommendations .product-recommendation .header",function(e){jQuery(e.target).is(".btn, .btn span, .btn .fa")||(e.preventDefault(),0<jQuery(".fa-square",this).length||(jQuery(this).parent().find(".rotate").toggleClass("down"),jQuery(this).parent().find(".body").slideToggle("fast")))}).on("click",".product-recommendations .product-recommendation .btn-add",function(){jQuery(this).attr("disabled","disabled").find("span.arrow i").removeClass("fa-chevron-right").addClass("fa-spinner fa-spin")}).on("click",".order-button, .order-btn, .btn-order-now",function(e){var href;1==jQuery(this).data("hasRecommendations")&&(e.preventDefault(),href=jQuery(this).attr("href"),jQuery("i",this).removeClass().addClass("fas fa-spinner fa-spin"),displayRecommendations(href,"addproductajax=1",!0).done(function(){window.location=href}))}),setRecommendationColors(),(document.URL.includes("cart.php?a=checkout")||document.URL.includes("cart.php?a=view"))&&0<jQuery("#recommendationsModal .product-recommendation:not(.clonable)").length&&jQuery("#recommendationsModal").modal("toggle")});