diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-07-11 02:59:35 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-07-11 02:59:40 +0300 |
commit | 864e73cdc75a2fb0e4fad500f649dae2343c10a8 (patch) | |
tree | 6ce6762c6be72c98592a32fe0bed4f2ce751d544 /htdocs/js/admin/10-draft.js | |
parent | cb13ea239b9f1ca6aea43125d5694d5a55dcd287 (diff) |
rewrite css and js assets building
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 |