projects
/
mkws-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reverse order of showDetails() arguments to match limitTarget() and
[mkws-moved-to-github.git]
/
tools
/
htdocs
/
mkws.js
diff --git
a/tools/htdocs/mkws.js
b/tools/htdocs/mkws.js
index
815eaa7
..
c79c1e0
100644
(file)
--- a/
tools/htdocs/mkws.js
+++ b/
tools/htdocs/mkws.js
@@
-67,7
+67,7
@@
Handlebars.registerHelper('commaList', function(items, options) {
// Some functions are visible to be called from outside code, namely
// 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'
// limitQuery(), delimitTarget(), delimitQuery(), pagerPrev(),
// pagerNext(), showPage(). Also mkws.M() is made available for the
// Handlebars helper 'translate'
@@
-292,7
+292,7
@@
function team($, teamName) {
{
var template = loadTemplate("Summary");
hit._id = "mkwsRec_" + hit.recid;
{
var template = loadTemplate("Summary");
hit._id = "mkwsRec_" + hit.recid;
- hit._onclick = "mkws.showDetails(this.id, '" + m_teamName + "');return false;"
+ hit._onclick = "mkws.showDetails('" + m_teamName + "', this.id);return false;"
return template(hit);
}
return template(hit);
}
@@
-347,7
+347,7
@@
function team($, teamName) {
function add_single_facet(acc, caption, data, max, pzIndex) {
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">');
acc.push('<div class="termtitle">' + M(caption) + '</div>');
for (var i = 0; i < data.length && i < max; i++) {
acc.push('<div class="term">');
@@
-356,9
+356,9
@@
function team($, teamName) {
if (!pzIndex) {
// Special case: target selection
acc.push('target_id='+data[i].id+' ');
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 {
} 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>');
}
acc.push('onclick="' + action + ';return false;">' + data[i].name + '</a>'
+ ' <span>' + data[i].freq + '</span>');
@@
-457,7
+457,7
@@
function team($, teamName) {
}
m_filters = []
}
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);
resetPage(); // ### the globals it resents should be indexed by windowid
loadSelect(); // ### should use windowid
triggerSearch(query, sort, targets, windowid);
@@
-543,7
+543,7
@@
function team($, teamName) {
// limit the query after clicking the facet
// 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 });
{
debug("limitQuery(field=" + field + ", value=" + value + ")");
m_filters.push({ field: field, value: value });
@@
-556,7
+556,7
@@
function team($, teamName) {
// limit by target functions
// 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 });
{
debug("limitTarget(id=" + id + ", name=" + name + ")");
m_filters.push({ id: id, name: name });
@@
-618,7
+618,7
@@
function team($, teamName) {
function redraw_navi ()
{
function redraw_navi ()
{
- var navi = document.getElementById('mkwsNavi');
+ var navi = $('.mkwsNavi.mkwsTeam_' + m_teamName);
if (!navi) return;
var text = "";
if (!navi) return;
var text = "";
@@
-637,7
+637,7
@@
function team($, teamName) {
}
}
}
}
- navi.innerHTML = text;
+ navi.html(text);
}
}
@@
-1381,10
+1381,18
@@
function _mkws_jquery_plugin ($) {
};
};
- mkws.showDetails = function (prefixRecId, tname) {
+ mkws.showDetails = function (tname, prefixRecId) {
mkws.teams[tname].showDetails(prefixRecId);
}
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 */
function default_mkws_config() {
/* default mkws config */