X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fremoteglot.js;h=f252f5b3a1b903a3af605e4df58e4196c8430b45;hb=2bd99f9e2e92e22e24c3f43baf048cd85889235d;hp=beaf63f74f1bfcba4437c3e4a6ca94aa30a91736;hpb=186934b70a80a776361659bea9e5478183e3aed5;p=remoteglot diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index beaf63f..f252f5b 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -244,12 +244,12 @@ var supports_html5_storage = function() { // Of course, you can never fully protect against people deliberately wanting to spam. var get_unique = function() { var use_local_storage = supports_html5_storage(); - if (use_local_storage && localStorage['unique']) { - return localStorage['unique']; + if (use_local_storage && window['localStorage']['unique']) { + return window['localStorage']['unique']; } var unique = Math.random(); if (use_local_storage) { - localStorage['unique'] = unique; + window['localStorage']['unique'] = unique; } return unique; } @@ -1971,7 +1971,7 @@ var set_sound = function(param_enable_sound) { document.getElementById("soundoff").innerHTML = "Off"; } if (supports_html5_storage()) { - localStorage['enable_sound'] = enable_sound ? 1 : 0; + window['localStorage']['enable_sound'] = enable_sound ? 1 : 0; } } window['set_sound'] = set_sound; @@ -2414,8 +2414,8 @@ var init = function() { unique = get_unique(); // Load settings from HTML5 local storage if available. - if (supports_html5_storage() && localStorage['enable_sound']) { - set_sound(parseInt(localStorage['enable_sound'])); + if (supports_html5_storage() && window['localStorage']['enable_sound']) { + set_sound(parseInt(window['localStorage']['enable_sound'])); } else { set_sound(false); }