2007-01-16 18:52:13 +01:00
|
|
|
|
/**
|
2007-01-25 02:20:47 +01:00
|
|
|
|
* $Id: editor_plugin_src.js 162 2007-01-03 16:16:52Z spocke $
|
2007-01-16 18:52:13 +01:00
|
|
|
|
*
|
|
|
|
|
* @author Moxiecode
|
2007-01-25 02:20:47 +01:00
|
|
|
|
* @copyright Copyright <EFBFBD> 2004-2007, Moxiecode Systems AB, All rights reserved.
|
2007-01-16 18:52:13 +01:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* 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);
|