mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-30 15:52:17 +09:00
1. jQuery뿐 아니라 여러 javascript 의 플러그인 사용을 위해 template handler에 <!--%load_js_plugin("이름")--> 기능 추가 ( ./common/js/plugins/이름/plugin.load 파일에 기재된 js/css, 또는 lang을 import 함)
2. 1번에 의해 ui.datepicker, ui.tree를 플러그인으로 빼서 적용 3. jquery의 버전별 이름이 생길 문제를 대비하여 jquery.js로 파일 이름 변경 4. js/css파일들은 크기보다 그 개수가 적어야 함으로 jquery-1.2.6.fix.js를 common.js 파일로 통합 git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5083 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
d2d9b2c3a2
commit
5d549bffd7
57 changed files with 149 additions and 366 deletions
|
|
@ -135,8 +135,7 @@
|
|||
else $this->allow_rewrite = false;
|
||||
|
||||
// 기본 JS/CSS 등록
|
||||
$this->addJsFile("./common/js/jquery-1.2.6.js");
|
||||
$this->addJsFile("./common/js/jquery-1.2.6.fix.js"); // jQuery 1.2.6 bug fix
|
||||
$this->addJsFile("./common/js/jquery.js");
|
||||
$this->addJsFile("./common/js/x.js");
|
||||
$this->addJsFile("./common/js/common.js");
|
||||
$this->addJsFile("./common/js/xml_handler.js");
|
||||
|
|
@ -1054,6 +1053,33 @@
|
|||
return $oOptimizer->getOptimizedFiles($this->_getUniqueFileList($this->css_files), "css");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief javascript plugin load
|
||||
**/
|
||||
function loadJavascriptPlugin($plugin_name) {
|
||||
$oContext = &Context::getInstance();
|
||||
return $oContext->_loadJavascriptPlugin($plugin_name);
|
||||
}
|
||||
|
||||
function _loadJavascriptPlugin($plugin_name) {
|
||||
$plugin_path = './common/js/plugins/'.$plugin_name.'/';
|
||||
if(!is_dir($plugin_path)) return;
|
||||
|
||||
$info_file = $plugin_path.'plugin.load';
|
||||
if(!file_exists($info_file)) return;
|
||||
|
||||
$list = file($info_file);
|
||||
for($i=0,$cnt=count($list);$i<$cnt;$i++) {
|
||||
$filename = trim($list[$i]);
|
||||
if(!$filename) continue;
|
||||
if(substr($filename,0,2)=='./') $filename = substr($filename,2);
|
||||
if(preg_match('/\.js$/i',$filename)) $this->_addJsFile($plugin_path.$filename, false, '');
|
||||
elseif(preg_match('/\.css$/i',$filename)) $this->_addCSSFile($plugin_path.$filename, false, 'all','');
|
||||
}
|
||||
|
||||
if(is_dir($plugin_path.'lang')) $this->_loadLang($plugin_path.'lang');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief HtmlHeader 추가
|
||||
**/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue