diff --git a/build-plugin.sh b/build-plugin.sh index b1f4ce1..bff287b 100755 --- a/build-plugin.sh +++ b/build-plugin.sh @@ -2,7 +2,7 @@ set -eu PLUGIN="u-navigator" -VERSION="2026.06.23.r035" +VERSION="2026.06.23.r036" PKG_DIR="packages" WORK_DIR=".plugin-build" PKG_NAME="${PLUGIN}-${VERSION}.tgz" diff --git a/packages/u-navigator-2026.06.23.r035.tgz b/packages/u-navigator-2026.06.23.r035.tgz deleted file mode 100644 index f428027..0000000 Binary files a/packages/u-navigator-2026.06.23.r035.tgz and /dev/null differ diff --git a/packages/u-navigator-2026.06.23.r036.tgz b/packages/u-navigator-2026.06.23.r036.tgz new file mode 100644 index 0000000..2103495 Binary files /dev/null and b/packages/u-navigator-2026.06.23.r036.tgz differ diff --git a/plugin-root/usr/local/emhttp/plugins/u-navigator/U-Navigator.page b/plugin-root/usr/local/emhttp/plugins/u-navigator/U-Navigator.page index a533eeb..dad285b 100644 --- a/plugin-root/usr/local/emhttp/plugins/u-navigator/U-Navigator.page +++ b/plugin-root/usr/local/emhttp/plugins/u-navigator/U-Navigator.page @@ -1,6 +1,10 @@ -Menu="Tools" -Title="U-Navigator" +Menu="Tasks:99" +Name="Navigator" Icon="u-navigator/u-navigator.svg" +Type="xmenu" +Tabs="true" +Code="f07b" +Tag="Navigator U-Navigator Unraid File Navigator files explorer" --- -(() => { - const targetHref = '/Tools/U-Navigator'; - const targetText = 'NAVIGATOR'; - - function normalize(text) { - return String(text || '').trim().toUpperCase(); - } - - function injectUNavigatorNav() { - if (document.querySelector('a[href="/Tools/U-Navigator"], a[data-u-navigator-nav="true"]')) { - return; - } - - const links = [...document.querySelectorAll('a')]; - const toolsLink = links.find((link) => { - const text = normalize(link.textContent); - const href = link.getAttribute('href') || ''; - return text === 'WERKZEUGE' || text === 'TOOLS' || href === '/Tools'; - }); - - if (!toolsLink) { - return; - } - - const wrapper = toolsLink.parentElement?.tagName === 'LI' ? toolsLink.parentElement : toolsLink; - const isListItem = wrapper.tagName === 'LI'; - const item = isListItem ? document.createElement('li') : document.createElement('a'); - const link = isListItem ? document.createElement('a') : item; - link.className = toolsLink.className || ''; - link.href = targetHref; - link.textContent = targetText; - link.setAttribute('data-u-navigator-nav', 'true'); - link.classList.remove('active', 'selected', 'on'); - - if (isListItem) { - item.className = wrapper.className || ''; - item.classList.remove('active', 'selected', 'on'); - item.appendChild(link); - } - - if (location.pathname === targetHref) { - toolsLink.classList.remove('active', 'selected', 'on'); - wrapper.classList?.remove('active', 'selected', 'on'); - link.classList.add('active'); - item.classList?.add('active'); - } - - wrapper.insertAdjacentElement('afterend', item); - } - - if (document.readyState === 'loading') { - document.addEventListener('DOMContentLoaded', injectUNavigatorNav); - } else { - injectUNavigatorNav(); - } -})(); - diff --git a/u-navigator.plg b/u-navigator.plg index cc4593e..afcaf29 100644 --- a/u-navigator.plg +++ b/u-navigator.plg @@ -1,7 +1,7 @@ - + @@ -24,13 +24,14 @@ https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package; -e2a3296496baf42be1d6695613c30275 +5ddb77ea5e8b2d4d9ca48060a002c8c3 mkdir -p /boot/config/plugins/&name; tar -xzf /boot/config/plugins/&name;/&package; -C / +rm -f /usr/local/emhttp/plugins/&name;/U-NavigatorNav.page find /boot/config/plugins/&name; -type f -name "&name;-*.tgz" ! -name "&package;" -delete echo "" echo "-----------------------------------------------------------" diff --git a/u-navigator.plg.in b/u-navigator.plg.in index bc5ec15..901ca63 100644 --- a/u-navigator.plg.in +++ b/u-navigator.plg.in @@ -31,6 +31,7 @@ mkdir -p /boot/config/plugins/&name; tar -xzf /boot/config/plugins/&name;/&package; -C / +rm -f /usr/local/emhttp/plugins/&name;/U-NavigatorNav.page find /boot/config/plugins/&name; -type f -name "&name;-*.tgz" ! -name "&package;" -delete echo "" echo "-----------------------------------------------------------"