New version 6.x-1.11 for Advanced CSS/JS Aggregation module

This commit is contained in:
Manuel Cillero 2017-08-05 00:43:16 +02:00
parent e72db62736
commit 329321644a
17 changed files with 734 additions and 414 deletions

View file

@ -4,9 +4,9 @@ package = Advanced CSS/JS Aggregation
core = 6.x
dependencies[] = advagg
; Information added by drupal.org packaging script on 2012-06-25
version = "6.x-1.9"
; Information added by Drupal.org packaging script on 2017-03-18
version = "6.x-1.11"
core = "6.x"
project = "advagg"
datestamp = "1340665277"
datestamp = "1489800488"

View file

@ -47,7 +47,7 @@ function advagg_js_cdn_advagg_js_pre_alter(&$javascript, $preprocess_js, $public
if (empty($jquery_update_version)) {
$jquery_update_version = variable_get('advagg_js_cdn_jquery_update_version', jquery_update_get_version());
}
$jquery_update_filepath = drupal_get_path('module', 'jquery_update');
$jquery_update_filepath = advagg_js_cdn_get_jquery_path();
}
if (module_exists('jquery_ui')) {
// jquery_ui_get_version hits disk and doesn't get cached.
@ -81,7 +81,11 @@ function advagg_js_cdn_advagg_js_pre_alter(&$javascript, $preprocess_js, $public
foreach ($data as $path => $info) {
// jquery.js
if ($cdn_jquery) {
if (isset($jquery_update_filepath) && ($path == $jquery_update_filepath . '/replace/jquery.min.js' || $path == $jquery_filepath . '/replace/jquery.js')) {
if ( isset($jquery_update_filepath)
&& ( $path == $jquery_update_filepath . '/jquery.min.js'
|| $path == $jquery_update_filepath . '/jquery.js'
)
) {
$info['preprocess'] = FALSE;
$javascript['external'][$schema . '://ajax.googleapis.com/ajax/libs/jquery/' . $jquery_update_version . '/jquery.min.js'] = $info;
unset($javascript[$type][$path]);
@ -144,3 +148,19 @@ function advagg_js_cdn_get_jquery_ui_path() {
return $jquery_ui_path;
}
/**
* Get the path for the jquery.js file.
*
* @return
* path to jquery.js file.
*/
function advagg_js_cdn_get_jquery_path() {
if (function_exists('jquery_update_jquery_path')) {
return dirname(jquery_update_jquery_path());
}
else {
$jquery_update_filepath = drupal_get_path('module', 'jquery_update');
return $jquery_update_filepath . '/replace/';
}
}