From: Jason Skomorowski Date: Mon, 9 Jun 2014 19:26:54 +0000 (-0400) Subject: Merge branch 'master' into templateallthemarkup X-Git-Tag: 1.0.0~324^2~66 X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=commitdiff_plain;h=a13ee3189f8ea602aebf9c49827689c28f451dc3;hp=86229ffbb4ef43e4f028c1f59fa93dc5b2285770;p=mkws-moved-to-github.git Merge branch 'master' into templateallthemarkup --- diff --git a/examples/htdocs/mkws-widget-credo-bs.js b/examples/htdocs/mkws-widget-credo-bs.js index 7c143c1..49651ea 100644 --- a/examples/htdocs/mkws-widget-credo-bs.js +++ b/examples/htdocs/mkws-widget-credo-bs.js @@ -25,14 +25,14 @@ mkws.registerWidgetType('Credo', function() { var that = this; this.team.registerTemplate('CredoImage', '\ -
\ +
\ \ {{#mkws-first md-thumburl}}\ {{../md-title}}\ {{/mkws-first}}\
\
\ -

{{md-title}}

\ +

{{{md-title}}}

\
\ '); @@ -47,8 +47,6 @@ mkws.registerWidgetType('Credo', function() { s.push('
'); s.push('
'); - s.push(section('mindmap', 'Create a Mind Map for ', - this.subwidget('Mindmap', { _team: 'main', facet: 'subject' }))); s.push(section('topics', 'Related Topics', this.subwidget('Facet', { _team: 'main', facet: 'subject' }))); s.push('
'); @@ -56,21 +54,19 @@ mkws.registerWidgetType('Credo', function() { s.push(''); s.push('
'); - s.push(section('image col-md-12', 'Images', this.subwidget('GoogleImage', { maxrecs: 4, template: 'CredoImage' }))); + s.push(section('image col-md-12', 'Images', this.subwidget('GoogleImage', { maxrecs: 4, template: 'CredoImage', target: 'google_images_js' }))); s.push('
'); s.push('
'); - s.push(section('entries clearfix col-md-4 col-sm-6', 'Credo Entries', - this.subwidget('Records', { _team: 'main' }))); + s.push(section('entries clearfix col-md-4 col-sm-6', 'News', + this.subwidget('Records', { _team: 'news', targetfilter: 'categories=news', perpage: 10 }))); s.push(section('articles clearfix col-md-4 col-sm-6', 'Articles', - this.subwidget('Records', { _team: 'articles', targetfilter: 'categories=articles' }))); + this.subwidget('Records', { _team: 'articles', targetfilter: 'categories=articles', perpage: 10 }))); s.push(section('books clearfix col-md-4 col-sm-6', 'Books', - this.subwidget('Records', { _team: 'books', targetfilter: 'categories=books' }))); - s.push(section('news col-md-4 col-sm-6', 'News', - this.subwidget('Records', { _team: 'news', targetfilter: 'categories=news' }))); - s.push(section('resources col-md-4 col-sm-6', 'Suggested Resources', - "### Not yet implemented")); + this.subwidget('Records', { _team: 'books', targetfilter: 'categories=books', perpage: 10 }))); + s.push(section('news col-md-4 col-sm-6', 'Results from all targets', + this.subwidget('Records', { _team: 'main' }))); s.push('
'); this.node.html(s.join('')); @@ -111,8 +107,3 @@ mkws.registerWidgetType('Credo', function() { return s.join(''); } }); - - -mkws.registerWidgetType('Mindmap', function() { - this.node.html("### We do not yet have a Mindmap widget"); -}); diff --git a/examples/htdocs/mkws-widget-credo.js b/examples/htdocs/mkws-widget-credo.js index 59a9a13..052aaec 100644 --- a/examples/htdocs/mkws-widget-credo.js +++ b/examples/htdocs/mkws-widget-credo.js @@ -32,7 +32,7 @@ mkws.registerWidgetType('Credo', function() { {{/mkws-first}}\
\ \ -

{{md-title}}

\ +

{{{md-title}}}

\ \ '); @@ -47,12 +47,10 @@ mkws.registerWidgetType('Credo', function() { this.subwidget('Reference', { _team: 'ref', paragraphs: 1 }))); // The Images widget needs to be in our team so we can set its template s.push(section('image', 'Images', - this.subwidget('GoogleImage', { maxrecs: 4, template: 'CredoImage' }))); + this.subwidget('GoogleImage', { maxrecs: 3, template: 'CredoImage', target: 'google_images_js' }))); s.push(''); s.push(''); - s.push(section('mindmap', 'Create a Mind Map for ', - this.subwidget('Mindmap', { _team: 'main', facet: 'subject' }))); s.push(section('topics', 'Related Topics', this.subwidget('Facet', { _team: 'main', facet: 'subject' }))); s.push(''); @@ -61,16 +59,14 @@ mkws.registerWidgetType('Credo', function() { s.push('
'); - s.push(sectionRow('entries', 'Credo Entries', - this.subwidget('Records', { _team: 'main' }))); + s.push(sectionRow('entries', 'News', + this.subwidget('Records', { _team: 'news', targetfilter: 'categories=news', perpage: 10 }))); s.push(sectionRow('articles', 'Articles', - this.subwidget('Records', { _team: 'articles', targetfilter: 'categories=articles' }))); + this.subwidget('Records', { _team: 'articles', targetfilter: 'categories=articles', perpage: 10 }))); s.push(sectionRow('books', 'Books', - this.subwidget('Records', { _team: 'books', targetfilter: 'categories=books' }))); - s.push(sectionRow('news', 'News', - this.subwidget('Records', { _team: 'news', targetfilter: 'categories=news' }))); - s.push(sectionRow('resources', 'Suggested Resources', - "### Not yet implemented")); + this.subwidget('Records', { _team: 'books', targetfilter: 'categories=books', perpage: 10 }))); + s.push(sectionRow('news', 'Results from all targets', + this.subwidget('Records', { _team: 'main' }))); s.push(''); @@ -112,8 +108,3 @@ mkws.registerWidgetType('Credo', function() { return s.join(''); } }); - - -mkws.registerWidgetType('Mindmap', function() { - this.node.html("### We do not yet have a Mindmap widget"); -}); diff --git a/examples/htdocs/ref-bootstrap.html b/examples/htdocs/ref-bootstrap.html index 91430f0..503a8fe 100644 --- a/examples/htdocs/ref-bootstrap.html +++ b/examples/htdocs/ref-bootstrap.html @@ -33,8 +33,16 @@ + - + diff --git a/src/mkws-widget.js b/src/mkws-widget.js index e7ab19f..39513d9 100644 --- a/src/mkws-widget.js +++ b/src/mkws-widget.js @@ -43,8 +43,8 @@ function widget($, team, type, node) { } for (var name in overrides) { + log(this + " overrode property " + name + "='" + overrides[name] + "' (was '" + attrs[name] + "') for " + type + " subwidget"); attrs[name] = overrides[name]; - log(this + " overrode property " + name + "='" + attrs[name] + "' for " + type + " subwidget"); } if (defaults) {