}
- // This function is taken from a StackOverflow answer
- // http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript/901144#901144
- mkws.getParameterByName = function(name) {
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
- var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
- results = regex.exec(location.search);
- return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
- }
-
-
mkws.defaultTemplate = function(name)
{
if (name === 'Record') {
function mkwsSetLang() {
- var lang = mkws.getParameterByName("lang") || mkws_config.lang;
+ var lang = getParameterByName("lang") || mkws_config.lang;
if (!lang || !mkws.locale_lang[lang]) {
mkws_config.lang = ""
} else {
if (query.match(/^!param!/)) {
var param = query.replace(/^!param!/, '');
- query = mkws.getParameterByName(param);
+ query = getParameterByName(param);
log("obtained query '" + query + "' from param '" + param + "'");
if (!query) {
alert("This page has a MasterKey widget that needs a query specified by the '" + param + "' parameter");
}
+ // This function is taken from a StackOverflow answer
+ // http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript/901144#901144
+ function getParameterByName(name) {
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
+ results = regex.exec(location.search);
+ return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
+ }
+
+
// Translation function. At present, this is properly a
// global-level function (hence the assignment to mkws.M) but we
// want to make it per-team so different teams can operate in