smaller buttons
This commit is contained in:
parent
e0022951ce
commit
7ad159a77e
|
|
@ -55,6 +55,7 @@ function noteApp() {
|
|||
totalMatches: 0, // Total number of matches in the note
|
||||
isSaving: false,
|
||||
lastSaved: false,
|
||||
linkCopied: false,
|
||||
saveTimeout: null,
|
||||
|
||||
// Theme state
|
||||
|
|
@ -4016,10 +4017,7 @@ function noteApp() {
|
|||
|
||||
// Copy current note link to clipboard
|
||||
async copyNoteLink() {
|
||||
if (!this.currentNote) {
|
||||
alert('No note selected');
|
||||
return;
|
||||
}
|
||||
if (!this.currentNote) return;
|
||||
|
||||
// Build the full URL
|
||||
const pathWithoutExtension = this.currentNote.replace('.md', '');
|
||||
|
|
@ -4028,14 +4026,6 @@ function noteApp() {
|
|||
|
||||
try {
|
||||
await navigator.clipboard.writeText(url);
|
||||
|
||||
// Brief visual feedback (change button text temporarily)
|
||||
const btn = event.target.closest('button');
|
||||
const originalHTML = btn.innerHTML;
|
||||
btn.innerHTML = '<span class="hidden md:inline">✓ Copied!</span><span class="md:hidden">✓</span>';
|
||||
setTimeout(() => {
|
||||
btn.innerHTML = originalHTML;
|
||||
}, 1500);
|
||||
} catch (error) {
|
||||
// Fallback for older browsers
|
||||
const textArea = document.createElement('textarea');
|
||||
|
|
@ -4044,8 +4034,13 @@ function noteApp() {
|
|||
textArea.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(textArea);
|
||||
alert('Link copied to clipboard!');
|
||||
}
|
||||
|
||||
// Show brief "Copied!" feedback
|
||||
this.linkCopied = true;
|
||||
setTimeout(() => {
|
||||
this.linkCopied = false;
|
||||
}, 1500);
|
||||
},
|
||||
|
||||
// Homepage folder navigation methods
|
||||
|
|
|
|||
|
|
@ -1848,30 +1848,45 @@
|
|||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Export HTML Button -->
|
||||
<!-- Note Actions Toolbar -->
|
||||
<div
|
||||
x-show="currentNote"
|
||||
class="flex items-center rounded overflow-hidden"
|
||||
style="background-color: var(--bg-tertiary); border: 1px solid var(--border-primary);"
|
||||
>
|
||||
<button
|
||||
@click="exportToHTML()"
|
||||
class="px-2 md:px-3 py-1 md:py-1.5 text-xs md:text-sm rounded transition hover:opacity-80"
|
||||
style="background-color: var(--bg-tertiary); color: var(--text-secondary);"
|
||||
class="p-2 transition"
|
||||
style="color: var(--text-secondary);"
|
||||
title="Export as HTML"
|
||||
@mouseenter="$el.style.backgroundColor = 'var(--bg-secondary)'"
|
||||
@mouseleave="$el.style.backgroundColor = 'transparent'"
|
||||
>
|
||||
<span class="hidden md:inline">📄 Export HTML</span>
|
||||
<span class="md:hidden">📄</span>
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<!-- Copy Link Button -->
|
||||
<div style="width: 1px; height: 20px; background-color: var(--border-primary);"></div>
|
||||
<button
|
||||
@click="copyNoteLink()"
|
||||
x-show="currentNote"
|
||||
class="px-2 md:px-3 py-1 md:py-1.5 text-xs md:text-sm rounded transition hover:opacity-80"
|
||||
style="background-color: var(--bg-tertiary); color: var(--text-secondary);"
|
||||
title="Copy link to clipboard"
|
||||
class="p-2 transition hover:bg-opacity-80"
|
||||
:title="linkCopied ? 'Copied!' : 'Copy link to clipboard'"
|
||||
:style="'color: ' + (linkCopied ? 'var(--success, #22c55e)' : 'var(--text-secondary)') + ';'"
|
||||
@mouseenter="$el.style.backgroundColor = 'var(--bg-secondary)'"
|
||||
@mouseleave="$el.style.backgroundColor = 'transparent'"
|
||||
>
|
||||
<span class="hidden md:inline">🔗 Copy Link</span>
|
||||
<span class="md:hidden">🔗</span>
|
||||
<!-- Link icon (default) -->
|
||||
<svg x-show="!linkCopied" class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"></path>
|
||||
</svg>
|
||||
<!-- Checkmark icon (after copy) -->
|
||||
<svg x-show="linkCopied" x-cloak class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Editor/Preview/Graph -->
|
||||
<div class="flex-1 flex relative" style="min-height: 0;">
|
||||
|
|
|
|||
Loading…
Reference in New Issue