From: Wolfram Schneider Date: Thu, 23 Oct 2014 15:03:30 +0000 (+0000) Subject: We need to map old wigets names in more fucntions, MKWS-316 X-Git-Tag: 1.0.0~123^2~1 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=f9d6d25a5fbc82c27e63ca020ee497eac62d7cc4;p=mkws-moved-to-github.git We need to map old wigets names in more fucntions, MKWS-316 --- diff --git a/src/mkws-core.js b/src/mkws-core.js index e72d70c..0ae5a99 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -132,6 +132,11 @@ mkws.getParameterByName = function(name, url) { mkws.registerWidgetType = function(name, fn) { + if(mkws._old2new.hasOwnProperty(name)) { + mkws.log("Warning: registerWidgetType old widget name: " + name + " => " + mkws._old2new[name]); + name = mkws._old2new[name]; + } + mkws.widgetType2function[name] = fn; mkws.log("registered widget-type '" + name + "'"); }; @@ -305,6 +310,8 @@ mkws.log("Using window.name '" + window.name + "'"); } } + mkws._old2new = _old2new; + function handleNodeWithTeam(node, callback) { // First branch for DOM objects; second branch for jQuery objects var classes = node.className || node.attr('class'); diff --git a/src/mkws-team.js b/src/mkws-team.js index 509fc2f..90b7391 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -417,11 +417,20 @@ mkws.makeTeam = function($, teamName) { that.registerTemplate = function(name, text) { + if(mkws._old2new.hasOwnProperty(name)) { + mkws.log("Warning: registerTemplate old widget name: " + name + " => " + mkws._old2new[name]); + name = mkws._old2new[name]; + } m_templateText[name] = text; }; function loadTemplate(name, fallbackString) { + if(mkws._old2new.hasOwnProperty(name)) { + mkws.log("Warning loadTemplate: old widget name: " + name + " => " + mkws._old2new[name]); + name = mkws._old2new[name]; + } + var template = m_template[name]; if (template === undefined && Handlebars.compile) { var source;