summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Stein2011-01-19 15:33:22 (GMT)
committerJoel Stein2011-01-19 15:33:22 (GMT)
commit8eb61361d7aeb93fc5605b0132aa9055d8ab952c (patch)
tree226bff65339856d470e2af0f7778c48857966202
parent24d56be0d4fa94a0e8917044ab673565b5f3cb02 (diff)
Skipped resolving imports and paths for JS files; only CSS files need it.6.x-1.4
-rwxr-xr-xskin.module7
1 files changed, 4 insertions, 3 deletions
diff --git a/skin.module b/skin.module
index aaaf829..ca065b2 100755
--- a/skin.module
+++ b/skin.module
@@ -83,11 +83,12 @@ function _skin_replace_callback($matches) {
$skin_path = file_create_path('skin') . (!$optimized ? '/'. dirname($filepath_minus_query) : '');
if (file_check_directory($skin_path, FILE_CREATE_DIRECTORY) or mkdir($skin_path, 0755, TRUE)) {
$filename = $skin_path .'/'. $info['filename'] .'.'. $info['extension'];
- // Optimized files have already resolved imports and prefixed paths.
- if ($optimized) {
+ // Optimized CSS files have resolved imports and prefixed paths.
+ // Un-optimized JS files don't need to be resolved.
+ if ($optimized or $info['extension'] == 'js') {
$contents = file_get_contents($filepath_minus_query);
}
- // Unoptimized files need to resolve imports and prefix paths.
+ // Unoptimized CSS files need to resolve imports and prefix paths.
// See drupal_build_css_cache().
else {
$contents = drupal_load_stylesheet($filepath_minus_query);