Tidy up bootstrap example.
authorJason Skomorowski <jason@indexdata.com>
Mon, 7 Jul 2014 23:53:47 +0000 (19:53 -0400)
committerJason Skomorowski <jason@indexdata.com>
Mon, 7 Jul 2014 23:53:47 +0000 (19:53 -0400)
examples/htdocs/mkws-widget-credo-bs.js [deleted file]
examples/htdocs/ref-bootstrap.html [deleted file]
examples/htdocs/topic-bootstrap-reorganise.html [deleted file]
examples/htdocs/topic-bootstrap.html

diff --git a/examples/htdocs/mkws-widget-credo-bs.js b/examples/htdocs/mkws-widget-credo-bs.js
deleted file mode 100644 (file)
index 49651ea..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-// 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]);
-  }
-});
-
-
-// ### This works inefficiently by having multiple teams all run the
-// same search against different sets of targets. A much better
-// approach would be run a single search, with all these panels
-// members of the same team, but picking out only the results relevant
-// to them. That will be more work.
-
-mkws.registerWidgetType('Credo', function() {
-  var that = this;
-
-  this.team.registerTemplate('CredoImage', '\
-      <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">\
-       <a href="{{mkws-googleurl md-electronic-url}}" target="_blank">\
-        {{#mkws-first md-thumburl}}\
-         <img src="{{this}}" alt="{{../md-title}}"/>\
-        {{/mkws-first}}\
-       <br/>\
-       </a>\
-       <p>{{{md-title}}}</p>\
-      </div>\
-');
-
-  var s = []
-  // Main panel: encylopaedia and images on the left, topics on the right
-  s.push('<div class="row">');
-
-  s.push('<div class="jumbotron panel col-md-8"><div class="panel-body">');
-  //s.push(section('encyclopaedia', 'Topic Page: <span class="x-mkws-title"/>',
-  s.push(this.subwidget('Reference', { _team: 'ref', paragraphs: 1 }));
-  // The Images widget needs to be in our team so we can set its template
-  s.push('</div></div>');
-
-  s.push('<div class="col-md-4">');
-  s.push(section('topics', 'Related Topics',
-                 this.subwidget('Facet', { _team: 'main', facet: 'subject' })));
-  s.push('</div>');
-
-  s.push('</div>');
-  
-  s.push('<div class="row">');
-  s.push(section('image col-md-12', 'Images', this.subwidget('GoogleImage', { maxrecs: 4, template: 'CredoImage', target: 'google_images_js' })));
-  s.push('</div>');
-  
-
-  s.push('<div class="row clearfix">');
-  s.push(section('entries clearfix col-md-4 col-sm-6', 'News',
-                 this.subwidget('Records', { _team: 'news', targetfilter: 'categories=news', perpage: 10 })));
-  s.push(section('articles clearfix col-md-4 col-sm-6', 'Articles',
-                    this.subwidget('Records', { _team: 'articles', targetfilter: 'categories=articles', perpage: 10 })));
-  s.push(section('books clearfix col-md-4 col-sm-6', 'Books',
-                    this.subwidget('Records', { _team: 'books', targetfilter: 'categories=books', perpage: 10 })));
-  s.push(section('news col-md-4 col-sm-6', 'Results from all targets',
-                    this.subwidget('Records', { _team: 'main' })));
-  s.push('</div>');
-  this.node.html(s.join(''));
-
-  // Fill in the titles from the query once widgets have all been prepared
-  var that = this;
-  this.team.queue("ready").subscribe(function() {
-    var query = toTitleCase(that.config.query);
-    that.log("got query '" + query + "' from team config");
-    mkws.$('.x-mkws-title').html(query);
-    mkws.$('title').html("MKWS: " + query);
-
-    mkws.$(".mkwsSummary img").addClass("media-object");
-    console.log(mkws.$("body").html());
-
-    // Derived from http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript
-    function toTitleCase(str) {
-      return str.replace(/\w\S*/g, function(txt) {
-        return txt.charAt(0).toUpperCase() + txt.substr(1);
-      });
-    }
-  });
-
-
-  function section(xclass, title, content) {
-    var s = [];
-    s.push('<div class="' + xclass + '"><div class="panel panel-default">');
-    s.push('<div class="panel-heading title"><h3 class="panel-title">' + title + '</h3></div>');
-    s.push('<div class="panel-body">' + content + '</div>');
-    s.push('</div></div>');
-    return s.join('');
-  }
-
-  function sectionRow(xclass, title, content) {
-    var s = [];
-    s.push('<div class="row">');
-    s.push(section(xclass, title, content));
-    s.push('</div>');
-    return s.join('');
-  }
-});
diff --git a/examples/htdocs/ref-bootstrap.html b/examples/htdocs/ref-bootstrap.html
deleted file mode 100644 (file)
index 503a8fe..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <title>MKWS demo: Compound reference widget</title>
-    <!-- <link rel="stylesheet" type="text/css" href="mkws&#45;widget&#45;credo.css" /> -->
-    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
-    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
-    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
-    <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
-    <script type="text/javascript">
-      var mkws_config = { service_proxy_auth: "//mkws.indexdata.com/service-proxy-credoauth" };
-    </script>
-    <script class="mkwsTemplate_FacetBootstrap" type="text/x-handlebars-template">
-      <h3>Results from Reference Universe</h3>
-      {{#each hits}}
-        <div class="refinement">
-          {{#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}}
-        </div>
-      {{/each}}
-    </script>
-    <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
-    <script type="text/javascript" src="mkws-widget-credo-bs.js"></script>
-    <style>
-      .mkwsCredo {
-        max-width: 1440px;
-      }
-      .mkwsGoogleImage img {
-        max-width: 95%;
-      }
-    </style>
-  </head>
-  <body>
-    <div class='mkwsCredo page-header container-fluid' autosearch='!param!q'></div>
-  </body>
-</html>
diff --git a/examples/htdocs/topic-bootstrap-reorganise.html b/examples/htdocs/topic-bootstrap-reorganise.html
deleted file mode 100644 (file)
index 4cb3e7d..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-  <meta charset="utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge">
-  <meta name="viewport" content="width=device-width, initial-scale=1">
-  <title>MKWS demo: Compound reference widget, Bootstrap edition</title>
-  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
-  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
-  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
-  <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
-  <script type="text/javascript">
-    var mkws_config = { service_proxy_auth: "//mkws.indexdata.com/service-proxy-credoauth" }
-  </script>
-  <!-- <script type="text/javascript" src="//mkws.indexdata.com/mkws&#45;complete.js"></script> -->
-  <script type="text/javascript" src="//mkws.local/src/mkws-complete.js"></script>
-  <link rel="stylesheet" type="text/css" href="topic-bootstrap.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]);
-      }
-    });
-  </script>
-  <script class="mkwsTemplate_TopicImage" type="text/x-handlebars-template">
-    {{#each hits}}
-      <div class="col-lg-6 col-md-12 col-sm-6">
-       <a href="{{mkws-googleurl md-electronic-url}}" target="_blank">
-        {{#mkws-first md-thumburl}}
-          <img src="{{this}}" alt="{{../md-title}}"/>
-        {{/mkws-first}}
-        <br/>
-       </a>
-       <p>{{{md-title}}}</p>
-      </div>
-    {{/each}}
-  </script>
-  <script class="mkwsTemplate_TopicFacet" type="text/x-handlebars-template">
-    {{#each terms}}
-      <li class="list-group-item mkwsTerm">
-        <span class="badge">{{count}}</span>
-        <a href="#" {{linkdata}}>{{term}}</a>
-      </li>
-    {{/each}}
-  </script>
-</head>
-<body>
-  <div class='page-header container' autosearch='!param!q'>
-    <div class="row">
-      <!-- reference entry -->
-      <div class="jumbotron panel col-md-7">
-        <div class="panel-body mkwsReference mkwsTeam_ref" autosearch="!param!q"
-             data-mkws-config='{"paragraphs":1}'></div>
-      </div>
-      <!-- images -->
-      <div class="col-md-5"><div class="panel panel-default">
-        <div class="panel-heading title">
-          <h3 class="panel-title">Images</h3>
-        </div>
-        <div class="panel-body mkwsGoogleImage" autosearch="!param!q"
-             data-mkws-config='{ "maxrecs": 4, "template": "TopicImage", "target": "google_images_js" }'></div>
-      </div></div>
-    </div>
-
-    <!-- sources -->
-    <div class="row">
-      <div class="col-md-4 col-sm-6"><div class="panel panel-default">
-        <div class="panel-heading title">
-          <h3 class="panel-title">News</h3>
-        </div>
-        <div class="panel-body mkwsRecords mkwsTeam_news" autosearch="!param!q"
-             data-mkws-config='{"targetfilter":"categories=news",
-                                "perpage":5}'></div>
-      </div></div>
-      <div class="col-md-4 col-sm-6"><div class="panel panel-default">
-        <div class="panel-heading title">
-          <h3 class="panel-title">Articles</h3>
-        </div>
-        <div class="panel-body mkwsRecords mkwsTeam_articles" autosearch="!param!q"
-             data-mkws-config='{"targetfilter":"categories=articles",
-                                "perpage":5}'></div>
-      </div></div>
-      <div class="col-md-4 col-sm-6"><div class="panel panel-default">
-        <div class="panel-heading title">
-          <h3 class="panel-title">Books</h3>
-        </div>
-        <div class="panel-body mkwsRecords mkwsTeam_books" autosearch="!param!q"
-             data-mkws-config='{"targetfilter":"categories=books",
-                                "perpage":5}'></div>
-      </div></div>
-    </div>
-
-    <div class="row">
-      <!-- all targets -->
-      <div class="col-md-9"><div class="panel panel-default">
-        <div class="panel-heading title">
-          <h3 class="panel-title">Results from all targets</h3>
-        </div>
-        <div class="panel-body mkwsRecords mkwsTeam_main"></div>
-      </div></div>
-      <!-- related topics -->
-      <div class="col-md-3"><div class="panel panel-default">
-        <div class="panel-heading title">
-          <h3 class="panel-title">Related Topics</h3>
-        </div>
-        <ul class="panel-body list-group mkwsFacet mkwsTeam_main"
-            autosearch="!param!q"
-            data-mkws-facet="subject"
-            data-mkws-config='{ "template": "TopicFacet" }'></ul>
-      </div></div>
-    </div>
-  </div>
-</body>
-</html>
index 7c11553..d72aa70 100644 (file)
@@ -16,8 +16,8 @@
   <script type="text/javascript">
     var mkws_config = { service_proxy_auth: "//mkws.indexdata.com/service-proxy-credoauth" }
   </script>
-  <!-- <script type="text/javascript" src="//mkws.indexdata.com/mkws&#45;complete.js"></script> -->
-  <script type="text/javascript" src="//mkws.local/src/mkws-complete.js"></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-bootstrap.css">
   <script>
     // The Google Images database returns links like: