DocumentRoot /usr/local/src/git/mkws/examples/htdocs/
Alias /tools/htdocs/ /usr/local/src/git/mkws/tools/htdocs/
Alias /src/ /usr/local/src/git/mkws/src/
+ Alias /jasmine/ /usr/local/src/git/mkws/examples/jasmine/
+ Alias /test/ /usr/local/src/git/mkws/test/
+
ErrorLog /var/log/apache2/mkws-examples-error.log
CustomLog /var/log/apache2/mkws-examples-access.log combined
--- /dev/null
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>MKWS demo: jQuery popup plugin with jasmine test framework</title>
+
+ <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
+ <link rel="stylesheet" type="text/css" href="//mkws.indexdata.com/mkws.css" />
+
+ <script type="text/javascript" src="//code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
+ <link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
+
+ <link rel="shortcut icon" type="image/png" href="jasmine/lib/jasmine-1.3.1/jasmine_favicon.png">
+ <link rel="stylesheet" type="text/css" href="jasmine/lib/jasmine-1.3.1/jasmine.css">
+ <script type="text/javascript" src="jasmine/lib/jasmine-1.3.1/jasmine.js"></script>
+ <script type="text/javascript" src="jasmine/lib/jasmine-1.3.1/jasmine-html.js"></script>
+
+ <script type="text/javascript" src="test/spec/true.spec.js"></script>
+ <script type="text/javascript" src="test/spec/mkws-config.js"></script>
+ <script type="text/javascript" src="test/spec/mkws-pazpar2.js"></script>
+
+ <script type="text/javascript" src="test/js/mkws-jasmine-run.js"></script>
+ <script type="text/javascript"> mkws_jasmine_init(500); </script>
+
+ <!-- jquery null test
+ <script type="text/javascript">$ = undefined;</script>
+ -->
+
+ <style type="text/css">
+ body > div > form > input.ui-state-default { background: none; }
+ </style>
+ </head>
+
+ <body>
+ <script type="text/javascript">
+
+ // using a local service proxy !!!
+ var mkws_config = {
+ perpage_default: 10
+ };
+
+ var jasmine_config = {
+ search_query: "netbsd",
+ expected_hits: 10,
+ // active_clients: 17,
+ check_motd: false,
+ show_record_url: true
+ };
+
+ jQuery.pazpar2({
+ "layout": "popup", /* "table" [default], "div", "popup" */
+ "width": 990, /* popup width, should be at least 800 */
+ "height": 760 /* popup height, should be at least 600 */
+ });
+ </script>
+
+<h2>MKWS Jasmine regression tests</h2>
+<p/>
+
+ </body>
+</html>
+
var jasmine_config = {
search_query: "netbsd",
expected_hits: 10,
- // active_clients: 17,
+ active_clients: 13,
check_motd: false,
show_record_url: true
};
});
</script>
- <pre>
-An embryonic MasterKey Widget Set
-=================================
-
-This directory contains an embryonic MasterKey Widget Set, based
-initially on "jsdemo" though now far removed from those beginnnings.
-[...]
- </pre>
+<h2>MKWS Jasmine regression tests</h2>
+<p/>
</body>
</html>
<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="tools/htdocs/mkws.css" />
- <script type="text/javascript" src="//code.jquery.com/jquery-1.10.0.min.js"></script>
+ <script type="text/javascript" src="src/jquery-1.10.0.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
- <script type="text/javascript" src="//git.indexdata.com/?p=pazpar2.git;a=blob_plain;f=js/pz2.js;hb=HEAD"></script>
- <script type="text/javascript" src="//jquery-json.googlecode.com/files/jquery.json-2.4.js"></script>
- <script type="text/javascript" src="//builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.1.2.js"></script>
-
+ <script type="text/javascript" src="src/pz2.js"></script>
+ <script type="text/javascript" src="src/jquery.json-2.4.js"></script>
+ <script type="text/javascript" src="src/handlebars-v1.1.2.js"></script>
<!-- <script type="text/javascript" src="src/mkws.js"></script> -->
<script type="text/javascript" src="src/mkws-handlebars.js"></script>
<script type="text/javascript" src="src/mkws-core.js"></script>
<script type="text/javascript" src="src/mkws-widget-main.js"></script>
<script type="text/javascript" src="src/mkws-widget-termlists.js"></script>
<script type="text/javascript" src="src/mkws-widget-authname.js"></script>
- <script type="text/javascript" src="src/mkws-widget-categories.js"></script>
<script type="text/javascript" src="src/mkws-widget-log.js"></script>
<script type="text/javascript" src="src/mkws-widget-record.js"></script>
- <script type="text/javascript" src="src/mkws-widget-builder.js"></script>
+
<script type="text/javascript" src="src/mkws-jquery.js"></script>
- <script type="text/javascript">$ = undefined;</script>
<link rel="shortcut icon" type="image/png" href="jasmine/lib/jasmine-1.3.1/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="jasmine/lib/jasmine-1.3.1/jasmine.css">
<script type="text/javascript" src="test/js/mkws-jasmine-run.js"></script>
<script type="text/javascript"> mkws_jasmine_init(500); </script>
+ <!-- jquery null test
+ <script type="text/javascript">$ = undefined;</script>
+ -->
+
<style type="text/css">
body > div > form > input.ui-state-default { background: none; }
</style>
<body>
<script type="text/javascript">
+
+ // use a our main service proxy with mkws test account
var mkws_config = {
perpage_default: 10,
- // active_clients: 17,
pazpar2_url: "//mkws.indexdata.com/service-proxy/",
service_proxy_auth: "//mkws.indexdata.com/service-proxy-testauth"
};
+ var jasmine_config = {
+ search_query: "netbsd",
+ expected_hits: 10,
+ active_clients: 13,
+ check_motd: false,
+ show_record_url: true
+ };
+
jQuery.pazpar2({
"layout": "popup", /* "table" [default], "div", "popup" */
- "id_button": "input.mkwsButton", /* submit button id in search field */
- "id_popup": ".mkwsPopup", /* internal id of popup window */
"width": 990, /* popup width, should be at least 800 */
"height": 760 /* popup height, should be at least 600 */
});
</script>
- <h1 style= "font-family: Monaco, 'Lucida Console', monospace">Jasmine test of MKWS</h1>
- <div id="testMOTD"><div class="mkwsMOTD">This is the mkwsMOTD div</div></div>
+<h2>MKWS Jasmine regression tests</h2>
+<p/>
+
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MKWS demo: Reference Universe widget</title>
- <link rel="stylesheet" type="text/css" href="//x.mkws.indexdata.com/mkws.css" />
+ <link rel="stylesheet" type="text/css" href="tools/htdocs/mkws.css" />
<script type="text/javascript">
var mkws_config = {
service_proxy_auth: "//mkws.indexdata.com/service-proxy/?command=auth&action=check,login&username=mkwstest&password=mkwstest"
};
</script>
<script type="text/javascript" src="//code.jquery.com/jquery-1.10.0.min.js"></script>
- <script type="text/javascript" src="//x.mkws.indexdata.com/jquery.json-2.4.js"></script>
- <script type="text/javascript" src="//x.mkws.indexdata.com/handlebars-v1.1.2.js"></script>
- <script type="text/javascript" src="//x.mkws.indexdata.com/pazpar2/js/pz2.js"></script>
+ <script type="text/javascript" src="src/jquery.json-2.4.js"></script>
+ <script type="text/javascript" src="src/handlebars-v1.1.2.js"></script>
+ <script type="text/javascript" src="src/pz2.js"></script>
<script type="text/javascript" src="src/mkws-handlebars.js"></script>
<script type="text/javascript" src="src/mkws-core.js"></script>
<script type="text/javascript" src="src/mkws-team.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MKWS demo: Reference Universe widget</title>
- <link rel="stylesheet" type="text/css" href="//x.mkws.indexdata.com/mkws.css" />
+ <link rel="stylesheet" type="text/css" href="tools/htdocs/mkws.css" />
<script type="text/javascript">
var mkws_config = {
service_proxy_auth: "//mkws.indexdata.com/service-proxy/?command=auth&action=check,login&username=mkwstest&password=mkwstest"
};
</script>
<script type="text/javascript" src="//code.jquery.com/jquery-1.10.0.min.js"></script>
- <script type="text/javascript" src="//x.mkws.indexdata.com/jquery.json-2.4.js"></script>
- <script type="text/javascript" src="//x.mkws.indexdata.com/handlebars-v1.1.2.js"></script>
- <script type="text/javascript" src="//x.mkws.indexdata.com/pazpar2/js/pz2.js"></script>
+ <script type="text/javascript" src="src/jquery.json-2.4.js"></script>
+ <script type="text/javascript" src="src/handlebars-v1.1.2.js"></script>
+ <script type="text/javascript" src="src/pz2.js"></script>
<script type="text/javascript" src="src/mkws-handlebars.js"></script>
<script type="text/javascript" src="src/mkws-core.js"></script>
<script type="text/javascript" src="src/mkws-team.js"></script>
content: "Source: ";
font-weight: bold;
}
+
+.mkwsFacet a {
+ text-decoration: none;
+}
+
+.mkwsFacet a:hover {
+ text-decoration: underline;
+}
+
+.mkwsTerm {
+ clear: both;
+}
+
+.mkwsTerm span {
+ float: right;
+}
+
</div>\
');
+ // Inhibit the display of the sole facet's title.
+ this.team.registerTemplate('facetTitle-Subject', 'doo');
+
var s = []
s.push('<table>');
s.push('<td class="side">');
s.push(section('topics', 'Related Topics',
- this.subwidget('Facet', { _team: 'main', facet: 'subject' })));
+ this.subwidget('Facet', { _team: 'main', facet: 'subject', template: 'CredoFacet' })));
s.push('</td>');
s.push('</tr>');
"use strict"; // HTML5: disable for log_level >= 2
+// Incredible that the standard JavaScript runtime doesn't define a
+// unique windowId. Instead, we have to make one up. And since there's
+// no global area shared between windows, the best we can do for
+// ensuring uniqueness is generating a random ID and crossing our
+// fingers. We stash this in window.name, as it's the only place to
+// keep data that is preserved across reloads and within-site
+// navigation. pz2.js picks this up and uses it as part of the
+// cookie-name, to ensure each tab gets its own session.
+if (window.name) {
+ console.log("Using existing window.name '" + window.name + "'");
+} else {
+ // Ten chars from 26 alpha-numerics = 36^10 = 3.65e15 combinations.
+ // At one per second, it will take 116 million years to duplicate a session
+ window.name = Math.random().toString(36).slice(2, 12);
+ console.log("Generated new window.name '" + window.name + "'");
+}
+
// Set up global mkws object. Contains truly global state such as SP
// authentication, and a hash of team objects, indexed by team-name.
//
{{#if md-title-responsibility}}\
<span><i>{{md-title-responsibility}}</i></span>\
{{/if}}\
+{{#if md-date}}, {{md-date}}\
+{{#if location}}\
+, {{#mkws-first location}}{{mkws-attr "@name"}}{{/mkws-first}}\
+{{/if}}\
+{{#if md-medium}}\
+<span>, {{md-medium}}</span>\
+{{/if}}\
+{{/if}}\
';
} else if (name === "Image") {
return '\
waitsFor(function () {
var hits_single_target = get_hit_counter();
+ console.log("hits_single_target='" + hits_single_target + "' cf. hits_all_targets='" + hits_all_targets + "'");
return hits_single_target > 0 && hits_single_target < hits_all_targets ? true : false;
}, "Limited author search for less than " + hits_all_targets + " hits", 4.5 * jasmine_config.second);