df-listdirs-patch #36
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "df/webif:df-listdirs-patch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Directories with names differing only by whitespace clash in the Browse Files list: only the first will have its size shown. Also, spaces in directory names are not shown accurately.
The server-side code generates IDs for the directory line's image and size elements. The directory size is calculated asynchronously using
du
and lazy-loaded by client-side JS, which therefore has to be implement a matching algorithm for the ID.The failing algorithm just strips spaces from the directory name, which means IDs aren't guaranteed to be unique, and therefore the HTML page is non-conformant.
Instead, I chose the name mapping to be the composition of
escape()
(ECMA-262 B.2.1), which guarantees its output to be a string of characters from the set of ASCII alphanumerics plus@*_+-./%
, followed by_-.
are left of the special characters.This makes the generated ID unique and valid in HTML4.01 as well as HTML5.
The name display is improved by making any spaces into non-breaking spaces for HTML.
See https://hummy.tv/forum/threads/webif-media-browser-oddity.10104
WIP:df-listdirs-patchto df-listdirs-patchThis now seems to be working for several people and I think is ready for beta test to see if it has any undesirable (eg performance, IE8) effects.