From 13b256cdf8e3cef810d1b3dcf580be751b94c9fe Mon Sep 17 00:00:00 2001 From: wei <> Date: Tue, 29 Aug 2006 11:12:33 +0000 Subject: Add separate debug javascript build. --- framework/Web/UI/TClientScriptManager.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'framework/Web/UI') diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index 54bf2aa4..5546ed3f 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -121,7 +121,7 @@ class TClientScriptManager extends TApplicationComponent $this->_registeredPradoScripts[$name]=true; if(!isset(self::$_pradoScripts[$name])) throw new TInvalidOperationException('csmanager_pradoscript_invalid',$name); - $basePath=Prado::getFrameworkPath().'/'.self::SCRIPT_PATH; + $basePath=$this->getPradoBaseScriptPath(); foreach(self::$_pradoScripts[$name] as $script) { if(!isset($this->_registeredPradoFiles[$script])) @@ -133,6 +133,15 @@ class TClientScriptManager extends TApplicationComponent } } + protected function getPradoBaseScriptPath() + { + $basePath = Prado::getFrameworkPath().'/'.self::SCRIPT_PATH; + if($this->getApplication()->getMode()===TApplication::STATE_DEBUG) + return $basePath.'/debug'; + else + return $basePath.'/compressed'; + } + protected function renderPradoScripts($writer) { $files=''; @@ -146,7 +155,7 @@ class TClientScriptManager extends TApplicationComponent } if($files!=='') { - $basePath=Prado::getFrameworkPath().'/'.self::SCRIPT_PATH; + $basePath=$this->getPradoBaseScriptPath(); $scriptLoader=$basePath.'/'.self::SCRIPT_LOADER; $url=$this->publishFilePath($scriptLoader).'?js='.trim($files,','); if($this->getApplication()->getMode()===TApplication::STATE_DEBUG) -- cgit v1.2.3