From: Mike Taylor Date: Wed, 9 Oct 2013 11:39:13 +0000 (+0100) Subject: Get rid of the responsive_design boolean configuration item, and always use responsiv... X-Git-Tag: 0.9.1~179 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=287904816476333f1b699d3ce612418059cf51d3 Get rid of the responsive_design boolean configuration item, and always use responsive design if responsive_design_width is defined. (It no longer has a default value). Get rid of the service_proxy_url configuration item: now we always used pazpar2_url --- diff --git a/examples/htdocs/index-jakub.html b/examples/htdocs/index-jakub.html index fc2539a..a9ef9f1 100644 --- a/examples/htdocs/index-jakub.html +++ b/examples/htdocs/index-jakub.html @@ -5,7 +5,7 @@ diff --git a/examples/htdocs/index-jasmine.html b/examples/htdocs/index-jasmine.html index 81c101b..9b97b78 100644 --- a/examples/htdocs/index-jasmine.html +++ b/examples/htdocs/index-jasmine.html @@ -6,7 +6,7 @@ diff --git a/examples/htdocs/index-mobile.html b/examples/htdocs/index-mobile.html index e6c300e..98165f1 100644 --- a/examples/htdocs/index-mobile.html +++ b/examples/htdocs/index-mobile.html @@ -15,7 +15,6 @@ lang_options: ["da", "en"], sort_default: "relevance", query_width: 50, - responsive_design: true, facets: ["authors", "sources", "subjects"], responsive_design_width: 990, perpage_default: 20 diff --git a/examples/htdocs/index-wolfram.html b/examples/htdocs/index-wolfram.html index 6405d03..fd0d51e 100644 --- a/examples/htdocs/index-wolfram.html +++ b/examples/htdocs/index-wolfram.html @@ -8,7 +8,7 @@ ~~~ diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 71daa52..41d34a3 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -22,10 +22,9 @@ if (!mkws_config) if (typeof mkws_config.use_service_proxy === 'undefined') mkws_config.use_service_proxy = true; -var pazpar2_url = mkws_config.pazpar2_url ? mkws_config.pazpar2_url : "/pazpar2/search.pz2"; -var service_proxy_url = mkws_config.service_proxy_url ? mkws_config.service_proxy_url : "http://mkws.indexdata.com/service-proxy/"; +var pazpar2_url = mkws_config.pazpar2_url ? mkws_config.pazpar2_url : "http://mkws.indexdata.com/service-proxy/"; -mkws.pazpar2path = mkws_config.use_service_proxy ? service_proxy_url : pazpar2_url; +mkws.pazpar2path = pazpar2_url; mkws.usesessions = mkws_config.use_service_proxy ? false : true; mkws.locale_lang = { @@ -559,7 +558,7 @@ function mkws_html_all(config) { /* default mkws config */ /* ### No defaults given for: - * lang, responsive_design, service_proxy_auth, use_service_proxy + * lang, service_proxy_auth, use_service_proxy * and of course the optional language_* entries. */ var mkws_config_default = { @@ -573,7 +572,7 @@ function mkws_html_all(config) { show_perpage: true, /* show/hide perpage menu */ lang_options: [], /* display languages links for given languages, [] for all */ facets: ["sources", "subjects", "authors"], /* display facets, in this order, [] for none */ - responsive_design_width: 980, /* a page with less pixel width considered as narrow */ + responsive_design_width: undefined, /* a page with less pixel width considered as narrow */ debug: 1, /* debug level for development: 0..2 */ dummy: "dummy" @@ -661,7 +660,7 @@ function mkws_html_all(config) { if (mkws_config.use_service_proxy) mkws_service_proxy_auth(config.service_proxy_auth); - if (mkws_config.responsive_design) { + if (mkws_config.responsive_design_width) { // Responsive web design - change layout on the fly based on // current screen width. Required for mobile devices. $(window).resize( function(e) { mkws_resize_page() }); @@ -823,7 +822,7 @@ function mkws_html_lang(mkws_config) { function mkws_resize_page () { var list = ["mkwsSwitch"]; - var width = mkws_config.responsive_design_width || 980; + var width = mkws_config.responsive_design_width; var parentId = $("#mkwsTermlists").parent().attr('id'); if ($(window).width() <= width && diff --git a/tools/htdocs/whitepaper.markdown b/tools/htdocs/whitepaper.markdown index 6f9e0c7..7487a2d 100644 --- a/tools/htdocs/whitepaper.markdown +++ b/tools/htdocs/whitepaper.markdown @@ -213,13 +213,11 @@ screen-width changes (as when a small device is rotated). To achieve this, MKWS supports responsive design which will move the termlists to the bottom on narrow screens and to the sidebar on wide screens. -To turn on this behaviour, set the `responsive_design` configuration -element to `true`, and `responsive_design_width` to the desired +To turn on this behaviour, set the `responsive_design_width` to the desired threshhold width in pixels. For example: @@ -299,9 +297,10 @@ language_* hash Support for any number of languages c `language_` followed by the code of the language. See the separate section below for details. -pazpar2_url string *Note 2* The URL used to access the metasearch middleware if `use_service_proxy` is false. ### - It's silly that you have to provide a different setting depending on whether - `use_service_proxy` is set. Should just use pazpar2_url in all cases. +pazpar2_url string *Note 2* The URL used to access the metasearch middleware. This service must be configured to + provide search results, facets, etc. It may be either unmediated or Pazpar2 the + MasterKey Service Proxy, which mediates access to an underlying Pazpar2 instance. In + the latter case, `service_proxy_auth` must be provided. perpage_options array *Note 3* A list of candidate page sizes. Users can choose between these to determine how many records are displayed on each page of results. @@ -313,20 +312,14 @@ show_perpage bool true Indicates whether or not to display t query_width int 50 The width of the query box, in characters. -responsive_design bool false If true, then the facets display moves between two locations as the screen-width - varies, as described above. ### This entry should not exist: the design should be - responsive whenever `responsive_design_width` has a defined value. - -responsive_design_width int 980 If `responsive_design` is true, this is the threshhold width, in pixels, at which the - facets move between their two locations. +responsive_design_width int If defined, then the facets display moves between two locations as the screen-width + varies, as described above. The specified number is the threshhold width, in pixels, + at which the facets move between their two locations. service_proxy_auth url *Note 4* A URL which, when `use_service_proxy` is true, is fetched once at the beginning of each session to authenticate the user and establish a session that encompasses a defined set of targets to search in. -service_proxy_url string *Note 5* The URL on which the service proxy is accessed if `use_service_proxy` is true. This - service must be configured to provide search results, facets, etc. - sort_options array *Note 6* List of supported sort criteria. Each element of the list is itself a two-element list: the first element of each sublist is a pazpar2 sort-expression such as `data:0` and the second is a human-readable label such as `newest`.