You are here

function views_timelinejs_library_info_build in Views TimelineJS integration 8.3

Implements hook_library_info_build().

File

./views_timelinejs.module, line 15
Views TimelineJS API, theming, libraries, etc.

Code

function views_timelinejs_library_info_build() {
  $libraries = [];

  // Create a library for each TimelineJS3 alternate font set.
  foreach (array_keys(_views_timelinejs_list_font_sets()) as $set) {
    $libraries['timelinejs.' . $set . '.cdn'] = [
      'remote' => 'https://github.com/NUKnightLab/TimelineJS3',
      'version' => '3.3.15',
      'license' => [
        'name' => 'MPL',
        'url' => 'https://github.com/NUKnightLab/TimelineJS3/blob/master/LICENSE',
        'gpl-compatible' => FALSE,
      ],
      'css' => [
        'component' => [
          'https://cdn.knightlab.com/libs/timeline3/latest/css/fonts/font.' . $set . '.css' => [
            'type' => 'external',
          ],
        ],
      ],
    ];
    $libraries['timelinejs.' . $set . '.local'] = [
      'remote' => 'https://github.com/NUKnightLab/TimelineJS3',
      'version' => '3.3.15',
      'license' => [
        'name' => 'MPL',
        'url' => 'https://github.com/NUKnightLab/TimelineJS3/blob/master/LICENSE',
        'gpl-compatible' => FALSE,
      ],
      'css' => [
        'component' => [
          '/libraries/TimelineJS3/compiled/css/fonts/font.' . $set . '.css' => [],
        ],
      ],
    ];
  }
  return $libraries;
}