Commit bef29418 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸
Browse files

more functions for params

parent 4d81e793
...@@ -11,6 +11,23 @@ var STWkit = { ...@@ -11,6 +11,23 @@ var STWkit = {
if (params[i][0] == name) params.splice(i, 1);; if (params[i][0] == name) params.splice(i, 1);;
} }
}, },
hasParam: function(name, id, params) {
for (var i = 0; i < params.length; i++) {
if ((params[i][0] == name) && (params[i][1] == id)) return true;
}
return false;
},
replaceParam: function(name, newid, params) {
for (var i = 0; i < params.length; i++) {
if (params[i][0] == name) params[i][1] = newid;
}
},
getParamIndex: function(name, id, params) {
for (var i = 0; i < params.length; i++) {
if ((params[i][0] == name) && (params[i][1] == id)) return i;
}
return -1;
},
getSearchUrl: function(params) { getSearchUrl: function(params) {
var search = ""; var search = "";
if (params.length > 0) search += "?"; if (params.length > 0) search += "?";
...@@ -53,5 +70,4 @@ var STWkit = { ...@@ -53,5 +70,4 @@ var STWkit = {
} }
return urlParams; return urlParams;
} }
}; };
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment