X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/wordpress.git/blobdiff_plain/a66f9e26487c560245ef9cd17d7e87c0cbb650af..refs/tags/wordpress-2.5.1:/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js diff --git a/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js b/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js index 2cdfb09b..01a994ee 100644 --- a/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js @@ -1,46 +1 @@ -/** - * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved. - */ - -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('autosave'); - -var TinyMCE_AutoSavePlugin = { - getInfo : function() { - return { - longname : 'Auto save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; - }, - - // Private plugin internal methods - - _beforeUnloadHandler : function() { - var n, inst, anyDirty = false, msg = tinyMCE.getLang("lang_autosave_unload_msg"); - - if (tinyMCE.getParam("fullscreen_is_enabled")) - return; - - for (n in tinyMCE.instances) { - inst = tinyMCE.instances[n]; - - if (!tinyMCE.isInstance(inst)) - continue; - - if (inst.isDirty()) - return msg; - } - - return; - } -}; - -window.onbeforeunload = TinyMCE_AutoSavePlugin._beforeUnloadHandler; - -tinyMCE.addPlugin("autosave", TinyMCE_AutoSavePlugin); +(function(){tinymce.create('tinymce.plugins.AutoSavePlugin',{init:function(ed,url){var t=this;t.editor=ed;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;},getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinymce.majorVersion+"."+tinymce.minorVersion};},'static':{_beforeUnloadHandler:function(){var msg;tinymce.each(tinyMCE.editors,function(ed){if(ed.getParam("fullscreen_is_enabled"))return;if(ed.isDirty()){msg=ed.getLang("autosave.unload_msg");return false;}});return msg;}}});tinymce.PluginManager.add('autosave',tinymce.plugins.AutoSavePlugin);})(); \ No newline at end of file