From: Mike Taylor Date: Wed, 26 Mar 2014 14:51:59 +0000 (+0000) Subject: New API functions registerWidgetType and promotionFunction X-Git-Tag: 1.0.0~1187 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=428b73f9bb4591271adcb81062ae611231450091;p=mkws-moved-to-github.git New API functions registerWidgetType and promotionFunction --- diff --git a/src/mkws-core.js b/src/mkws-core.js index 61cccdc..7df143a 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -14,6 +14,8 @@ var mkws = { log_level: 1, // Will be overridden from mkws_config, but // initial value allows jQuery popup to use logging. teams: {}, + widgetType2function: {}, + locale_lang: { "de": { "Authors": "Autoren", @@ -103,6 +105,16 @@ if (mkws_config == null || typeof mkws_config != 'object') { mkws.log = log; + mkws.registerWidgetType = function(name, fn) { + mkws.widgetType2function[name] = fn; + log("registered widget-type '" + name + "'"); + } + + mkws.promotionFunction = function(name) { + return mkws.widgetType2function[name]; + } + + function handleNodeWithTeam(node, callback) { // First branch for DOM objects; second branch for jQuery objects var classes = node.className || node.attr('class');