A tumblelog CMS built on AJAX, PHP and MySQL.

editor_plugin_src.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
  3. *
  4. * @author Moxiecode
  5. * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
  6. */
  7. /* Import plugin specific language pack */
  8. tinyMCE.importPluginLanguagePack('autosave');
  9. var TinyMCE_AutoSavePlugin = {
  10. getInfo : function() {
  11. return {
  12. longname : 'Auto save',
  13. author : 'Moxiecode Systems AB',
  14. authorurl : 'http://tinymce.moxiecode.com',
  15. infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',
  16. version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
  17. };
  18. },
  19. // Private plugin internal methods
  20. _beforeUnloadHandler : function() {
  21. var n, inst, anyDirty = false, msg = tinyMCE.getLang("lang_autosave_unload_msg");
  22. if (tinyMCE.getParam("fullscreen_is_enabled"))
  23. return;
  24. for (n in tinyMCE.instances) {
  25. inst = tinyMCE.instances[n];
  26. if (!tinyMCE.isInstance(inst))
  27. continue;
  28. if (inst.isDirty())
  29. return msg;
  30. }
  31. return;
  32. }
  33. };
  34. window.onbeforeunload = TinyMCE_AutoSavePlugin._beforeUnloadHandler;
  35. tinyMCE.addPlugin("autosave", TinyMCE_AutoSavePlugin);