Merge branch 'master' of ssh://git.indexdata.com/home/git/private/mkws
authorMike Taylor <mike@indexdata.com>
Tue, 7 Oct 2014 16:21:33 +0000 (17:21 +0100)
committerMike Taylor <mike@indexdata.com>
Tue, 7 Oct 2014 16:21:33 +0000 (17:21 +0100)
examples/htdocs/topic.html
src/mkws-core.js
test/package.json
tools/htdocs/Makefile

index af4e1d6..ff88fb4 100644 (file)
@@ -34,6 +34,9 @@
         return mkws.getParameterByName('q', obj[0]);
       }
     });
+    Handlebars.registerHelper('mkws-topicurl', function(topic) {
+      return window.location.pathname + "?q=" + encodeURIComponent(topic);
+    });
   </script>
   <script class="mkwsTemplate_TopicImage" type="text/x-handlebars-template">
     {{#each hits}}
@@ -52,7 +55,7 @@
     {{#each terms}}
       <li class="list-group-item mkwsTerm">
         <span class="badge">{{count}}</span>
-        <a href="#" {{linkdata}}>{{term}}</a>
+        <a href="{{mkws-topicurl term}}">{{term}}</a>
       </li>
     {{/each}}
   </script>
index 20b5723..eba71fd 100644 (file)
@@ -497,21 +497,6 @@ mkws.log("Using window.name '" + window.name + "'");
     if (message) greet += " :: " + message; 
     mkws.log(greet);
 
-    // TODO: Let's remove this soon
-    // Backwards compatibility: set new magic class names on any
-    // elements that have the old magic IDs.
-    var ids = [ "Switch", "Lang", "Search", "Pager", "Navi",
-                "Results", "Records", "Targets", "Ranking",
-                "Termlists", "Stat", "MOTD" ];
-    for (var i = 0; i < ids.length; i++) {
-      var id = 'mkws' + ids[i];
-      var node = $('#' + id);
-      if (node.attr('id')) {
-        node.addClass(id);
-        log("added magic class to '" + node.attr('id') + "'");
-      }
-    }
-
     // MKWS is not active until init() has been run against an object with widget nodes.
     // We only set initial configuration when MKWS is first activated.
     if (!mkws.isActive) {
index c047864..c0aca1c 100644 (file)
@@ -18,7 +18,7 @@
         "jasmine-reporters": "<= 0.4.1",
         "jasmine-node": "*",
         "phantomjs": "*",
-        "handlebars": "= 1.3.0"
+        "handlebars": "= 2.0.0"
     },
     "repository": {
         "type": "git",
index 96b8c89..b168496 100644 (file)
@@ -2,7 +2,7 @@
 
 SRC=   ../../src
 
-HANDLEBARS_FILE = handlebars-v1.3.0.js
+HANDLEBARS_FILE = handlebars-v2.0.0.js
 JQUERY_FILE = jquery-1.10.0.min.js
 JQUERY_JSON_FILE = jquery.json-2.4.js
 PP2_FILE = pz2.js