Get rid of the responsive_design boolean configuration item, and always use responsiv...
authorMike Taylor <mike@indexdata.com>
Wed, 9 Oct 2013 11:39:13 +0000 (12:39 +0100)
committerMike Taylor <mike@indexdata.com>
Wed, 9 Oct 2013 11:39:13 +0000 (12:39 +0100)
Get rid of the service_proxy_url configuration item: now we always used pazpar2_url

examples/htdocs/index-jakub.html
examples/htdocs/index-jasmine.html
examples/htdocs/index-mike.html
examples/htdocs/index-mobile.html
examples/htdocs/index-wolfram.html
test/spec/mkws-config.js
tools/htdocs/README.markdown
tools/htdocs/mkws.js
tools/htdocs/whitepaper.markdown

index fc2539a..a9ef9f1 100644 (file)
@@ -5,7 +5,7 @@
     <link rel="stylesheet" type="text/css" href="http://mkws-origin/mkwsStyle.css" />
     <script type="text/javascript">
       var mkws_config = {
-        service_proxy_url: "http://mkws-origin/service-proxy/",
+        pazpar2_url: "http://mkws-origin/service-proxy/",
         service_proxy_auth: "http://mkws-origin/service-proxy-auth/"
       };
     </script>
index 81c101b..9b97b78 100644 (file)
@@ -6,7 +6,7 @@
     <script type="text/javascript">
       var mkws_config = {
          /*
-         service_proxy_url : "/service-proxy/",
+         pazpar2_url : "/service-proxy/",
          service_proxy_auth : "/service-proxy-auth/",
          */
       };
index f2be1ce..0a8e504 100644 (file)
@@ -5,6 +5,7 @@
     <link rel="stylesheet" type="text/css" href="http://x.mkws.indexdata.com/mkwsStyle.css" />
     <script type="text/javascript">
       var mkws_config = {
+        responsive_design_width: 600,
         //service_proxy_auth: "/service-proxy-auth-mike"
       };
     </script>
index e6c300e..98165f1 100644 (file)
@@ -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
index 6405d03..fd0d51e 100644 (file)
@@ -8,7 +8,7 @@
     <script type="text/javascript">
       var mkws_config = {
        /*
-         service_proxy_url : "/service-proxy/",
+         pazpar2_url : "/service-proxy/",
          service_proxy_auth : "/service-proxy-auth/",
          */
       };
index f005ad8..2bb84f3 100644 (file)
@@ -9,8 +9,8 @@ describe("Check mkws_config object", function () {
         expect(mkws_config).not.toBe(undefined);
     });
 
-    it("mkws_config service proxy config", function () {
-        expect(mkws_config.service_proxy_url).toBe(undefined);
+    it("mkws_config pazpar2 config", function () {
+        expect(mkws_config.pazpar2_url).toBe(undefined);
     });
 
     it("mkws_config locale check German", function () {
index 882592b..6e685e0 100644 (file)
@@ -73,11 +73,10 @@ possible options:
                lang: "en",                 /* "en", "de", "da" */
                debug: 0,                   /* debug level for development: 0..2 */
 
-               responsive_design: false    /* true, false: resize for smaller mobile devices */
-               pazpar2_url: "/pazpar2/search.pz2",        /* URL */
-               service_proxy_url: "/service-proxy/",      /* URL */
+               responsive_design_wodth: 600,    /* page reflows for devices < 600 pixels wide */
+               pazpar2_url: "/service-proxy/",            /* URL */
                service_proxy_auth: "/service-proxy-auth", /* URL */
-               // TODO: language_*, perpage_options, responsive_design_width, sort_options
+               // TODO: language_*, perpage_options, sort_options
            };
        </script>
 ~~~
index 71daa52..41d34a3 100644 (file)
@@ -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 &&
index 6f9e0c7..7487a2d 100644 (file)
@@ -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:
 
         <script type="text/javascript">
             var mkws_config = {
-                responsive_design: true,
                 responsive_design_width: 990
             };
         </script>
@@ -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`.