1 % An embryonic MasterKey Widget Set
2 % Mike Taylor; Wolfram Schneider
6 This directory contains an embryonic MasterKey Widget Set. The initial
7 version was based on the "jsdemo" application distributed with
8 pazpar2, but it is now far removed from those beginnnings.
14 The goal is to make it that as much of the searching functionality as
16 <http://mkws.indexdata.com/>
17 so that very simple websites such as
18 <http://example.indexdata.com/>
19 can have MasterKey searching with minimal effort.
21 The following files are hosted on mkws.indexdata.com:
25 * `/libjs-pz2/pz2api.1.js`
27 The following files make up an application:
30 * `favicon.ico` [_optional_]
31 * `robots.txt` [_optional_]
37 The application's HTML must contains the following elements as well as
38 whatever makes up the application itself:
41 <link rel="stylesheet" href="mkwsStyle.css" />
42 <script type="text/javascript">
43 var mkws_config = { };
45 <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
46 <script type="text/javascript" src="/libjs-pz2/pz2api.1.js"></script>
47 <script type="text/javascript" src="mkws.js"></script>
48 (Yes, we're using JQuery. We use it only in the most trivial ways, and
49 could probably get rid of it without too much pain. I'd like to have
50 mkws.js automatically pull in pz2api.1.js, too, so you don't need to
51 do so many things, but that's not quite trivial.)
53 Then the following special <div>s can be added (with no content), and
54 will be filled in by MKWS:
55 <div id="mkwsSwitch"></div> -- switch between record and target views
56 <div id="mkwsLang"></div> -- switch between English, Danish and German
57 <div id="mkwsSearch"></div> -- search box and button
58 <div id="mkwsResults"></div> -- result list, including pager/sorting
59 <div id="mkwsTargets"></div> -- target list, including status
60 <div id="mkwsStat"></div> -- summary statistics
62 At present, MKWS will not work correctly if any of these is
63 missing. One of the TODOs is to fix it so that it doesn't try to use
64 whatever is not there, and just uses what is.
67 You can configure and control the client with the JavaScript mkws_config object.
69 Here is an example of all possible options
70 <script type="text/javascript">
72 use_service_proxy: true, /* true, flase: use service proxy instead pazpar2 */
73 switch_menu: true, /* true, false: show/hide Records|Targets menu */
74 lang_menu: true, /* true, false: show/hide language menu */
75 sort_menu: true, /* true, false: show/hide sort menu */
76 perpage_menu: true, /* true, false: show/hide perpage menu */
77 lang_display: ["en", "de", "da"], /* display languages links for given
78 languages, [] for all */
79 facets: ["sources", "subjects", "authors"], /* display facets, in this order, [] for none */
80 sort_default: "relevance", /* "relevance", "title:1", "date:0", "date:1" */
81 query_width: 50, /* 5..50 */
82 perpage_default: 20, /* 10, 20, 30, 50 */
83 lang: "en", /* "en", "de", "da" */
84 debug: 0, /* debug level for development: 0..2 */
86 responsive_design: false /* true, false: resize for smaller mobile devices */
87 pazpar2_url: "/pazpar2/search.pz2", /* URL */
88 service_proxy_url: "/service-proxy/", /* URL */
89 service_proxy_auth: "/service-proxy-auth", /* URL */
93 Note: the mkws_config object which must be loaded before the mkws.js and pz2api.js files.
99 The jQuery plugin version, consisting of a single line of JavaScript code
101 <script>jQuery.pazpar2();</script>
103 put the code in your page at the position where the metasearch should occours.
105 Here is an example of all possible options
107 jQuery.pazpar2({"layout": "popup", /* "table", "div", "popup", default is table */
108 "id_button": "input#mkwsButton", /* submit button id in search field */
109 "id_popup": "#mkwsPopup", /* interal id of popup window */
110 "width": 880, /* popup width, should be at least 800 */
111 "height": 760 /* popup height, should be at least 600 */
118 Any modern HTML5 browser will work fine. JavaScript must be enabled.
121 * Firefox 17 or later
122 * Google Chrome 27 or later
125 * iOS 6.x (iPhone, iPad)
128 Not supported: IE6, IE7
130 New Features since jsdemo
131 --------------------------
132 - multilinguality: English (default), Danish, German
133 - depends on the new pazpar2 JS library libjs-pz2/pz2api.1.js
134 which will make the development of pazpar2 plugins faster and
135 easier to share code between projects
136 - supports basic pazpar2 and service-proxy requests
138 - the search page is fully configurable by a JSON object
145 * Make MKWS robust to missing widgets