2019-12-08 22:43:49 +01:00
|
|
|
var Link = {
|
|
|
|
// Helper for taking server-rendered links with a component that we want
|
|
|
|
// to change client-side, and updating them based on parameters.
|
|
|
|
|
|
|
|
get: function(name, param, anchor) {
|
|
|
|
var uri = window.uris[name];
|
|
|
|
if (!param || !uri) {
|
2022-10-08 03:32:59 +02:00
|
|
|
if (!anchor) {
|
|
|
|
return uri;
|
|
|
|
} else {
|
|
|
|
return uri + '#' + anchor.toString();
|
|
|
|
}
|
2019-12-08 22:43:49 +01:00
|
|
|
} else if (!anchor) {
|
|
|
|
return uri.replace("/-1", "/" + param.toString());
|
|
|
|
} else {
|
|
|
|
return uri.replace("/-1", "/" + param.toString()) + '#' + anchor.toString();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|