From ceab24db2a7bf459684a650c287770b4ff090f54 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 7 Jun 2011 22:46:47 +0000 Subject: Refs #3510, #9113. Updated tinyMCE version in trunk. git-svn-id: http://code.elgg.org/elgg/trunk@9140 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../tiny_mce/plugins/autosave/editor_plugin_src.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js') diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js index d8cc1120f..061cf1351 100644 --- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js +++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js @@ -106,7 +106,7 @@ ed.addButton(RESTORE_DRAFT, { title : PLUGIN_NAME + ".restore_content", onclick : function() { - if (ed.getContent().replace(/\s| |<\/?p[^>]*>|]*>/gi, "").length > 0) { + if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|]*>/gi, "").length > 0) { // Show confirm dialog if the editor isn't empty ed.windowManager.confirm( PLUGIN_NAME + ".warning_message", @@ -257,15 +257,24 @@ userDataElement.setAttribute(key, value); userDataElement.expires = self.getExpDate(); - userDataElement.save("TinyMCE"); + + try { + userDataElement.save("TinyMCE"); + } catch (e) { + // Ignore, saving might fail if "Userdata Persistence" is disabled in IE + } }, getItem : function(key) { var userDataElement = ed.getElement(); - userDataElement.load("TinyMCE"); - - return userDataElement.getAttribute(key); + try { + userDataElement.load("TinyMCE"); + return userDataElement.getAttribute(key); + } catch (e) { + // Ignore, loading might fail if "Userdata Persistence" is disabled in IE + return null; + } }, removeItem : function(key) { @@ -303,7 +312,7 @@ return; // Store contents if the contents if longer than the minlength of characters - content = editor.getContent(); + content = editor.getContent({draft: true}); if (content.length > editor.settings.autosave_minlength) { expires = self.getExpDate(); -- cgit v1.2.3