configurable credit for reference widget, MKWS-344
authorWolfram Schneider <wosch@indexdata.dk>
Thu, 11 Dec 2014 17:52:43 +0000 (17:52 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Thu, 11 Dec 2014 17:54:23 +0000 (17:54 +0000)
e.g.:

<div class="mkws-reference" autosearch="sushi" credit="credo api">Loading..</div>

src/mkws-widget-reference.js
src/templates/reference.handlebars

index 85c04b8..59da6e7 100644 (file)
@@ -4,4 +4,5 @@ mkws.registerWidgetType('reference', function() {
   if (!this.config.template) this.config.template = 'reference';
   this.config.template_vars.paragraphs = this.config.paragraphs || 0;
   this.config.template_vars.sentences = this.config.sentences || 0;
+  this.config.template_vars.credit = this.config.credit || "Wikipedia";
 });
index cedad80..831be44 100644 (file)
@@ -14,4 +14,4 @@ md-* - metadata fields passed through from backend
 <i>{{md-title-responsibility}}</i>
 {{/if}}
 {{{mkws-paragraphs md-description paragraphs sentences}}}
-<p class="mkws-credit mkwsCredit">Wikipedia</p>
+<p class="mkws-credit mkwsCredit">{{credit}}</p>