You are here

function advagg_preload_list in Advanced CSS/JS Aggregation 7.2

Generate a list of file types for the as field given the extension.

Return value

array Returns an array of arrays.

1 call to advagg_preload_list()
advagg_get_preload_info_from_url in ./advagg.module
Given a link get the as, type, and crossorigin attributes.

File

./advagg.module, line 6711
Advanced CSS/JS aggregation module.

Code

function advagg_preload_list() {
  $list = array(
    'font' => array(
      'woff2',
      'woff',
      'ttf',
      'otf',
      'eot',
      // Need to check if the svg file is in a font folder.
      'svg',
    ),
    'image' => array(
      'gif',
      'jpg',
      'jpeg',
      'jpe',
      'jif',
      'jfif',
      'jfi',
      'png',
      'webp',
      'jp2',
      'jpx',
      'jxr',
      'heif',
      'heic',
      'bpg',
      'svg',
    ),
    'style' => array(
      'css',
    ),
    'script' => array(
      'js',
    ),
    'video' => array(
      'mp4',
      'webm',
      'ogg',
    ),
  );

  // Call hook_advagg_preload_list_alter()
  drupal_alter('advagg_preload_list', $list);
  return $list;
}