2024-12-05 00:07:04 -08:00
|
|
|
<!doctype html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<style>
|
|
|
|
|
:not(:defined) {
|
|
|
|
|
visibility: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
body {
|
|
|
|
|
font: 12px var(--sl-font-mono);
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-05 17:26:00 -08:00
|
|
|
a {
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
color: var(--sl-color-primary-700);
|
2024-12-05 17:39:57 -08:00
|
|
|
text-wrap: nowrap;
|
2024-12-05 00:07:04 -08:00
|
|
|
}
|
|
|
|
|
|
2024-12-05 17:26:00 -08:00
|
|
|
sl-tree-item {
|
2024-12-05 00:07:04 -08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
2024-12-05 00:22:08 -08:00
|
|
|
|
2024-12-05 17:26:00 -08:00
|
|
|
.short, .long {
|
2024-12-05 00:22:08 -08:00
|
|
|
margin-left: 7px;
|
|
|
|
|
}
|
2024-12-05 00:07:04 -08:00
|
|
|
</style>
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
<link rel="icon" type="image/png" href="_favicon.png" />
|
|
|
|
|
<link rel="apple-touch-icon" href="_favicon.png" />
|
|
|
|
|
<link
|
|
|
|
|
rel="stylesheet"
|
|
|
|
|
media="(prefers-color-scheme:light)"
|
|
|
|
|
href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.18.0/cdn/themes/light.css"
|
|
|
|
|
/>
|
|
|
|
|
<link
|
|
|
|
|
rel="stylesheet"
|
|
|
|
|
media="(prefers-color-scheme:dark)"
|
|
|
|
|
href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.18.0/cdn/themes/dark.css"
|
|
|
|
|
onload="document.documentElement.classList.add('sl-theme-dark');"
|
|
|
|
|
/>
|
|
|
|
|
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.18.0/cdn/shoelace-autoloader.js"></script>
|
|
|
|
|
<script>
|
2024-12-05 17:26:00 -08:00
|
|
|
document.addEventListener('DOMContentLoaded', async () => {
|
|
|
|
|
await Promise.allSettled([
|
|
|
|
|
customElements.whenDefined('sl-tree'),
|
|
|
|
|
customElements.whenDefined('sl-tree-item'),
|
|
|
|
|
customElements.whenDefined('sl-copy-button'),
|
|
|
|
|
customElements.whenDefined('sl-tooltip'),
|
|
|
|
|
customElements.whenDefined('sl-icon')
|
|
|
|
|
]);
|
2024-12-05 00:07:04 -08:00
|
|
|
|
2024-12-05 17:26:00 -08:00
|
|
|
document.getElementById('search').addEventListener('sl-input', () => {
|
|
|
|
|
const search = document.getElementById('search').value.toLowerCase();
|
|
|
|
|
const rows = document.getElementById('links').children;
|
2024-12-05 00:07:04 -08:00
|
|
|
|
|
|
|
|
for (const row of rows) {
|
2024-12-05 17:26:00 -08:00
|
|
|
const query = row.getAttribute('data-query');
|
2024-12-05 00:07:04 -08:00
|
|
|
|
2024-12-05 17:26:00 -08:00
|
|
|
if (search == undefined || search == '' || query.includes(search)) {
|
2024-12-05 00:07:04 -08:00
|
|
|
row.style.visibility = 'visible';
|
|
|
|
|
} else {
|
|
|
|
|
row.style.visibility = 'collapse';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div id="container" style="width: min(500px, calc(100vw - 10px))">
|
|
|
|
|
<sl-input id="search"></sl-input>
|
|
|
|
|
<br />
|
|
|
|
|
<br />
|
|
|
|
|
|
2024-12-05 17:26:00 -08:00
|
|
|
<sl-tree id="links">
|
|
|
|
|
{{ range .links }}
|
|
|
|
|
<sl-tree-item data-query="{{ .Short | lower }}|{{ .Long | lower }}">
|
|
|
|
|
|
|
|
|
|
<sl-copy-button value="{{ .URL }}" style="color: var(--sl-color-neutral-400);"></sl-copy-button>
|
|
|
|
|
<sl-tooltip content="Edit">
|
|
|
|
|
<a href="./?short={{ .Short }}">
|
|
|
|
|
<sl-icon name="pencil" label="Edit" style="color: var(--sl-color-neutral-400);"></sl-icon>
|
|
|
|
|
</a>
|
|
|
|
|
</sl-tooltip>
|
|
|
|
|
<a href="{{ .URL }}" class="short">{{ .Short }}</a>
|
|
|
|
|
|
|
|
|
|
<sl-tree-item>
|
|
|
|
|
<sl-copy-button value="{{ .Long }}" style="color: var(--sl-color-neutral-400);"></sl-copy-button>
|
|
|
|
|
<sl-tooltip content="Add">
|
|
|
|
|
<a href="./?long={{ .Long }}">
|
|
|
|
|
<sl-icon name="plus-circle" label="Add" style="color: var(--sl-color-neutral-400);"></sl-icon>
|
|
|
|
|
</a>
|
|
|
|
|
</sl-tooltip>
|
|
|
|
|
<a href="{{ .Long }}" class="long">{{ .Long }}</a>
|
|
|
|
|
</sl-tree-item>
|
|
|
|
|
|
|
|
|
|
{{ range .History }}
|
|
|
|
|
<sl-tree-item>
|
|
|
|
|
<sl-copy-button value="{{ .Long }}" style="color: var(--sl-color-neutral-400);"></sl-copy-button>
|
|
|
|
|
<sl-tooltip content="Restore">
|
|
|
|
|
<a href="./?short={{ .Short }}&long={{ .Long }}">
|
|
|
|
|
<sl-icon name="arrow-counterclockwise" label="Restore" style="color: var(--sl-color-neutral-400);"></sl-icon>
|
|
|
|
|
</a>
|
|
|
|
|
</sl-tooltip>
|
|
|
|
|
<a href="{{ .Long }}" class="long">{{ .Long }}</a>
|
|
|
|
|
</sl-tree-item>
|
2024-12-05 00:07:04 -08:00
|
|
|
{{ end }}
|
2024-12-05 17:26:00 -08:00
|
|
|
|
|
|
|
|
</sl-tree-item>
|
|
|
|
|
{{ end }}
|
|
|
|
|
</sl-tree>
|
2024-12-05 00:07:04 -08:00
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|