cur.id = data[i].id;
cur.hits = data[i].hits;
cur.diagnostic = data[i].diagnostic;
+ cur.message = data[i].message;
cur.records = data[i].records;
cur.state = data[i].state;
cleandata.push(cur);
}
- var template = that.team.loadTemplate(that.config.template || "Targets");
+ var template = that.team.loadTemplate(that.config.template || "targets");
that.node.html(template({data: cleandata}));
});
});
mkws.registerWidgetType('stat', function() {
var that = this;
this.team.queue("stat").subscribe(function(data) {
- var template = that.team.loadTemplate(that.config.template || "Stat");
+ var template = that.team.loadTemplate(that.config.template || "stat");
that.node.html(template(data));
});
});
output.found = data.total;
//client indexes pages from 1 but pz2 from 0
- var onsides = 6;
+ var onsides = 5;
var pages = Math.ceil(that.team.totalRecordCount() / that.team.perpage());
var currentPage = that.team.currentPage();
if (pages - currentPage > 0) output.nextClick = "mkws.pagerNext(\'" + teamName + "\')";
- var template = that.team.loadTemplate(that.config.template || "Pager");
+ var template = that.team.loadTemplate(that.config.template || "pager");
that.node.html(template(output));
});
});
});
}
this.team.queue("record").subscribe(function(data) {
- console.log(data);
if ($.inArray(recid, data.recid) > -1) {
- var template = that.team.loadTemplate(that.config.template || "Record");
+ var template = that.team.loadTemplate(that.config.template || "details");
that.node.html(template(data));
}
});
- that.autosearch();
});
mkws.registerWidgetType('records', function() {
this.team.queue("records").subscribe(function(data) {
for (var i = 0; i < data.hits.length; i++) {
var hit = data.hits[i];
- that.team.queue("record").publish(hit);
hit.detailLinkId = team.recordElementId(hit.recid[0]);
hit.detailClick = "mkws.showDetails('" + team.name() + "', '" + hit.recid[0] + "');return false;";
- hit.containerClass = "mkws-summary mkws-team-" + team.name();
+ hit.containerClass = "mkws-summary mkwsSummary mkws-team-" + team.name();
hit.containerClass += " " + hit.detailLinkId;
// ### At some point, we may be able to move the
// m_currentRecordId and m_currentRecordData members
}
}
}
- var template = team.loadTemplate(that.config.template || "Records");
- var targs = $.extend({}, {"hits": data.hits}, that.config.template_vars);
- that.node.html(template(targs));
+ var template = team.loadTemplate(that.config.template || "records");
+ var summaryPartial = team.loadTemplate(that.config['summary-template'] || "summary");
+ var tdata = $.extend({}, {"hits": data.hits}, that.config.template_vars);
+ that.node.html(template(tdata, {"partials":{"summary":summaryPartial}}));
});
that.autosearch();
output.filters.push(cur);
});
- var template = that.team.loadTemplate(that.config.template || "Navi");
+ var template = that.team.loadTemplate(that.config.template || "navi");
that.node.html(template(output));
});
});
-// It seems this and the per-page widget doen't need to subscribe to
+// It seems this and the Perpage widget doen't need to subscribe to
// anything, since they produce events rather than consuming them.
//
mkws.registerWidgetType('sort', function() {
mkws.registerWidgetType('done', function() {
var that = this;
this.team.queue("complete").subscribe(function(n) {
- var template = that.team.loadTemplate(that.config.template || "Done");
+ var template = that.team.loadTemplate(that.config.template || "done");
that.node.html(template({count: n}));
});
});
var output = {};
output.recordClick = "mkws.switchView(\'" + tname + "\', \'records\')";
output.targetClick = "mkws.switchView(\'" + tname + "\', \'targets\')";
- var template = this.team.loadTemplate(this.config.template || "Switch");
+ var template = this.team.loadTemplate(this.config.template || "switch");
this.node.html(template(output));
this.hideWhenNarrow();
});
mkws.registerWidgetType('search', function() {
var output = {};
output.team = this.team.name();
- output.queryWidth = this.config.query_width;
- var template = this.team.loadTemplate(this.config.template || "Search");
+ var template = this.team.loadTemplate(this.config.template || "search");
this.node.html(template(output));
});
mkws.registerWidgetType('results', function() {
- var template = this.team.loadTemplate(this.config.template || "Results");
+ var template = this.team.loadTemplate(this.config.template || "results");
this.node.html(template({team: this.team.name()}));
this.autosearch();
});
output.perPage.push(cur);
}
- var template = this.team.loadTemplate(this.config.template || "Ranking");
+ var template = this.team.loadTemplate(this.config.template || "ranking");
this.node.html(template(output));
});
var list = [];
/* display a list of configured languages, or all */
- var lang_options = this.config.lang_options || [];
+ var lang_options = this.config.lang_options;
var toBeIncluded = {};
for (var i = 0; i < lang_options.length; i++) {
toBeIncluded[lang_options[i]] = true;
this.log("language menu: " + list.join(", "));
- var template = this.team.loadTemplate(this.config.template || "Lang");
+ var template = this.team.loadTemplate(this.config.template || "lang");
this.node.html(template({languages: list}));
this.hideWhenNarrow();
var that = this;
this.node.hide();
this.team.queue("stat").subscribe(function(data) {
- var template = that.team.loadTemplate(that.config.template || "Progress");
+ var template = that.team.loadTemplate(that.config.template || "progress");
that.node.html(template({
done: data.clients - data.activeclients,
waiting: data.activeclients