add help hint on main page

Co-authored-by: Pietro Bonaldo Gregori <pietro.bogre@gmail.com>
This commit is contained in:
Pierre Dubouilh
2024-08-04 21:12:56 +02:00
committed by Pierre Dubouilh
co-authored by Pietro Bonaldo Gregori
parent 33c93fc0b4
commit 99a6aec8db
3 changed files with 26 additions and 1 deletions
+10
View File
@@ -11,6 +11,7 @@ const rmMsg = () => !confirm('Remove file?\n')
const ensureMove = () => !confirm('move items?')
const isRo = () => window.ro
// DOM elements
const upBarName = document.getElementById('upBarName')
const upBarPc = document.getElementById('upBarPc')
const upGrid = document.getElementById('drop-grid')
@@ -29,6 +30,8 @@ const editor = document.getElementById('text-editor')
const crossIcon = document.getElementById('quitAll')
const toast = document.getElementById('toast')
const table = document.getElementById('linkTable')
const helpMsg = document.getElementById('help_message')
const transparentPixel = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
// helpers
@@ -847,5 +850,12 @@ function init () {
const matchingA = allA.find(a => a.href === cleanURL)
padOn(matchingA)
}
// check if we're at root path
if (location.pathname === window.extraPath + '/') {
helpMsg.style.display = 'block'
} else {
helpMsg.style.display = 'none'
}
}
init()