Offer to edit images
Any SVG image in assets/ can now be edited with js-draw. It won't reload automatically (yet)
This commit is contained in:
parent
5c261b35f2
commit
8d1438de33
4 changed files with 240 additions and 18 deletions
|
@ -1,6 +1,9 @@
|
|||
function copyEditLink(fileID) {
|
||||
navigator.clipboard.writeText(getEditLink(fileID));
|
||||
}
|
||||
function copyImageLink(fileID) {
|
||||
navigator.clipboard.writeText(``);
|
||||
}
|
||||
|
||||
function refreshPage() {
|
||||
window.location.reload();
|
||||
|
@ -20,7 +23,7 @@ function addButton(document, fileID) {
|
|||
popupMenu.innerHTML = `
|
||||
<button onclick="refreshPage()">Refresh</button>
|
||||
<button onclick="copyEditLink('${fileID}')">Copy Direct Edit Link</button>
|
||||
|
||||
<button onclick="copyImageLink('${fileID}')">Copy Image Link</button>
|
||||
`;
|
||||
document.body.appendChild(popupMenu);
|
||||
|
||||
|
@ -31,6 +34,7 @@ function addButton(document, fileID) {
|
|||
|
||||
document.body.addEventListener('mouseleave', () => {
|
||||
floatingButton.style.display = 'none';
|
||||
popupMenu.style.display = 'none';
|
||||
});
|
||||
|
||||
// Toggle popup menu on button click
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue