diff --git a/Cargo.lock b/Cargo.lock index 2b45326..ac99115 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2581,7 +2581,7 @@ dependencies = [ [[package]] name = "rustpad" -version = "0.0.32" +version = "0.0.33" dependencies = [ "argon2", "aws-config", diff --git a/Cargo.toml b/Cargo.toml index 1cf794b..3142d4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustpad" -version = "0.0.32" +version = "0.0.33" edition = "2024" rust-version = "1.94" description = "Collaborative Markdown notepad built with Axum, WebSockets and SQLite, PostgreSQL and MySQL" diff --git a/static/css/styles.css b/static/css/styles.css index 55e0068..082fb92 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -4144,3 +4144,71 @@ dialog::backdrop { .public-content :is(h1, h2, h3, h4, h5, h6)[id] { scroll-margin-top: 88px; } + +/* Shared semantic action buttons. Keep legacy class names as aliases. */ +.action-button, +.primary-button, +.secondary-button, +.danger-button { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + min-height: 42px; + padding: 0 16px; + border: 1px solid var(--border); + border-radius: 9px; + font: inherit; + font-weight: 650; + line-height: 1; + text-decoration: none; + cursor: pointer; + transition: background-color .15s, border-color .15s, color .15s; +} + +.action-button--primary, +.primary-button { + border-color: #8372ef; + background: var(--accent); + color: white; +} + +.action-button--primary:hover, +.primary-button:hover { + background: var(--accent-hover); +} + +.action-button--secondary, +.secondary-button { + border-color: var(--border-strong); + background: var(--surface-2); + color: #d2d8e1; +} + +.action-button--secondary:hover, +.secondary-button:hover { + border-color: #4b5565; + background: var(--surface-3); +} + +.action-button--danger, +.danger-button { + border-color: #7f3340; + background: #6e2935; + color: white; +} + +.action-button--danger:hover, +.danger-button:hover { + background: #7c3040; +} + +.action-button.compact-button { + min-height: 36px; + padding: 7px 11px; +} + +.file-actions button, +.file-code button { + height: auto; +} diff --git a/static/js/home.js b/static/js/home.js index 7533130..cf72fef 100644 --- a/static/js/home.js +++ b/static/js/home.js @@ -110,7 +110,7 @@ async function loadResources() { const sharedLabel = !item.owned ? `Shared by ${escapeHtml(item.shared_by || "another user")}` : ""; const permissionLabel = item.permission === "rw" ? "Read and write" : "Read only"; row.classList.toggle("resource-row--shared", !Boolean(item.owned)); - row.innerHTML = `
No files uploaded.
'; if (open && !dialog.open) dialog.showModal(); } catch (error) { @@ -84,7 +83,6 @@ export function bindNoteFiles({ editor, endpoints, getAccessToken, canDelete, to const absolute = new URL(showButton.dataset.url, location.origin).href; let text = absolute; if (showButton.dataset.showFileCode === "markdown") text = showButton.dataset.mime?.startsWith("image/") ? `` : `[${showButton.dataset.name}](${absolute})`; - if (showButton.dataset.showFileCode === "html") text = showButton.dataset.mime?.startsWith("image/") ? `