Rewrite comment for global mkws object.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index 23b76d1..194a595 100644 (file)
@@ -66,15 +66,9 @@ Handlebars.registerHelper('commaList', function(items, options) {
 
 
 
-// Some functions are visible to be called from outside code, namely
-// generated HTML: that.switchView(), showDetails(), limitTarget(),
-// limitQuery(), delimitTarget(), delimitQuery(), pagerPrev(),
-// pagerNext(), showPage(). Also mkws.M() is made available for the
-// Handlebars helper 'translate'
-
-
-// Set up global mkws object. Contains a hash of team objects,
-// indexed by windowid.
+// Set up global mkws object. Contains truly global state such as SP
+// authentication, and a hash of team objects, indexed by windowid.
+//
 var mkws = {
     authenticated: false,
     debug_function: undefined, // will be set during initialisation
@@ -149,7 +143,15 @@ if (mkws_config == null || typeof mkws_config != 'object') {
 }
 
 
-// wrapper for jQuery lib
+// Factory function for team objects. As much as possible, this uses
+// only member variables (prefixed "m_") and inner functions with
+// private scope. Some functions are visibl as member-functions to be
+// called from outside code -- specifically, from generated
+// HTML. These functions are that.switchView(), showDetails(),
+// limitTarget(), limitQuery(), delimitTarget(), delimitQuery(),
+// pagerPrev(), pagerNext(), showPage(). Also mkws.M() is made
+// available for the Handlebars helper 'translate'
+//
 function team($, teamName) {
     var that = {};
     var m_teamName = teamName;
@@ -452,7 +454,7 @@ function team($, teamName) {
 
        m_filters = []
        redraw_navi();
-       resetPage(); // ### the globals it resents should be indexed by windowid
+       resetPage();
        loadSelect();
        triggerSearch(query, sort, targets, windowid);
        that.switchView('records'); // In case it's configured to start off as hidden