At the moment, drupal_add_js(..., 'core') doesn’t really do much more than any other value, it’s just output at the very first place.
This patch changes the behavior a little bit: the core scope now acts as a toggle for JavaScript: When there are only core files in the array, no JavaScript at all is added to the page. Core files are now meant to be “support” files that don’t do anything of their own. Only if another JS file, settings or inline JavaScript is also added, they are added to the page.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | drupal-core-js_0.patch | 4.92 KB | kkaefer |
| drupal-core-js.patch | 3.61 KB | kkaefer |
Comments
Comment #1
kkaefer commentedChanged three 'core' JavaScript files.
Comment #2
m3avrck commentedMost of these changes have been rolled into this JS aggregation patch since it's already mucking in that exact same area: http://drupal.org/node/119441#comment-197707
Comment #3
keith.smith commentedno longer applies
patching file update.php
Hunk #1 FAILED at 322.
Hunk #2 FAILED at 403.
2 out of 2 hunks FAILED -- saving rejects to file update.php.rej
patching file includes/common.inc
Hunk #1 succeeded at 1656 (offset 93 lines).
Hunk #2 FAILED at 1698.
Hunk #3 FAILED at 1729.
Hunk #4 FAILED at 1744.
3 out of 4 hunks FAILED -- saving rejects to file includes/common.inc.rej
Comment #4
panchoDon't know if this is still needed after JS get aggregated, but if yes it's for the D7 queue.
Comment #5
casey commentedhttp://api.drupal.org/api/function/drupal_add_js/6
JS handling has changed in D7. Does this still apply?