diff options
Diffstat (limited to 'htdocs/js/admin/10-draft.js')
-rw-r--r-- | htdocs/js/admin/10-draft.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/htdocs/js/admin/10-draft.js b/htdocs/js/admin/10-draft.js new file mode 100644 index 0000000..99106f2 --- /dev/null +++ b/htdocs/js/admin/10-draft.js @@ -0,0 +1,29 @@ +var Draft = { + get: function() { + if (!LS) return null; + + var title = LS.getItem('draft_title') || null; + var text = LS.getItem('draft_text') || null; + + return { + title: title, + text: text + }; + }, + + setTitle: function(text) { + if (!LS) return null; + LS.setItem('draft_title', text); + }, + + setText: function(text) { + if (!LS) return null; + LS.setItem('draft_text', text); + }, + + reset: function() { + if (!LS) return; + LS.removeItem('draft_title'); + LS.removeItem('draft_text'); + } +};
\ No newline at end of file |