From 8b8bdf1509ab5811e143b641699c503226e74ea7 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 5 Nov 2012 10:47:50 -0800 Subject: [PATCH] Add more documentation to session. --- guacamole/src/main/webapp/scripts/session.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/guacamole/src/main/webapp/scripts/session.js b/guacamole/src/main/webapp/scripts/session.js index 6538684c3..34eb7aed6 100644 --- a/guacamole/src/main/webapp/scripts/session.js +++ b/guacamole/src/main/webapp/scripts/session.js @@ -19,6 +19,7 @@ /** * Maintains state across multiple Guacamole pages via HTML5 Web Storage. + * @constructor */ function GuacamoleSessionState() { @@ -84,7 +85,19 @@ function GuacamoleSessionState() { return state[name]; }; - // Reload properties every 5 seconds + /** + * Event which is fired whenever a property value is changed externally. + * + * @event + * @param old_state An object whose properties' values are the old values + * of this GuacamoleSessionState. + * @param new_state An object whose properties' values are the new values + * of this GuacamoleSessionState. + * @param {String} name The name of the property that is being changed. + */ + this.onchange = null; + + // Reload properties every second window.setInterval(guac_state.reload, 1000); // Initial load