Merge branch 'master' of ssh://git.indexdata.com:222/home/git/private/mkws
authorWolfram Schneider <wosch@indexdata.dk>
Tue, 16 Sep 2014 09:51:21 +0000 (09:51 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Tue, 16 Sep 2014 09:51:21 +0000 (09:51 +0000)
examples/htdocs/jasmine-cors-popup.html
examples/htdocs/mkws-widget-wimp.css [new file with mode: 0644]
examples/htdocs/mkws-widget-wimp.html [new file with mode: 0644]
examples/htdocs/mkws-widget-wimp.js [new file with mode: 0644]
test/Makefile
test/spec/mkws-config.js

index a910bee..4e8cb6f 100644 (file)
@@ -49,7 +49,7 @@
 
     <script type="text/javascript">
     var mkws_config = {
-      service_proxy_auth: "//mkws.indexdata.com/service-proxy-testauth",
+      service_proxy_auth: "//sp-mkws.indexdata.com/service-proxy-testauth",
       perpage_default: 10
     };
 
diff --git a/examples/htdocs/mkws-widget-wimp.css b/examples/htdocs/mkws-widget-wimp.css
new file mode 100644 (file)
index 0000000..2212e25
--- /dev/null
@@ -0,0 +1,37 @@
+.mkwsWimp {
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  background: #FCFBFA;
+  padding: 0.5em 1em 0.25em;
+  box-shadow: 0 0 2px 0 #7F8F93;
+  border-radius: 0 0 1.5em;
+  -moz-border-radius: 0 0 1.5em;
+  -webkit-border-radius: 0 0 1.5em;
+  line-height: 1.4;
+  color: #86979B;
+  background: radial-gradient(ellipse at center,  #ffffff 0%,#f8f8f8 100%);
+}
+
+h2 {
+  font-size: 100%;
+  color: #4A5456;
+  padding-bottom: .5em;
+}
+
+ul {
+  margin: 0;
+  padding: 0;
+}
+
+li {
+  margin: .95em .25em;
+  padding-top: .75em;
+  border-top: 1px dotted #BEC8CC;
+  font-size: 90%;
+  list-style: none;
+}
+
+a {
+  text-decoration: none;
+  font-weight:bold;
+  color: #2B77AF;
+}
diff --git a/examples/htdocs/mkws-widget-wimp.html b/examples/htdocs/mkws-widget-wimp.html
new file mode 100644 (file)
index 0000000..b203ef2
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+  <div style="max-width: 18em; margin: 1.5em 1.5em">
+    <script src="//mkws.indexdata.com/mkws-complete.js"></script>
+    <script src="mkws-widget-wimp.js"></script>
+    <link rel="stylesheet" type="text/css" href="mkws-widget-wimp.css" />
+    <div class="mkwsWimp" autosearch="!param!q"></div>
+  </div>
+</html>
diff --git a/examples/htdocs/mkws-widget-wimp.js b/examples/htdocs/mkws-widget-wimp.js
new file mode 100644 (file)
index 0000000..4b1425b
--- /dev/null
@@ -0,0 +1,36 @@
+var mkws_config = {
+   service_proxy_auth: "//sp-mkws.indexdata.com/service-proxy/?command=auth&action=login&username=wimp&password=wimp6363"
+};
+
+mkws.registerWidgetType('Wimp', function() {
+  if (!this.config.perpage) this.config.perpage = 5;
+  if (!this.config.sort) this.config.sort = "position";
+  this.team.registerTemplate('Wimp', '\
+<h2>Results from Wimp</h2>\
+<ul>\
+{{#each hits}}\
+  <li>\
+    {{#mkws-first md-electronic-url}}\
+    <a href="{{this}}">\
+    {{/mkws-first}}\
+      {{md-title}}\
+    </a>\
+  {{#if md-title-remainder}}\
+    <span>{{md-title-remainder}}</span>\
+  {{/if}}\
+  {{#if md-title-responsibility}}\
+    <span><i>{{md-title-responsibility}}</i></span>\
+  {{/if}}\
+  </li>\
+{{/each}}\
+</ul>\
+');
+
+  var that = this;
+  var template = that.team.loadTemplate(that.config.template || "Wimp");
+  this.team.queue("records").subscribe(function(data) {
+    that.node.html(template(data));
+  }); 
+  that.autosearch();
+});
+
index 89c0c02..4fbc15d 100644 (file)
@@ -103,7 +103,7 @@ apache-stop:
        else \
           killall apache2 2> /dev/null; \
        fi
-       @sleep 0.3
+       @sleep 0.6
        rm -f ${TMP_DIR}/mkws-jasmine.pid
 
 help:
index 59a0132..b6852a9 100644 (file)
@@ -34,8 +34,8 @@ describe("Check mkws.config object", function () {
 
 
 describe("Check pazpar2 config", function () {
-    it("pazpar2path is a path or an full URL", function () {
-        expect(mkws.config.pazpar2_url).toMatch(/^(\/|https?:\/\/)/)
+    it("pazpar2_url is a path or an full URL", function () {
+        expect(mkws.config.pazpar2_url).toMatch(/^(\/|https?:\/\/|undefined$)/)
     });
 });