Closed (won't fix)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Jan 2007 at 20:01 UTC
Updated:
29 Jul 2014 at 17:33 UTC
This patch adds a new page to Administer >> Settings called “JavaScript”. On this page, JavaScript enhancements can be toggled. Other modules (like upload.module) can add their own settings via hook_form_alter.
| Comment | File | Size | Author |
|---|---|---|---|
| javascript-settings.patch | 5.73 KB | kkaefer |
Comments
Comment #1
nedjoThis level of control over javascript behaviours seems like something many admins would like.
Some thoughts:
1. I wonder if we could/should consider a standard way for behaviours to describe themselves that would then be loaded and used by this settings page. E.g.,
hook_behaviors().2. Somehow directly checking the variables from within the theme function seems awkward. If we don't want a behavior, it seems like it shouldn't arrive at the theme function with the setting that triggers it. How else could we do this? At the form alter stage, e.g. setting a fieldset #collapsible to FALSE based on the variable?
Comment #2
bdragon commentedAutopatch Results:
patching file includes/form.inc
Hunk #1 succeeded at 1111 (offset 139 lines).
Hunk #2 succeeded at 1357 with fuzz 1 (offset 22 lines).
patching file includes/theme.inc
Hunk #1 FAILED at 815.
1 out of 1 hunk FAILED -- saving rejects to file includes/theme.inc.rej
patching file modules/system/system.module
Hunk #1 FAILED at 233.
Hunk #2 succeeded at 755 (offset 48 lines).
1 out of 2 hunks FAILED -- saving rejects to file modules/system/system.module.rej
patching file modules/upload/upload.module
Hunk #1 FAILED at 348.
1 out of 1 hunk FAILED -- saving rejects to file modules/upload/upload.module.rej
Comment #3
wim leersSince this is not really a usability enhancement, marking for D7. I like nedjo's idea to add an additional layer, which gives you more fine-grained control:
1) the FAPI layer
2) the behaviors layer (#behaviors/hook_behaviors() and hook_behaviors_alter()?)
3) the themeing layer
That way, the behaviors can be independent from the themeing layer, which I think is the future. That way you could install a module that completely changes (enhances?) other forms' or form elements' behaviors.
For the people who saw kkaefer's demo of #behaviors for FAPI in Barcelona: #behaviors/hook_behaviors() + hook_behaviors_alter() = magical Drupal UI improvements? (#behaviors in FAPI, hook_behaviors() for behaviors in non-FAPI stuff?)
Comment #4
redndahead commented#219061: Settings page to control core JavaScript behaviors. was marked as a duplicate
Comment #5
wim leersComment #6
nod_I'm not sure core should have that. We should on the contrary provide the minimum JS implementation/styling and let contrib override everything.
I'm tempted to mark that won't fix. Any other opinions?
Comment #7
robloachI'm with you. I haven't seen this kind of functionality on any other website system ever.