
| Key: |
MDL-16695
|
| Type: |
Sub-task
|
| Status: |
Resolved
|
| Resolution: |
Fixed
|
| Priority: |
Minor
|
| Assignee: |
Tim Hunt
|
| Reporter: |
Tim Hunt
|
| Votes: |
0
|
| Watchers: |
2
|
|
|
| Participants: |
Penny Leach and Tim Hunt
|
| Security Level: |
None
|
| Resolved date: |
12/Jun/09
|
| Affected Branches: |
MOODLE_20_STABLE
|
| Fixed Branches: |
MOODLE_20_STABLE
|
|
This will help with storing lists of scripts, etc. and allow us to get the output without nasty hacks like the current $extracthtml argument to require_js.
|
|
Description
|
This will help with storing lists of scripts, etc. and allow us to get the output without nasty hacks like the current $extracthtml argument to require_js. |
Show » |
tjhunt committed 4 files to 'Moodle CVS' - 12/Jun/09 11:13 AM
ajaxlib: MDL-16695 New page_requirements_manager class. Soon to replace require_js.
This new class does the work that require_js used to do, and more.
It can track a number of different things that may be required to
be output somewhere on the page, including:
* Links to JS files
* Links to CSS files
* Links to YUI libraries (this class knows about the dependancies between the different libs).
* Skip links that go from the top of <body> to various places in the content.
* Calls to JavaScript functions (for example to initialise things)
* Bits of data from PHP that need to be available to JavaScript
* As a special case of that, an easy way to pass language strings to JS.
The new API looks like
$PAGE->requires->css('mod/mymod/styles.css');
$PAGE->requires->js('mod/mymod/script.js');
$PAGE->requires->js('mod/mymod/small_but_urgent.js')->in_head();
$PAGE->requires->js_function_call('init_mymod', array($data))->on_dom_ready();
$PAGE->requires is the canonical instances of this new class.
The commit also includes unit tests, and hopefully the PHP doc comments are
clear enough that it is easy to understand.
|
|
|
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 17 files to 'Lang CVS' - 13/Jun/09 01:44 AM
MDL-16695 Translated a new string for page_requirements_manager class.
MDL-19182 Splitting auth.php lang file into multiple files based on en_utf8 split.
|
|
|
committed 1 file to 'Moodle CVS' - 15/Jun/09 01:06 PM
tjhunt committed 1 file to 'Moodle CVS' - 17/Jun/09 06:29 PM
javascript: MDL-16695 print_footer('empty'); was not printing the necessary end of page code.
|
|
|
tjhunt committed 1 file to 'Moodle CVS' - 19/Jun/09 04:02 PM
javascript: MDL-16695 print_footer('empty'); I had the wrong type of quotes.
Thanks to Dongsheng for noticing.
|
|
|
martignoni committed 1 file to 'Lang CVS' - 26/Jun/09 03:27 AM
|