This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
2022-12-23 18:06:42 +01:00
|
|
|
(function() {
|
|
|
|
function setup(id) {
|
|
|
|
var inputEl = document.getElementById(id);
|
|
|
|
var preEl = document.getElementById(id + "-url");
|
|
|
|
function onChange(ev) {
|
|
|
|
setTimeout(function() {
|
|
|
|
var value = encodeURIComponent(inputEl.value.replace(/^#/, ""));
|
|
|
|
preEl.innerText = value ?
|
2023-01-11 18:50:28 +01:00
|
|
|
"https://" + document.location.host + "/" + id + "/" + value :
|
2022-12-23 18:06:42 +01:00
|
|
|
"";
|
|
|
|
}, 10);
|
|
|
|
}
|
|
|
|
inputEl.addEventListener('change', onChange);
|
|
|
|
inputEl.addEventListener('keyup', onChange);
|
|
|
|
}
|
|
|
|
|
|
|
|
setup("tag");
|
|
|
|
setup("instance");
|
|
|
|
})()
|