1
0
mirror of synced 2024-11-15 02:17:36 +01:00
bemaniutils/bemani/frontend/static/link.js
2019-12-08 21:43:49 +00:00

16 lines
511 B
JavaScript

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) {
return uri;
} else if (!anchor) {
return uri.replace("/-1", "/" + param.toString());
} else {
return uri.replace("/-1", "/" + param.toString()) + '#' + anchor.toString();
}
},
};