mirror of
https://gitlab.com/ArkHost/HelixNotes.git
synced 2026-07-24 07:45:57 +02:00
v1.2.9: mermaid diagrams, math editor, external viewer, manual notebook sort, heading hotkeys
This commit is contained in:
@@ -690,13 +690,17 @@
|
|||||||
function addToolbar(container: HTMLElement, source: string) {
|
function addToolbar(container: HTMLElement, source: string) {
|
||||||
const toolbar = document.createElement('div');
|
const toolbar = document.createElement('div');
|
||||||
toolbar.className = 'mermaid-render-toolbar';
|
toolbar.className = 'mermaid-render-toolbar';
|
||||||
|
const isAndroid = /android/i.test(navigator.userAgent);
|
||||||
|
|
||||||
|
if (!isAndroid) {
|
||||||
const copyBtn = document.createElement('button');
|
const copyBtn = document.createElement('button');
|
||||||
copyBtn.type = 'button';
|
copyBtn.type = 'button';
|
||||||
copyBtn.className = 'mermaid-render-action';
|
copyBtn.className = 'mermaid-render-action';
|
||||||
copyBtn.title = 'Copy as PNG';
|
copyBtn.title = 'Copy as PNG';
|
||||||
copyBtn.textContent = 'Copy';
|
copyBtn.textContent = 'Copy';
|
||||||
copyBtn.onclick = (e) => { e.preventDefault(); e.stopPropagation(); copyDiagram(container); };
|
copyBtn.onclick = (e) => { e.preventDefault(); e.stopPropagation(); copyDiagram(container); };
|
||||||
|
toolbar.appendChild(copyBtn);
|
||||||
|
}
|
||||||
|
|
||||||
const saveBtn = document.createElement('button');
|
const saveBtn = document.createElement('button');
|
||||||
saveBtn.type = 'button';
|
saveBtn.type = 'button';
|
||||||
@@ -717,7 +721,6 @@
|
|||||||
renderInto(container, source);
|
renderInto(container, source);
|
||||||
};
|
};
|
||||||
|
|
||||||
toolbar.appendChild(copyBtn);
|
|
||||||
toolbar.appendChild(saveBtn);
|
toolbar.appendChild(saveBtn);
|
||||||
toolbar.appendChild(reRenderBtn);
|
toolbar.appendChild(reRenderBtn);
|
||||||
container.appendChild(toolbar);
|
container.appendChild(toolbar);
|
||||||
|
|||||||
Reference in New Issue
Block a user