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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

neofactor’s picture

Error... I meant "When building your toolbar"...

TwoD’s picture

Status: Active » Needs review
FileSize
734 bytes

There'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.

sun’s picture

Hm. Screenshots?

+++ wysiwyg.admin.inc	29 Jan 2010 19:11:08 -0000
@@ -346,8 +346,10 @@ function theme_wysiwyg_admin_button_tabl
+  $select_header = count($rows) > 0 ? theme('table_select_header_cell') : '';
+  $header = array($select_header, '', '');

Can there be less than 1 row at all? :)

+++ wysiwyg.admin.inc	29 Jan 2010 19:11:08 -0000
@@ -346,8 +346,10 @@ function theme_wysiwyg_admin_button_tabl
-  $output = theme('table', array(), $rows, array('width' => '100%'));
+  $output = theme('table',$header ,$rows, array('width' => '100%'));

(minor) Wrong spacing between commas.

Powered by Dreditor.

TwoD’s picture

Status: Needs review » Active

Oh, 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.

mrP’s picture

Version: 6.x-2.0 » 6.x-2.2

+1 on this feature

mrP’s picture

Version: 6.x-2.2 » 7.x-2.x-dev

Any chance we could take another look at this feature with D7 ?

borgewarvik’s picture

Status: Active » Needs review
FileSize
1.74 KB

Hi

This is a first attempt to fix this issue. This is for 7 branch.

Summit’s picture

Hi, I would love to see this in D7, and D6. Any news on this please?
Anyone tested the patch?

greetings, Martijn

mrP’s picture

Status: Needs review » Reviewed & tested by the community

Just 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

Krizalys’s picture

Subscribed.

TwoD’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for patching and testing, but the patch is full of whitespace errors (tab indents and non-empty lines).

+++ b/wysiwyg.admin.incundefined
@@ -371,8 +372,12 @@ function theme_wysiwyg_admin_button_table($variables) {
+  drupal_add_js($path . '/wysiwyg.admin.js');

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.

+++ b/wysiwyg.admin.jsundefined
@@ -0,0 +1,22 @@
+		attach: function(context, settings) {

For good measure, we should implement a detach method which removes the event handlers as well.

swim’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
2.06 KB

Following instructions from #12. Excluding implementation recommendations; this is a different approach again.

Patch attached.

mglaman’s picture

Status: Needs review » Reviewed & tested by the community

Applies, is a nice enhancement.