Upload 2 new, 10 modified files from chat-switchboard-v0.7.4.zip
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.svg">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32.png">
|
||||
<link rel="apple-touch-icon" sizes="192x192" href="favicon-192.png">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<meta name="theme-color" content="#0e0e10">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<link rel="stylesheet" href="css/styles.css?v=%%APP_VERSION%%">
|
||||
<link rel="stylesheet" href="branding/custom.css" onerror="this.remove()">
|
||||
</head>
|
||||
@@ -56,6 +60,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sidebar-search" id="sidebarSearch">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
|
||||
<input type="text" id="chatSearchInput" placeholder="Search chats…" autocomplete="off">
|
||||
<button class="sidebar-search-clear" id="chatSearchClear" title="Clear">✕</button>
|
||||
</div>
|
||||
<div class="sidebar-chats" id="chatHistory"></div>
|
||||
|
||||
<!-- Notes shortcut -->
|
||||
@@ -546,6 +555,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Command Palette (Ctrl+K) -->
|
||||
<div class="cmd-palette-overlay" id="cmdPalette">
|
||||
<div class="cmd-palette">
|
||||
<div class="cmd-input-wrap">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
|
||||
<input type="text" id="cmdInput" placeholder="Type a command…" autocomplete="off" spellcheck="false">
|
||||
<kbd class="cmd-kbd">esc</kbd>
|
||||
</div>
|
||||
<div class="cmd-results" id="cmdResults"></div>
|
||||
<div class="cmd-footer">
|
||||
<span><kbd>↑↓</kbd> navigate</span>
|
||||
<span><kbd>↵</kbd> run</span>
|
||||
<span><kbd>esc</kbd> close</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="toast-container" id="toastContainer"></div>
|
||||
|
||||
<!-- Vendor libs -->
|
||||
@@ -557,5 +583,51 @@
|
||||
<script src="js/api.js?v=%%APP_VERSION%%"></script>
|
||||
<script src="js/ui.js?v=%%APP_VERSION%%"></script>
|
||||
<script src="js/app.js?v=%%APP_VERSION%%"></script>
|
||||
<script>
|
||||
// ── Service Worker Registration ─────────
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('sw.js').then(reg => {
|
||||
console.log('SW registered, scope:', reg.scope);
|
||||
// Check for updates periodically
|
||||
setInterval(() => reg.update(), 60 * 60 * 1000);
|
||||
}).catch(err => console.warn('SW registration failed:', err));
|
||||
});
|
||||
}
|
||||
|
||||
// ── PWA Install Prompt ──────────────────
|
||||
let _deferredInstallPrompt = null;
|
||||
window.addEventListener('beforeinstallprompt', (e) => {
|
||||
e.preventDefault();
|
||||
_deferredInstallPrompt = e;
|
||||
_showInstallBanner();
|
||||
});
|
||||
|
||||
function _showInstallBanner() {
|
||||
if (document.getElementById('pwaInstallBanner')) return;
|
||||
const banner = document.createElement('div');
|
||||
banner.id = 'pwaInstallBanner';
|
||||
banner.className = 'pwa-install-banner';
|
||||
banner.innerHTML =
|
||||
'<span>Install Chat Switchboard for a better experience</span>' +
|
||||
'<button class="btn-small btn-primary" onclick="_installPWA()">Install</button>' +
|
||||
'<button class="btn-small" onclick="this.parentElement.remove()">Dismiss</button>';
|
||||
document.body.appendChild(banner);
|
||||
}
|
||||
|
||||
function _installPWA() {
|
||||
if (!_deferredInstallPrompt) return;
|
||||
_deferredInstallPrompt.prompt();
|
||||
_deferredInstallPrompt.userChoice.then(() => {
|
||||
_deferredInstallPrompt = null;
|
||||
document.getElementById('pwaInstallBanner')?.remove();
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener('appinstalled', () => {
|
||||
document.getElementById('pwaInstallBanner')?.remove();
|
||||
_deferredInstallPrompt = null;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user