
| Key: |
MDL-16693
|
| Type: |
Sub-task
|
| Status: |
Resolved
|
| Resolution: |
Fixed
|
| Priority: |
Minor
|
| Assignee: |
Tim Hunt
|
| Reporter: |
Tim Hunt
|
| Votes: |
0
|
| Watchers: |
0
|
|
|
| Participants: |
Tim Hunt
|
| Security Level: |
None
|
| Resolved date: |
12/Jun/09
|
| Affected Branches: |
MOODLE_20_STABLE
|
| Fixed Branches: |
MOODLE_20_STABLE
|
|
The advice about improving the performance of web pages is to put the JavaScript in the footer of the page. This lets the actual content can load more quickly, so the user can get on with things. JavaScript that just sets up event handlers, and the libraries required to do this, can safely be loaded later.
Therefore, add an optional $loadimmediately argument to require_js that defaults to false. When it is false, the include link is only printed in the page footer. When it is true, the link is output according to the current logic.
|
|
Description
|
The advice about improving the performance of web pages is to put the JavaScript in the footer of the page. This lets the actual content can load more quickly, so the user can get on with things. JavaScript that just sets up event handlers, and the libraries required to do this, can safely be loaded later.
Therefore, add an optional $loadimmediately argument to require_js that defaults to false. When it is false, the include link is only printed in the page footer. When it is true, the link is output according to the current logic. |
Show » |
tjhunt committed 36 files to 'Moodle CVS' - 12/Jun/09 08:13 PM
ajaxlib/require_js: MDL-16693 $PAGE->requires->... deprecates require_js etc.
There is a new implementation of require_js in lib/deprecatedlib.php,
based on $PAGE->requires.
There were a few other recently introduced functions in lib/weblib.php,
namely print_js_call, print_delayed_js_call, print_js_config and
standard_js_config. These have been removed, since they were never in
a stable branch, and all the places that used them have been changed
to use the newer $PAGE->requires->... methods.
get_require_js_code is also gone, and the evil places that were calling
it, even though it is an internal function, have been fixed.
Also, I made some minor improvements to the code I committed yesterday
for MDL-16695.
All that remains is to update all the places in core code that are
still using require_js.
(This commit also fixes the problem where the admin tree would not
start with the right categories expanded.)
|
|
|
committed 2 files to 'Moodle CVS' - 22/Jun/09 10:59 AM
ajaxlib MDL-16693 Fixed fringe condition in ajaxlib and added test
|
|
|
committed 1 file to 'Moodle CVS' - 24/Jun/09 03:39 PM
tjhunt committed 1 file to 'Moodle CVS' - 17/Jul/09 03:46 PM
|