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 As much of the searching functionality as possible is hosted on
15 <http://mkws.indexdata.com/>
16 so that very simple websites such as
17 <http://example.indexdata.com/>
18 can have MasterKey searching with minimal effort.
20 The following files are hosted on `mkws.indexdata.com`:
24 * `/libjs-pz2/pz2api.1.js`
25 * `mkws-complete.js` -- a single file consisting of `mkws.js`,
26 jQuery (which it uses) and `pz2api.1.js`
32 The application's HTML must contains the following elements as well as
33 whatever makes up the application itself:
38 <link rel="stylesheet" href="http://mkws.indexdata.com/mkwsStyle.css" />
39 <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
42 Then the following special `<div>`s can be added (with no content), and
43 will be filled in by MKWS:
45 * `<div id="mkwsSwitch"></div>` -- switch between record and target views
46 * `<div id="mkwsLang"></div> ` -- switch between English, Danish and German
47 * `<div id="mkwsSearch"></div>` -- search box and button
48 * `<div id="mkwsResults"></div>` -- result list, including pager/sorting
49 * `<div id="mkwsTargets"></div>` -- target list, including status
50 * `<div id="mkwsStat"></div>` -- summary statistics
52 At present, MKWS may not work correctly if some of these are
53 missing. One of the TODOs is to fix it so that it doesn't try to use
54 whatever is not there, and just uses what is.
56 You can configure and control the client by creating an `mkws_config`
57 object _before_ loading the widget-set. Here is an example of all
61 <script type="text/javascript">
63 use_service_proxy: true, /* true, flase: use service proxy instead pazpar2 */
64 show_lang: true, /* true, false: show/hide language menu */
65 show_sort: true, /* true, false: show/hide sort menu */
66 show_perpage: true, /* true, false: show/hide perpage menu */
67 lang_display: ["en", "de", "da"], /* display languages links for given
68 languages, [] for all */
69 facets: ["sources", "subjects", "authors"], /* display facets, in this order, [] for none */
70 sort_default: "relevance", /* "relevance", "title:1", "date:0", "date:1" */
71 query_width: 50, /* 5..50 */
72 perpage_default: 20, /* 10, 20, 30, 50 */
73 lang: "en", /* "en", "de", "da" */
74 debug: 0, /* debug level for development: 0..2 */
76 responsive_design: false /* true, false: resize for smaller mobile devices */
77 pazpar2_url: "/pazpar2/search.pz2", /* URL */
78 service_proxy_url: "/service-proxy/", /* URL */
79 service_proxy_auth: "/service-proxy-auth", /* URL */
80 // TODO: language_*, perpage, responsive_design_width, sort
88 The jQuery plugin version can be used by a single line of JavaScript code:
91 <script>jQuery.pazpar2();</script>
94 put the code in your page at the position where the metasearch should occur.
96 Here is an example of all possible options
100 "layout": "popup", /* "table" [default], "div", "popup" */
101 "id_button": "input#mkwsButton", /* submit button id in search field */
102 "id_popup": "#mkwsPopup", /* internal id of popup window */
103 "width": 880, /* popup width, should be at least 800 */
104 "height": 760 /* popup height, should be at least 600 */
112 Any modern HTML5 browser will work fine. JavaScript must be enabled.
115 * Firefox 17 or later
116 * Google Chrome 27 or later
119 * iOS 6.x (iPhone, iPad)
122 Not supported: IE6, IE7
125 New Features since jsdemo
126 --------------------------
128 - Multilinguality: English (default), Danish, German
129 - Depends on the new pazpar2 JS library libjs-pz2/pz2api.1.js
130 which will make the development of pazpar2 plugins faster and
131 easier to share code between projects
132 - Supports basic pazpar2 and service-proxy requests
134 - The search page is fully configurable by a JSON object
137 Checklist before doing a release
138 ---------------------------------
139 - open the site, e.g. http://mkws-dev.indexdata.com/index-mike.html
140 - open the debug/error console in your browser (alt-cmd-J, shift-cmd-J)
141 - check the language links ("de", "da", "en")
142 - run a search with few, but not to few results, e.g.: freebsd
143 - check "Targets" | "Records" links
144 - check "Next" and "Prev" links
145 - click on the first hit and display details, click on an "URL" to jump to
146 the local catalog or full text
147 - limit search to a "Source"
148 - limit search to an "Author"
149 - sort results by "Title" and "newest"
159 * Make MKWS robust to missing widgets
163 \(c) 2013 by IndexData ApS, <http://www.indexdata.com>