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`
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:
43 <link rel="stylesheet" href="http://mkws.indexdata.com/mkwsStyle.css" />
44 <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
47 Then the following special `<div>`s can be added (with no content), and
48 will be filled in by MKWS:
50 * `<div id="mkwsSwitch"></div>` -- switch between record and target views
51 * `<div id="mkwsLang"></div> ` -- switch between English, Danish and German
52 * `<div id="mkwsSearch"></div>` -- search box and button
53 * `<div id="mkwsResults"></div>` -- result list, including pager/sorting
54 * `<div id="mkwsTargets"></div>` -- target list, including status
55 * `<div id="mkwsStat"></div>` -- summary statistics
57 At present, MKWS may not work correctly if some of these are
58 missing. One of the TODOs is to fix it so that it doesn't try to use
59 whatever is not there, and just uses what is.
61 You can configure and control the client by creating an `mkws_config`
62 object _before_ loading the widget-set. Here is an example of all
66 <script type="text/javascript">
68 use_service_proxy: true, /* true, flase: use service proxy instead pazpar2 */
69 switch_menu: true, /* true, false: show/hide Records|Targets menu */
70 lang_menu: true, /* true, false: show/hide language menu */
71 sort_menu: true, /* true, false: show/hide sort menu */
72 perpage_menu: true, /* true, false: show/hide perpage menu */
73 lang_display: ["en", "de", "da"], /* display languages links for given
74 languages, [] for all */
75 facets: ["sources", "subjects", "authors"], /* display facets, in this order, [] for none */
76 sort_default: "relevance", /* "relevance", "title:1", "date:0", "date:1" */
77 query_width: 50, /* 5..50 */
78 perpage_default: 20, /* 10, 20, 30, 50 */
79 lang: "en", /* "en", "de", "da" */
80 debug: 0, /* debug level for development: 0..2 */
82 responsive_design: false /* true, false: resize for smaller mobile devices */
83 pazpar2_url: "/pazpar2/search.pz2", /* URL */
84 service_proxy_url: "/service-proxy/", /* URL */
85 service_proxy_auth: "/service-proxy-auth", /* URL */
93 The jQuery plugin version can be used by a single line of JavaScript code:
96 <script>jQuery.pazpar2();</script>
99 put the code in your page at the position where the metasearch should occur.
101 Here is an example of all possible options
105 "layout": "popup", /* "table" [default], "div", "popup" */
106 "id_button": "input#mkwsButton", /* submit button id in search field */
107 "id_popup": "#mkwsPopup", /* internal id of popup window */
108 "width": 880, /* popup width, should be at least 800 */
109 "height": 760 /* popup height, should be at least 600 */
117 Any modern HTML5 browser will work fine. JavaScript must be enabled.
120 * Firefox 17 or later
121 * Google Chrome 27 or later
124 * iOS 6.x (iPhone, iPad)
127 Not supported: IE6, IE7
130 New Features since jsdemo
131 --------------------------
133 - Multilinguality: English (default), Danish, German
134 - Depends on the new pazpar2 JS library libjs-pz2/pz2api.1.js
135 which will make the development of pazpar2 plugins faster and
136 easier to share code between projects
137 - Supports basic pazpar2 and service-proxy requests
139 - The search page is fully configurable by a JSON object
147 * Make MKWS robust to missing widgets
151 \(c) 2013 by IndexData ApS, <http://www.indexdata.com>