X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=3a44f46fee77749e73860299dd20d19944a503ae;hb=5ef5d20b3d8c331c19adaa6920f0849fb4984dd8;hp=fe9473ab5b6bab818c66485ef28af990f40a6486;hpb=e5ef5a50508cf1d503e813280a11b3455f7991af;p=mkws-moved-to-github.git
diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js
index fe9473a..3a44f46 100644
--- a/tools/htdocs/mkws.js
+++ b/tools/htdocs/mkws.js
@@ -66,14 +66,13 @@ Handlebars.registerHelper('commaList', function(items, options) {
Handlebars.registerHelper('index1', function(obj) {
- mkws.debug($.toJSON(obj));
return obj.data.index + 1;
});
// Set up global mkws object. Contains truly global state such as SP
-// authentication, and a hash of team objects, indexed by windowid.
+// authentication, and a hash of team objects, indexed by team-name.
//
var mkws = {
authenticated: false,
@@ -149,6 +148,73 @@ if (mkws_config == null || typeof mkws_config != 'object') {
}
+// Factory function for widget objects.
+function widget($, team, type, node) {
+ var that = {
+ team: team,
+ type: type,
+ node: node
+ };
+
+ var M = mkws.M;
+
+ if (type === 'Targets') {
+ promoteTargets();
+ } else if (type === 'Stat') {
+ promoteStat();
+ } else {
+ // ### Handle other types here
+ }
+
+ mkws.debug("made widget(team=" + team + ", type=" + type + ", node=" + node);
+ return that;
+
+
+ // Functions follow for promoting the regular widget object into
+ // widgets of specific types. These could be moved outside of the
+ // widget object, or even into their own source files.
+
+ function promoteTargets() {
+ team.queue("targets").subscribe(function(data) {
+ if (node.length === 0) alert("huh?!");
+
+ var table ='
' +
+ '
' + M('Target ID') + '
' +
+ '
' + M('Hits') + '
' +
+ '
' + M('Diags') + '
' +
+ '
' + M('Records') + '
' +
+ '
' + M('State') + '
' +
+ '
';
+
+ for (var i = 0; i < data.length; i++) {
+ table += "
" + data[i].id +
+ "
" + data[i].hits +
+ "
" + data[i].diagnostic +
+ "
" + data[i].records +
+ "
" + data[i].state + "
";
+ }
+
+ table += '
';
+ var subnode = $(node).children('.mkwsBytarget');
+ subnode.html(table);
+ });
+ }
+
+
+ function promoteStat() {
+ team.queue("stat").subscribe(function(data) {
+ if (node.length === 0) alert("huh?!");
+
+ $(node).html('' + M('Status info') + '' +
+ ' -- ' +
+ '' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '' +
+ ' -- ' +
+ '' + M('Retrieved records') + ': ' + data.records + '/' + data.hits + '');
+ });
+ }
+}
+
+
// 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
@@ -160,6 +226,7 @@ if (mkws_config == null || typeof mkws_config != 'object') {
function team($, teamName) {
var that = {};
var m_teamName = teamName;
+ that.name = function() { return m_teamName; }
var m_submitted = false;
var m_query; // initially undefined
var m_sort; // will be set below
@@ -175,6 +242,7 @@ function team($, teamName) {
"last": $.now()
};
var m_paz; // will be initialised below
+ var m_template = {};
var debug = function (s) {
@@ -188,121 +256,56 @@ function team($, teamName) {
debug("start running MKWS");
m_sort = mkws_config.sort_default;
- debug("copied mkws_config.sort_default '" + mkws_config.sort_default + "' to m_sort");
-
- if (mkws_config.query_width < 5 || mkws_config.query_width > 150) {
- debug("Reset query width: " + mkws_config.query_width);
- mkws_config.query_width = 50;
- }
-
- for (var key in mkws_config) {
- if (mkws_config.hasOwnProperty(key)) {
- if (key.match(/^language_/)) {
- var lang = key.replace(/^language_/, "");
- // Copy custom languages into list
- mkws.locale_lang[lang] = mkws_config[key];
- debug("Added locally configured language '" + lang + "'");
- }
- }
- }
-
- // protocol independent link for pazpar2: "//mkws/sp" -> "https://mkws/sp"
- if (mkws_config.pazpar2_url.match(/^\/\//)) {
- mkws_config.pazpar2_url = document.location.protocol + mkws_config.pazpar2_url;
- debug("adjust protocol independent links: " + mkws_config.pazpar2_url);
- }
+ m_perpage = mkws_config.perpage_default;
debug("Create main pz2 object");
// create a parameters array and pass it to the pz2's constructor
// then register the form submit event with the pz2.search function
// autoInit is set to true on default
- m_paz = new pz2({ "onshow": my_onshow,
- "windowid": teamName,
- "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way
+ m_paz = new pz2({ "windowid": teamName,
"pazpar2path": mkws_config.pazpar2_url,
- "oninit": my_oninit,
- "onstat": my_onstat,
- "onterm": (mkws_config.facets.length ? my_onterm : undefined),
- "termlist": mkws_config.facets.join(','),
- "onbytarget": my_onbytarget,
"usesessions" : mkws_config.use_service_proxy ? false : true,
- "showResponseType": '', // or "json" (for debugging?)
- "onrecord": my_onrecord });
-
- if (!isNaN(parseInt(mkws_config.perpage_default))) {
- m_perpage = parseInt(mkws_config.perpage_default);
- }
+ "oninit": onInit,
+ "onbytarget": onBytarget,
+ "onstat": onStat,
+ "onterm": (mkws_config.facets.length ? onTerm : undefined),
+ "onshow": onShow,
+ "onrecord": onRecord,
+ "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way
+ "termlist": mkws_config.facets.join(',')
+ });
//
// pz2.js event handlers:
//
- function my_oninit(teamName) {
+ function onInit() {
debug("init");
m_paz.stat();
m_paz.bytarget();
}
- function my_onshow(data, teamName) {
- debug("show");
- m_totalRec = data.merged;
-
- var pager = $(".mkwsPager.mkwsTeam_" + m_teamName);
- if (pager.length) {
- pager.html(drawPager(data))
- }
-
- var results = $(".mkwsRecords.mkwsTeam_" + m_teamName);
- if (!results.length)
- return;
-
- var html = [];
- for (var i = 0; i < data.hits.length; i++) {
- var hit = data.hits[i];
- html.push('
',
- renderSummary(hit),
- '
');
- if (hit.recid == m_curDetRecId) {
- if (m_curDetRecData)
- html.push(renderDetails(m_curDetRecData));
- }
- }
- results.html(html.join(''));
- }
-
-
- function renderSummary(hit)
- {
- var template = loadTemplate("Summary");
- hit._id = "mkwsRec_" + hit.recid;
- hit._onclick = "mkws.showDetails('" + m_teamName + "', this.id);return false;"
- return template(hit);
+ function onBytarget(data) {
+ debug("target");
+ queue("targets").publish(data);
}
- function my_onstat(data, teamName) {
+ function onStat(data) {
debug("stat");
- var stat = $('.mkwsStat.mkwsTeam_' + teamName);
- if (stat.length === 0)
- return;
-
- stat.html('' + M('Status info') + '' +
- ' -- ' +
- '' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '' +
- ' -- ' +
- '' + M('Retrieved records') + ': ' + data.records + '/' + data.hits + '');
+ queue("stat").publish(data);
}
- function my_onterm(data, teamName) {
+ function onTerm(data) {
debug("term");
- var node = $(".mkwsTermlists.mkwsTeam_" + teamName);
+ var node = findnode(".mkwsTermlists");
if (node.length == 0) return;
// no facets: this should never happen
if (!mkws_config.facets || mkws_config.facets.length == 0) {
- alert("my_onterm called even though we have no facets: " + $.toJSON(data));
+ alert("onTerm called even though we have no facets: " + $.toJSON(data));
node.hide();
return;
}
@@ -316,11 +319,11 @@ function team($, teamName) {
for(var i = 0; i < facets.length; i++) {
if (facets[i] == "xtargets") {
- add_single_facet(acc, "Sources", data.xtargets, 16, null);
+ addSingleFacet(acc, "Sources", data.xtargets, 16, null);
} else if (facets[i] == "subject") {
- add_single_facet(acc, "Subjects", data.subject, 10, "subject");
+ addSingleFacet(acc, "Subjects", data.subject, 10, "subject");
} else if (facets[i] == "author") {
- add_single_facet(acc, "Authors", data.author, 10, "author");
+ addSingleFacet(acc, "Authors", data.author, 10, "author");
} else {
alert("bad facet configuration: '" + facets[i] + "'");
}
@@ -330,7 +333,50 @@ function team($, teamName) {
}
- function add_single_facet(acc, caption, data, max, pzIndex) {
+ function onShow(data, teamName) {
+ debug("show");
+ m_totalRec = data.merged;
+
+ var pager = findnode(".mkwsPager");
+ if (pager.length) {
+ pager.html(drawPager(data))
+ }
+
+ var results = findnode(".mkwsRecords");
+ if (!results.length)
+ return;
+
+ var html = [];
+ for (var i = 0; i < data.hits.length; i++) {
+ var hit = data.hits[i];
+ html.push('
',
+ renderSummary(hit),
+ '
');
+ if (hit.recid == m_curDetRecId) {
+ if (m_curDetRecData)
+ html.push(renderDetails(m_curDetRecData));
+ }
+ }
+ results.html(html.join(''));
+ }
+
+
+ function onRecord(data, args, teamName) {
+ debug("record");
+ // FIXME: record is async!!
+ clearTimeout(m_paz.recordTimer);
+ // in case on_show was faster to redraw element
+ var detRecordDiv = document.getElementById('mkwsDet_' + teamName + '_' + data.recid);
+ if (detRecordDiv) return;
+ m_curDetRecData = data;
+ // Can't use jQuery's $('#x') syntax to find this ID, because it contains spaces.
+ var recordDiv = document.getElementById('mkwsRecdiv_' + teamName + '_' + m_curDetRecData.recid);
+ var html = renderDetails(m_curDetRecData);
+ $(recordDiv).append(html);
+ }
+
+
+ function addSingleFacet(acc, caption, data, max, pzIndex) {
acc.push('
');
acc.push('
' + M(caption) + '
');
for (var i = 0; i < data.length && i < max; i++) {
@@ -340,7 +386,7 @@ function team($, teamName) {
if (!pzIndex) {
// Special case: target selection
acc.push('target_id='+data[i].id+' ');
- if (!target_filtered(data[i].id)) {
+ if (!targetFiltered(data[i].id)) {
action = 'mkws.limitTarget(\'' + m_teamName + '\', this.getAttribute(\'target_id\'),this.firstChild.nodeValue)';
}
} else {
@@ -354,7 +400,7 @@ function team($, teamName) {
}
- function target_filtered(id) {
+ function targetFiltered(id) {
for (var i = 0; i < m_filters.length; i++) {
if (m_filters[i].id === id ||
m_filters[i].id === 'pz:id=' + id) {
@@ -365,47 +411,60 @@ function team($, teamName) {
}
- function my_onrecord(data, args, teamName) {
- debug("record: teamName=" + teamName + ", m_teamName=" + m_teamName);
- // FIXME: record is async!!
- clearTimeout(m_paz.recordTimer);
- // in case on_show was faster to redraw element
- var detRecordDiv = document.getElementById('mkwsDet_' + teamName + '_' + data.recid);
- if (detRecordDiv) return;
- m_curDetRecData = data;
- var recordDiv = document.getElementById('mkwsRecdiv_' + teamName + '_' + m_curDetRecData.recid);
- var html = renderDetails(m_curDetRecData);
- recordDiv.innerHTML += html;
- }
+ function drawPager (data)
+ {
+ var s = '
\
@@ -860,256 +1171,33 @@ function team($, teamName) {
}
- /*
- * All the HTML stuff to render the search forms and
- * result pages.
- */
- function mkws_html_all() {
- mkws_set_lang();
- if (mkws_config.show_lang)
- mkws_html_lang();
-
- debug("HTML search form");
- // ### There is only one match here by design: fix not to bother looping
- $('.mkwsSearch.mkwsTeam_' + m_teamName).each(function (i, obj) {
- var node = this;
- mkws.handle_node_with_team(node, function(tname) {
- $(node).html('\
-');
- });
- });
-
- debug("HTML records");
- // If the team has a .mkwsResults, populate it in the usual
- // way. If not, assume that it's a smarter application that
- // defines its own subcomponents, some or all of the
- // following:
- // .mkwsTermlists
- // .mkwsRanking
- // .mkwsPager
- // .mkwsNavi
- // .mkwsRecords
- if ($(".mkwsResults.mkwsTeam_" + m_teamName).length) {
- $(".mkwsResults.mkwsTeam_" + m_teamName).html('\
-
\
-
\
-
\
- \
-
\
-
\
- \
- \
- \
- \
-
\
-
\
-
\
-
\
- \
-
\
-
\
-
');
- }
-
- var node = $(".mkwsRanking.mkwsTeam_" + m_teamName);
- if (node.length) {
- var ranking_data = '';
- ranking_data += '';
-
- node.html(ranking_data);
- }
-
- mkws_html_switch();
-
- // ### Should not be in the team code, since window size is global
- if (mkws_config.responsive_design_width) {
- // Responsive web design - change layout on the fly based on
- // current screen width. Required for mobile devices.
- $(window).resize(function(e) { mkws.resize_page() });
- // initial check after page load
- $(document).ready(function() { mkws.resize_page() });
- }
-
- $('.mkwsSearchForm.mkwsTeam_' + m_teamName).each(function (i, obj) {
- debug("adding search-forms for team '" + m_teamName + "'");
- var node = this;
- mkws.handle_node_with_team(node, function(tname) {
- debug("adding search-form '" + tname + "' for team '" + m_teamName + "'");
- $(node).submit(onFormSubmitEventHandler);
- });
- });
-
- node = $('.mkwsSort.mkwsTeam_' + m_teamName);
- if (node.length)
- node.change(onSelectDdChange);
- node = $('.mkwsPerpage.mkwsTeam_' + m_teamName);
- if (node.length)
- node.change(onSelectDdChange);
-
- // on first page, hide the termlist
- $(document).ready(function() { $(".mkwsTermlists.mkwsTeam_" + m_teamName).hide(); });
- var motd = $(".mkwsMOTD.mkwsTeam_" + m_teamName);
- var container = $(".mkwsMOTDContainer.mkwsTeam_" + m_teamName);
- if (motd.length && container.length) {
- // Move the MOTD from the provided element down into the container
- motd.appendTo(container);
- }
- }
-
-
- // implement $.parseQuerystring() for parsing URL parameters
- function parseQuerystring() {
- var nvpair = {};
- var qs = window.location.search.replace('?', '');
- var pairs = qs.split('&');
- $.each(pairs, function(i, v){
- var pair = v.split('=');
- nvpair[pair[0]] = pair[1];
- });
- return nvpair;
- }
-
-
- function mkws_set_lang() {
- var lang = parseQuerystring().lang || mkws_config.lang;
- if (!lang || !mkws.locale_lang[lang]) {
- mkws_config.lang = ""
- } else {
- mkws_config.lang = lang;
- }
-
- debug("Locale language: " + (mkws_config.lang ? mkws_config.lang : "none"));
- return mkws_config.lang;
- }
-
-
- function mkws_html_switch() {
- debug("HTML switch for team " + m_teamName);
-
- var node = $(".mkwsSwitch.mkwsTeam_" + m_teamName);
- node.append($('' + M('Records') + ''));
- node.append($("", { text: " | " }));
- node.append($('' + M('Targets') + ''));
-
- debug("HTML targets");
- var node = $(".mkwsTargets.mkwsTeam_" + m_teamName);
- node.html('\
-
\
- No information available yet.\
-
');
- node.css("display", "none");
- }
-
-
- function mkws_html_sort() {
- debug("HTML sort, m_sort = '" + m_sort + "'");
- var sort_html = '';
-
- return sort_html;
- }
-
-
- function mkws_html_perpage() {
- debug("HTML perpage, m_perpage = " + m_perpage);
- var perpage_html = '';
-
- return perpage_html;
- }
-
-
- /* create locale language menu */
- function mkws_html_lang() {
- var lang_default = "en";
- var lang = mkws_config.lang || lang_default;
- var list = [];
-
- /* display a list of configured languages, or all */
- var lang_options = mkws_config.lang_options || [];
- var toBeIncluded = {};
- for (var i = 0; i < lang_options.length; i++) {
- toBeIncluded[lang_options[i]] = true;
- }
-
- for (var k in mkws.locale_lang) {
- if (toBeIncluded[k] || lang_options.length == 0)
- list.push(k);
- }
-
- // add english link
- if (lang_options.length == 0 || toBeIncluded[lang_default])
- list.push(lang_default);
-
- debug("Language menu for: " + list.join(", "));
-
- /* the HTML part */
- var data = "";
- for(var i = 0; i < list.length; i++) {
- var l = list[i];
-
- if (data)
- data += ' | ';
-
- if (lang == l) {
- data += ' ' + l + ' ';
- } else {
- data += ' ' + l + ' '
- }
+ // The following PubSub code is modified from the jQuery manual:
+ // https://api.jquery.com/jQuery.Callbacks/
+ //
+ // Use as:
+ // team.queue("eventName").subscribe(function(param1, param2 ...) { ... });
+ // team.queue("eventName").publish(arg1, arg2, ...);
+
+ var queues = {};
+ var queue = function(id) {
+ if (!queues[id]) {
+ var callbacks = $.Callbacks();
+ queues[id] = {
+ publish: callbacks.fire,
+ subscribe: callbacks.add,
+ unsubscribe: callbacks.remove
+ };
}
-
- $(".mkwsLang.mkwsTeam_" + m_teamName).html(data);
+ return queues[id];
}
-
- /* locale */
- function M(word) {
- var lang = mkws_config.lang;
-
- if (!lang || !mkws.locale_lang[lang])
- return word;
-
- return mkws.locale_lang[lang][word] || word;
- }
- mkws.M = M; // so the Handlebars helper can use it
+ that.queue = queue;
// main
(function() {
try {
- mkws_html_all()
+ mkwsHtmlAll()
}
catch (e) {
@@ -1145,21 +1233,33 @@ function team($, teamName) {
var debug = mkws.debug;
- mkws.handle_node_with_team = function(node, callback) {
- var classes = node.className;
+ mkws.handleNodeWithTeam = function(node, callback) {
+ // First branch for DOM objects; second branch for jQuery objects
+ var classes = node.className || node.attr('class');
+ if (!classes) {
+ // For some reason, if we try to proceed when classes is
+ // undefined, we don't get an error message, but this
+ // function and its callers, up several stack level,
+ // silently return. What a crock.
+ mkws.debug("handleNodeWithTeam() called on node with no classes");
+ return;
+ }
var list = classes.split(/\s+/)
- var tname;
+ var teamName, type;
+
for (var i = 0; i < list.length; i++) {
var cname = list[i];
if (cname.match(/^mkwsTeam_/)) {
- tname = cname.replace(/^mkwsTeam_/, '');
+ teamName = cname.replace(/^mkwsTeam_/, '');
+ } else if (cname.match(/^mkws/)) {
+ type = cname.replace(/^mkws/, '');
}
}
- callback(tname);
+ callback.call(node, teamName, type);
}
- mkws.resize_page = function () {
+ mkws.resizePage = function () {
var list = ["mkwsSwitch", "mkwsLang"];
var width = mkws_config.responsive_design_width;
@@ -1228,7 +1328,7 @@ function team($, teamName) {
}
- function default_mkws_config() {
+ function defaultMkwsConfig() {
/* default mkws config */
var config_default = {
use_service_proxy: true,
@@ -1278,7 +1378,7 @@ function team($, teamName) {
* The username/password is configured in the apache config file
* for the site.
*/
- function authenticate_session(auth_url, auth_domain, pp2_url) {
+ function authenticateSession(auth_url, auth_domain, pp2_url) {
debug("Run service proxy auth URL: " + auth_url);
if (!auth_domain) {
@@ -1304,73 +1404,59 @@ function team($, teamName) {
debug("Service proxy auth successfully done");
mkws.authenticated = true;
- run_auto_searches();
+ runAutoSearches();
});
}
- function run_auto_searches() {
+ function runAutoSearches() {
debug("running auto searches");
for (var teamName in mkws.teams) {
- // ### should check mkwsTermlist as well, for facet-only teams
- var node = $('.mkwsRecords.mkwsTeam_' + teamName);
- var query = node.attr('autosearch');
-
- if (query.match(/^!param!/)) {
- var param = query.replace(/^!param!/, '');
- query = getParameterByName(param);
- debug("obtained query '" + query + "' from param '" + param + "'");
- if (!query) {
- alert("This page has a MasterKey widget that needs a query specified by the '" + param + "' parameter");
- }
- } else if (query.match(/^!path!/)) {
- var index = query.replace(/^!path!/, '');
- var path = window.location.pathname.split('/');
- query = path[path.length - index];
- debug("obtained query '" + query + "' from path-component '" + index + "'");
- if (!query) {
- alert("This page has a MasterKey widget that needs a query specified by the path-component " + index);
- }
- }
-
- debug("teamName '" + teamName + "', node=" + node + ", class='" + node.className + "', query=" + query);
-
- if (query) {
- var sort = node.attr('sort');
- var targets = node.attr('targets');
- var s = "running auto search: '" + query + "'";
- if (teamName) s += " [teamName '" + teamName + "']";
- if (sort) s += " sorted by '" + sort + "'";
- if (targets) s += " in targets '" + targets + "'";
- debug(s);
- var team = mkws.teams[teamName];
- debug($.toJSON(team));
- team.newSearch(query, sort, targets, teamName);
- }
+ mkws.teams[teamName].runAutoSearch();
}
}
- // This function is taken from a StackOverflow answer
- // http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript/901144#901144
- function getParameterByName(name) {
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
- var regex = new RegExp("[\\?&]" + name + "=([^]*)"),
- results = regex.exec(location.search);
- return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
- }
-
-
$(document).ready(function() {
debug("on load ready");
- default_mkws_config();
+ defaultMkwsConfig();
+
+ if (mkws_config.query_width < 5 || mkws_config.query_width > 150) {
+ debug("Reset query width: " + mkws_config.query_width);
+ mkws_config.query_width = 50;
+ }
+
+ for (var key in mkws_config) {
+ if (mkws_config.hasOwnProperty(key)) {
+ if (key.match(/^language_/)) {
+ var lang = key.replace(/^language_/, "");
+ // Copy custom languages into list
+ mkws.locale_lang[lang] = mkws_config[key];
+ debug("Added locally configured language '" + lang + "'");
+ }
+ }
+ }
+
+ if (mkws_config.responsive_design_width) {
+ // Responsive web design - change layout on the fly based on
+ // current screen width. Required for mobile devices.
+ $(window).resize(function(e) { mkws.resizePage() });
+ // initial check after page load
+ $(document).ready(function() { mkws.resizePage() });
+ }
+
+ // protocol independent link for pazpar2: "//mkws/sp" -> "https://mkws/sp"
+ if (mkws_config.pazpar2_url.match(/^\/\//)) {
+ mkws_config.pazpar2_url = document.location.protocol + mkws_config.pazpar2_url;
+ debug("adjust protocol independent links: " + mkws_config.pazpar2_url);
+ }
// Backwards compatibility: set new magic class names on any
// elements that have the old magic IDs.
var ids = [ "Switch", "Lang", "Search", "Pager", "Navi",
"Results", "Records", "Targets", "Ranking",
- "Termlists", "Stat" ];
+ "Termlists", "Stat", "MOTD" ];
for (var i = 0; i < ids.length; i++) {
var id = 'mkws' + ids[i];
var node = $('#' + id);
@@ -1391,23 +1477,27 @@ function team($, teamName) {
// Find all nodes with an class, and determine their team from
// the mkwsTeam_* class. Make all team objects.
+ var then = $.now();
$('[class^="mkws"],[class*=" mkws"]').each(function () {
- var node = this;
- mkws.handle_node_with_team(node, function(tname) {
+ mkws.handleNodeWithTeam(this, function(tname, type) {
if (!mkws.teams[tname]) {
mkws.teams[tname] = team(j, tname);
debug("Made MKWS team '" + tname + "'");
}
+ var myTeam = mkws.teams[tname];
+ var myWidget = widget(j, myTeam, type, this);
});
});
+ var now = $.now();
+ debug("Walking MKWS nodes took " + (now-then) + " ms");
if (mkws_config.use_service_proxy) {
- authenticate_session(mkws_config.service_proxy_auth,
- mkws_config.service_proxy_auth_domain,
- mkws_config.pazpar2_url);
+ authenticateSession(mkws_config.service_proxy_auth,
+ mkws_config.service_proxy_auth_domain,
+ mkws_config.pazpar2_url);
} else {
// raw pp2
- run_auto_searches();
+ runAutoSearches();
}
});
})(jQuery);