On Tue, Sep 30, 2014 at 4:45 PM, Andy Bradford <amb-fos...@bradfords.org>
wrote:

>
> Would it be better to just add  each new capability letter to the end of
> the current string?
>

Seems i spoke to soon on the option of underlining/marking the most
recently selected letter: the sorting (ironically enough) gets in the way
of that because the sorting must be done at the end, but the markup wants
to be done in the middle, which means that sorting has to be made aware of
the markup (or appropriate state has to be kept).

More state for that seems like way overkill, but i'm open to suggestions.
Testing/tweaking JS code generated from C code, requiring a recompile and
server process restart after each change, gets really tedious really
quickly, so i'd like to keep the implementation as trivial as possible ;).

My first attempt relied on the order of the UI elements, which (per the
W3C) is defined as their byte-offset order within the originating HTML
stream[1]. That looked like "pure chaos" and went with the sorting route,
which is at least predictable, but i will agree that having the character
appear in the middle of an existing list is a bit awkward. Appending to the
list requires knowing/parsing/updating the state of the list on each
checkbox update, which i wanted to avoid for the aforementioned "testing
tedium" reasons. It also "might" not play intuitively with the initial
setup of the string, which sets up the initial state of the perms string
using the current state of the checkboxes right after they are rendered. In
such a case there is no "most recently selected" entry, and we'd be using
(probably) UI order (i.e. byte stream order). As soon as we rely on the
UI-level ordering, someone will say, "but shouldn't it sort top to bottom
instead of left to right, since the perms are listed in three columns?" at
which point the answer becomes, "no, because the W3C defines the ordering
that way," and yet another can of worms gets opened, along with more
bikeshedding[2] about visual style.


[1] i coincidentally looked that up last week for a project at work, but
could find no documentation specifying the "proper" ordering for
programmatically injected elements.

[2] no small amount of which would likely come from me ;)


Or perhaps instead each Capability should have it's letter next to it?
>
> (s) Setup        (u) Reader       (r) Read Ticket
> (a) Admin        (v) Developer    (n) New Tickets
> (d) Delete       (g) Clone        (c) Append To Ticket
> (e) Email        (j) Read Wiki    (w) Write Tickets
>

That's certainly doable with or without the permissions string update.
Looking into it now.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to