From: Mike Taylor Date: Fri, 16 May 2014 15:26:27 +0000 (+0100) Subject: Add new widget type, "Config", which allows configuration settings to X-Git-Tag: 1.0.0~659 X-Git-Url: http://jsfdemo.indexdata.com/?a=commitdiff_plain;h=5374406d1e6b911c4a92a826b20ec6282ec31012;p=mkws-moved-to-github.git Add new widget type, "Config", which allows configuration settings to be established for the team. For example:
Fixes bug MKWS-191. --- diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index 161f61f..9271602 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -405,6 +405,21 @@ mkws.registerWidgetType('MOTD', function() { }); +// This widget has no functionality of its own, but its configuration +// is copied up into its team, allowing it to affect other widgets in +// the team. +// +mkws.registerWidgetType('Config', function() { + var c = this.config; + for (var name in c) { + if (c.hasOwnProperty(name)) { + this.team.config()[name] = c[name]; + this.log(this + " copied property " + name + "='" + c[name] + "' up to team"); + } + } +}); + + // Some elements have mkws* classes that makes them appear as widgets // -- for example, because we want to style them using CSS -- but have // no actual functionality. We register these to prevent ignorable