DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy

devel:event:confutil_cdn_select

CONFUTIL_CDN_SELECT

Description:
Pick the URLs to load scripts from depending on the jquerycdn setting
DefaultAction:
pick the correct URLs
Preventable:
yes
Added:
2017-02-03

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