4 <meta http-equiv="X-UA-Compatible" content="IE=edge">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>MKWS demo</title>
8 <!-- Include Bootstrap. It needs jQuery. -->
9 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
10 <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
11 <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
12 <!-- http://www.bootstrapcdn.com/#bootswatch_tab has some themes that look mediumly okay -->
13 <!-- <link href="//maxcdn.bootstrapcdn.com/bootswatch/3.1.1/cyborg/bootstrap.min.css" rel="stylesheet"> -->
14 <!-- <link href="//maxcdn.bootstrapcdn.com/bootswatch/3.1.1/amelia/bootstrap.min.css" rel="stylesheet"> -->
15 <!-- <link href="//maxcdn.bootstrapcdn.com/bootswatch/3.1.1/united/bootstrap.min.css" rel="stylesheet"> -->
16 <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
18 <!-- Before including MKWS we can define a configuration object. -->
19 <script type="text/javascript">
20 var mkws_config = { sp_auth_credentials: "credo/emu" };
23 <!-- mkws-complete.js includes jQuery and Handlebars. It will co-exist with
24 another copy of jQuery as we have here but you can also use mkws.js
25 if you have included both separately -->
26 <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
27 <link rel="stylesheet" type="text/css" href="topic.css">
29 <!-- Handlebars templates can make calls to Javascript functions you
32 Handlebars.registerHelper('mkws-topicurl', function(topic) {
33 /* Creates a link back to this page with the topic as a parameter */
34 return window.location.pathname + "?q=" + encodeURIComponent(topic);
38 <!-- Here we create replacement templates that incorporate bootstrap.
39 The prefix "mkws-template-" makes them available to MKWS -->
40 <script class="mkws-template-topic-image" type="text/x-handlebars-template">
42 <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
43 <a href="{{md-electronic-url}}" target="_blank">
44 {{#mkws-first md-thumburl}}
45 <img src="{{this}}" alt="{{../md-title}}"/>
53 <script class="mkws-template-topic-facet" type="text/x-handlebars-template">
55 <li class="list-group-item mkws-term">
56 <span class="badge">{{count}}</span>
57 <a href="{{mkws-topicurl term}}">{{term}}</a>
64 <div class='page-header container'>
66 <!-- mkws-reference - A widget that fetches a Wikipedia entry -->
67 <div class="jumbotron panel col-md-8 col-sm-7">
68 <!-- Note the "autosearch" attribute. It indicates where to get
69 the search term from, in this case a URL parameter. A URL
70 path component or Javascript variable are also possible. -->
71 <div class="panel-body mkws-reference mkws-team-ref" autosearch="!param!q"
72 data-mkws-config='{"paragraphs":1}'></div>
74 <!-- Related topics -->
75 <div class="col-md-offset-1 col-md-3 col-sm-5"><div class="panel panel-default">
76 <div class="panel-heading title">
77 <h3 class="panel-title">Related Topics</h3>
79 <!-- This mkws-facet widget is particularly illustrative:
80 * the data-mkws-facet attribute specifies a particular facet
81 * data-mkws-config allows configuration override; in this case
82 we employ one of the templates we defined above.
83 * having the class mkws-team-main groups this widget with others
84 on the same team. The mkws-records widget at the bottom of
85 the page shares the same team and is thus working from the same
87 <ul class="panel-body list-group mkws-facet mkws-team-main"
89 data-mkws-facet="subject"
90 data-mkws-config='{ "template": "topic-facet" }'></ul>
95 <div class="col-md-12"><div class="panel panel-default">
96 <div class="panel-heading title">
97 <h3 class="panel-title">Images</h3>
99 <!-- The "target" config key narrows the search to a list of targets -->
100 <div class="panel-body mkws-google-image" autosearch="!param!q"
101 data-mkws-config='{ "maxrecs": 4, "template": "topic-image", "target": "google_images_js" }'></div>
107 <div class="news col-md-4 col-sm-6"><div class="panel panel-default">
108 <div class="panel-heading title">
109 <h3 class="panel-title">News</h3>
111 <!-- The "targetfilter" narrows the search to targets matching some criteria -->
112 <div class="panel-body mkws-records mkws-team-news" autosearch="!param!q"
113 data-mkws-config='{"targetfilter":"categories=news",
116 <div class="articles col-md-4 col-sm-6"><div class="panel panel-default">
117 <div class="panel-heading title">
118 <h3 class="panel-title">Articles</h3>
120 <div class="panel-body mkws-records mkws-team-articles" autosearch="!param!q"
121 data-mkws-config='{"targetfilter":"categories=articles",
124 <div class="books col-md-4 col-sm-6"><div class="panel panel-default">
125 <div class="panel-heading title">
126 <h3 class="panel-title">Books</h3>
128 <div class="panel-body mkws-records mkws-team-books" autosearch="!param!q"
129 data-mkws-config='{"targetfilter":"categories=books",
134 <div class="alltargets col-md-12"><div class="panel panel-default">
135 <div class="panel-heading title">
136 <h3 class="panel-title">Results from all targets</h3>
138 <div class="panel-body multicol mkws-records mkws-team-main"></div>