summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_SWITCH_THEME.min.js')
-rwxr-xr-xplugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_SWITCH_THEME.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_SWITCH_THEME.min.js b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_SWITCH_THEME.min.js
new file mode 100755
index 00000000..fa6e88cd
--- /dev/null
+++ b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_SWITCH_THEME.min.js
@@ -0,0 +1 @@
+function WMP_SWITCH_THEME(){var a=this;this.type="wmp_themes",this.DOMDoc,this.selectedTheme,this.savingTheme=!1,this.init=function(){WMPJSInterface=window.parent.WMPJSInterface,this.initSelectButtons()},this.initSelectButtons=function(){jQuery("."+a.type+"_select").click(function(){var b=Number(jQuery(this).attr("data-theme"));if(b!=a.selectedTheme){if(1==a.savingTheme)return;confirm("This setting will change the appearance of your app and reset your color schemes and fonts. Are you sure you want to continue?")&&a.switchTheme(b)}})},this.switchTheme=function(b){WMPJSInterface.Preloader.start({message:"Switching theme ..."}),a.savingTheme=!0,jQuery.get(ajaxurl,{action:"wmp_theme_switch",theme:b},function(c){if(WMPJSInterface.Preloader.remove(100),a.savingTheme=!1,c=Boolean(Number(String(c)))){var d=jQuery("."+a.type+'_select[data-theme="'+String(b)+'"]'),e=d.closest(".theme");jQuery(".corner",e).addClass("active"),d.hide(),jQuery(".text-select",e).text("Enabled");var f=jQuery("."+a.type+'_select[data-theme="'+String(a.selectedTheme)+'"]');f.closest(".actions").show();var g=f.closest(".theme");jQuery(".corner",g).removeClass("active"),f.show(),jQuery(".text-select",g).text("Activate"),a.selectedTheme=b;var h="Your mobile app theme has been successfully changed.";WMPJSInterface.Loader.display({message:h})}else{var h="There was an error. Please reload the page and try again.";WMPJSInterface.Loader.display({message:h})}})}}