feat: add Obsidian open button; fix folder button using dolphin --select
This commit is contained in:
+5
-1
@@ -8,6 +8,7 @@ const logoutBtn = document.getElementById('logout-btn');
|
||||
const modal = document.getElementById('modal');
|
||||
const modalTitle = document.getElementById('modal-title');
|
||||
const modalBody = document.getElementById('modal-body');
|
||||
const modalObsidianBtn = document.getElementById('modal-obsidian-btn');
|
||||
const modalFolderBtn = document.getElementById('modal-folder-btn');
|
||||
const modalOpenBtn = document.getElementById('modal-open-btn');
|
||||
const modalCloseBtn = document.getElementById('modal-close-btn');
|
||||
@@ -74,8 +75,11 @@ function closeModal() {
|
||||
modalCloseBtn.addEventListener('click', closeModal);
|
||||
modal.querySelector('.modal-backdrop').addEventListener('click', closeModal);
|
||||
document.addEventListener('keydown', e => { if (e.key === 'Escape') closeModal(); });
|
||||
modalObsidianBtn.addEventListener('click', () => {
|
||||
if (_modalPath) apiFetch('/open', { method: 'POST', body: JSON.stringify({ path: _modalPath, mode: 'obsidian' }) });
|
||||
});
|
||||
modalFolderBtn.addEventListener('click', () => {
|
||||
if (_modalPath) apiFetch('/open', { method: 'POST', body: JSON.stringify({ path: _modalPath, folder: true }) });
|
||||
if (_modalPath) apiFetch('/open', { method: 'POST', body: JSON.stringify({ path: _modalPath, mode: 'folder' }) });
|
||||
});
|
||||
modalOpenBtn.addEventListener('click', () => {
|
||||
if (_modalPath) apiFetch('/open', { method: 'POST', body: JSON.stringify({ path: _modalPath }) });
|
||||
|
||||
@@ -256,6 +256,11 @@
|
||||
<div class="modal-header">
|
||||
<span id="modal-title" class="modal-title"></span>
|
||||
<div class="modal-actions">
|
||||
<button id="modal-obsidian-btn" class="modal-btn" title="In Obsidian öffnen">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<button id="modal-folder-btn" class="modal-btn" title="Verzeichnis öffnen">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z"/>
|
||||
|
||||
Reference in New Issue
Block a user