1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 06:25:56 +00:00

split main objects to dojo modules

This commit is contained in:
Andrew Dolgov
2018-12-02 17:18:59 +03:00
parent fda3ad39c8
commit 807ff07454
9 changed files with 2226 additions and 2210 deletions

25
js/ArticleCache.js Normal file
View File

@@ -0,0 +1,25 @@
define(["dojo/_base/declare"], function (declare) {
return declare("fox.ArticleCache", null, {
has_storage: 'sessionStorage' in window && window['sessionStorage'] !== null,
set: function(id, obj) {
if (this.has_storage)
try {
sessionStorage["article:" + id] = obj;
} catch (e) {
sessionStorage.clear();
}
},
get: function(id) {
if (this.has_storage)
return sessionStorage["article:" + id];
},
clear: function() {
if (this.has_storage)
sessionStorage.clear();
},
del: function(id) {
if (this.has_storage)
sessionStorage.removeItem("article:" + id);
},
});
});