//>>built
define("dojox/editor/plugins/Save","dojo dijit dojox dijit/_editor/_Plugin dijit/form/Button dojo/_base/connect dojo/_base/declare dojo/i18n dojo/i18n!dojox/editor/plugins/nls/Save".split(" "),function(b,d,g,f){var e=b.declare("dojox.editor.plugins.Save",f,{iconClassPrefix:"dijitAdditionalEditorIcon",url:"",logResults:!0,_initButton:function(){var a=b.i18n.getLocalization("dojox.editor.plugins","Save");this.button=new d.form.Button({label:a.save,showLabel:!1,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+
"Save",tabIndex:"-1",onClick:b.hitch(this,"_save")})},updateState:function(){this.button.set("disabled",this.get("disabled"))},setEditor:function(a){this.editor=a;this._initButton()},_save:function(){var a=this.editor.get("value");this.save(a)},save:function(a){var c={"Content-Type":"text/html"};this.url&&(a={url:this.url,postData:a,headers:c,handleAs:"text"},this.button.set("disabled",!0),a=b.xhrPost(a),a.addCallback(b.hitch(this,this.onSuccess)),a.addErrback(b.hitch(this,this.onError)))},onSuccess:function(a,
c){this.button.set("disabled",!1)},onError:function(a,c){this.button.set("disabled",!1)}});b.subscribe(d._scopeName+".Editor.getPlugin",null,function(a){a.plugin||"save"!==a.args.name.toLowerCase()||(a.plugin=new e({url:"url"in a.args?a.args.url:"",logResults:"logResults"in a.args?a.args.logResults:!0}))});return e});