tinymce.create("tinymce.plugins.Save",{init:function(e,a){var n=this;n.editor=e,e.addCommand("mceSave",n._save,n),e.addCommand("mceCancel",n._cancel,n),e.addButton("save",{title:"save.save_desc",cmd:"mceSave"}),e.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"}),e.onNodeChange.add(n._nodeChange,n),e.addShortcut("ctrl+s",e.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(e,a,n){(e=this.editor).getParam("save_enablewhendirty")&&(a.setDisabled("save",!e.isDirty()),a.setDisabled("cancel",!e.isDirty()))},_save:function(){var e,a=this.editor;e=tinymce.DOM.get(a.id).form||tinymce.DOM.getParent(a.id,"form"),a.getParam("save_enablewhendirty")&&!a.isDirty()||(tinyMCE.triggerSave(),a.getParam("save_onsavecallback")?a.execCallback("save_onsavecallback",a)&&(a.startContent=tinymce.trim(a.getContent({format:"raw"})),a.nodeChanged()):e?(a.isNotDirty=!0,null!=e.onsubmit&&0==e.onsubmit()||e.submit(),a.nodeChanged()):a.windowManager.alert("Error: No form element found."))},_cancel:function(){var e=this.editor,a=tinymce.trim(e.startContent);e.getParam("save_oncancelcallback")?e.execCallback("save_oncancelcallback",e):(e.setContent(a),e.undoManager.clear(),e.nodeChanged())}}),tinymce.PluginManager.add("save",tinymce.plugins.Save);
