17 Commits

Author SHA1 Message Date
Petr Skoda
2e866010a3 fixed regression 2010-02-09 17:56:26 +00:00
Petr Skoda
593f9b8703 MDL-21400 finalising JS api - removing ->on_dom_ready (now bool param in js() and js_init_call()) and after_delay() (again int parameter) - the reason is it was adding unnecessary complexity and it is used in just a few places that will be eventually converted to the new js_init_call() anyway 2010-02-06 14:45:17 +00:00
Petr Skoda
cd9729e405 MDL-21400 ->in_head() from deprecated data_for_js(), this actually also fixes order of loading of libs+init code 2010-02-06 13:30:15 +00:00
Petr Skoda
88515081c8 MDL-21403 RIP $PAGE->requires->*()->asap() 2010-01-26 10:42:25 +00:00
Petr Skoda
f5de8ee77b MDL-21401 killed top_of_body support because it does not encourage good coding style (agreed with Tim), skiplinks conversion to html_writer 2010-01-20 18:30:55 +00:00
Petr Skoda
77774f6a83 MDL-21240 move script tag generation into html_writer + improving api a bit 2010-01-18 20:17:43 +00:00
Petr Skoda
a685593466 MDL-21233 moodle_url improvemewnts, code simplification, more diagnostics; fixed several regressions 2010-01-16 15:39:56 +00:00
Petr Skoda
78946b9bdb MDL-20204 first batch of major theme changes, some regressions are still there, expect more changes and improvements soon; see tracker for details and list of subtasks 2009-12-16 18:00:58 +00:00
Petr Skoda
117bd74897 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-01 11:31:16 +00:00
stronk7
d47cf63dec MDL-19579 code coverage - add initial $includecoverage attributes 2009-06-26 17:21:36 +00:00
samhemelryk
d76b8a2068 ajaxlib MDL-16693 Fixed fringe condition in ajaxlib and added test 2009-06-22 02:59:02 +00:00
tjhunt
32941d74c8 Move extra ajaxlib unit tests to the right place. 2009-06-17 07:35:33 +00:00
tjhunt
cf6155226c 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.)
2009-06-12 12:13:07 +00:00
tjhunt
b2330db606 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.
2009-06-12 03:13:29 +00:00
tjhunt
3744f3770c ajaxlib: fix unit tests. 2009-03-10 07:48:29 +00:00
skodak
cc4245a3cd MDL-16483 - stopped using MoodleUnitTestCase in tests where $DB not needed 2009-01-10 13:23:37 +00:00
tjhunt
e874af28ce MDL-16583 Make require_js accept library names like lib/javascript-static.js without the caller having to fiddle around with $CFG->wwwroot themselves. 2008-09-25 06:29:28 +00:00