From 9eea29aeca3e286e6a9754dd0f4a7afee56c8a8e Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 3 Mar 2014 17:22:28 +0000 Subject: [PATCH] Move related utility functions together. --- tools/htdocs/mkws.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index abee7d2..e7d36be 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -978,19 +978,6 @@ function team($, teamName) { } - // implement $.parseQuerystring() for parsing URL parameters - function parseQuerystring() { - var nvpair = {}; - var qs = window.location.search.replace('?', ''); - var pairs = qs.split('&'); - $.each(pairs, function(i, v){ - var pair = v.split('='); - nvpair[pair[0]] = pair[1]; - }); - return nvpair; - } - - function mkwsSetLang() { var lang = parseQuerystring().lang || mkws_config.lang; if (!lang || !mkws.locale_lang[lang]) { @@ -1142,6 +1129,19 @@ function team($, teamName) { } + // implement $.parseQuerystring() for parsing URL parameters + function parseQuerystring() { + var nvpair = {}; + var qs = window.location.search.replace('?', ''); + var pairs = qs.split('&'); + $.each(pairs, function(i, v){ + var pair = v.split('='); + nvpair[pair[0]] = pair[1]; + }); + return nvpair; + } + + // This function is taken from a StackOverflow answer // http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript/901144#901144 // ### should we unify this and parseQuerystring()? -- 1.7.10.4