X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=b1a04d713463aa8d77542b65c7f61b20c2994b73;hb=099876e5483d5fcc77aebc69e63b238e09889b1f;hp=980a5d2dd1053ade4596a2622ee2074b061481f8;hpb=a0495c501ec76cd2cbb99f0934d9b5106ed97413;p=mkws-moved-to-github.git
diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js
index 980a5d2..b1a04d7 100644
--- a/tools/htdocs/mkws.js
+++ b/tools/htdocs/mkws.js
@@ -292,7 +292,7 @@ function team($, teamName) {
{
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);
}
@@ -542,11 +542,11 @@ function team($, teamName) {
}
- // limit the query after clicking the facet
- that.limitQuery = function (field, value)
+ // limit by target functions
+ that.limitTarget = function (id, name)
{
- debug("limitQuery(field=" + field + ", value=" + value + ")");
- m_filters.push({ field: field, value: value });
+ debug("limitTarget(id=" + id + ", name=" + name + ")");
+ m_filters.push({ id: id, name: name });
redraw_navi();
resetPage();
loadSelect();
@@ -555,11 +555,11 @@ function team($, teamName) {
}
- // limit by target functions
- that.limitTarget = function (id, name)
+ // limit the query after clicking the facet
+ that.limitQuery = function (field, value)
{
- debug("limitTarget(id=" + id + ", name=" + name + ")");
- m_filters.push({ id: id, name: name });
+ debug("limitQuery(field=" + field + ", value=" + value + ")");
+ m_filters.push({ field: field, value: value });
redraw_navi();
resetPage();
loadSelect();
@@ -568,7 +568,7 @@ function team($, teamName) {
}
- mkws.delimitQuery = function (field, value)
+ that.delimitQuery = function (field, value)
{
debug("delimitQuery(field=" + field + ", value=" + value + ")");
var newFilters = [];
@@ -577,9 +577,9 @@ function team($, teamName) {
if (filter.field &&
field == filter.field &&
value == filter.value) {
- debug("delimitTarget() removing filter " + $.toJSON(filter));
+ debug("delimitQuery() removing filter " + $.toJSON(filter));
} else {
- debug("delimitTarget() keeping filter " + $.toJSON(filter));
+ debug("delimitQuery() keeping filter " + $.toJSON(filter));
newFilters.push(filter);
}
}
@@ -593,7 +593,7 @@ function team($, teamName) {
}
- mkws.delimitTarget = function (id)
+ that.delimitTarget = function (id)
{
debug("delimitTarget(id=" + id + ")");
var newFilters = [];
@@ -628,11 +628,11 @@ function team($, teamName) {
}
var filter = m_filters[i];
if (filter.id) {
- text += M('source') + ': ' + filter.name + '';
+ text += M('source') + ': ' + filter.name + '';
} else {
- text += M(filter.field) + ': ' + filter.value + '';
}
}
@@ -1381,7 +1381,7 @@ function _mkws_jquery_plugin ($) {
};
- mkws.showDetails = function (prefixRecId, tname) {
+ mkws.showDetails = function (tname, prefixRecId) {
mkws.teams[tname].showDetails(prefixRecId);
}
@@ -1393,6 +1393,13 @@ function _mkws_jquery_plugin ($) {
mkws.teams[tname].limitQuery(field, value);
}
+ mkws.delimitTarget = function (tname, id) {
+ mkws.teams[tname].delimitTarget(id);
+ }
+
+ mkws.delimitQuery = function (tname, field, value) {
+ mkws.teams[tname].delimitQuery(field, value);
+ }
function default_mkws_config() {
/* default mkws config */