]> code.citadel.org Git - citadel.git/blobdiff - webcit/tiny_mce/plugins/autosave/editor_plugin_src.js
* Removed the Kevin Roth rich text editor and replaced it with TinyMCE.
[citadel.git] / webcit / tiny_mce / plugins / autosave / editor_plugin_src.js
diff --git a/webcit/tiny_mce/plugins/autosave/editor_plugin_src.js b/webcit/tiny_mce/plugins/autosave/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..0c7b901
--- /dev/null
@@ -0,0 +1,28 @@
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('autosave', 'en,sv,cs');
+
+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 (inst.isDirty())
+                       return msg;
+       }
+
+       return;
+}
+
+window.onbeforeunload = TinyMCE_autosave_beforeUnloadHandler;