Our existing theming for the configuration of file components was written ages ago (even before jQuery was included in Drupal!) so its implementation has got quite a few out-dated ideas in it:
- Table-based extensions lists
- Inline JavaScript, which doesn't work within Form Builder module
- The theming is unnecessarily on the entire form, when only the extensions list is actually themed
This patch does the following:
- Converts the extension list into a similar, but updated list that uses a single column for extensions, making it so it works more flexibly on smaller (or larger) displays.
- Moves the select-all extensions link to webform-admin.js, making it so that it works in Form Builder and can be reused elsewhere if needed.
- Moves the file size validation above the extension list, so that it doesn't get lost against the significantly larger configuration form.
These changes also make it possible for Form Builder to properly display the extension list table, right now it just displays the list of checkboxes in a complete unthemed manner.
Patches for D6 and D7 attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | webform_select_checkboxes_change.patch | 825 bytes | quicksketch |
| webform_file_extension_update-d7.patch | 12.16 KB | quicksketch | |
| webform_file_extension_update-d6.patch | 11.94 KB | quicksketch |
Comments
Comment #1
quicksketchUpon reviewing the patch one more time, I also realized that it makes some string changes to comply with Coder standards (Sentence casing the labels). But after testing with and without Form Builder on both D6 and D7, it looks good to me. Functionality (and most of the appearance) remains the same, but it should work better in a variety of situations. Committed to both branches.
Comment #2
quicksketchI found a minor problem with this code that made it incompatible with Form Builder. Because setting the value manually does not trigger a "change" or "click" event, clicking the "select" link does not update the preview element via AJAX, since the end-user didn't manually click any of the checkboxes. This resulted in the quite confusing effect of the select link selecting checkboxes, but the values not getting saved.
This patch fixes this issue by triggering the "change" event on the checkboxes so their value gets saved properly. Committed to both branches.