zZzzZ.
home2
/
zrzvbdry
/
public_html
/
wp-content
/
plugins
/
wc-multi-currency
/
js
New Folder
Editing: wc_main.min.js
Save
Cancel
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){(function(global){(function(){"use strict";global.mc_default_id="";const url_helper=require("./url_helper");var gatewayObj={Init:function(){APPSBDAPPJS.core.AddOnEvent("mc-new-currency",gatewayObj.onNewCurrency);APPSBDAPPJS.core.AddOnEvent("mc-up-currency",gatewayObj.onUpdateCurrency);APPSBDAPPJS.core.AddOnEvent("mc-del-currency",gatewayObj.onDeleteCurrency);gatewayObj.SetEvent()},onUpdateCurrency:function(rdata){try{if(rdata.has_currency_change){$("#APBDWMC_payment_currency #cur-gateway-html #cur-gtw-"+rdata.id+" .app-gt-cur").html(rdata.currency_title)}}catch(e){}},onNewCurrency:function(curObj){gatewayObj.ReloadCurrencyHtml()},onDeleteCurrency:function(curID){gatewayObj.ReloadCurrencyHtml()},SetEvent:function(){},ReloadCurrencyHtml:function(){$.ajax({url:url_helper.ajax_url("action=wc-multi-currency_AJ_APBDWMC_payment_currency_get-html"),type:"GET",scriptCharset:"utf-8",dataType:"html",success:function(rdata){$("#APBDWMC_payment_currency #cur-gateway-html").html(rdata)}})}};module.exports=gatewayObj}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./url_helper":4}],2:[function(require,module,exports){(function(global){(function(){"use strict";global.mc_default_id="";const url_helper=require("./url_helper");var coreObj={Init:function(){coreObj.SetNewCurrencyEvent();coreObj.SetCurrencyContainerEvent();coreObj.SetDefault();global.mc_default_id=$(".apbd-mc-default:checked").val()},SetNewCurrencyEvent:function(){$("#APBD_add_currency").on("click",function(){var thisObj=$(this);var itag=thisObj.find("> i");console.log(window.WCMULTICURRENCY);$.ajax({url:url_helper.ajax_url("action=wc-multi-currency_AJ_APBDWMC_general_add"),data:{},type:"POST",scriptCharset:"utf-8",dataType:"json",beforeSend:function(){var oldClass=itag.attr("class");itag.data("old-class",oldClass);itag.attr("class","icon-loading")},success:function(rdata){$("#gn_currency_list").append(rdata.currency_tr);coreObj.SetCurrencyContainerEvent();APPSBDAPPJS.core.CallOnEvent("mc-new-currency",rdata.currency_obj)},complete:function(jqXHR,textStatus){itag.attr("class",itag.data("old-class"))}})});$("#APBD_update_all_rate").on("click",function(e){e.preventDefault();var mainobj=$(this);var icons=$(".apbd-mc-up-rate > i");swal({title:appGlobalLang.confirmText,text:mainobj.data("msg"),type:"warning",showCancelButton:true,confirmButtonClass:"btn-danger",confirmButtonText:appGlobalLang.yesText,cancelButtonText:appGlobalLang.noText,closeOnConfirm:false,closeOnCancel:true,showLoaderOnConfirm:true},function(isConfirm){if(isConfirm){try{swal.close()}catch(e){}$.ajax({url:url_helper.ajax_url("&action=wc-multi-currency_AJ_APBDWMC_general_update-all"),type:"GET",scriptCharset:"utf-8",dataType:"json",beforeSend:function(){icons.removeClass("fa").addClass("icon-loading")},success:function(rdata){console.log(rdata);if(rdata.status){for(var i in rdata.data){$("#tr_"+rdata.data[i].id+" [name=mc_rate]").val(rdata.data[i].rate)}}},complete:function(jqXHR,textStatus){icons.removeClass("icon-loading").addClass("fa")}})}})})},UpdateCurrency:function(tr){var cur={is_show:tr.find("[name=mc_is_show]").val(),code:tr.find("[name=mc_code]").val(),position:tr.find("[name=mc_position]").val(),rate:tr.find("[name=mc_rate]").val(),ex_fee:tr.find("[name=mc_ex_fee]").val(),dec:tr.find("[name=mc_dec_num]").val(),custom_symbol:tr.find("[name=mc_custom_symbol]").val()};$.ajax({url:url_helper.ajax_url("action=wc-multi-currency_AJ_APBDWMC_general_update&id="+tr.data("currency-id")),data:cur,type:"POST",scriptCharset:"utf-8",dataType:"json",beforeSend:function(){},success:function(rdata){if(rdata.status){APPSBDAPPJS.core.CallOnEvent("mc-up-currency",rdata.data)}},complete:function(jqXHR,textStatus){}})},SetDefault:function(){$("#gn_currency_list").on("change",".apbd-mc-default",function(evt){evt.preventDefault();$(this).prop("checked",false);var mainobj=$(this);var parentTr=mainobj.closest("tr");swal({title:mainobj.data("title"),text:mainobj.data("msg"),type:"warning",showCancelButton:true,confirmButtonClass:"btn-danger",confirmButtonText:appGlobalLang.yesText,cancelButtonText:appGlobalLang.noText,closeOnConfirm:false,closeOnCancel:true,showLoaderOnConfirm:true},function(isConfirm){if(isConfirm){$.ajax({url:url_helper.ajax_url("action=wc-multi-currency_AJ_APBDWMC_general_set-default"),data:{id:mainobj.val()},type:"POST",scriptCharset:"utf-8",dataType:"json",beforeSend:function(){},success:function(rdata){if(rdata.status){mainobj.prop("checked",true);global.mc_default_id=mainobj.val()}APPSBDAPPJS.notification.ShowSwal(rdata);coreObj.UpdateCurrency(parentTr)},complete:function(jqXHR,textStatus){}})}else{$("#mc-default-"+global.mc_default_id).prop("checked",true)}})})},SetCurrencyContainerEvent:function(){var tr=$(".apbd-cur-container:not(.aev-dded)");if(tr){tr.addClass("aev-dded");tr.find(".apbd-cur-input").on("change",function(){var parentTr=$(this).closest("tr");coreObj.UpdateCurrency(parentTr)});tr.find(".apbd-mc-up-rate").on("click",function(){var parentTr=$(this).closest("tr");var thisObj=$(this);var itag=thisObj.find("> i");$.ajax({url:url_helper.ajax_url("action=wc-multi-currency_AJ_APBDWMC_general_get-rate"),data:{cur:parentTr.find("[name=mc_code]").val()},type:"POST",scriptCharset:"utf-8",dataType:"json",beforeSend:function(){var oldClass=itag.attr("class");itag.data("old-class",oldClass);itag.attr("class","icon-loading")},success:function(rdata){if(rdata.status){parentTr.find("input[name=mc_rate]").val(rdata.data)}else{APPSBDAPPJS.notification.ShowSwal(rdata)}},complete:function(jqXHR,textStatus){itag.attr("class",itag.data("old-class"))}});coreObj.UpdateCurrency(parentTr)})}},OnRowDeleted:function(rdata,elem){if(rdata.status){elem.closest("tr").remove()}APPSBDAPPJS.notification.ShowSwal(rdata);APPSBDAPPJS.core.CallOnEvent("mc-del-currency",rdata.data)}};module.exports=coreObj}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./url_helper":4}],3:[function(require,module,exports){(function(global){(function(){"use strict";global.mc_default_id="";const url_helper=require("./url_helper");var locationObj={Init:function(){APPSBDAPPJS.core.AddOnEvent("mc-new-currency",locationObj.onNewCurrency);APPSBDAPPJS.core.AddOnEvent("mc-up-currency",locationObj.onUpdateCurrency);APPSBDAPPJS.core.AddOnEvent("mc-del-currency",locationObj.onDeleteCurrency);locationObj.SetEvent()},onUpdateCurrency:function(rdata){try{if(rdata.has_currency_change){$("#APBDWMC_location #cloc-"+rdata.id+" .apbd-cur-title").html(rdata.currency_title)}}catch(e){}},onNewCurrency:function(curObj){console.log(curObj);locationObj.ReloadCurrencyHtml()},onDeleteCurrency:function(curID){console.log(curID);locationObj.ReloadCurrencyHtml()},SetEvent:function(){$("#APBDWMC_location").on("click",".apbd-all-country",function(e){e.preventDefault();var parentTr=$(this).closest("td");parentTr.find(".apbd-app-multi-select option").prop("selected",true).trigger("change")});$("#APBDWMC_location").on("click",".apbd-empty-country",function(e){e.preventDefault();var parentTr=$(this).closest("td");parentTr.find(".apbd-app-multi-select option").prop("selected",false).trigger("change")})},ReloadCurrencyHtml:function(){$.ajax({url:url_helper.ajax_url("action=wc-multi-currency_AJ_APBDWMC_location_get-html"),type:"GET",scriptCharset:"utf-8",dataType:"html",success:function(rdata){$("#currency-location-container").html(rdata);try{$(".apbd-app-multi-select").select2()}catch(e){}}})}};module.exports=locationObj}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./url_helper":4}],4:[function(require,module,exports){(function(global){(function(){"use strict";global.mc_default_id="";var url_helper={ajax_url:function($action){return window.WCMULTICURRENCY.ajax_url+"&"+$action}};module.exports=url_helper}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],5:[function(require,module,exports){(function(global){(function(){"use strict";global.jQuery=global.$=jQuery;window.APPSBDAPPJS_MC={General:require("./modules/general"),Location:require("./modules/location"),Gateway:require("./modules/gateway"),Initialize:function(){APPSBDAPPJS_MC.General.Init();APPSBDAPPJS_MC.Location.Init();APPSBDAPPJS_MC.Gateway.Init()}};jQuery(document).ready(function($){APPSBDAPPJS_MC.Initialize();try{$("#APBDWMC_location .apbd-app-multi-select").each(function(){let $this=$(this),selectedValue=$(this).data("selectedvalue");var exSelectedArray=selectedValue.split(",");$this.select2({multiple:true});$this.val(exSelectedArray).trigger("change")})}catch(e){}$(".apbd-pro-btn").on("click",function(e){e.preventDefault();$("#apbd_pro_modal").modal("show")});$("#apbd_pro_modal").on("show.bs.modal",function(e){var datain=$("#apbd_pro_modal").data("in-anim");var dataout=$("#apbd_pro_modal").data("out-anim");$("#apbd_pro_modal .modal-dialog").removeClass(dataout).addClass(datain)});$("#apbd_pro_modal").on("hide.bs.modal",function(e){var datain=$("#apbd_pro_modal").data("in-anim");var dataout=$("#apbd_pro_modal").data("out-anim");$("#apbd_pro_modal .modal-dialog").removeClass(datain).addClass(dataout)})})}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./modules/gateway":1,"./modules/general":2,"./modules/location":3}]},{},[5]);