X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget.js;h=5476796fd37d5d027ab7cff6243a71cee7eaeeb0;hb=e45b7cd66b1f1fb573bc734584b6dc8348e67024;hp=9a3a7f76c458694c50a6a7c31d71795284060d2f;hpb=1d463ff7b1cf5930087bb848b7175f4f89e04047;p=mkws-moved-to-github.git diff --git a/src/mkws-widget.js b/src/mkws-widget.js index 9a3a7f7..5476796 100644 --- a/src/mkws-widget.js +++ b/src/mkws-widget.js @@ -1,5 +1,5 @@ // Factory function for widget objects. -function widget($, team, type, node) { +mkws.makeWidget = function($, team, type, node) { // Static register of attributes that do not contribute to config var ignoreAttrs = { id:1, 'class':1, style:1, name:1, action:1, type:1, size:1, @@ -66,8 +66,7 @@ function widget($, team, type, node) { return s.join(''); }; - // ### why is this a member function? It's never called from outside this file. - that.expandValue = function(val) { + function expandValue(val) { if (val.match(/^!param!/)) { var param = val.replace(/^!param!/, ''); val = mkws.getParameterByName(param); @@ -153,7 +152,7 @@ function widget($, team, type, node) { for (var i = 0; i < node.attributes.length; i++) { var a = node.attributes[i]; - var val = that.expandValue(a.value); + var val = expandValue(a.value); if (a.name === 'data-mkws-config') { // Treat as a JSON fragment configuring just this widget log(node + ": parsing config fragment '" + val + "'");