%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/bitrix/www/bitrix/components/bitrix/sale.account.pay/templates/.default/
Upload File :
Create Path :
Current File : //home/bitrix/www/bitrix/components/bitrix/sale.account.pay/templates/.default/script.min.js

BX.saleAccountPay=function(){var e=function(e){this.messages=e.alertMessages||{};this.nameValue=e.nameValue||"buyMoney";this.ajaxUrl=e.url;this.signedParams=e.signedParams||{};this.wrapperId=e.wrapperId||"";this.templateFolder=e.templateFolder;this.templateName=e.templateName||"";this.wrapper=document.getElementById("bx-sap"+this.wrapperId);this.changeInputContainer=this.wrapper.getElementsByClassName("sale-acountpay-fixedpay-container")[0];this.paySystemsContainer=this.wrapper.getElementsByClassName("sale-acountpay-pp")[0];this.inputElement=this.wrapper.getElementsByClassName("sale-acountpay-input")[0];this.submitButton=this.wrapper.getElementsByClassName("btn")[0];this.checkboxList=this.wrapper.getElementsByClassName("sale-acountpay-pp-company");BX.ready(BX.proxy(this.init,this))};e.prototype.init=function(){this.checkboxList[0].checked="checked";BX.bindDelegate(this.paySystemsContainer,"click",{className:"sale-acountpay-pp-company"},BX.proxy(function(e){var t=this.wrapper.querySelectorAll(".sale-acountpay-pp-company-checkbox:checked");Array.prototype.forEach.call(t,function(e){e.checked=false;e.parentNode.parentNode.classList.remove("bx-selected")});var a=e.target.parentNode;a.classList.add("bx-selected");a.parentNode.classList.add("bx-selected");a.querySelector(".sale-acountpay-pp-company-checkbox").checked="checked";return this},this));BX.bind(this.inputElement,"input",BX.delegate(function(){this.inputElement.value=this.inputElement.value.replace(/[^\d,.]*/g,"").replace(/\,/g,".").replace(/([,.])[,.]+/g,"$1").replace(/^[^\d]*(\d+([.,]\d{0,5})?).*$/g,"$1")},this));BX.bindDelegate(this.changeInputContainer,"click",{className:"sale-acountpay-fixedpay-item"},BX.proxy(function(e){this.inputElement.value=parseInt(e.target.innerText)},this));BX.bind(this.submitButton,"click",BX.delegate(function(e){e.preventDefault();if(parseFloat(this.inputElement.value)<=0||this.inputElement.value==""){window.alert(BX.util.htmlspecialchars(this.messages.wrongInput));return false}this.startLoader();BX.ajax({method:"POST",dataType:"html",url:this.ajaxUrl,data:{sessid:BX.bitrix_sessid(),buyMoney:this.inputElement.value,templateName:this.templateName,paySystemId:this.wrapper.querySelector(".sale-acountpay-pp-company-checkbox:checked").value,signedParamsString:this.signedParams},onsuccess:BX.proxy(function(e){while(this.wrapper.firstChild){this.wrapper.removeChild(this.wrapper.firstChild)}this.wrapper.innerHTML=e;this.endLoader()},this),onfailure:BX.proxy(function(){return this},this)},this);this.destroy()},this));return this};e.prototype.destroy=function(){this.messages=null;this.nameValue=null;this.signedParams=null;this.changeInputContainer=null;this.paySystemsContainer=null;this.inputElement=null;this.submitButton=null;this.checkboxList=null};e.prototype.startLoader=function(){if(this.BXFormPosting===true){return false}this.BXFormPosting=true;if(!this.loadingScreen){this.loadingScreen=new BX.PopupWindow("loading_screen",this.submitButton,{overlay:{backgroundColor:"white",opacity:"80"},autoHide:true,events:{onAfterPopupShow:BX.proxy(function(){BX.cleanNode(this.loadingScreen.popupContainer);this.loadingScreen.popupContainer.appendChild(BX.create("IMG",{props:{src:this.templateFolder+"/images/loader.gif"}}));this.loadingScreen.popupContainer.removeAttribute("style");this.loadingScreen.popupContainer.style.display="block"},this)}})}return this.loadingScreen.show()};e.prototype.endLoader=function(e){this.BXFormPosting=false;if(this.loadingScreen&&this.loadingScreen.isShown()){this.loadingScreen.close()}clearTimeout(e)};return e}();

Zerion Mini Shell 1.0