blob: 99106f2c4a3f8cc008656b005701b20297049485 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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');
}
};
|