Skip to content

Instantly share code, notes, and snippets.

@cyberlex404
Last active April 21, 2016 13:21
Show Gist options
  • Save cyberlex404/f1aaafc5c9f04e8f79364f81231d17a1 to your computer and use it in GitHub Desktop.
Save cyberlex404/f1aaafc5c9f04e8f79364f81231d17a1 to your computer and use it in GitHub Desktop.
function akselslider_libraries_info() {
return array(
'swiper' => array(
'name' => 'swiper',
'library path' => drupal_get_path('module', 'akselslider'),
// 'version callback' => , // Set a callback here to get the version in use.
'version arguments' => array(),
'variants' => array(),
'cdn' => array(
'aliases' => array('swiper',),
'limit' => 3,
'options' => array(
'weight' => -2,
'group' => 'swiper',
),
'download' => array(
'versions' => array('3.3.1'),
'plugins' => array(
'cdnjs' => array('latest'),
'*' => array('latest')
)
),
'request' => array(
'timeout' => 5,
),
)
)
);
}
function swiper_libraries_info() {
$swiper_url = SWIPER_CDN . '3.3.1';
$libraries['swiper'] = array(
'name' => 'Swiper library',
'vendor url' => 'http://idangero.us/swiper/',
'download url' => 'http://idangero.us/swiper/',
'library path' => $swiper_url,
'version' => '3.3.1',
/*'version arguments' => array(
'file' => 'readme.txt',
// Best practice: Document the actual version strings for later reference.
// 1.x: Version 1.0
'pattern' => '/Version (\d+)/',
'lines' => 5,
),*/
'files' => array(
// 'js' and 'css' follow the syntax of hook_library(), but file paths are
// relative to the library path.
'js' => array(
$swiper_url . SWIPER_JS_MIN => array(
'type' => 'external',
'group' => JS_LIBRARY,
),
),
'css' => array(
$swiper_url . SWIPER_CSS_MIN,
),
),
'variants' => array(
// All properties defined for 'minified' override top-level properties.
'minified' => array(
'files' => array(
'js' => array(
$swiper_url . SWIPER_JS_MIN => array(
'type' => 'external',
'group' => JS_LIBRARY,
),
),
'css' => array(
$swiper_url . SWIPER_CSS_MIN,
),
),
),
'source' => array(
'files'=> array(
'js' => array(
$swiper_url . SWIPER_JS => array(
'type' => 'external',
'group' => JS_LIBRARY,
),
),
'css' => array(
$swiper_url . SWIPER_CSS,
),
),
),
),
);
return $libraries;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment