If you have JS on, then the token tree with its collapsible groups is quite nice.
Without JS, though, the table is quite overwhelming (for instance with '#global_types' => TRUE) and it is not immediately obvious that some rows are only headings for the following ones.
The attached patch adds a 'token-group-nojs' class to those rows, which makes them bold, and then removes that class via JS, so that it doesn't make the nice collapsible groups scream at you.
I tested this with #922022: The token tree UI is not accessible to keyboard only users applied also, and it doesn't seem to conflict, although this would need a reroll if that got in.

Files: 
CommentFileSizeAuthor
#7 1067268-token-groups-nojs.patch250 byteststoeckler
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1067268-token-groups-nojs.patch.
[ View ]
#5 1067268-bold-token-groups-no-js.patch672 bytesDave Reid
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1067268-bold-token-groups-no-js.patch.
[ View ]
#4 token_bold_group_titles.patch1.53 KBtstoeckler
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch token_bold_group_titles_0.patch.
[ View ]
token_bold_group_titles.patch1.53 KBtstoeckler
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch token_bold_group_titles.patch.
[ View ]

Comments

Status:Needs review» Needs work

The last submitted patch, token_bold_group_titles.patch, failed testing.

tstoeckler’s picture

Status:Needs work» Needs review

token_bold_group_titles.patch queued for re-testing.

tstoeckler’s picture

Assigned:Unassigned» tstoeckler

Also assigning to me.

tstoeckler’s picture

StatusFileSize
new1.53 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch token_bold_group_titles_0.patch.
[ View ]

Re-uploading for the testbot.

Dave Reid’s picture

StatusFileSize
new672 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1067268-bold-token-groups-no-js.patch.
[ View ]

Can't we do something like this?

Jacine’s picture

Hey, saw this on twitter, and figured I'd chime in. You don't need to add a "js" class and using :not() isn't necessary in this case. You've already got the "js" class that Drupal adds on the <html> tag for free. You can just do something like:

.token-group {
  font-weight: bold;
}
.js .token-group {
  font-weight: normal;
}

:)

tstoeckler’s picture

StatusFileSize
new250 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1067268-token-groups-nojs.patch.
[ View ]

Thanks, Jacine, for the hint!
That's why I love Drupal ... :)
Rolled a patch and tried it out. It works beautifully.

Dave Reid’s picture

Status:Needs review» Fixed
Jacine’s picture

Cool, glad I could help. ;)

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.