// Some functions are visible to be called from outside code, namely
-// generated HTML: mkws.switchView(), showDetails(), limitTarget(),
+// generated HTML: that.switchView(), showDetails(), limitTarget(),
// limitQuery(), delimitTarget(), delimitQuery(), pagerPrev(),
// pagerNext(), showPage(). Also mkws.M() is made available for the
// Handlebars helper 'translate'
function add_single_facet(acc, caption, data, max, pzIndex) {
- acc.push('<div class="facet" id="mkwsFacet' + caption + '">');
+ acc.push('<div class="facet mkwsFacet' + caption + ' mkwsTeam_' + m_teamName + '">');
acc.push('<div class="termtitle">' + M(caption) + '</div>');
for (var i = 0; i < data.length && i < max; i++) {
acc.push('<div class="term">');
if (!pzIndex) {
// Special case: target selection
acc.push('target_id='+data[i].id+' ');
- action = 'mkws.limitTarget(this.getAttribute(\'target_id\'),this.firstChild.nodeValue)';
+ action = 'mkws.limitTarget(\'' + m_teamName + '\', this.getAttribute(\'target_id\'),this.firstChild.nodeValue)';
} else {
- action = 'mkws.limitQuery(\'' + pzIndex + '\', this.firstChild.nodeValue)';
+ action = 'mkws.limitQuery(\'' + m_teamName + '\', \'' + pzIndex + '\', this.firstChild.nodeValue)';
}
acc.push('onclick="' + action + ';return false;">' + data[i].name + '</a>'
+ ' <span>' + data[i].freq + '</span>');
}
m_filters = []
- redraw_navi(); // ### should use windowid
+ redraw_navi();
resetPage(); // ### the globals it resents should be indexed by windowid
loadSelect(); // ### should use windowid
triggerSearch(query, sort, targets, windowid);
// limit the query after clicking the facet
- mkws.limitQuery = function (field, value)
+ that.limitQuery = function (field, value)
{
debug("limitQuery(field=" + field + ", value=" + value + ")");
m_filters.push({ field: field, value: value });
// limit by target functions
- mkws.limitTarget = function (id, name)
+ that.limitTarget = function (id, name)
{
debug("limitTarget(id=" + id + ", name=" + name + ")");
m_filters.push({ id: id, name: name });
function redraw_navi ()
{
- var navi = document.getElementById('mkwsNavi');
+ var navi = $('.mkwsNavi.mkwsTeam_' + m_teamName);
if (!navi) return;
var text = "";
}
}
- navi.innerHTML = text;
+ navi.html(text);
}
mkws.teams[tname].showDetails(prefixRecId);
}
+ mkws.limitTarget = function (tname, id, name) {
+ mkws.teams[tname].limitTarget(id, name);
+ }
+
+ mkws.limitQuery = function (tname, field, value) {
+ mkws.teams[tname].limitQuery(field, value);
+ }
+
function default_mkws_config() {
/* default mkws config */