X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=3c273eb64cd3930f8e7c689500cf1ca24436349d;hb=3465362833b175a4e4fbe6cdd4a6d63ddc031f3f;hp=7152ebb986cb5b7bd086e0f6a12fac5cda0bd36f;hpb=4590674ec009e2e43871920d3fd1f3ffe97e1708;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 7152ebb..3c273eb 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -148,6 +148,19 @@ if (mkws_config == null || typeof mkws_config != 'object') { } +// Factory function for widget objects. +function widget($, team, node) { + var that = { + team: team, + node: node + }; + + // ### More to do here, surely + + return that; +} + + // 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 @@ -503,6 +516,7 @@ function team($, teamName) { debug("triggerSearch(" + m_query + "): filters = " + $.toJSON(m_filters) + ", pp2filter = " + pp2filter + ", params = " + $.toJSON(params)); // We can use: params.torusquery = "udb=NAME" + // Note: that won't work when running against raw pazpar2 m_paz.search(m_query, m_perpage, m_sort, pp2filter, undefined, params); } @@ -1410,6 +1424,8 @@ function team($, teamName) { mkws.teams[tname] = team(j, tname); debug("Made MKWS team '" + tname + "'"); } + var myTeam = mkws.teams[tname] + var myWidget = widget(j, myTeam, node) }); }); var now = $.now();