Same name and namespace in other branches
  1. 7.x-2.x advagg_mod/advagg_mod.module \advagg_mod_get_lists() 1 commentaire

Generate a list of rules and exceptions for js files.

Controls no async/defer file list.

Return value

array A multidimensional array.

2 calls to advagg_mod_get_lists()
advagg_mod_js_async_defer dans advagg_mod/advagg_mod.module
Add the defer and or the async tag to js.
advagg_mod_sort_css_js dans advagg_mod/advagg_mod.module
Rearrange CSS/JS so that aggregates are better grouped.

Fichier

advagg_mod/advagg_mod.module, line 197

Code

function advagg_mod_get_lists() {
    $lists =& drupal_static(__FUNCTION__);
    if (!isset($lists)) {
        // Do not defer/async list.
        $no_async_defer_list = [
            // Wistia js.
'//fast.wistia.',
            // Maps.
'//maps.googleapis.com',
            '//dev.virtualearth.net',
            '//api.maps.yahoo.com',
        ];
        $no_move = [
            '//cdn.rawgit.com/stubbornella/csslint/master/release/csslint.js',
        ];
        // Allow other modules to add/edit the above lists.
        // Call hook_advagg_mod_get_lists_alter().
        $lists = [
            $no_async_defer_list,
            $no_move,
        ];
        \Drupal::moduleHandler()->alter('advagg_mod_get_lists', $lists);
    }
    return $lists;
}