aboutsummaryrefslogtreecommitdiffstats
path: root/library/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js
diff options
context:
space:
mode:
authortony baldwin <tonybaldwin@gmx.com>2012-03-21 01:36:23 -0400
committertony baldwin <tonybaldwin@gmx.com>2012-03-21 01:36:23 -0400
commite5c29fcc786cee73c08247824cb87e9ed65a2c36 (patch)
tree1e5a6fcf5ba20e5effdd60e6d6ffa5fadb11d9d7 /library/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js
parentcf17606d0f6200296b1e6d67f9ae3fb797e0df69 (diff)
parentb4a2dae0850ed72b61b008e44efa98f300ccd640 (diff)
downloadvolse-hubzilla-e5c29fcc786cee73c08247824cb87e9ed65a2c36.tar.gz
volse-hubzilla-e5c29fcc786cee73c08247824cb87e9ed65a2c36.tar.bz2
volse-hubzilla-e5c29fcc786cee73c08247824cb87e9ed65a2c36.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'library/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js')
-rw-r--r--[-rwxr-xr-x]library/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js23
1 files changed, 16 insertions, 7 deletions
diff --git a/library/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js
index d8cc1120f..8311483f9 100755..100644
--- a/library/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js
+++ b/library/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|&nbsp;|<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) {
+ if (ed.getContent({draft: true}).replace(/\s|&nbsp;|<\/?p[^>]*>|<br[^>]*>/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();
@@ -326,7 +335,7 @@
* @method restoreDraft
*/
restoreDraft : function() {
- var self = this, storage = self.storage;
+ var self = this, storage = self.storage, content;
if (storage) {
content = storage.getItem(self.key);