Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/mkws
authorMike Taylor <mike@indexdata.com>
Mon, 23 Feb 2015 10:12:28 +0000 (10:12 +0000)
committerMike Taylor <mike@indexdata.com>
Mon, 23 Feb 2015 10:12:28 +0000 (10:12 +0000)
examples/htdocs/custom.css [deleted file]
examples/htdocs/localauth.html [deleted file]
examples/htdocs/minimal.html [deleted file]
examples/htdocs/popup.html [deleted file]
examples/htdocs/templates.html [deleted file]
src/Makefile
src/mkws-core.js
src/mkws-filter.js
src/mkws-widget-main.js
src/templates/waiting.handlebars [new file with mode: 0644]
test/package.json

diff --git a/examples/htdocs/custom.css b/examples/htdocs/custom.css
deleted file mode 100644 (file)
index 80eb04a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-.mkws-facets {
-    background: white;
-}
-.mkws-facet {
-    background: white;
-}
diff --git a/examples/htdocs/localauth.html b/examples/htdocs/localauth.html
deleted file mode 100644 (file)
index e1e9b72..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo client</title>
-    <link rel="stylesheet" type="text/css" href="//mkws.indexdata.com/mkws.css" />
-    <script type="text/javascript">
-      var mkws_config = {
-        service_proxy_auth: "http://example.indexdata.com/service-proxy-auth/",
-        service_proxy_auth_domain : "sp-mkws.indexdata.com"
-      };
-      // See also the Apache2 RewriteRule needed to make this work:
-      // http://example.indexdata.com/apache-config.txt
-    </script>
-    <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
-  </head>
-  <body>
-    <div class="mkws-switch"></div>
-    <div class="mkws-lang"></div>
-    <div class="mkws-search"></div>
-    <div class="mkws-results"></div>
-    <div class="mkws-targets"></div>
-    <div class="mkws-stat"></div>
-  </body>
-</html>
diff --git a/examples/htdocs/minimal.html b/examples/htdocs/minimal.html
deleted file mode 100644 (file)
index 37a783c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
-<div class="mkws-search"></div>
-<div class="mkws-results"></div>
diff --git a/examples/htdocs/popup.html b/examples/htdocs/popup.html
deleted file mode 100644 (file)
index 256d695..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo: Popup Widget</title>
-    <link rel="stylesheet" type="text/css" href="//mkws.indexdata.com/mkws.css" />
-
-    <script type="text/javascript">
-      var mkws_config = {
-       sp_auth_credentials: "mkwstest/mkwstest"
-      };
-    </script>
-
-    <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
-
-    <link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
-    <!-- jquery-ui need a reference to the internal jQuery object -->
-    <script>$ = jQuery = mkws.$; </script>
-    <script type="text/javascript" src="//code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
-
-    <style>
-    .mkws-search { float: left !important; }
-    .mkws-search input.mkws-button { color: black; }
-    </style>
-  </head>
-
-  <body>
-    <h3>MKWS demo: popup widget(s)</h3>
-
-    <div>
-      <p><a id="popup_no1">popup number 1</a></p>
-      <p><a id="popup_no2">popup number 2</a></p>
-    </div>
-
-    <!-- search box is outside the popup window -->
-    <div class="mkws-search"></div>
-
-    <!-- popup widget config -->
-    <div class="mkws-popup" popup_width="1024" popup_height="750" popup_modal="0" popup_autoOpen="0" popup_button="input.mkws-button">
-      <div class="mkws-switch"></div>
-      <div class="mkws-lang"></div>
-      <div class="mkws-results"></div>
-      <div class="mkws-targets"></div>
-      <div class="mkws-stat"></div>
-    </div>
-
-    <!-- popup widget config -->
-    <div class="mkws-popup" popup_width="500" popup_height="350" popup_modal="0" popup_autoOpen="0" popup_button="a#popup_no1">
-       <h1>popup no 1</h1>
-       some text...
-    </div>
-
-    <div class="mkws-popup" popup_width="400" popup_height="250" popup_modal="0" popup_autoOpen="0" popup_button="a#popup_no2">
-       <h1>popup no 2</h1>
-       other text...
-    </div>
-
-  </body>
-</html>
diff --git a/examples/htdocs/templates.html b/examples/htdocs/templates.html
deleted file mode 100644 (file)
index 6c02276..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo client</title>
-    <link rel="stylesheet" type="text/css" href="//mkws.indexdata.com/mkws.css" />
-    <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
-    <script class="mkws-template-summary" type="text/x-handlebars-template">
-      <a href="#" id="{{_id}}" onclick="{{_onclick}}">
-       <b>{{md-title}}</b>
-      </a>
-      {{#if md-title-remainder}}
-        <span>{{md-title-remainder}}</span>
-      {{/if}}
-      {{#if md-title-responsibility}}
-       <span><i>{{md-title-responsibility}}</i></span>
-      {{/if}}
-    </script>
-    <script class="mkws-template-record" type="text/x-handlebars-template">
-      <table>
-       <tr>
-         <th>Title</th>
-         <td>
-           {{md-title}}
-           {{#if md-title-remainder}}
-             ({{md-title-remainder}})
-           {{/if}}
-           {{#if md-title-responsibility}}
-             <i>{{md-title-responsibility}}</i>
-           {{/if}}
-         </td>
-       </tr>
-       {{#if md-date}}
-       <tr>
-         <th>Date</th>
-         <td>{{md-date}}</td>
-       </tr>
-       {{/if}}
-       {{#if md-author}}
-       <tr>
-         <th>Author</th>
-         <td>{{md-author}}</td>
-       </tr>
-       {{/if}}
-       {{#if md-electronic-url}}
-       <tr>
-         <th>URL</th>
-         <td>
-           {{#each md-electronic-url}}
-             <a href="{{this}}">{{this}}</a><br/>
-           {{/each}}
-         </td>
-       </tr>
-       {{/if}}
-       {{#mkws-if-any location having="md-subject"}}
-       <tr>
-         <th>Subject</th>
-         <td>
-           {{#mkws-first location having="md-subject"}}
-             {{#if md-subject}}
-               {{md-subject}}
-             {{/if}}
-           {{/mkws-first}}
-         </td>
-       </tr>
-       {{/mkws-if-any}}
-       <tr>
-         <th>Locations</th>
-         <td>
-           {{#mkws-commaList location}}
-             {{mkws-attr "@name"}}{{/mkws-commaList}}
-         </td>
-       </tr>
-      </table>
-    </script>
-  </head>
-  <body>
-    <div class="mkws-switch"></div>
-    <div class="mkws-lang"></div>
-    <div class="mkws-search"></div>
-    <div class="mkws-results"></div>
-    <div class="mkws-targets"></div>
-    <div class="mkws-stat"></div>
-  </body>
-</html>
index 21a8c5a..cf60ea6 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com
+# Copyright (c) 2013-2015 Index Data ApS. http://indexdata.com
 
 DEST = ../tools/htdocs
 
@@ -46,7 +46,7 @@ all: $(INSTALLED)
 
 $(DEST)/mkws-complete.js: Makefile $(INSTALLED_DOWNLOADABLE) $(DEST)/mkws.js
        ( set -e; \
-         echo "/*! Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com"; \
+         echo "/*! Copyright (c) 2013-$$(date '+%Y') Index Data ApS. http://indexdata.com"; \
          echo "   Licence: LGPL, http://www.indexdata.com/licences/lgpl"; \
          echo "   created at: $$(date)"; \
          echo "   MKWS GIT id: $$(git show | head -n 1 | perl -npe 's,\S+\s+,,')"; \
index ade2ed6..615f30d 100644 (file)
@@ -1,5 +1,5 @@
 /*! MKWS, the MasterKey Widget Set.
- *  Copyright (C) 2013-2014 Index Data
+ *  Copyright (C) 2013-2015 Index Data
  *  See the file LICENSE for details
  */
 
index 3554d98..0b2ea63 100644 (file)
@@ -95,7 +95,7 @@ function filterSet(team) {
 
     that.visitCategories(function(id) {
       if (res) res += ",";
-      res += "category~" + id.replace(/[\\|,]/g, '\\$&');
+      res += "category~" + id.replace(/[\\,]/g, '\\$&');
     });
     return res;
   }
index 2a68283..22a5f59 100644 (file)
@@ -388,8 +388,10 @@ mkws.registerWidgetType('waiting', function() {
   var that = this;
 
   this.node.css("visibility", "hidden");
-  var src = this.config.src || "http://mkws.indexdata.com/progress.gif";
-  this.node.html('<img src="' + src + '"/>');
+  var template = that.team.loadTemplate(that.config.template || "waiting");
+  this.node.html(template({
+    src: this.config.src || "http://mkws.indexdata.com/progress.gif"
+  }));
 
   this.team.queue("searchtriggered").subscribe(function(data) {
     that.node.css("visibility", "visible");
diff --git a/src/templates/waiting.handlebars b/src/templates/waiting.handlebars
new file mode 100644 (file)
index 0000000..b9c1ab4
--- /dev/null
@@ -0,0 +1,6 @@
+{{!
+Search activity indicator
+
+src - image to display when active
+}}
+<img src="{{src}}"/>
index 69e0d70..c3faab5 100644 (file)
@@ -18,7 +18,7 @@
         "jasmine-reporters": "*",
         "jasmine-node": "*",
         "phantomjs": "*",
-        "handlebars": "*",
+        "handlebars": "<= 2.0.0",
         "uglify-js": "*"
     },
     "repository": {