X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=1de551488d57892072918db614b77ca87798798c;hb=e68bce23c27148f21675012108dc7a4ae16c8d26;hp=08b78627c545105991f49245f69e44db956acae1;hpb=6ad264891941d02dda2b751680806750940cfe72;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 08b7862..1de5514 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -988,9 +988,9 @@ function team($, teamName) { debug("HTML switch for team " + m_teamName); var node = $(".mkwsSwitch.mkwsTeam_" + m_teamName); - node.append($('' + M('Records') + '')); + node.append($('' + M('Records') + '')); node.append($("", { text: " | " })); - node.append($('' + M('Targets') + '')); + node.append($('' + M('Targets') + '')); debug("HTML targets"); var node = $(".mkwsTargets.mkwsTeam_" + m_teamName); @@ -1311,11 +1311,20 @@ function _mkws_jquery_plugin ($) { var id = 'mkws' + ids[i]; var node = $('#' + id); if (node.attr('id')) { - node.addClass(id + " mkwsTeam_AUTO"); - log("added magic classes to '" + node.attr('id') + "'"); + node.addClass(id); + log("added magic class to '" + node.attr('id') + "'"); } } + // For all MKWS-classed nodes that don't have a team + // specified, set the team to AUTO. + $('div[class^="mkws"],div[class*=" mkws"]').each(function () { + if (!this.className.match(/mkwsTeam_/)) { + log("adding AUTO team to node with class '" + this.className + "'"); + $(this).addClass('mkwsTeam_AUTO'); + } + }); + // Find all nodes with class (NOT id) mkwsRecords, and // determine their team from the mkwsTeam_* class. So: //
@@ -1352,8 +1361,6 @@ function _mkws_jquery_plugin ($) { tname = cname.replace(/^mkwsTeam_/, ''); } } - if (!tname) - tname = "AUTO"; callback(tname); }