Commit 3716c871 authored by Nicolò Caruso's avatar Nicolò Caruso

First commit

parents
name: Fullcalendar library
type: module
description: Fullcalendar library
core: 8.x
package: Fullcalendar
\ No newline at end of file
fullcalendar:
version: VERSION
js:
/libraries/fullcalendar/lib/moment.min.js: { minified: true }
/libraries/fullcalendar/fullcalendar.min.js: { minified: true }
/libraries/fullcalendar/locale-all.js: { minified: true }
dependencies:
- core/jquery
css:
theme:
/libraries/fullcalendar/fullcalendar.min.css: { minified: true }
fullcalendar-scheduler:
version: VERSION
js:
/libraries/fullcalendar-scheduler/scheduler.min.js: { minified: true }
dependencies:
- fullcalendar_library/fullcalendar
css:
theme:
/libraries/fullcalendar-scheduler/scheduler.min.css: { minified: true }
<?php
define('FULLCALENDAR_JS_CDN', 'https://cdn.jsdelivr.net/npm/fullcalendar@3.8.0/dist/fullcalendar.min.js');
define('FULLCALENDAR_LOCALE_JS_CDN', 'https://cdn.jsdelivr.net/npm/fullcalendar@3.8.0/dist/locale-all.js');
define('FULLCALENDAR_CSS_CDN', 'https://cdn.jsdelivr.net/npm/fullcalendar@3.8.0/dist/fullcalendar.min.css');
define('FULLCALENDAR_SCHEDULER_JS_CDN', 'https://cdn.jsdelivr.net/npm/fullcalendar-scheduler@1.9.1/dist/scheduler.min.js');
define('FULLCALENDAR_SCHEDULER_CSS_CDN', 'https://cdn.jsdelivr.net/npm/fullcalendar-scheduler@1.9.1/dist/scheduler.min.css');
define('MOMENT_JS_CDN', 'https://cdn.jsdelivr.net/npm/moment@2.20.1/moment.min.js');
/**
* Implements hook_library_info_alter().
*/
function fullcalendar_library_library_info_alter(&$libraries, $extension) {
if ($extension == 'fullcalendar_library') {
if (!file_exists(DRUPAL_ROOT . '/libraries/fullcalendar/lib/moment.min.js')) {
unset($libraries['fullcalendar']['js']['/libraries/fullcalendar/lib/moment.min.js']);
$libraries['fullcalendar']['js'][MOMENT_JS_CDN] = ['type' => 'external', 'minified' => TRUE];
}
if (!file_exists(DRUPAL_ROOT . '/libraries/fullcalendar/fullcalendar.min.js')) {
unset($libraries['fullcalendar']['js']['/libraries/fullcalendar/fullcalendar.min.js']);
$libraries['fullcalendar']['js'][FULLCALENDAR_JS_CDN] = ['type' => 'external', 'minified' => TRUE];
}
if (!file_exists(DRUPAL_ROOT . '/libraries/fullcalendar/locale-all.js')) {
unset($libraries['fullcalendar']['js']['/libraries/fullcalendar/locale-all.js']);
$libraries['fullcalendar']['js'][FULLCALENDAR_LOCALE_JS_CDN] = ['type' => 'external', 'minified' => TRUE];
}
if (!file_exists(DRUPAL_ROOT . '/libraries/fullcalendar/fullcalendar.min.css')) {
unset($libraries['fullcalendar']['css']['theme']['/libraries/fullcalendar/fullcalendar.min.css']);
$libraries['fullcalendar']['css']['theme'][FULLCALENDAR_CSS_CDN] = ['type' => 'external', 'minified' => TRUE];
}
if (!file_exists(DRUPAL_ROOT . '/libraries/fullcalendar-scheduler/scheduler.min.js')) {
unset($libraries['fullcalendar-scheduler']['js']['/libraries/fullcalendar-scheduler/scheduler.min.js']);
$libraries['fullcalendar-scheduler']['js'][FULLCALENDAR_SCHEDULER_JS_CDN] = ['type' => 'external', 'minified' => TRUE];
}
if (!file_exists(DRUPAL_ROOT . '/libraries/fullcalendar-scheduler/scheduler.min.css')) {
unset($libraries['fullcalendar-scheduler']['css']['theme']['/libraries/fullcalendar-scheduler/scheduler.min.css']);
$libraries['fullcalendar-scheduler']['css']['theme'][FULLCALENDAR_SCHEDULER_CSS_CDN] = ['type' => 'external', 'minified' => TRUE];
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment