diff --git a/wysiwyg.admin.inc b/wysiwyg.admin.inc index ff23b282785df8757f1c700bb7e626b699dd9ec0..f6bd6b1c72d588203cbb554b40c32f03ef3b92c9 100644 --- a/wysiwyg.admin.inc +++ b/wysiwyg.admin.inc @@ -117,6 +117,7 @@ function wysiwyg_profile_form($form, &$form_state, $profile) { '#collapsed' => TRUE, '#tree' => TRUE, '#theme' => 'wysiwyg_admin_button_table', + '#attributes' => array('class' => array('buttons-and-plugins')), ); $plugins = wysiwyg_get_plugins($profile->editor); @@ -371,8 +372,12 @@ function theme_wysiwyg_admin_button_table($variables) { } $rows[] = $row; } + + $output = '

' . t('Select all') . ' / Unselect all

'; + $output .= theme('table', array('rows' => $rows, 'attributes' => array('width' => '100%'))); - $output = theme('table', array('rows' => $rows, 'attributes' => array('width' => '100%'))); + $path = drupal_get_path('module', 'wysiwyg'); + drupal_add_js($path . '/wysiwyg.admin.js'); return $output; } diff --git a/wysiwyg.admin.js b/wysiwyg.admin.js new file mode 100644 index 0000000000000000000000000000000000000000..bba0f52c2f841f8efb0eb7a72fca2ef77d020e6d --- /dev/null +++ b/wysiwyg.admin.js @@ -0,0 +1,22 @@ +(function($) { + + Drupal.behaviors.wysiwyg = { + attach: function(context, settings) { + + var toggle = function(state) { + $('#wysiwyg-profile-form .buttons-and-plugins input:checkbox').attr('checked', state); + } + + $('#wysiwyg-select-all').click(function(){ + toggle(true); + return false; + }); + + $('#wysiwyg-unselect-all').click(function(){ + toggle(false); + return false; + }); + } + } + +}(jQuery)) \ No newline at end of file