mirror of https://github.com/zulip/zulip.git
Add a localstorage.js module
(imported from commit 9f3ab248ce84ce296bb1fb918de3b2dd8cde1ded)
This commit is contained in:
parent
e24dcb3952
commit
24cb5fb079
|
@ -0,0 +1,21 @@
|
||||||
|
var localstorage = (function () {
|
||||||
|
|
||||||
|
var exports = {};
|
||||||
|
|
||||||
|
var warned_of_localstorage = false;
|
||||||
|
|
||||||
|
exports.supported = function supports_localstorage() {
|
||||||
|
try {
|
||||||
|
return window.hasOwnProperty('localStorage') && window.localStorage !== null;
|
||||||
|
} catch (e) {
|
||||||
|
if (!warned_of_localstorage) {
|
||||||
|
blueslip.error("Client browser does not support local storage, will lose socket message on reload");
|
||||||
|
warned_of_localstorage = true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return exports;
|
||||||
|
|
||||||
|
}());
|
|
@ -44,6 +44,9 @@ var globals =
|
||||||
// echo.js
|
// echo.js
|
||||||
+ ' echo'
|
+ ' echo'
|
||||||
|
|
||||||
|
// localstorage.js
|
||||||
|
+ ' localstorage'
|
||||||
|
|
||||||
// zulip.js
|
// zulip.js
|
||||||
+ ' all_msg_list home_msg_list narrowed_msg_list current_msg_list get_updates_params'
|
+ ' all_msg_list home_msg_list narrowed_msg_list current_msg_list get_updates_params'
|
||||||
+ ' add_messages'
|
+ ' add_messages'
|
||||||
|
|
|
@ -512,6 +512,7 @@ JS_SPECS = {
|
||||||
'js/summary.js',
|
'js/summary.js',
|
||||||
'js/util.js',
|
'js/util.js',
|
||||||
'js/dict.js',
|
'js/dict.js',
|
||||||
|
'js/localstorage.js',
|
||||||
'js/channel.js',
|
'js/channel.js',
|
||||||
'js/muting.js',
|
'js/muting.js',
|
||||||
'js/muting_ui.js',
|
'js/muting_ui.js',
|
||||||
|
|
Loading…
Reference in New Issue