X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=experiments%2Fspclient%2Fmkws.js;h=050475397a8c985ab231d7f1ffce60230990a68f;hb=91117c67b1a2ce7909d3ad2fb6c49b47ddd08673;hp=f14fcf861e1789492cfdacb25e784ed43d81656f;hpb=02cd939666195c78607bdc47479b6361db1cd77a;p=mkws-moved-to-github.git diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index f14fcf8..0504753 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -1,7 +1,7 @@ /* A very simple client that shows a basic usage of the pz2.js */ -// "use strict"; // HTML5 +"use strict"; // HTML5 if (!mkws_config) var mkws_config = {}; // for the guys who forgot to define mkws_config... @@ -437,7 +437,7 @@ function mkws_html_all(data) { sort_default: "relevance", perpage_default: 20, query_width: 50, - switch: true, /* show/hide Records|Targets menu */ + switch_menu: true, /* show/hide Records|Targets menu */ debug: 0, /* debug level for development: 0..2 */ dummy: "dummy" @@ -455,6 +455,10 @@ function mkws_html_all(data) { config[k] = data[k]; debug("Set config: " + k + ' => ' + data[k]); } + if (mkws_config.query_width < 5 || mkws_config.query_width > 150) { + debug("Reset query width: " + mkws_config.query_width); + mkws_config.query_width = 50; + } mkws_set_lang(mkws_config); mkws_html_lang(mkws_config); @@ -463,8 +467,8 @@ function mkws_html_all(data) { // document.search.query being undefined, hence the raw HTML. debug("HTML search form"); $("#mkwsSearch").html('\ -
\ - \ + \ + \ \
'); @@ -477,7 +481,7 @@ function mkws_html_all(data) { \ \
\ -
\ + \ ' + M('Sort by') + mkws_html_sort(config) + '\ ' + M('and show') + ' ' + mkws_html_perpage(config) + '\ ' + M('per page') + '.\ @@ -488,8 +492,7 @@ function mkws_html_all(data) {
\ \ \ - \ -
'); + '); mkws_html_switch(config); if (mkws_config.use_service_proxy) @@ -532,8 +535,8 @@ function mkws_html_switch(config) { '); $("#mkwsTargets").css("display", "none"); - if (!config.switch) { - debug("disable switch"); + if (!config.switch_menu) { + debug("disable switch menu"); $("#mkwsSwitch").css("display", "none"); } } @@ -657,7 +660,8 @@ jQuery.extend({ function debug(string) { if (!mkws_debug) return; - + + var console; // IE8 quirks if (!console) { /* ARGH!!! */ return; }