|
|
|
@ -68,11 +68,34 @@ define(["app/i18n"], function(i18n) {
|
|
|
|
|
.replace(/\n/gi, '<br>');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Safari private browsing mode supports localStorage, but throws QUOTA_EXCEEDED_ERR
|
|
|
|
|
var localStorageImpl;
|
|
|
|
|
try {
|
|
|
|
|
localStorage.setItem("x", "y");
|
|
|
|
|
localStorage.removeItem("x");
|
|
|
|
|
localStorageImpl = localStorage;
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
localStorageImpl = (function(storage) {
|
|
|
|
|
return {
|
|
|
|
|
setItem: function(key, val) {
|
|
|
|
|
storage[key] = val;
|
|
|
|
|
},
|
|
|
|
|
getItem: function(key) {
|
|
|
|
|
return typeof(storage[key]) !== 'undefined' ? storage[key] : null;
|
|
|
|
|
},
|
|
|
|
|
removeItem: function(key) {
|
|
|
|
|
delete storage[key];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
})({});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
cookie: cookie,
|
|
|
|
|
pad: pad,
|
|
|
|
|
ago: ago,
|
|
|
|
|
text: text,
|
|
|
|
|
detext: detext
|
|
|
|
|
detext: detext,
|
|
|
|
|
localStorageImpl: localStorageImpl
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|