From: Mike Taylor Date: Fri, 1 May 2015 19:57:48 +0000 (+0100) Subject: Expand mkws-core parse_fragment() function to parse apart the X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=dc17008e8d8fc2a78d53ef9f955c9185352282a4;p=mkws-moved-to-github.git Expand mkws-core parse_fragment() function to parse apart the individual teams' sets of parameters. --- diff --git a/src/mkws-core.js b/src/mkws-core.js index deb78d0..66d95fd 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -696,8 +696,20 @@ mkws.info("Using window.name '" + window.name + "'"); d = function (s) { return decodeURIComponent(s.replace(a, " ")); }, q = s.substring(1); - while (e = r.exec(q)) - hashParams[d(e[1])] = d(e[2]); + while (e = r.exec(q)) { + var key = d(e[1]); + if (key === 'mkws') { + key = 'AUTO'; + } else { + key = key.replace('mkws', ''); + } + var team = mkws.teams[key]; + if (team) { + hashParams[key] = team.parseFragment(d(e[2])); + } else { + alert("can't resolve team name '" + key + "'"); + } + } return hashParams; }