Wordpress/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js
Ryan Boren a1a8f1af2e Set eol-style to native.
git-svn-id: https://develop.svn.wordpress.org/trunk@4747 602fd350-edb4-49c9-b593-d223f7449a82
2007-01-16 17:52:13 +00:00

47 lines
1.1 KiB
JavaScript

/**
* $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, 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://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html',
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);