diff --git a/src/app.js b/src/app.js
deleted file mode 100644
index 3d5a874..0000000
--- a/src/app.js
+++ /dev/null
@@ -1,150 +0,0 @@
-// Global variables
-let archiveData = [];
-let sortedData = [];
-let currentSort = { column: 'created_at', order: 'desc' };
-const rowsPerPage = 100;
-let currentPage = 1;
-
-// Event Listeners
-document.addEventListener('DOMContentLoaded', function() {
- document.getElementById('fileInput').addEventListener('change', handleFileLoad);
-
- // Add click listeners to sortable headers
- document.querySelectorAll('#dataTable th[data-sort]').forEach(th => {
- th.addEventListener('click', () => {
- sortTable(th.dataset.sort);
- });
- });
-});
-
-// File handling
-function handleFileLoad(event) {
- const file = event.target.files[0];
- if (!file) return;
-
- const reader = new FileReader();
- reader.onload = (e) => {
- try {
- const data = JSON.parse(e.target.result);
- if (!Array.isArray(data)) throw new Error('Invalid archive format: Expected an array.');
- archiveData = data;
- sortedData = [...archiveData];
- updateStats();
- sortTable(currentSort.column); // Initial sort
- } catch (err) {
- alert(`Failed to load archive: ${err.message}`);
- }
- };
- reader.readAsText(file);
-}
-
-// Statistics
-function updateStats() {
- const statsDiv = document.getElementById('stats');
- const kindCounts = archiveData.reduce((acc, event) => {
- acc[event.kind] = (acc[event.kind] || 0) + 1;
- return acc;
- }, {});
-
- const totalEvents = archiveData.length;
- let statsText = `Total Events: ${totalEvents}
`;
- statsText += 'Most Common Types: ';
-
- const topKinds = Object.entries(kindCounts)
- .sort(([,a], [,b]) => b - a)
- .slice(0, 3)
- .map(([kind, count]) => `${getKindLabel(parseInt(kind))}: ${count}`);
-
- statsText += topKinds.join(' | ');
-
- statsDiv.innerHTML = statsText;
-}
-
-// Table rendering
-function renderTable() {
- const tbody = document.querySelector('#dataTable tbody');
- tbody.innerHTML = '';
-
- const start = (currentPage - 1) * rowsPerPage;
- const end = start + rowsPerPage;
- const pageData = sortedData.slice(start, end);
-
- if (pageData.length === 0) {
- tbody.innerHTML = `
A Nostr Archive Creation, Browser, and Broadcaster Tool
- Collector - View Archive - GitHub Repository + + + + + +Choose an option above to get started!
+Select a JSON archive file to broadcast its events to relays.
+ + +# | +Time | +Kind | +Content | +Actions | +
---|