New
authorMike Taylor <mike@indexdata.com>
Thu, 22 May 2014 11:07:01 +0000 (12:07 +0100)
committerMike Taylor <mike@indexdata.com>
Thu, 22 May 2014 11:07:01 +0000 (12:07 +0100)
examples/htdocs/mike-1efb82332d8d1a9293ad60f7517668cfcce480b0.html [new file with mode: 0644]
examples/htdocs/mkws-widget-credo-1efb82332d8d1a9293ad60f7517668cfcce480b0.js [new file with mode: 0644]

diff --git a/examples/htdocs/mike-1efb82332d8d1a9293ad60f7517668cfcce480b0.html b/examples/htdocs/mike-1efb82332d8d1a9293ad60f7517668cfcce480b0.html
new file mode 100644 (file)
index 0000000..0053fb6
--- /dev/null
@@ -0,0 +1,32 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>MKWS demo: Reference Universe widget</title>
+    <link rel="stylesheet" type="text/css" href="mkws-widget-credo.css" />
+    <script type="text/javascript">
+      var mkws_config = { service_proxy_auth: "//mkws.indexdata.com/service-proxy-testauth" };
+    </script>
+    <script type="text/javascript" src="//code.jquery.com/jquery-1.10.0.min.js"></script>
+    <script type="text/javascript" src="//x.mkws.indexdata.com/jquery.json-2.4.js"></script>
+    <script type="text/javascript" src="//x.mkws.indexdata.com/handlebars-v1.1.2.js"></script>
+    <script type="text/javascript" src="//x.mkws.indexdata.com/pazpar2/js/pz2.js"></script>
+    <script type="text/javascript" src="src/mkws-handlebars.js"></script>
+    <script type="text/javascript" src="src/mkws-core.js"></script>
+    <script type="text/javascript" src="src/mkws-team.js"></script>
+    <script type="text/javascript" src="src/mkws-filter.js"></script>
+    <script type="text/javascript" src="src/mkws-widget.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-main.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-termlists.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-authname.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-categories.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-log.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-record.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-reference.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-builder.js"></script>
+    <script type="text/javascript" xsrc="mkws-widget-credo.js"></script>
+    <script type="text/javascript" src="mkws-widget-credo-1efb82332d8d1a9293ad60f7517668cfcce480b0.js"></script>
+  </head>
+  <body>
+    <div class='mkwsCredo' autosearch='!param!q'>result will appear here</div>
+  </body>
+</html>
diff --git a/examples/htdocs/mkws-widget-credo-1efb82332d8d1a9293ad60f7517668cfcce480b0.js b/examples/htdocs/mkws-widget-credo-1efb82332d8d1a9293ad60f7517668cfcce480b0.js
new file mode 100644 (file)
index 0000000..2bb1b1a
--- /dev/null
@@ -0,0 +1,59 @@
+mkws.registerWidgetType('Credo', function() {
+  var that = this;
+  var s = []
+  s.push('<table>');
+
+  // Main panel: encylopaedia and images on the left, topics on the right
+  s.push('<tr class="front">');
+
+  s.push('<td class="main">');
+  s.push(section('encyclopaedia', 'Topic Page: ### title',
+                 this.subwidget('Reference')));
+  s.push(section('image', 'Images',
+                 this.subwidget('Images', { /* ### config */ })));
+  s.push('</td>');
+
+  s.push('<td class="side">');
+  s.push(section('mindmap', 'Create a Mind Map for ### title',
+                 '### Is there a way to make a mind-map?'));
+  s.push(section('topics', 'Related Topics',
+                 this.subwidget('Facet', { facet: 'subject' })));
+  s.push('</td>');
+
+  s.push('</tr>');
+
+  s.push(sectionRow('entries', 'Credo Entries',
+                    this.subwidget('Records', { /* ### config */ })));
+  s.push(sectionRow('articles', 'Articles',
+                    this.subwidget('Records', { /* ### config */ })));
+  s.push(sectionRow('books', 'Books',
+                    this.subwidget('Records', { /* ### config */ })));
+  s.push(sectionRow('news', 'News',
+                    this.subwidget('Records', { /* ### config */ })));
+  s.push(sectionRow('resources', 'Suggested Resources',
+                    this.subwidget('Records', { /* ### config */ })));
+
+  s.push('</table>');
+
+  this.node.html(s.join(''));
+
+
+  function section(xclass, title, content) {
+    var s = [];
+    s.push('<div class="' + xclass + ' section">');
+    s.push('<div class="title">' + title + '</div>');
+    s.push('<div class="content">' + content + '</div>');
+    s.push('</div>');
+    return s.join('');
+  }
+
+  function sectionRow(xclass, title, content) {
+    var s = [];
+    s.push('<tr>');
+    s.push('<td colspan="2">');
+    s.push(section(xclass, title, content));
+    s.push('</td>');
+    s.push('</tr>');
+    return s.join('');
+  }
+});