type = cname.replace(/^mkws/, '');
}
}
+
+ if (!teamName) teamName = "AUTO";
callback.call(node, teamName, type);
}
}
}
- // For all MKWS-classed nodes that don't have a team
- // specified, set the team to AUTO.
- $('[class^="mkws"],[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 an MKWS class, and determine their team from
// the mkwsTeam_* class. Make all team objects.
var then = $.now();
teamName = teamName || m_teamName;
selector = $.map(selector.split(','), function(s, i) {
- return s + '.mkwsTeam_' + teamName;
+ if (teamName === 'AUTO') {
+ return (s + '.mkwsTeam_' + teamName + ',' +
+ s + ':not([class^="mkwsTeam"],[class*=" mkwsTeam"])');
+ } else {
+ return s + '.mkwsTeam_' + teamName;
+ }
}).join(',');
var node = $(selector);