From f9d6d25a5fbc82c27e63ca020ee497eac62d7cc4 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Thu, 23 Oct 2014 15:03:30 +0000 Subject: [PATCH] We need to map old wigets names in more fucntions, MKWS-316 --- src/mkws-core.js | 7 +++++++ src/mkws-team.js | 9 +++++++++ 2 files changed, 16 insertions(+) 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; -- 1.7.10.4