Mercurial > public > sg101
annotate media/js/tiny_mce/plugins/autosave/editor_plugin_src.js @ 45:a5b4c5ce0658
Breaking down and controlling all media files, including javascript libraries.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 19 Jun 2009 03:16:03 +0000 |
parents | |
children | 149c3567fec1 |
rev | line source |
---|---|
bgneal@45 | 1 /** |
bgneal@45 | 2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ |
bgneal@45 | 3 * |
bgneal@45 | 4 * @author Moxiecode |
bgneal@45 | 5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. |
bgneal@45 | 6 */ |
bgneal@45 | 7 |
bgneal@45 | 8 (function() { |
bgneal@45 | 9 tinymce.create('tinymce.plugins.AutoSavePlugin', { |
bgneal@45 | 10 init : function(ed, url) { |
bgneal@45 | 11 var t = this; |
bgneal@45 | 12 |
bgneal@45 | 13 t.editor = ed; |
bgneal@45 | 14 |
bgneal@45 | 15 window.onbeforeunload = tinymce.plugins.AutoSavePlugin._beforeUnloadHandler; |
bgneal@45 | 16 }, |
bgneal@45 | 17 |
bgneal@45 | 18 getInfo : function() { |
bgneal@45 | 19 return { |
bgneal@45 | 20 longname : 'Auto save', |
bgneal@45 | 21 author : 'Moxiecode Systems AB', |
bgneal@45 | 22 authorurl : 'http://tinymce.moxiecode.com', |
bgneal@45 | 23 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', |
bgneal@45 | 24 version : tinymce.majorVersion + "." + tinymce.minorVersion |
bgneal@45 | 25 }; |
bgneal@45 | 26 }, |
bgneal@45 | 27 |
bgneal@45 | 28 // Private plugin internal methods |
bgneal@45 | 29 |
bgneal@45 | 30 'static' : { |
bgneal@45 | 31 _beforeUnloadHandler : function() { |
bgneal@45 | 32 var msg; |
bgneal@45 | 33 |
bgneal@45 | 34 tinymce.each(tinyMCE.editors, function(ed) { |
bgneal@45 | 35 if (ed.getParam("fullscreen_is_enabled")) |
bgneal@45 | 36 return; |
bgneal@45 | 37 |
bgneal@45 | 38 if (ed.isDirty()) { |
bgneal@45 | 39 msg = ed.getLang("autosave.unload_msg"); |
bgneal@45 | 40 return false; |
bgneal@45 | 41 } |
bgneal@45 | 42 }); |
bgneal@45 | 43 |
bgneal@45 | 44 return msg; |
bgneal@45 | 45 } |
bgneal@45 | 46 } |
bgneal@45 | 47 }); |
bgneal@45 | 48 |
bgneal@45 | 49 // Register plugin |
bgneal@45 | 50 tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSavePlugin); |
bgneal@45 | 51 })(); |