Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Ehrn building your toolbar... it would be VERY helpful to have a simple "check all / uncheck all" option.
I usually just want to turn off on or two options.. so having to click everyone but the one seems backwards. It would be a great UI improvement if you could all this.
Comment | File | Size | Author |
---|---|---|---|
#13 | wysiwyg-check-uncheck-toggle-698348-13.patch | 2.06 KB | swim |
#8 | wysiwyg-togglecheckboxes-698348-8.patch | 1.74 KB | borgewarvik |
#2 | wysiwyg-select-all.patch | 734 bytes | TwoD |
Comments
Comment #1
neofactor CreditAttribution: neofactor commentedError... I meant "When building your toolbar"...
Comment #2
TwoDThere's a simple way to do that using functionality in Core. The downside is that Core's code assumes the table is a single column and that the whole row should be highlighted when a checkbox on it is selected. It does this by adding a 'selected' class to the
<tr>
when want it do go on the<td>
. The highlighed and regular styles comes from the theme so we can't really predict how to negate it.Attaching a patch to show what I mean. (The code in the patch is adapted from modules/node/node.admin.inc.) If users are bothered by the whole row highlighting, we could go the long way around and re-implement misc/tableselect.js, but that sounds like overkill as we'd have to include yet another JavaScript file for that which would only be used on that page.
The same thing could also be done by overriding theme_wysiwyg_admin_button_table() in your template.php to add the code from the patch.
Comment #3
sunHm. Screenshots?
Can there be less than 1 row at all? :)
(minor) Wrong spacing between commas.
Powered by Dreditor.
Comment #4
TwoDOh, I didn't mean for this to be "Needs review" as the patch wasn't meant for commit. Just put it up to show how this could theoretically be done, but that it's not so easy because Core makes a few assumptions about the table. I should have been more obvious about wanting to start a discussion on getting a better solution in place. (Yeah I should have posted a screenshot instead hehe. Will do that later.)
I'm not sure we actually want a "[un]select all" box here as choosing which buttons/plugins should be enabled is something that should be done with care. It's very easy to just "Select All"->"Save" and expect to have a fully working editor. Most of the time people do don't look at the list, or don't understand what a plugin does, they just select everything they see, including stuff they really don't want. Take the BBCode plugins for example: Having them enabled is one of the most frequent WYSIWYG problems encountered here and on IRC. I admit it's not easy to figure out what each button does, but that's a different issue.
Related: A 'clone settings from profile X' tool/link could help with the repetitive task of creating similar profiles. Some kind of "validation" check comparing the enabled plugins with the enabled input filters would perhaps be necessary if a "select all" gets in to catch most of the cases where enabling the 'wrong' plugin turns the output into garbage. It's a bit hard to pull that off tho and should be its own issue.
Comment #6
mrP CreditAttribution: mrP commented+1 on this feature
Comment #7
mrP CreditAttribution: mrP commentedAny chance we could take another look at this feature with D7 ?
Comment #8
borgewarvik CreditAttribution: borgewarvik commentedHi
This is a first attempt to fix this issue. This is for 7 branch.
Comment #9
Summit CreditAttribution: Summit commentedHi, I would love to see this in D7, and D6. Any news on this please?
Anyone tested the patch?
greetings, Martijn
Comment #10
mrP CreditAttribution: mrP commentedJust tested patch #8 against 7.x-2.x-dev on a local site and it works like a charm.
For reference, I tested it for a Full HTML text format using TinyMCE as the editor
Comment #11
Krizalys CreditAttribution: Krizalys commentedSubscribed.
Comment #12
TwoDThanks for patching and testing, but the patch is full of whitespace errors (tab indents and non-empty lines).
We could use the
'#attached'
key for this below the'#theme' => 'wysiwyg_admin_button_table'
key for this so form alterations could easily replace it.Perhaps even implement
hook_library()
and attach it that way.For good measure, we should implement a detach method which removes the event handlers as well.
Comment #13
swim CreditAttribution: swim commentedFollowing instructions from #12. Excluding implementation recommendations; this is a different approach again.
Patch attached.
Comment #14
mglamanApplies, is a nice enhancement.