1 % An embryonic MasterKey Widget Set
2 % Mike Taylor; Wolfram Schneider
9 This directory contains an embryonic MasterKey Widget Set. The initial
10 version was based on the "jsdemo" application distributed with
11 pazpar2, but it is now far removed from those beginnnings.
17 As much of the searching functionality as possible is hosted on
18 <http://mkws.indexdata.com/>
19 so that very simple websites such as
20 <http://example.indexdata.com/>
21 can have MasterKey searching with minimal effort.
23 The following files are hosted on `mkws.indexdata.com`:
27 * `/libjs-pz2/pz2api.1.js`
28 * `mkws-complete.js` -- a single file consisting of `mkws.js`,
29 jQuery (which it uses) and `pz2api.1.js`
35 The application's HTML must contains the following elements as well as
36 whatever makes up the application itself:
41 <link rel="stylesheet" href="http://mkws.indexdata.com/mkws.css" />
42 <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
45 Then the following special `<div>`s can be added (with no content), and
46 will be filled in by MKWS:
48 * `<div id="mkwsSwitch"></div>` -- switch between record and target views
49 * `<div id="mkwsLang"></div> ` -- switch between English, Danish and German
50 * `<div id="mkwsSearch"></div>` -- search box and button
51 * `<div id="mkwsResults"></div>` -- result list, including pager/sorting
52 * `<div id="mkwsTargets"></div>` -- target list, including status
53 * `<div id="mkwsStat"></div>` -- summary statistics
55 At present, MKWS may not work correctly if some of these are
56 missing. One of the TODOs is to fix it so that it doesn't try to use
57 whatever is not there, and just uses what is.
59 You can configure and control the client by creating an `mkws_config`
60 object _before_ loading the widget-set. Here is an example of all
64 <script type="text/javascript">
66 use_service_proxy: true, /* true, flase: use service proxy instead pazpar2 */
67 show_lang: true, /* true, false: show/hide language menu */
68 show_sort: true, /* true, false: show/hide sort menu */
69 show_perpage: true, /* true, false: show/hide perpage menu */
70 lang_options: ["en", "de", "da"], /* display languages links for given
71 languages, [] for all */
72 facets: ["sources", "subjects", "authors"], /* display facets, in this order, [] for none */
73 sort_default: "relevance", /* "relevance", "title:1", "date:0", "date:1" */
74 query_width: 50, /* 5..50 */
75 perpage_default: 20, /* 10, 20, 30, 50 */
76 lang: "en", /* "en", "de", "da" */
77 debug_level: 0, /* debug level for development: 0..2 */
79 responsive_design_wodth: 600, /* page reflows for devices < 600 pixels wide */
80 pazpar2_url: "/service-proxy/", /* URL */
81 service_proxy_auth: "/service-proxy-auth", /* URL */
82 // TODO: language_*, perpage_options, sort_options
90 The jQuery plugin version can be used by a single line of JavaScript code:
93 <script>jQuery.pazpar2();</script>
96 put the code in your page at the position where the metasearch should occur.
98 Here is an example of all possible options
102 "layout": "popup", /* "table" [default], "div", "popup" */
103 "id_button": "input#mkwsButton", /* submit button id in search field */
104 "id_popup": "#mkwsPopup", /* internal id of popup window */
105 "width": 880, /* popup width, should be at least 800 */
106 "height": 760 /* popup height, should be at least 600 */
114 Any modern HTML5 browser will work fine. JavaScript must be enabled.
117 * Firefox 17 or later
118 * Google Chrome 27 or later
121 * iOS 6.x (iPhone, iPad)
124 Not supported: IE6, IE7
127 New Features since jsdemo
128 --------------------------
130 - Multilinguality: English (default), Danish, German
131 - Depends on the new pazpar2 JS library libjs-pz2/pz2api.1.js
132 which will make the development of pazpar2 plugins faster and
133 easier to share code between projects
134 - Supports basic pazpar2 and service-proxy requests
136 - The search page is fully configurable by a JSON object
139 Checklist before doing a release
140 ---------------------------------
141 - open the site, e.g. http://mkws-dev.indexdata.com/index-mike.html
142 - open the debug/error console in your browser (alt-cmd-J, shift-cmd-J)
143 - check the language links ("de", "da", "en")
144 - run a search with few, but not to few results, e.g.: freebsd
145 - check "Targets" | "Records" links
146 - check "Next" and "Prev" links
147 - click on the first hit and display details, click on an "URL" to jump to
148 the local catalog or full text
149 - limit search to a "Source"
150 - limit search to an "Author"
151 - sort results by "Title" and "newest"
161 * Make MKWS robust to missing widgets
165 \(c) 2013 by IndexData ApS, <http://www.indexdata.com>