From: Wolfram Schneider Date: Thu, 20 Jun 2013 13:16:36 +0000 (+0000) Subject: sort menu is configurable X-Git-Tag: 0.9.1~574^2~21 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=9ac7630768eec9a35dcbadea004c6c842e1e451d;p=mkws-moved-to-github.git sort menu is configurable --- diff --git a/experiments/spclient/index.html b/experiments/spclient/index.html index 8195cbc..7fa992b 100644 --- a/experiments/spclient/index.html +++ b/experiments/spclient/index.html @@ -8,7 +8,7 @@ diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index 1b42aff..f1e0e9e 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -1,8 +1,6 @@ /* A very simple client that shows a basic usage of the pz2.js */ -"use strict"; - // create a parameters array and pass it to the pz2's constructor // then register the form submit event with the pz2.search function // autoInit is set to true on default @@ -379,6 +377,7 @@ function renderDetails(data, marker) */ function mkws_html_all(data) { + /* default config */ var config = { sort: [ ["relevance"], ["title:1", "title"], ["date:0", "newest"], ["date:1", "oldest"]], perpage: [10, 20, 30, 50], @@ -412,6 +411,19 @@ function mkws_html_all(data) { $("#mkwsSwitch").css("display", "none"); } + var sort_html = ''; + // For some reason, doing this programmatically results in // document.search.query being undefined, hence the raw HTML. $("#mkwsSearch").html('\ @@ -429,8 +441,7 @@ function mkws_html_all(data) { \
\
\ - Sort by\ - \ + Sort by' + sort_html + '\ and show \ \ per page.\