Mercurial > public > sg101
comparison media/js/tiny_mce/plugins/autosave/editor_plugin_src.js @ 247:6ed2932901fa
Update tinymce to 3.3.9
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 18 Sep 2010 19:54:11 +0000 |
parents | 149c3567fec1 |
children |
comparison
equal
deleted
inserted
replaced
246:e4dc0b649fcb | 247:6ed2932901fa |
---|---|
104 | 104 |
105 // Register restore button | 105 // Register restore button |
106 ed.addButton(RESTORE_DRAFT, { | 106 ed.addButton(RESTORE_DRAFT, { |
107 title : PLUGIN_NAME + ".restore_content", | 107 title : PLUGIN_NAME + ".restore_content", |
108 onclick : function() { | 108 onclick : function() { |
109 if (ed.getContent().replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) { | 109 if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) { |
110 // Show confirm dialog if the editor isn't empty | 110 // Show confirm dialog if the editor isn't empty |
111 ed.windowManager.confirm( | 111 ed.windowManager.confirm( |
112 PLUGIN_NAME + ".warning_message", | 112 PLUGIN_NAME + ".warning_message", |
113 function(ok) { | 113 function(ok) { |
114 if (ok) | 114 if (ok) |
301 // it's original value then there is no point in saving a draft | 301 // it's original value then there is no point in saving a draft |
302 if (!storage.getItem(self.key) && !editor.isDirty()) | 302 if (!storage.getItem(self.key) && !editor.isDirty()) |
303 return; | 303 return; |
304 | 304 |
305 // Store contents if the contents if longer than the minlength of characters | 305 // Store contents if the contents if longer than the minlength of characters |
306 content = editor.getContent(); | 306 content = editor.getContent({draft: true}); |
307 if (content.length > editor.settings.autosave_minlength) { | 307 if (content.length > editor.settings.autosave_minlength) { |
308 expires = self.getExpDate(); | 308 expires = self.getExpDate(); |
309 | 309 |
310 // Store expiration date if needed IE userData has auto expire built in | 310 // Store expiration date if needed IE userData has auto expire built in |
311 if (!self.storage.autoExpires) | 311 if (!self.storage.autoExpires) |