Skip to content

Commit 6f0db81

Browse files
committed
Version pop-up
1 parent 1752e30 commit 6f0db81

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import "./styles.css";
22
import "../node_modules/tabulator-tables/dist/css/tabulator_bootstrap5.min.css";
3+
import statusData from "../public/status.json"
34

45
import {
56
CellComponent,
@@ -408,7 +409,7 @@ async function main() {
408409
placeholder: "No matches",
409410
responsiveLayout: "hide",
410411
footerElement: `<span class="w-100 mx-2 my-1">
411-
<img src="/favicon.svg" class="pe-2 mb-1" style="height:1.5em;" alt="EmojiSearch logo"/><span style="font-size: 1.2em;font-family: 'Emilys Candy'">EmojiSearch</span>
412+
<img id="favicon" src="/favicon.svg" class="pe-2 mb-1" style="height:1.5em;" alt="EmojiSearch logo"/><span style="font-size: 1.2em;font-family: 'Emilys Candy'">EmojiSearch</span>
412413
<span id="rowcount" class="px-3">Rows: ${data.length.toLocaleString()}</span>
413414
<a class="d-none d-lg-block float-end" href="https://github.com/FileFormatInfo/emojisearch">Source</a>
414415
</span>`,
@@ -438,6 +439,13 @@ async function main() {
438439
window.history.replaceState(null, "", "?" + qs);
439440
});
440441

442+
table.on("tableBuilt", function () {
443+
document.getElementById("favicon")!.onclick = () => {
444+
table.alert(`Last modified ${statusData.lastmod} (${statusData.commit})`);
445+
setTimeout(() => table.clearAlert(), 2500);
446+
}
447+
});
448+
441449
document.getElementById("loading")!.style.display = "none";
442450
document.getElementById("emojitable")!.style.display = "block";
443451
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"target": "ES6",
44
"module": "ESNext",
55
"moduleResolution": "node",
6+
"resolveJsonModule": true,
67
"strict": true,
78
"esModuleInterop": true,
89
"skipLibCheck": true,
910
"outDir": "./dist"
1011
},
1112
"include": ["src"]
12-
}
13+
}

0 commit comments

Comments
 (0)