Move from file IDs to file paths (with retrocompatibility)
This commit is contained in:
parent
56cf62f1eb
commit
a2503d5def
7 changed files with 62 additions and 49 deletions
|
@ -1,15 +1,15 @@
|
|||
function copyEditLink(fileID) {
|
||||
navigator.clipboard.writeText(getEditLink(fileID));
|
||||
function copyEditLink(path) {
|
||||
navigator.clipboard.writeText(getEditLink(path));
|
||||
}
|
||||
function copyImageLink(fileID) {
|
||||
navigator.clipboard.writeText(``);
|
||||
function copyImageLink(path) {
|
||||
navigator.clipboard.writeText(`})`);
|
||||
}
|
||||
|
||||
function refreshPage() {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
function addButton(document, fileID) {
|
||||
function addButton(document, path) {
|
||||
|
||||
// Add floating button
|
||||
const floatingButton = document.createElement('button');
|
||||
|
@ -22,8 +22,8 @@ function addButton(document, fileID) {
|
|||
popupMenu.id = 'popupMenu';
|
||||
popupMenu.innerHTML = `
|
||||
<button onclick="refreshPage()">Refresh</button>
|
||||
<button onclick="copyEditLink('${fileID}')">Copy Direct Edit Link</button>
|
||||
<button onclick="copyImageLink('${fileID}')">Copy Image Link</button>
|
||||
<button onclick="copyEditLink('${path}')">Copy Direct Edit Link</button>
|
||||
<button onclick="copyImageLink('${path}')">Copy Image Link</button>
|
||||
`;
|
||||
document.body.appendChild(popupMenu);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue