function my_onshow(data) {
totalRec = data.merged;
// move it out
- var pager = document.getElementById("pager");
+ var pager = document.getElementById("mkwsPager");
pager.innerHTML = "";
pager.innerHTML +='<hr/><div style="float: right">' + M('Displaying') + ': '
+ (data.start + 1) + ' ' + M('to') + ' ' + (data.start + data.num) +
function my_onterm(data) {
// no facets
if (!mkws_config.facets || mkws_config.facets.length == 0) {
- $("#termlist").parent().hide();
+ $("#mkwsTermlists").parent().hide();
return;
}
// display if we first got results
- $("#termlist").parent().show();
+ $("#mkwsTermlists").parent().show();
- var termlists = [];
- termlists.push('<div class="title">' + M('Termlists') + '</div>');
+ var acc = [];
+ acc.push('<div class="title">' + M('Termlists') + '</div>');
var facets = mkws_config.facets;
for(var i = 0; i < facets.length; i++) {
- if (facets[i] == "sources")
- add_single_facet(termlists, "Sources", data.xtargets, SourceMax, null);
- if (facets[i] == "subjects")
- add_single_facet(termlists, "Subjects", data.subject, SubjectMax, "su");
- if (facets[i] == "authors")
- add_single_facet(termlists, "Authors", data.author, AuthorMax, "au");
+ if (facets[i] == "sources") {
+ add_single_facet(acc, "Sources", data.xtargets, SourceMax, null);
+ } else if (facets[i] == "subjects") {
+ add_single_facet(acc, "Subjects", data.subject, SubjectMax, "su");
+ } else if (facets[i] == "authors") {
+ add_single_facet(acc, "Authors", data.author, AuthorMax, "au");
+ } else {
+ alert("bad facet configuration: '" + facets[i] + "'");
+ }
}
- var termlist = document.getElementById("termlist");
- replaceHtml(termlist, termlists.join(''));
+ var termlist = document.getElementById("mkwsTermlists");
+ replaceHtml(termlist, acc.join(''));
}
function add_single_facet(acc, caption, data, max, cclIndex) {
<table width="100%" border="0" cellpadding="6" cellspacing="0">\
<tr>\
<td width="250" valign="top">\
- <div id="termlist"></div>\
+ <div id="mkwsTermlists"></div>\
</td>\
<td valign="top">\
<div id="ranking">\
' + M('per page') + '.\
</form>\
</div>\
- <div id="pager"></div>\
+ <div id="mkwsPager"></div>\
<div id="navi"></div>\
<div id="results"></div>\
</td>\
domReady();
// on first page, hide the termlist
- $(document).ready(function() { $("#termlist").parent().hide(); } );
+ $(document).ready(function() { $("#mkwsTermlists").parent().hide(); } );
}
/* Responsive web design - change layout on the fly depending on
$("#" + list[i]).hide();
}
- $("#termlist").parent().hide();
- obj = $("#termlist").parent().html();
- $("#mkwsTermlist").html("<hr/>" + obj);
+ $("#mkwsTermlists").parent().hide();
+ obj = $("#mkwsTermlists").parent().html();
+ $("#mkwsShiftedTermlists").html("<hr/>" + obj);
} else {
for(var i = 0; i < list.length; i++) {
$("#" + list[i]).show();
}
- $("#termlist").parent().show();
- $("#mkwsTermlist").html("");
+ $("#mkwsTermlists").parent().show();
+ $("#mkwsShiftedTermlists").html("");
}
};