It's better when it's simple

User Tools

Site Tools



Pick the URLs to load scripts from depending on the jquerycdn setting
pick the correct URLs

This event is signalled by getCdnUrls() in inc/confutils.php when the jQuery script URLs are selected, handlers can use it to use a different CDN or to add their own script files in addition.

Passed Data

$data is an array with two arrays:

$data = array(
    'versions' => array(
        'JQ_VERSION' => '3.1.1', // jquery
        'JQUI_VERSION' => '1.12.1', // jquery-ui
        'JQM_VERSION' => '3.0.0' // jquery-migrate
    'src' => array(

The version array contains the currently configured jquery versions from lib/scripts/jquery/versions. The src array is empty in the BEFORE event and will contain all script URLs to be loaded in the AFTER event. The src array may be modified by plugins.

A BEFORE event could prevent the default handling and use a different CDN for the given jQuery versions. It could also modify the versions loaded (but only when using a CDN – locally we only have one version available).

An AFTER event could add additional scripts to be loaded.

See also

devel/event/confutil_cdn_select.txt · Last modified: 2018-12-08 15:10 by torpedo

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki