X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=ee13dba15fa719cd7a6e2ceab197954a466b89f5;hb=c3390fc0d2188fda0e382a3ee8eca39de2be0a2c;hp=37694228ae9f19a617ef1d7fb25abd1b7e0cfe99;hpb=0afab23ce298ced8796a4762d1e9bb0bfb0703f9;p=mkws-moved-to-github.git
diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js
index 3769422..ee13dba 100644
--- a/tools/htdocs/mkws.js
+++ b/tools/htdocs/mkws.js
@@ -194,12 +194,15 @@ function my_onshow(data) {
totalRec = data.merged;
// move it out
var pager = document.getElementById("mkwsPager");
- pager.innerHTML = "";
- pager.innerHTML +='
' + M('Displaying') + ': '
- + (data.start + 1) + ' ' + M('to') + ' ' + (data.start + data.num) +
- ' ' + M('of') + ' ' + data.merged + ' (' + M('found') + ': '
- + data.total + ')
';
- drawPager(pager);
+ if (pager) {
+ pager.innerHTML = "";
+ pager.innerHTML +='' + M('Displaying') + ': '
+ + (data.start + 1) + ' ' + M('to') + ' ' + (data.start + data.num) +
+ ' ' + M('of') + ' ' + data.merged + ' (' + M('found') + ': '
+ + data.total + ')
';
+ drawPager(pager);
+ }
+
// navi
var results = document.getElementById("mkwsRecords");
@@ -569,10 +572,8 @@ function renderDetails(data, marker)
details += renderField("Subject", data["location"][0]["md-subject"]);
if (locations.length == 0) {
details += 'No locations for record! |
';
- } else if (locations.length == 1) {
- details += renderField("Location", locations);
} else {
- details += renderField("Locations", locations);
+ details += renderField("Location" + (locations.length == 1 ? "" : "s"), locations);
}
details += '';
@@ -674,7 +675,8 @@ function mkws_html_all() {
mkws_html_switch();
if (mkws_config.use_service_proxy)
- mkws_service_proxy_auth(mkws_config.service_proxy_auth);
+ mkws_service_proxy_auth(mkws_config.service_proxy_auth,
+ mkws_config.service_proxy_auth_domain);
if (mkws_config.responsive_design_width) {
// Responsive web design - change layout on the fly based on
@@ -767,13 +769,13 @@ function mkws_html_perpage() {
* The username/password is configured in the apache config file
* for the site.
*/
-function mkws_service_proxy_auth(auth_url) {
+function mkws_service_proxy_auth(auth_url, auth_domain) {
debug("Run service proxy auth URL: " + auth_url);
var request = new pzHttpRequest(auth_url, function(err) {
- alert("HTTP call for authentication failed: " + err)
- return;
- });
+ alert("HTTP call for authentication failed: " + err)
+ return;
+ }, auth_domain);
request.get(null, function(data) {
if (!$.isXMLDoc(data)) {