# HG changeset patch # User Atul Varma # Date 1277568610 25200 # Node ID b92bb0974500b98dead80ae88cf64fcc47302c81 # Parent f56852d2076fd687ee0f817d2dbd301a5196e164 Added comments. diff -r f56852d2076f -r b92bb0974500 static-files/index.js --- a/static-files/index.js Sat Jun 26 09:00:46 2010 -0700 +++ b/static-files/index.js Sat Jun 26 09:10:10 2010 -0700 @@ -1,5 +1,11 @@ +// ----------------------------------------------------------------------- +// Config object +// ----------------------------------------------------------------------- +// +// This manages interactions with client-side persistent storage and the +// current login state of the app. + ( - // Config initialization code. function(window) { var Config = window.Config = { get value() { @@ -39,8 +45,13 @@ } )(window); +// ----------------------------------------------------------------------- +// Attendees object +// ----------------------------------------------------------------------- +// +// This manages the list of Summit attendees and their shared metadata. + ( - // Attendee initialization code. function(window) { var req; @@ -102,9 +113,16 @@ return jQuery.ajax(options); }; +// ----------------------------------------------------------------------- +// UserInterface object +// ----------------------------------------------------------------------- +// +// This manages the user interface logic. + ( - // This anonymous closure sets up the UI. function(window) { + var UserInterface = window.UserInterface = {}; + function updateUI() { $(".screen").hide(); $("#" + Config.value.state).show(); @@ -230,9 +248,17 @@ } )(window); +// ----------------------------------------------------------------------- +// Server object +// ----------------------------------------------------------------------- +// +// This sets up an in-browser "server" that can be accessed from other +// windows via a postMessage API. + ( - // Set up the postMessage API. function(window) { + var Server = window.Server = {}; + var attendeeCallbacks = []; var myOrigin = window.location.protocol + "//" + window.location.host;