ed.addButton(RESTORE_DRAFT, {\r
title : PLUGIN_NAME + ".restore_content",\r
onclick : function() {\r
- if (ed.getContent().replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) {\r
+ if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) {\r
// Show confirm dialog if the editor isn't empty\r
ed.windowManager.confirm(\r
PLUGIN_NAME + ".warning_message",\r
return;\r
\r
// Store contents if the contents if longer than the minlength of characters\r
- content = editor.getContent();\r
+ content = editor.getContent({draft: true});\r
if (content.length > editor.settings.autosave_minlength) {\r
expires = self.getExpDate();\r
\r