Une nouvelle version du portail de gestion des comptes externes sera mise en production lundi 09 août. Elle permettra d'allonger la validité d'un compte externe jusqu'à 3 ans. Pour plus de détails sur cette version consulter : https://doc-si.inria.fr/x/FCeS

Commit e0d703db authored by marc duez's avatar marc duez
Browse files

url.js : parseUrlParams() must parse location first to find sample_set id and config_id

parent c93ec511
function Url(model, win) { function Url(model, win) {
View.call(this, model); View.call(this, model);
this.m = model; this.m = model;
this.window = (typeof win != "undefined") ? win : window this.window = (typeof win != "undefined") ? win : window;
this.encoder = new UrlEncoder(); this.encoder = new UrlEncoder();
this.url_dict = this.parseUrlParams(this.window.location.search.toString()) this.url_dict = this.parseUrlParams(this.window.location.search.toString());
this.sp = this.m.sp this.sp = this.m.sp;
this.m.start(this.url_dict); this.m.start(this.url_dict);
} }
...@@ -109,10 +109,19 @@ Url.prototype= { ...@@ -109,10 +109,19 @@ Url.prototype= {
}, },
parseUrlParams:function (urlparams) { parseUrlParams:function (urlparams) {
params={} params={};
var url = this.window.location;
var positionnal_params = url.pathname.substr(1).split('-');
var pos_param_keys = this.getPositionnalParams();
if (positionnal_params.length > 1 && positionnal_params[0] != "index.html")
for (var j = 0; j < positionnal_params.length; j++)
params[pos_param_keys[j]] = positionnal_params[j];
if (urlparams.length === 0) { if (urlparams.length === 0) {
return params; return params;
} }
url_param = urlparams.substr(1).split("&"); url_param = urlparams.substr(1).split("&");
for (var i = 0; i < url_param.length; i++) { for (var i = 0; i < url_param.length; i++) {
var tmparr = url_param[i].split("="); var tmparr = url_param[i].split("=");
...@@ -134,13 +143,7 @@ Url.prototype= { ...@@ -134,13 +143,7 @@ Url.prototype= {
} }
} }
var url = this.window.location; return params;
var positionnal_params = url.pathname.substr(1).split('-');
var pos_param_keys = this.getPositionnalParams();
if (positionnal_params.length > 1 && positionnal_params[0] != "index.html")
for (var j = 0; j < positionnal_params.length; j++)
params[pos_param_keys[j]] = positionnal_params[j];
return params
}, },
generateParamsString: function(params_dict) { generateParamsString: function(params_dict) {
......
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