projects
/
mkws-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a couple of escaped selectors to use findnode()
[mkws-moved-to-github.git]
/
tools
/
htdocs
/
mkws.js
diff --git
a/tools/htdocs/mkws.js
b/tools/htdocs/mkws.js
index
710e47f
..
a1f6f70
100644
(file)
--- a/
tools/htdocs/mkws.js
+++ b/
tools/htdocs/mkws.js
@@
-275,9
+275,17
@@
function team($, teamName) {
// Finds the node of the specified class within the current team
// Finds the node of the specified class within the current team
+ // Multiple OR-clauses separated by commas are handled
+ // More complex cases may not work
+ //
function findnode(selector, teamName) {
teamName = teamName || m_teamName;
function findnode(selector, teamName) {
teamName = teamName || m_teamName;
- return $(selector + '.mkwsTeam_' + teamName);
+
+ selector = selector.split(',').map(function(s) {
+ return s + '.mkwsTeam_' + teamName;
+ }).join(',');
+
+ return $(selector);
}
}
@@
-752,8
+760,7
@@
function team($, teamName) {
// switching view between targets and records
that.switchView = function(view) {
var targets = findnode('.mkwsTargets');
// switching view between targets and records
that.switchView = function(view) {
var targets = findnode('.mkwsTargets');
- // ### Fix next line to use findnode()
- var results = $('.mkwsResults.mkwsTeam_' + m_teamName + ',.mkwsRecords.mkwsTeam_' + m_teamName);
+ var results = findnode('.mkwsResults,.mkwsRecords');
var blanket = findnode('.mkwsBlanket');
var motd = findnode('.mkwsMOTD');
var blanket = findnode('.mkwsBlanket');
var motd = findnode('.mkwsMOTD');
@@
-950,8
+957,8
@@
function team($, teamName) {
// .mkwsPager
// .mkwsNavi
// .mkwsRecords
// .mkwsPager
// .mkwsNavi
// .mkwsRecords
- if ($(".mkwsResults.mkwsTeam_" + m_teamName).length) {
- $(".mkwsResults.mkwsTeam_" + m_teamName).html('\
+ if (findnode(".mkwsResults").length) {
+ findnode(".mkwsResults").html('\
<table width="100%" border="0" cellpadding="6" cellspacing="0">\
<tr>\
<td class="mkwsTermlistContainer1 mkwsTeam_' + m_teamName + '" width="250" valign="top">\
<table width="100%" border="0" cellpadding="6" cellspacing="0">\
<tr>\
<td class="mkwsTermlistContainer1 mkwsTeam_' + m_teamName + '" width="250" valign="top">\