In some cases you may not want Uniform to apply to every instance of a form element because you are doing something else for some (for instance, using the jQuery UI Slider plugin on some <select> elements).
Attached is a patch against 1.3 that adds an admin text input to allow an administrator to provide a list of jQuery selectors to be excluded from uniform.
| Comment | File | Size | Author |
|---|---|---|---|
| uniform-allow-exclusions.patch | 1.44 KB | bmcmurray |
Comments
Comment #1
bmcmurray commentedA patch that combines this with http://drupal.org/node/947374 can be found here http://drupal.org/node/947394
Comment #2
realityloop commentedI'd like to improve the information text here, can you give example of exclusion string that a user would need to enter?
Comment #3
bmcmurray commentedA specific example could be more misleading than helpful, but perhaps linking to the API documentation for jQuery's .not() method would explain better, since it contains lengthy examples: http://api.jquery.com/not/
Comment #4
realityloop commentedUntil you can give me a usage example with multiple selectors that I can test locally this is on hold.
Comment #5
MixologicSo I found a great use case for this patch.
We would like to use uniform for all of our admin pages, with one exception - the user permissions page. We have 9 roles, and 279 different permissions. 2511 checkboxes craters the browser with uniform on.
I worked this patch in, and my specific example happens to be '#user-admin-perm input:checkbox' which works great.
The main advantage I see with this patch is its fine grained enough to allow absolute control on your site of exactly the elements that you want to ignore.
The main disadvantage is that asking somebody to input jquery selectors into an exception list doesnt provide for an intuitive user interface - it assumes they know what a jquery selector is, and what to do with it. Though we have php input into all kinds of form inputs in drupal, so maybe just an 'expert warning" and an additional comment to express that it should be a comma separated list of selectors.
In any case the /admin/user/permissions page should probably be excluded regardless.. even small sites are likely to have swarms of checkboxes and the value added in having pretty checkboxes on that particular form is questionable.
Comment #6
realityloop commentedAdded in 6.x-1.5 and 7.x-1.5