X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=7ec9c2f3b700a0fecd77ef91687953d5b1a3789d;hb=9f066ca3996aaaa84fc41d1291edd112be939df5;hp=ad0c77ed4b8117448f0fe589a6dfe09071adf50b;hpb=fb9e3fb3b09926f4be249b0263b9ad3174830481;p=mkws-moved-to-github.git
diff --git a/src/mkws-team.js b/src/mkws-team.js
index ad0c77e..7ec9c2f 100644
--- a/src/mkws-team.js
+++ b/src/mkws-team.js
@@ -185,7 +185,7 @@ mkws.makeTeam = function($, teamName) {
}
m_paz = new pz2(params);
- log("ccreated main pz2 object");
+ log("created main pz2 object");
}
@@ -391,7 +391,7 @@ mkws.makeTeam = function($, teamName) {
if (teamName === 'AUTO') {
selector = (selector + '.mkws-team-' + teamName + ',' +
- selector + ':not([class^="mkwsTeam"],[class*=" mkwsTeam"],[class^="mkws-team-"],[class*=" mkws-team-"])');
+ selector + ':not([class^="mkws-team"],[class*=" mkws-team"])');
} else {
selector = selector + '.mkws-team-' + teamName;
}
@@ -408,26 +408,35 @@ mkws.makeTeam = function($, teamName) {
}
function renderDetails(data, marker) {
- var template = loadTemplate("Record");
+ var template = loadTemplate("details");
var details = template(data);
- return '
' + details + '
';
}
that.renderDetails = renderDetails;
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;
- var node = $(".mkws-template_" + name + " .mkws-team-" + that.name());
+ var node = $(".mkws-template-" + name + " .mkws-team-" + that.name());
if (node && node.length < 1) {
- node = $(".mkws-template_" + name);
+ node = $(".mkws-template-" + name);
}
if (node) source = node.html();
if (!source) source = m_templateText[name];
@@ -438,7 +447,7 @@ mkws.makeTeam = function($, teamName) {
}
//if (template === undefined) template = mkws_templatesbyteam[m_teamName][name];
if (template === undefined && Handlebars.templates) {
- template = Handlebars.templates[name];
+ template = Handlebars.templates["mkws-template-" + name];
}
if (template === undefined && mkws.defaultTemplates) {
template = mkws.defaultTemplates[name];
@@ -448,7 +457,7 @@ mkws.makeTeam = function($, teamName) {
return template;
}
else {
- mkws.log("No MKWS template for " + name);
+ log("No MKWS template for " + name);
return null;
}
}