Permalink
Browse files

Merge branch 'w51_MDL-30659_m21_yuidebug' of git://github.com/skodak/…

…moodle into MOODLE_21_STABLE
  • Loading branch information...
2 parents 16a6377 + 6778f4b commit dfda3efcc88c854e4c57973c2006d6117e7fb912 Sam Hemelryk committed Dec 12, 2011
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/outputrequirementslib.php
@@ -160,7 +160,7 @@ public function __construct() {
$this->M_yui_loader->base = $this->yui3loader->base;
$this->M_yui_loader->comboBase = $this->yui3loader->comboBase;
$this->M_yui_loader->combine = $this->yui3loader->combine;
- $this->M_yui_loader->filter = ($this->yui3loader->filter == YUI_DEBUG) ? 'debug' : '';
+ $this->M_yui_loader->filter = (string)$this->yui3loader->filter;
$this->M_yui_loader->insertBefore = 'firstthemesheet';
$this->M_yui_loader->modules = array();
$this->M_yui_loader->groups = array(
@@ -977,10 +977,14 @@ protected function get_yui3lib_headcode() {
$code .= '<link rel="stylesheet" type="text/css" href="'.$this->yui3loader->base.'cssbase/base-min.css" />';
}
- if (debugging('', DEBUG_DEVELOPER)) {
- $code .= '<script type="text/javascript" src="'.$this->yui3loader->base.'yui/yui-debug.js"></script>';
- } else {
- $code .= '<script type="text/javascript" src="'.$this->yui3loader->base.'yui/yui-min.js"></script>';
+ $code .= '<script type="text/javascript" src="'.$this->yui3loader->base.'yui/yui-min.js"></script>';
+
+ if ($this->yui3loader->filter === YUI_RAW) {
+ $code = str_replace('-min.css', '.css', $code);
+ $code = str_replace('-min.js', '.js', $code);
+ } else if ($this->yui3loader->filter === YUI_DEBUG) {
+ $code = str_replace('-min.css', '.css', $code);
+ $code = str_replace('-min.js', '-debug.js', $code);
}
return $code;

0 comments on commit dfda3ef

Please sign in to comment.