repo: janusweb action: commit revision: path_from: revision_from: 05c3347546bd79592d27f4ca2633573adb85c7c8: path_to: revision_to:
commit 05c3347546bd79592d27f4ca2633573adb85c7c8 Author: James BaicoianuDate: Wed Jan 13 01:11:54 2021 -0800 room.cookies localStorage implementation diff --git a/scripts/room.js b/scripts/room.js
--- a/scripts/room.js
+++ b/scripts/room.js
@@ -856,6 +856,11 @@ elation.require([
this.properties.run_speed = room.run_speed || 5.4;
this.properties.cursor_visible = room.cursor_visible;
+ let cookieStorageID = 'cookies.' + this.url;
+ if (cookieStorageID in localStorage) {
+ this.cookies = JSON.parse(localStorage['cookies.' + this.url]);
+ }
+
if (room.onload) {
this.properties.onload = room.onload;
this.addEventListenerProxy('room_load_complete', (ev) => { let func = new Function(room.onload); func();});
@@ -1481,6 +1486,7 @@ elation.require([
}
this.addCookie = function(name, value) {
this.cookies[name] = value;
+ localStorage['cookies.' + this.url] = JSON.stringify(this.cookies);
}
this.doScriptOnload = function() {
if (--this.pendingScripts <= 0) {
-----END OF PAGE-----