]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/autosave/editor_plugin.js
Wordpress 2.3.2
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / autosave / editor_plugin.js
index 28d7ae7607cce5dfbf7bf9f4a7b28f9305c36620..2cdfb09bb485c85008b44fe2d04b2e87c66bf447 100644 (file)
@@ -1,2 +1,46 @@
-/* Import plugin specific language pack */\r
- tinyMCE.importPluginLanguagePack('autosave','en,sv,cs,he,no,hu,de,da,ru,ru_KOI8-R,ru_UTF-8,fi,cy,es,is,pl');function TinyMCE_autosave_getInfo(){return{longname:'Auto save',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_autosave_beforeUnloadHandler(){var msg=tinyMCE.getLang("lang_autosave_unload_msg");var anyDirty=false;for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(inst.isDirty())return msg;}return;}window.onbeforeunload=TinyMCE_autosave_beforeUnloadHandler;
\ No newline at end of file
+/**
+ * $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);