Serve redirects

This commit is contained in:
Ian Gulliver
2024-11-26 22:07:05 -06:00
parent bac1cde9e5
commit 640e04f356
2 changed files with 35 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ sl-icon[name="type"] {
sl-icon[name="square"] {
color: var(--sl-color-warning-500);
cursor: pointer;
}
sl-icon[name="check-square"] {
@@ -123,7 +124,15 @@ function setShortItem(short, icon) {
tree.insertBefore(item, tree.firstChild);
}
document.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', async () => {
await Promise.all([
customElements.whenDefined('sl-input'),
customElements.whenDefined('sl-icon'),
customElements.whenDefined('sl-button'),
customElements.whenDefined('sl-alert'),
customElements.whenDefined('sl-tree'),
]);
document.getElementById('short').setAttribute('label', `${window.location.host}/`);
document.getElementById('short').addEventListener('sl-input', () => {
@@ -178,16 +187,13 @@ document.addEventListener('DOMContentLoaded', () => {
document.getElementById('long').focus();
setInputIcons();
});
// name="type"
// name="circle"
// name="check-circle"
</script>
</head>
<body>
<div id="container" style="width: min(500px, calc(100vw - 10px))">
<sl-input id="short">
<sl-input id="short" value="{{ .path }}">
<sl-icon id="short-icon" name="type" slot="suffix"></sl-icon>
</sl-input>
<br/>