Topic page example w/bootstrap
authorJason Skomorowski <jason@indexdata.com>
Wed, 11 Jun 2014 02:54:47 +0000 (22:54 -0400)
committerJason Skomorowski <jason@indexdata.com>
Wed, 11 Jun 2014 02:54:47 +0000 (22:54 -0400)
examples/htdocs/topic-bootstrap-reorganise.html [new file with mode: 0644]
examples/htdocs/topic-bootstrap.css [new file with mode: 0644]
examples/htdocs/topic-bootstrap.html [new file with mode: 0644]

diff --git a/examples/htdocs/topic-bootstrap-reorganise.html b/examples/htdocs/topic-bootstrap-reorganise.html
new file mode 100644 (file)
index 0000000..4cb3e7d
--- /dev/null
@@ -0,0 +1,123 @@
+<!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>
diff --git a/examples/htdocs/topic-bootstrap.css b/examples/htdocs/topic-bootstrap.css
new file mode 100644 (file)
index 0000000..30d733e
--- /dev/null
@@ -0,0 +1,92 @@
+body {
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 
+  background: radial-gradient(ellipse at center,  #ffffff 0%,#f8f8f8 100%);
+  font-weight: 300;
+}
+b, strong {
+  font-weight: 400; 
+}
+.panel {
+  border: none;
+  background: white;
+  padding: 1em .75em;
+  border-radius: 3px;
+  -moz-border-radius: 3px;
+  -webkit-border-radius: 3px;
+  color: #76868A;
+  box-shadow: 0 0 2px rgba(0, 0, 0, 0.09);
+  margin-bottom: 2em;
+}
+
+.panel-default > .panel-heading {
+  background-image: none; 
+  border: none;
+  background-color: white;
+}
+
+.panel-heading {
+  padding: 0.5em 15px 0;
+}
+
+.panel-title {
+  font-size: 130%;
+  color: #4A5456;
+}
+
+.panel-body {
+  padding: 10px 15px; 
+}
+
+.mkwsFacetTitle {
+  font-style: italic;
+  font-weight: 400;
+}
+  .mkwsTerm {
+    padding: .1em 0;
+  }
+  .mkwsTerm a {
+    padding-right: .5em; 
+    font-weight: 400;
+  }
+
+.mkwsSummary {
+  padding: .5em 0;
+  line-height: 1.35;
+}
+.mkwsSummary:last-child {
+  padding-bottom: 0;
+}
+  
+.container .jumbotron {
+  background: none;
+  padding: 0 2em 0 0;
+  box-shadow: none;
+  color: black;
+}  
+  .jumbotron .mkwsSummary {
+    line-height: 1.5;  
+  }
+  .jumbotron p{
+    font-size: 150%; 
+  }
+  .mkwsCredit {
+    font-size: 125% !important;
+    font-style: italic;
+  }
+  
+.mkwsGoogleImage .mkwsSummary {
+  padding: 0;
+  font-weight: 400;
+}
+  .mkwsGoogleImage img {
+    max-width: 100%;
+    max-height: 200px;
+    padding: 1em 0 .5em;
+  }
+.list-group-item {
+  padding: 10px 15px !important;
+}
+.list-group {
+  box-shadow: none;
+  -webkit-box-shadow: none;
+}
diff --git a/examples/htdocs/topic-bootstrap.html b/examples/htdocs/topic-bootstrap.html
new file mode 100644 (file)
index 0000000..1464408
--- /dev/null
@@ -0,0 +1,125 @@
+<!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-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>
+    {{/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-8">
+        <div class="panel-body mkwsReference mkwsTeam_ref" autosearch="!param!q"
+             data-mkws-config='{"paragraphs":1}'></div>
+      </div>
+      <!-- related topics -->
+      <div class="col-lg-offset-1 col-lg-3 col-md-4"><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>
+    <!-- images -->
+    <div class="row">
+      <div class="col-md-12"><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-lg-6 col-md-8 col-sm-6">
+        <div class="col-md-6 col-sm-12"><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":10}'></div>
+        </div></div>
+        <div class="col-md-6 col-sm-12"><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":10}'></div>
+        </div></div>
+        <div class="col-md-6 col-sm-12"><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":10}'></div>
+        </div></div>
+      </div>
+      <div class="col-lg-6 col-md-4 col-sm-6">
+          <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>
+    </div>
+  </div>
+</body>
+</html>