summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.min.js')
-rw-r--r--plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.min.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.min.js b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.min.js
index ae0d1ef7..a5b56d9d 100644
--- a/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.min.js
+++ b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.min.js
@@ -1 +1 @@
-function WMP_EDIT_THEME(){var e=this;this.type="wmp_edittheme";this.form;this.DOMDoc;this.send_btn;this.enableCustomSelects=0;this.init=function(){WMPJSInterface=window.parent.WMPJSInterface;this.send_btn=jQuery("#"+this.type+"_send_btn",this.DOMDoc).get(0);this.form=this.DOMDoc.getElementById(this.type+"_form");this.addButtonsActions();if(this.form==null){return}this.initCustomSelects()};this.initCustomSelects=function(){if(this.enableCustomSelects==1){jQuery("#"+e.type+"_fontheadlines").selectBoxIt();jQuery("#"+e.type+"_fontsubtitles").selectBoxIt();jQuery("#"+e.type+"_fontparagraphs").selectBoxIt()}};this.addButtonsActions=function(){jQuery(this.send_btn).unbind("click");jQuery(this.send_btn).bind("click",function(){e.disableButton(this);e.sendData()});e.enableButton(this.send_btn)};this.enableButton=function(e){jQuery(e).css("cursor","pointer");jQuery(e).animate({opacity:1},100)};this.disableButton=function(e){jQuery(e).unbind("click");jQuery(e).animate({opacity:.4},100);jQuery(e).css("cursor","default")};this.submitForm=function(){return WMPJSInterface.AjaxUpload.dosubmit(e.form,{onStart:e.startUploadingData,onComplete:e.completeUploadingData})};this.sendData=function(){jQuery("#"+this.form.id,this.DOMDoc).unbind("submit");jQuery("#"+this.form.id,this.DOMDoc).bind("submit",function(){e.submitForm()});jQuery("#"+this.form.id,this.DOMDoc).submit();e.disableButton(e.send_btn)};this.startUploadingData=function(){WMPJSInterface.Preloader.start();setTimeout(function(){var t=e.form.elements;nElems=t.length;for(j=0;j<nElems;j++){t[j].disabled=true}},300);return true};this.completeUploadingData=function(t){jQuery("#"+e.form.id,e.DOMDoc).unbind("submit");jQuery("#"+e.form.id,e.DOMDoc).bind("submit",function(){return false});WMPJSInterface.Preloader.remove(100);t=Boolean(Number(String(t)));if(t==true){var n="Your app has been successfully modified!";WMPJSInterface.Loader.display({message:n})}else{var n="There was an error. Please reload the page and try again.";WMPJSInterface.Loader.display({message:n})}setTimeout(function(){var t=e.form.elements;nElems=t.length;for(j=0;j<nElems;j++){t[j].disabled=false}},300);e.addButtonsActions()}} \ No newline at end of file
+function WMP_EDIT_THEME(){var JSObject=this;this.type="wmp_edittheme",this.form,this.DOMDoc,this.send_btn,this.enableCustomSelects=0,this.init=function(){WMPJSInterface=window.parent.WMPJSInterface,this.send_btn=jQuery("#"+this.type+"_send_btn",this.DOMDoc).get(0),this.form=this.DOMDoc.getElementById(this.type+"_form"),this.addButtonsActions(),null!=this.form&&(this.initCustomColors(),this.initCustomSelects())},this.initCustomColors=function(){jQuery('input[name^="'+JSObject.type+'_customcolor"]').wpColorPicker(),jQuery('input[name="'+JSObject.type+'_colorscheme"]').click(function(){0==jQuery(this).val()?jQuery(".color-schemes-custom").show():jQuery(".color-schemes-custom").hide()})},this.initCustomSelects=function(){1==this.enableCustomSelects&&(jQuery("#"+JSObject.type+"_fontheadlines").selectBoxIt(),jQuery("#"+JSObject.type+"_fontsubtitles").selectBoxIt(),jQuery("#"+JSObject.type+"_fontparagraphs").selectBoxIt())},this.addButtonsActions=function(){jQuery(this.send_btn).unbind("click"),jQuery(this.send_btn).bind("click",function(){JSObject.disableButton(this),JSObject.sendData()}),JSObject.enableButton(this.send_btn)},this.enableButton=function(e){jQuery(e).css("cursor","pointer"),jQuery(e).animate({opacity:1},100)},this.disableButton=function(e){jQuery(e).unbind("click"),jQuery(e).animate({opacity:.4},100),jQuery(e).css("cursor","default")},this.submitForm=function(){return WMPJSInterface.AjaxUpload.dosubmit(JSObject.form,{onStart:JSObject.startUploadingData,onComplete:JSObject.completeUploadingData})},this.sendData=function(){jQuery("#"+this.form.id,this.DOMDoc).unbind("submit"),jQuery("#"+this.form.id,this.DOMDoc).bind("submit",function(){JSObject.submitForm()}),jQuery("#"+this.form.id,this.DOMDoc).submit(),JSObject.disableButton(JSObject.send_btn)},this.startUploadingData=function(){return WMPJSInterface.Preloader.start(),setTimeout(function(){var e=JSObject.form.elements;for(nElems=e.length,j=0;j<nElems;j++)e[j].disabled=!0},300),!0},this.completeUploadingData=function(responseJSON){jQuery("#"+JSObject.form.id,JSObject.DOMDoc).unbind("submit"),jQuery("#"+JSObject.form.id,JSObject.DOMDoc).bind("submit",function(){return!1}),WMPJSInterface.Preloader.remove(100);var JSON=eval("("+responseJSON+")"),response=Boolean(Number(String(JSON.status)));if(1==response&&0==JSON.messages.length){var message="Your app has been successfully modified!";WMPJSInterface.Loader.display({message:message})}else if(0==JSON.messages.length){var message="There was an error. Please reload the page and try again.";WMPJSInterface.Loader.display({message:message})}else for(var i=0;i<JSON.messages.length;i++)WMPJSInterface.Loader.display({message:JSON.messages[i]});setTimeout(function(){var e=JSObject.form.elements;for(nElems=e.length,j=0;j<nElems;j++)e[j].disabled=!1},300),JSObject.addButtonsActions()}} \ No newline at end of file