X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-core.js;h=668b44a6b26478508269f642565e25e0e249c657;hb=5d823f96587dafbe34c2a53df0b1792c1282d95a;hp=e353e6cea7b43e2c3fd6b628dcd9ff0b96dce480;hpb=867531e90782b1af6324d9b36449c0e33a2ccced;p=mkws-moved-to-github.git diff --git a/src/mkws-core.js b/src/mkws-core.js index e353e6c..668b44a 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -11,9 +11,12 @@ // var mkws = { authenticated: false, + authName: undefined, 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 +106,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'); @@ -163,7 +176,8 @@ if (mkws_config == null || typeof mkws_config != 'object') { // The following functions are dispatchers for team methods that // are called from the UI using a team-name rather than implicit - // context. + // context. Apart from mkws.log, they are the ONLY public UI to + // this module. mkws.switchView = function(tname, view) { mkws.teams[tname].switchView(view); } @@ -281,6 +295,7 @@ if (mkws_config == null || typeof mkws_config != 'object') { log("Service proxy auth successfully done"); mkws.authenticated = true; + mkws.authName = $(data).find("displayName").text(); runAutoSearches(); }); }