From: Jason Skomorowski Date: Mon, 19 May 2014 21:27:34 +0000 (-0400) Subject: RU widget: use own template; be independent of records widget X-Git-Tag: 1.0.0~646^2~5 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=17ac8f1707ae8b1dd20c78c7b0935822e4fc60f1;p=mkws-moved-to-github.git RU widget: use own template; be independent of records widget --- diff --git a/examples/htdocs/mkws-widget-ru.css b/examples/htdocs/mkws-widget-ru.css index fa406fb..0d5c684 100644 --- a/examples/htdocs/mkws-widget-ru.css +++ b/examples/htdocs/mkws-widget-ru.css @@ -17,11 +17,17 @@ h2 { padding-bottom: .5em; } -.record, .mkwsSummary { +ul { + margin: 0; + padding: 0; +} + +li { margin: .95em .25em; padding-top: .75em; border-top: 1px dotted #BEC8CC; font-size: 90%; + list-style: none; } a { diff --git a/examples/htdocs/mkws-widget-ru.html b/examples/htdocs/mkws-widget-ru.html index 64ef386..a457db5 100644 --- a/examples/htdocs/mkws-widget-ru.html +++ b/examples/htdocs/mkws-widget-ru.html @@ -1,6 +1,7 @@
- + +
diff --git a/examples/htdocs/mkws-widget-ru.js b/examples/htdocs/mkws-widget-ru.js index 0fb6c67..5185d05 100644 --- a/examples/htdocs/mkws-widget-ru.js +++ b/examples/htdocs/mkws-widget-ru.js @@ -1,23 +1,33 @@ var mkws_config = {service_proxy_auth: "http://mkws.indexdata.com/service-proxy/?command=auth&action=login&username=paratext&password=paratext_mkc"}; -console.log(JSON.stringify(mkws.config)); mkws.registerWidgetType('ReferenceUniverse', function() { if (!this.config.perpage) this.config.perpage = 5; if (!this.config.sort) this.config.sort = "position"; - this.config.template = 'ReferenceUniverse'; this.team.registerTemplate('ReferenceUniverse', '\ -{{#mkws-first md-electronic-url}}\ -\ -{{/mkws-first}}\ - {{md-title}}\ -\ -{{#if md-title-remainder}}\ - {{md-title-remainder}}\ -{{/if}}\ -{{#if md-title-responsibility}}\ - {{md-title-responsibility}}\ -{{/if}}\ +

Results from Reference Universe

\ +\ '); - this.node.html("

Reference Universe results:

\n" + - this.subwidget('Records')); + + var that = this; + var template = that.team.loadTemplate(that.config.template || "ReferenceUniverse"); + this.team.queue("records").subscribe(function(data) { + that.node.html(template(data)); + }); + widget.autosearch(that); });