X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-core.js;h=da57e9486a93c268f7ee9fd421e5dca674535b2b;hb=b9ec634af85ea55b6241d4ffe1c23189a2840f26;hp=b30b38007c43814a1e51a2f2184732441b0896bc;hpb=857d9397ed4c8bee8e96747e4619297bcaff9c87;p=mkws-moved-to-github.git diff --git a/src/mkws-core.js b/src/mkws-core.js index b30b380..da57e94 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -84,7 +84,7 @@ if (mkws_config == null || typeof mkws_config != 'object') { // wrapper to call team() after page load (function (j) { - mkws.log = function (string) { + function log(string) { if (!mkws.log_level) return; @@ -100,10 +100,10 @@ if (mkws_config == null || typeof mkws_config != 'object') { } console.log(string); } - var log = mkws.log; + mkws.log = log; - mkws.handleNodeWithTeam = function(node, callback) { + function handleNodeWithTeam(node, callback) { // First branch for DOM objects; second branch for jQuery objects var classes = node.className || node.attr('class'); if (!classes) { @@ -161,6 +161,9 @@ if (mkws_config == null || typeof mkws_config != 'object') { }; + // The following functions are dispatchers for team methods that + // are called from the UI using a te3am-name rather than implicit + // context. mkws.switchView = function(tname, view) { mkws.teams[tname].switchView(view); } @@ -353,7 +356,7 @@ if (mkws_config == null || typeof mkws_config != 'object') { // the mkwsTeam_* class. Make all team objects. var then = $.now(); $('[class^="mkws"],[class*=" mkws"]').each(function () { - mkws.handleNodeWithTeam(this, function(tname, type) { + handleNodeWithTeam(this, function(tname, type) { if (!mkws.teams[tname]) { mkws.teams[tname] = team(j, tname); log("Made MKWS team '" + tname + "'"); @@ -365,7 +368,7 @@ if (mkws_config == null || typeof mkws_config != 'object') { // that sometimes makes new widget nodes (e.g. creating // mkwsTermlists inside mkwsResults. $('[class^="mkws"],[class*=" mkws"]').each(function () { - mkws.handleNodeWithTeam(this, function(tname, type) { + handleNodeWithTeam(this, function(tname, type) { var myTeam = mkws.teams[tname]; var myWidget = widget(j, myTeam, type, this); });