1. JS/CSS 파일 제거 문법 추가

: Context.class.php에 unloadCSSFile, unloadJsFile 추가 (파일명과 옵션이 일치해야 제거됨)
: templateHandler에 <!--%unload(..)--> 추가
2. optmized된 JS/CSS 통합 파일을 제일 먼저 불러오도록 순서 변경


git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4580 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-10-01 07:25:31 +00:00
parent 2f44b9c980
commit 81ac933a7a
3 changed files with 97 additions and 4 deletions

View file

@ -46,10 +46,12 @@
// 캐시 디렉토리가 없으면 실행하지 않음
if(!is_dir($this->cache_path)) return $this->_getOptimizedRemoved($source_files);
$files = array();
if(!count($source_files)) return;
foreach($source_files as $file) {
if(!$file || !$file['file']) continue;
if(empty($file['optimized']) || preg_match('/^https?:\/\//i', $file['file']) || $file['file'] == './common/css/button.css') $files[] = $file;
if(empty($file['optimized']) || preg_match('/^https?:\/\//i', $file['file']) ) $files[] = $file;
else $targets[] = $file;
}
@ -62,7 +64,7 @@
$this->doOptimizedFile($path, $filename, $targets, $type);
$files[] = array('file' => $path.'/'.$filename, 'media' => 'all');
array_unshift($files, array('file' => $path.'/'.$filename, 'media' => 'all'));
return $this->_getOptimizedRemoved($files);
}