Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-38667 JavaScript: Correct loading of Shifted CSS

  • Loading branch information...
commit f0e79573cf2dd155b219604af0d2e6f9d9e4f2a8 1 parent 373a8e0
@andrewnicols andrewnicols authored
Showing with 12 additions and 7 deletions.
  1. +12 −7 theme/yui_combo.php
View
19 theme/yui_combo.php
@@ -103,18 +103,23 @@
$filename = array_pop($bits);
$modulename = $bits[0];
$dir = get_component_directory($frankenstyle);
- if ($mimetype == 'text/css') {
- $bits[] = 'assets';
- $bits[] = 'skins';
- $bits[] = 'sam';
- }
// For shifted YUI modules, we need the YUI module name in frankenstyle format.
$frankenstylemodulename = join('-', array($version, $frankenstyle, $modulename));
+ $frankenstylefilename = preg_replace('/' . $modulename . '/', $frankenstylemodulename, $filename);
// By default, try and use the /yui/build directory.
- $frankenstylefilename = preg_replace('/' . $modulename . '/', $frankenstylemodulename, $filename);
- $contentfile = $dir . '/yui/build/' . $frankenstylemodulename . '/' . $frankenstylefilename;
+ if ($mimetype == 'text/css') {
+ // CSS assets are in a slightly different place to the JS.
+ $contentfile = $dir . '/yui/build/' . $frankenstylemodulename . '/assets/skins/sam/' . $frankenstylefilename;
+
+ // Add the path to the bits to handle fallback for non-shifted assets.
+ $bits[] = 'assets';
+ $bits[] = 'skins';
+ $bits[] = 'sam';
+ } else {
+ $contentfile = $dir . '/yui/build/' . $frankenstylemodulename . '/' . $frankenstylefilename;
+ }
// If the shifted versions don't exist, fall back to the non-shifted file.
if (!file_exists($contentfile) or !is_file($contentfile)) {
Please sign in to comment.
Something went wrong with that request. Please try again.