Remove Google helper from topic.html to clean up markup for demo.
[mkws-moved-to-github.git] / examples / htdocs / topic.html
index 5e43736..3a53765 100644 (file)
     var mkws_config = { sp_auth_credentials: "credo/emu" };
   </script>
   <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
-  <!-- <script type="text/javascript" src="//mkws.local/mkws&#45;complete.js"></script> -->
   <link rel="stylesheet" type="text/css" href="topic.css">
   <script>
-    // The Google Images database returns links like:
-    //      http://images.google.com/url?q=http://eofdreams.com/fish.html&sa=U&ei=RAB-U9XNDo2Dqga1o4L4Bw&ved=0CC4Q9QEwAA&usg=AFQjCNFhRtn6GMevHbpITZ6kfx6rsHV2ow
-    // This Handlebars helper avoids a pointless redirect by transforming
-    // this to the URL of the underling page, in this case
-    //      http://eofdreams.com/fish.html
-    Handlebars.registerHelper('mkws-googleurl', function(obj) {
-      if (!obj) {
-        return "obj undefined";
-      } else if (!obj[0]) {
-        return "obj[0] undefined, JSON=" + $.toJSON(obj);
-      } else {
-        return mkws.getParameterByName('q', obj[0]);
-      }
-    });
     Handlebars.registerHelper('mkws-topicurl', function(topic) {
       return window.location.pathname + "?q=" + encodeURIComponent(topic);
     });
   </script>
-  <script class="mkws-template_topicimage" type="text/x-handlebars-template">
+  <script class="mkws-template-topic-image" type="text/x-handlebars-template">
     {{#each hits}}
       <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
-       <a href="{{mkws-googleurl md-electronic-url}}" target="_blank">
+       <a href="{{md-electronic-url}}" target="_blank">
         {{#mkws-first md-thumburl}}
           <img src="{{this}}" alt="{{../md-title}}"/>
         {{/mkws-first}}
@@ -51,7 +36,7 @@
       </div>
     {{/each}}
   </script>
-  <script class="mkws-template_topicfacet" type="text/x-handlebars-template">
+  <script class="mkws-template-topic-facet" type="text/x-handlebars-template">
     {{#each terms}}
       <li class="list-group-item mkws-term">
         <span class="badge">{{count}}</span>
@@ -76,7 +61,7 @@
         <ul class="panel-body list-group mkws-facet mkws-team-main"
             autosearch="!param!q"
             data-mkws-facet="subject"
-            data-mkws-config='{ "template": "TopicFacet" }'></ul>
+            data-mkws-config='{ "template": "topic-facet" }'></ul>
       </div></div>
     </div>
     <!-- images -->
@@ -85,8 +70,8 @@
         <div class="panel-heading title">
           <h3 class="panel-title">Images</h3>
         </div>
-        <div class="panel-body mkws-googleimage" autosearch="!param!q"
-             data-mkws-config='{ "maxrecs": 4, "template": "TopicImage", "target": "google_images_js" }'></div>
+        <div class="panel-body mkws-google-image" autosearch="!param!q"
+             data-mkws-config='{ "maxrecs": 4, "template": "topic-image", "target": "google_images_js" }'></div>
       </div></div>
     </div>