diff --git a/build-plugin.sh b/build-plugin.sh index 73f2dee..ed429a2 100755 --- a/build-plugin.sh +++ b/build-plugin.sh @@ -2,7 +2,7 @@ set -eu PLUGIN="u-navigator" -VERSION="0.2.8" +VERSION="0.2.9" PKG_DIR="packages" WORK_DIR=".plugin-build" PKG_NAME="${PLUGIN}-${VERSION}.tgz" diff --git a/packages/u-navigator-0.2.8.tgz b/packages/u-navigator-0.2.8.tgz deleted file mode 100644 index 48e31ef..0000000 Binary files a/packages/u-navigator-0.2.8.tgz and /dev/null differ diff --git a/packages/u-navigator-0.2.9.tgz b/packages/u-navigator-0.2.9.tgz new file mode 100644 index 0000000..158aed5 Binary files /dev/null and b/packages/u-navigator-0.2.9.tgz differ diff --git a/server/public/app.js b/server/public/app.js index 9a624b6..3bb2aea 100644 --- a/server/public/app.js +++ b/server/public/app.js @@ -242,8 +242,11 @@ function renderExplorer(body, win) { }); row.addEventListener('dragstart', (event) => { state.draggedEntry = { path: entry.path, name: entry.name, sourceWindowId: win.id }; - event.dataTransfer.setData('application/x-u-navigator-path', entry.path); - event.dataTransfer.setData('text/plain', entry.path); + try { + event.dataTransfer.setData('text/plain', entry.path); + } catch { + // Some WebKit builds reject programmatic drag data. App state is the primary channel. + } event.dataTransfer.effectAllowed = 'copyMove'; row.classList.add('dragging'); }); @@ -359,7 +362,7 @@ async function handleDrop(event, win, targetPath) { return; } - const internalPath = event.dataTransfer.getData('application/x-u-navigator-path') || event.dataTransfer.getData('text/plain') || state.draggedEntry?.path; + const internalPath = state.draggedEntry?.path || safeGetDragText(event); if (internalPath) { const name = internalPath.split('/').filter(Boolean).at(-1); const destination = `${targetPath.replace(/\/$/, '')}/${name}`; @@ -402,7 +405,7 @@ async function reloadExplorerWindows(ids) { } function hasDropPayload(event) { - return Boolean(state.draggedEntry || event.dataTransfer?.types?.includes('Files') || event.dataTransfer?.types?.includes('application/x-u-navigator-path') || event.dataTransfer?.types?.includes('text/plain')); + return Boolean(state.draggedEntry || event.dataTransfer?.types?.includes('Files') || event.dataTransfer?.types?.includes('text/plain')); } function showError(error) { @@ -410,6 +413,14 @@ function showError(error) { alert(message); } +function safeGetDragText(event) { + try { + return event.dataTransfer.getData('text/plain'); + } catch { + return ''; + } +} + async function renameEntry(win, entry) { const nextName = prompt('Neuer Name', entry.name); if (!nextName || nextName === entry.name) { diff --git a/u-navigator.plg b/u-navigator.plg index bccb9e8..3ab2cc2 100644 --- a/u-navigator.plg +++ b/u-navigator.plg @@ -1,7 +1,7 @@ - + ]> @@ -14,7 +14,7 @@ https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package; -5e77298b9383a80c1ca8c27020b1d8b0 +a8f39d867d56be04d8645f0975440b0a