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`
28 The following files make up an application:
31 * `favicon.ico` [_optional_]
32 * `robots.txt` [_optional_]
38 The application's HTML must contains the following elements as well as
39 whatever makes up the application itself:
44 <link rel="stylesheet" href="http://mkws.indexdata.com/mkwsStyle.css" />
45 <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
48 Then the following special `<div>`s can be added (with no content), and
49 will be filled in by MKWS:
51 * `<div id="mkwsSwitch"></div>` -- switch between record and target views
52 * `<div id="mkwsLang"></div> ` -- switch between English, Danish and German
53 * `<div id="mkwsSearch"></div>` -- search box and button
54 * `<div id="mkwsResults"></div>` -- result list, including pager/sorting
55 * `<div id="mkwsTargets"></div>` -- target list, including status
56 * `<div id="mkwsStat"></div>` -- summary statistics
58 At present, MKWS may not work correctly if some of these are
59 missing. One of the TODOs is to fix it so that it doesn't try to use
60 whatever is not there, and just uses what is.
62 You can configure and control the client by creating an `mkws_config`
63 object _before_ loading the widget-set. Here is an example of all
67 <script type="text/javascript">
69 use_service_proxy: true, /* true, flase: use service proxy instead pazpar2 */
70 switch_menu: true, /* true, false: show/hide Records|Targets menu */
71 lang_menu: true, /* true, false: show/hide language menu */
72 sort_menu: true, /* true, false: show/hide sort menu */
73 perpage_menu: true, /* true, false: show/hide perpage menu */
74 lang_display: ["en", "de", "da"], /* display languages links for given
75 languages, [] for all */
76 facets: ["sources", "subjects", "authors"], /* display facets, in this order, [] for none */
77 sort_default: "relevance", /* "relevance", "title:1", "date:0", "date:1" */
78 query_width: 50, /* 5..50 */
79 perpage_default: 20, /* 10, 20, 30, 50 */
80 lang: "en", /* "en", "de", "da" */
81 debug: 0, /* debug level for development: 0..2 */
83 responsive_design: false /* true, false: resize for smaller mobile devices */
84 pazpar2_url: "/pazpar2/search.pz2", /* URL */
85 service_proxy_url: "/service-proxy/", /* URL */
86 service_proxy_auth: "/service-proxy-auth", /* URL */
94 The jQuery plugin version can be used by a single line of JavaScript code:
97 <script>jQuery.pazpar2();</script>
100 put the code in your page at the position where the metasearch should occur.
102 Here is an example of all possible options
106 "layout": "popup", /* "table" [default], "div", "popup" */
107 "id_button": "input#mkwsButton", /* submit button id in search field */
108 "id_popup": "#mkwsPopup", /* internal id of popup window */
109 "width": 880, /* popup width, should be at least 800 */
110 "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
131 New Features since jsdemo
132 --------------------------
134 - Multilinguality: English (default), Danish, German
135 - Depends on the new pazpar2 JS library libjs-pz2/pz2api.1.js
136 which will make the development of pazpar2 plugins faster and
137 easier to share code between projects
138 - Supports basic pazpar2 and service-proxy requests
140 - The search page is fully configurable by a JSON object
148 * Make MKWS robust to missing widgets
152 \(c) 2013 by IndexData ApS, <http://www.indexdata.com>