merge sandbox to trunk for 1.4.3.1

git-svn-id: http://xe-core.googlecode.com/svn/trunk@7659 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2010-08-25 06:19:21 +00:00
parent 289973781a
commit 200d63636c
195 changed files with 8166 additions and 3576 deletions

View file

@ -13,7 +13,8 @@
// called_position가 after_module_proc일때 rsd 태그 삽입
if($called_position == 'after_module_proc') {
// 현재 모듈의 rsd주소를 만듬
$rsd_url = sprintf('%s%s/api', Context::getRequestUri(), $this->mid);
$site_module_info = Context::get('site_module_info');
$rsd_url = getFullSiteUrl($site_module_info->domain, '', 'mid',$site_module_info->mid, 'act','api');
// 헤더에 rsd태그 삽입
Context::addHtmlHeader(" ".'<link rel="EditURI" type="application/rsd+xml" title="RSD" href="'.$rsd_url.'" />');
@ -34,6 +35,11 @@
$params = $xmlDoc->methodcall->params->param;
if($params && !is_array($params)) $params = array($params);
// 일부 methodname에 대한 호환
if(in_array($method_name, array('metaWeblog.deletePost', 'metaWeblog.getUsersBlogs', 'metaWeblog.getUserInfo'))) {
$method_name = str_replace('metaWeblog.', 'blogger.', $method_name);
}
// blogger.deletePost일 경우 첫번째 인자 값 삭제
if($method_name == 'blogger.deletePost') array_shift($params);
@ -440,7 +446,8 @@
default :
$homepagelink = getUrl('','mid',$this->mid);
$api_url = sprintf('%s%s/api', Context::getRequestUri(), $this->mid);
$site_module_info = Context::get('site_module_info');
$api_url = getFullSiteUrl($site_module_info->domain, '', 'mid',$site_module_info->mid, 'act','api');
$content = <<<RSDContent
<?xml version="1.0" ?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd" >

BIN
addons/captcha/audio/F_A.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_B.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_C.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_D.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_E.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_F.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_G.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_H.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_I.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_J.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_K.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_L.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_M.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_N.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_O.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_P.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_Q.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_R.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_S.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_T.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_U.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_V.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_W.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_X.mp3 Executable file

Binary file not shown.

BIN
addons/captcha/audio/F_Y.mp3 Executable file

Binary file not shown.

View file

@ -3,41 +3,68 @@
/**
* @file captcha.addon.php
* @author zero (zero@nzeo.com)
* @brief 특정 action을 실행할때 captcah를 띄우도록
* @author zero (zero@nzeo.com), sol(ngleader@gmail.com)
* @brief 특정 action을 실행할때 captcha를 띄우도록
* 영어 알파벳을 입력, 음성기능 추가
**/
// before_module_proc 일 경우 && act_type != everytime 이면 세션 초기화
if($called_position == "before_module_proc" && $addon_info->act_type == 'everytime' && $_SESSION['captcha_authed']) {
unset($_SESSION['captcha_authed']);
if(!class_exists('AddonCaptcha'))
{
class AddonCaptcha
{
var $addon_info;
// before_module_init 일때에 captcha 동작
} else if($called_position == 'before_module_init') {
function setInfo(&$addon_info)
{
$this->addon_info = $addon_info;
}
$logged_info = Context::get('logged_info');
if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) return;
if($addon_info->target != 'all' && Context::get('is_logged')) return;
function before_module_proc()
{
if($this->addon_info->act_type == 'everytime' && $_SESSION['captcha_authed']) {
unset($_SESSION['captcha_authed']);
}
}
$target_acts = array('procBoardInsertDocument','procBoardInsertComment','procIssuetrackerInsertIssue','procIssuetrackerInsertHistory','procTextyleInsertComment');
if($addon_info->apply_find_account=='apply') $target_acts[] = 'procMemberFindAccount';
if($addon_info->apply_resend_auth_mail=='apply') $target_acts[] = 'procMemberResendAuthMail';
if($addon_info->apply_signup=='apply') $target_acts[] = 'procMemberInsert';
function before_module_init(&$ModuleHandler)
{
$logged_info = Context::get('logged_info');
if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) return false;
if($this->addon_info->target != 'all' && Context::get('is_logged')) return false;
Context::addHtmlHeader('<script type="text/javascript"> var captchaTargetAct = new Array("'.implode('","',$target_acts).'"); </script>');
$target_acts = array('procBoardInsertDocument','procBoardInsertComment','procIssuetrackerInsertIssue','procIssuetrackerInsertHistory','procTextyleInsertComment');
if($this->addon_info->apply_find_account=='apply') $target_acts[] = 'procMemberFindAccount';
if($this->addon_info->apply_resend_auth_mail=='apply') $target_acts[] = 'procMemberResendAuthMail';
if($this->addon_info->apply_signup=='apply') $target_acts[] = 'procMemberInsert';
// 캡챠 인증이 되지 않은 세션이면 실행 시작
if(!$_SESSION['captcha_authed']) {
if(Context::getRequestMethod()!='XMLRPC' && Context::getRequestMethod()!=='JSON')
{
Context::addHtmlHeader('<script type="text/javascript"> var captchaTargetAct = new Array("'.implode('","',$target_acts).'"); </script>');
Context::addJsFile('./addons/captcha/captcha.js',false);
}
// 언어파일 로드
Context::loadLang(_XE_PATH_.'addons/captcha/lang');
// 게시판/ 이슈트래커의 글쓰기/댓글쓰기 액션 호출시 세션 비교
if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $target_acts)) {
Context::loadLang('./addons/captcha/lang');
$ModuleHandler->error = "captcha_denied";
}
return true;
}
function before_module_init_setCaptchaSession()
{
if($_SESSION['captcha_authed']) return false;
// 언어파일 로드
Context::loadLang(_XE_PATH_.'addons/captcha/lang');
// 키워드 생성
$arr = range('A','Y');
shuffle($arr);
$arr = array_slice($arr,0,6);
$_SESSION['captcha_keyword'] = join('', $arr);
// 캡챠 세션 세팅
if(Context::get('captcha_action')=='setCaptchaSession') {
$f = FileHandler::readDir('./addons/captcha/icon');
shuffle($f);
$key = rand(0,count($f)-1);
$keyword = str_replace('.gif','',$f[$key]);
$_SESSION['captcha_keyword'] = $keyword;
$target = Context::getLang('target_captcha');
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
@ -45,50 +72,161 @@
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
printf("<response>\r\n<error>0</error>\r\n<message>success</message>\r\n<about><![CDATA[%s]]></about>\r\n<keyword><![CDATA[%s]]></keyword>\r\n</response>",Context::getLang('about_captcha'),$target[$keyword]);
printf("<response>\r\n <error>0</error>\r\n <message>success</message>\r\n <about_captcha><![CDATA[%s]]></about_captcha>\r\n <captcha_reload><![CDATA[%s]]></captcha_reload>\r\n <captcha_play><![CDATA[%s]]></captcha_play>\r\n <cmd_input><![CDATA[%s]]></cmd_input>\r\n <cmd_cancel><![CDATA[%s]]></cmd_cancel>\r\n </response>"
,Context::getLang('about_captcha')
,Context::getLang('captcha_reload')
,Context::getLang('captcha_play')
,Context::getLang('cmd_input')
,Context::getLang('cmd_cancel')
);
Context::close();
exit();
}
// 캡챠 이미지 출력
} else if(Context::get('captcha_action')=='captchaImage') {
$f = FileHandler::readDir('./addons/captcha/icon');
shuffle($f);
$keyword = $_SESSION['captcha_keyword'];
for($key=0,$c=count($f);$key<$c;$key++) {
if($keyword.".gif" == $f[$key]) break;
}
function before_module_init_captchaImage()
{
if($_SESSION['captcha_authed']) return false;
// 이미지 만들기
$thumb = imagecreatetruecolor(250,100);
for($i=0,$c=count($f);$i<$c;$i++) {
$x = ($i%5)*50;
$y = $i>4?0:50;
imagedestroy($dummy);
$dummy = imagecreatefromgif('./addons/captcha/icon/'.$f[$i]);
imagecopyresampled($thumb, $dummy, $x, $y, 0, 0, 50, 50, 50, 50);
$keyword = $_SESSION['captcha_keyword'];
$im = $this->createCaptchaImage($keyword);
if($i==$key) {
$_SESSION['captcha_x'] = $x;
$_SESSION['captcha_y'] = $y;
}
}
imagedestroy($dummy);
header("Cache-Control: ");
header("Pragma: ");
header("Content-Type: image/png");
imagepng($thumb, null,9);
imagedestroy($thumb);
Context::close();
imagepng($im);
imagedestroy($im);
Context::close();
exit();
}
// 캡챠 이미지 점검
} else if(Context::get('captcha_action')=='captchaCompare') {
$x = Context::get('mx');
$y = Context::get('my');
$sx = $_SESSION['captcha_x'];
$sy = $_SESSION['captcha_y'];
function createCaptchaImage($string)
{
$arr = array();
for($i=0,$c=strlen($string);$i<$c;$i++) $arr[] = $string{$i};
if($x>=$sx && $x<=$sx+50 && $y>=$sy && $y<=$sy+50) $_SESSION['captcha_authed'] = true;
// 글자 하나 사이즈
$w = 18;
$h = 25;
// 글자 수
$c = count($arr);
// 글자 이미지
$im = array();
// 총사이즈로 바탕 이미지 생성
$im[] = imagecreate(($w+2)*count($arr), $h);
$deg = range(-30,30);
shuffle($deg);
// 글자별 이미지 생성
foreach($arr as $i => $str)
{
$im[$i+1] = @imagecreate($w, $h);
$background_color = imagecolorallocate($im[$i+1], 255, 255, 255);
$text_color = imagecolorallocate($im[$i+1], 0, 0, 0);
// 글자폰트(사이즈) 조절
$ran = range(1,20);
shuffle($ran);
if(function_exists('imagerotate'))
{
imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%8), $str, $text_color);
$im[$i+1] = imagerotate($im[$i+1], array_pop($deg), 0);
$background_color = imagecolorallocate($im[$i+1], 255, 255, 255);
imagecolortransparent($im[$i+1], $background_color);
}
else
{
imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%4), $str, $text_color);
}
}
// 각글자 이미지를 합침
for($i=1;$i<count($im);$i++)
{
imagecopy($im[0],$im[$i],(($w+2)*($i-1)),0,0,0,$w,$h);
imagedestroy($im[$i]);
}
// 이미지 확대
$big_count = 2;
$big = imagecreatetruecolor(($w+2)*$big_count*$c, $h*$big_count);
imagecopyresized($big, $im[0], 0, 0, 0, 0, ($w+2)*$big_count*$c, $h*$big_count, ($w+2)*$c, $h);
imagedestroy($im[0]);
if(function_exists('imageantialias')) imageantialias($big,true);
// 배경 라인 및 점찍기
$line_color = imagecolorallocate($big, 0, 0, 0);
$w = ($w+2)*$big_count*$c;
$h = $h*$big_count;
$d = array_pop($deg);
for($i=-abs($d);$i<$h+abs($d);$i=$i+7) imageline($big,0,$i+$d,$w,$i,$line_color);
$x = range(0,($w-10));
shuffle($x);
for($i=0;$i<200;$i++) imagesetpixel($big,$x[$i]%$w,$x[$i+1]%$h,$line_color);
return $big;
}
function before_module_init_captchaAudio()
{
if($_SESSION['captcha_authed']) return false;
$keyword = strtoupper($_SESSION['captcha_keyword']);
$data = $this->createCaptchaAudio($keyword);
header('Content-type: audio/mpeg');
header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\"");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Expires: Sun, 1 Jan 2000 12:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Content-Length: ' . strlen($data));
echo $data;
Context::close();
exit();
}
function createCaptchaAudio($string)
{
$data = '';
$_audio = './addons/captcha/audio/F_%s.mp3';
for($i=0,$c=strlen($string);$i<$c;$i++)
{
$_data = FileHandler::readFile(sprintf($_audio, $string{$i}));
$start = rand(5, 68); // 해더 4바이트, 데이터 영역 64바이트 정도 랜덤하게 시작
$datalen = strlen($_data) - $start - 256; // 마지막 unchanged 256 바이트
for($j=$start;$j<$datalen;$j+=64)
{
$ch = ord($_data{$j});
if($ch<9 || $ch>119) continue;
$_data{$j} = chr($ch+rand(-8,8));
}
$data .= $_data;
}
return $data;
}
function before_module_init_captchaCompare()
{
if($_SESSION['captcha_authed']) return false;
if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text'))) $_SESSION['captcha_authed'] = true;
else $_SESSION['captcha_authed'] = false;
header("Content-Type: text/xml; charset=UTF-8");
@ -100,15 +238,25 @@
print("<response>\r\n<error>0</error>\r\n<message>success</message>\r\n</response>");
Context::close();
exit();
}
Context::addJsFile('./addons/captcha/captcha.min.js',false);
}
}
$GLOBALS['__AddonCaptcha__'] = new AddonCaptcha;
$GLOBALS['__AddonCaptcha__']->setInfo($addon_info);
}
$oAddonCaptcha = &$GLOBALS['__AddonCaptcha__'];
if(method_exists(&$oAddonCaptcha, $called_position))
{
if(!call_user_func(array(&$oAddonCaptcha, $called_position), &$this)) return false;
}
$addon_act = Context::get('captcha_action');
if($addon_act && method_exists(&$oAddonCaptcha, $called_position.'_'.$addon_act))
{
if(!call_user_func(array(&$oAddonCaptcha, $called_position.'_'.$addon_act), &$this)) return false;
}
// 게시판/ 이슈트래커의 글쓰기/댓글쓰기 액션 호출시 세션 비교
if(in_array(Context::get('act'), $target_acts)) {
$this->error = "msg_not_permitted";
}
}
}
?>

View file

@ -11,103 +11,111 @@ var calledArgs = null;
function xeCaptcha() {
var body = $(document.body);
var captchaIma;
if (!captchaXE) {
captchaXE = $("<div>")
.attr("id","captcha_screen")
.css({
position:"absolute",
display:"none",
backgroundColor:"#111",
backgroundRepeat:"repeat",
backgroundPosition:"0 0",
zIndex:500
});
$('<div id="captchaBox" style="display:none;*zoom:1;overflow:hidden;height:200px;">'+
'<img src="about:blank" id="captcha_image" />'+
'<p style="color:#666;width:250px;padding:0;margin:10px 0 20px 0; " id="captchaAbout">&nbsp;</p>'+
'<p style="color:#DDD;width:250px;font-size:15px;padding:0; margin:0 0 10px; font-weight:bold; text-align:center;" id="captchaText">&nbsp;</p>'+
'</div>').appendTo(captchaXE);
body.append(captchaXE);
if (!captchaXE) {
var fc_isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var fc_isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var fc_isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var _swfURL_ = request_uri + 'addons/captcha/swf/play.swf';
if(fc_isIE && fc_isWin && !fc_isOpera){
_object_ ='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="captcha_audio" align="middle">';
_object_ += '<param name="allowScriptAccess" value="always" />';
_object_ += '<param name="quality" value="high" />';
_object_ += '<param name="movie" value="'+_swfURL_+'" />';
_object_ += '<param name="wmode" value="window" />';
_object_ += '<param name="allowFullScreen" value="false">';
_object_ += '<param name="bgcolor" value="#fffff" />';
_object_ += '</object>';
}else{
_object_ = '<embed src="'+_swfURL_+'" quality="high" wmode="window" allowFullScreen="false" bgcolor="#ffffff" width="0" height="0" name="captcha_audio" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
}
captchaXE = $('<div id="captcha_layer" style="position:fixed; _position:absolute; top:0; left:0; width:100%; height:100%;display:none;z-index:10">').appendTo(document.body);
var $div = $('<div style="position:absolute; top:0; left:0; width:100%; height:100%; background:#000; opacity:.5; filter:alpha(opacity=50);"></div>'+
'<div style="z-index:1000;position:absolute; width:310px; margin:-105px 0 0 -105px; top:50%; left:50%; background:#fff; border:3px solid #ccc;">'+
'<form method="post" action="">'+
'<div style="position:relative; margin:25px 20px 15px 20px">'+
'<img src="about:blank" id="captcha_image" alt="CAPTCHA" width="240" height="50" style="display:block; width:240px; height:50px; border:1px solid #b0b0b0" />'+
'<button type="button" class="reload" title="" style="position:absolute; top:0; left:245px; width:25px; height:25px; padding:0; overflow:visible; border:1px solid #575757; background:#747474 url('+request_uri + 'addons/captcha/img/icon.gif) no-repeat center 5px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #444 inset;-moz-box-shadow:0 0 3px #444 inset;-webkit-box-shadow:0 0 3px #444 inset;"></button>'+
'<button type="button" class="play" title="" style="position:absolute; top:27px; left:245px; width:25px; height:25px; padding:0; overflow:visible; border:1px solid #575757; background:#747474 url('+request_uri + 'addons/captcha/img/icon.gif) no-repeat center -20px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #444 inset;-moz-box-shadow:0 0 3px #444 inset;-webkit-box-shadow:0 0 3px #444 inset;"></button>'+
'</div>'+
'<label id="captchaAbout" for="captcha" style="display:block; border-top:1px dashed #c5c5c5; padding:15px 0; margin:0 20px; font-size:12px; color:#5f5f5f;"></label>'+
'<input name="" type="text" id="secret_text" style="margin:0 20px; width:232px; border:1px solid #bdbdbd; padding:3px 4px; font-size:18px; font-weight:bold;" />'+
'<div style="margin:20px; border-top:1px dashed #c5c5c5; padding:15px 0 0 0; text-align:center">'+
'<button type="submit" style="height:31px; line-height:31px; padding:0 15px; margin:0 2px; font-size:12px; font-weight:bold; color:#fff; overflow:visible; border:1px solid #5c8a16; background:#6faa13;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #666 inset;-moz-box-shadow:0 0 3px #666 inset;-webkit-box-shadow:0 0 3px #666 inset;"></button>'+
'<button type="button" class="cancel" style="height:31px; line-height:31px; padding:0 15px; margin:0 2px; font-size:12px; font-weight:bold; color:#fff; overflow:visible; border:1px solid #575757; background:#747474;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px; cursor:pointer;box-shadow:0 0 3px #444 inset;-moz-box-shadow:0 0 3px #444 inset;-webkit-box-shadow:0 0 3px #444 inset;"></button>'+
'</div>'+
'</form>'+_object_ +
'</div>').appendTo(captchaXE);
$div.find('form')
.submit(function(){
if(!$('#secret_text').val()){
$div.find('input[type=text]').val('').focus();
return false;
}
captchaXE.compare(); return false;
});
$div.find('button.cancel')
.click(function(){ $('#captcha_layer').hide(); });
$div.find('button.play')
.click(function(){
var swf = window['captcha_audio'] || document['captcha_audio'];
var audio = current_url.setQuery('captcha_action','captchaAudio').setQuery('rnd', (new Date).getTime());
$div.find('input[type=text]').focus();
swf.setSoundTarget(audio,'1');
});
$div.find('button.reload')
.click(function(){
var params = new Array();
params['captcha_action'] = 'setCaptchaSession';
params['mid'] = current_mid;
oldExecXml('','',params, function() {
$("#captcha_image").attr("src", current_url.setQuery('captcha_action','captchaImage').setQuery('rnd', (new Date).getTime()));
});
});
captchaXE.exec = function(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj) {
var doCheck = false;
if(typeof(captchaTargetAct)!='undefined') {
for(var i in captchaTargetAct) {
if(captchaTargetAct[i]==act) {
doCheck = true;
break;
}
}
}
if(doCheck) {
$.each(captchaTargetAct || {}, function(key,val){ if (val == act){ doCheck = true; return false; } });
if (doCheck) { // captcha 를 사용하는 경우
calledArgs = {'module':module,'act':act,'params':params,'callback_func':callback_func,'response_tags':response_tags,'callback_func_arg':callback_func_arg,'fo_obj':fo_obj};
var params = new Array();
params['captcha_action'] = 'setCaptchaSession';
params['mid'] = current_mid;
oldExecXml(module, act, params, captchaXE.show,new Array('error','message','about','keyword'));
} else {
oldExecXml(module, act, params, captchaXE.show,new Array('error','message','about_captcha','captcha_reload','captcha_play','cmd_input','cmd_cancel'));
} else {
oldExecXml(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj);
}
}
return true;
};
captchaXE.show = function(ret_obj) {
var clientWidth = $(window).width();
var clientHeight = $(window).height();
$(document).scrollTop(0);
$(document).scrollLeft(0);
$("#captcha_screen").css({
display:"block",
width : clientWidth+"px",
height : clientHeight+"px",
left : 0,
top : 0
});
$("#captchaAbout").html(ret_obj['about']);
$("#captchaText").html(ret_obj['keyword']);
$("#captcha_image")
.css( {
width:"250px",
height:"100px",
margin:"0 0 10px 0",
cursor:"pointer"
})
.attr("src", current_url.setQuery('captcha_action','captchaImage').setQuery('rnd',Math.round(Math.random() * 6)))
.click (captchaXE.compare)
.focus( function() { this.blur(); } );
$("#captchaBox")
.css({
display:"block",
border:"10px solid #222222",
padding:"10px",
position:"absolute",
backgroundColor:"#2B2523",
left : (clientWidth/2-125)+"px",
top : (clientHeight/2-100)+"px"
})
$('#captcha_layer').show();
$("#captchaAbout").html(ret_obj['about_captcha']);
$("#captcha_layer .reload").attr('title',ret_obj['captcha_reload']);
$("#captcha_layer .play").attr('title',ret_obj['captcha_play']);
$("#captcha_layer button[type=submit]").html(ret_obj['cmd_input']);
$("#captcha_layer button.cancel").html(ret_obj['cmd_cancel']);
$("#captcha_image").attr("src", current_url.setQuery('captcha_action','captchaImage').setQuery('rnd', (new Date).getTime()));
$div.find('input[type=text]').val('').focus();
};
captchaXE.compare = function(e) {
var posX = parseInt($("#captchaBox").css("left").replace(/px$/,''),10);
var posY = parseInt($("#captchaBox").css("top").replace(/px$/,''),10);
var x = e.pageX - posX - 20;
var y = e.pageY - posY - 20;
var params = new Array();
params['mx'] = x;
params['my'] = y;
params['captcha_action'] = 'captchaCompare';
params['mid'] = current_mid;
params['secret_text'] = $('#secret_text').val();
oldExecXml(calledArgs.module,calledArgs.act,params, function() {
$("#captcha_screen").css({ display:"none" });
$("#captcha_layer").hide();
oldExecXml(calledArgs.module, calledArgs.act, calledArgs.params, calledArgs.callback_func, calledArgs.response_tags, calledArgs.callback_func_arg, calledArgs.fo_obj);
} );
};

View file

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon version="0.2">
<title xml:lang="ko">Captcha 애드온</title>
<title xml:lang="en">CAPTCHA addon</title>
<title xml:lang="en">CAPTCHA</title>
<title xml:lang="vi">Captcha Addon</title>
<title xml:lang="zh-CN">验证码插件</title>
<title xml:lang="jp">Captchaアドオン</title>
<title xml:lang="ru">Аддон Captcha</title>
<title xml:lang="zh-TW">圖形驗證</title>
<description xml:lang="ko">
프로그램 글 등록기를 막기 위해 게시판/ issueTracker에서 글/ 댓글을 입력하려 할 때 이미지를 보여주고 글에 해당하는 이미지를 선택하게 하는 애드온입니다.
프로그램 글 등록기를 막기 위해 게시판/ issueTracker에서 글/ 댓글을 입력하려 할 때 알파벳을 입력해야 글/댓글이 입력되는 애드온 입니다.
로그인하지 않은 경우에만 해당됩니다.
</description>
<description xml:lang="en">
@ -34,51 +34,51 @@
<description xml:lang="zh-TW">
此元件可防止機器人程式的垃圾留言,非註冊用戶在討論板/問題追蹤發表主題或評論時,必須要先選對畫面中所顯示的圖案才能發表。
</description>
<version>0.2</version>
<date>2009-02-20</date>
<version>1.0</version>
<date>2010-08-19</date>
<author email_address="developers@xpressengine.com" link="http://www.xpressengine.com">
<name xml:lang="ko">XE</name>
<name xml:lang="zh-CN">XE</name>
<name xml:lang="jp">XE</name>
<name xml:lang="zh-CN">XE</name>
<name xml:lang="jp">XE</name>
<name xml:lang="zh-TW">XE</name>
<name xml:lang="en">XE</name>
<name xml:lang="ru">XE</name>
<name xml:lang="en">XE</name>
<name xml:lang="ru">XE</name>
<name xml:lang="vi">XE</name>
</author>
<extra_vars>
<var name="target" type="select">
<title xml:lang="ko">Captcha 표시 대상</title>
<title xml:lang="zh-CN">应用对象</title>
<title xml:lang="jp">Captchaを表示する対象</title>
<title xml:lang="zh-TW">選擇目標</title>
<title xml:lang="zh-CN">应用对象</title>
<title xml:lang="jp">Captchaを表示する対象</title>
<title xml:lang="zh-TW">選擇目標</title>
<title xml:lang="en">Captcha Target</title>
<title xml:lang="ru">Captcha Target</title>
<title xml:lang="ru">Captcha Target</title>
<title xml:lang="vi">Mục tiêu Captcha hiển thị</title>
<description xml:lang="ko">글/댓글 등록시 captcha가 동작할 대상을 정할 수 있습니다. 관리자는 무조건 제외됩니다</description>
<description xml:lang="zh-CN">可以指定验证码应用对象(管理员除外)。</description>
<description xml:lang="jp">管理者を除き、書き込み・コメントを入力する際にcaptchaイメージを見せる対象を設定します。</description>
<description xml:lang="zh-TW">除了管理員,在發表主題或評論時,設定圖形驗證應用的對象。</description>
<description xml:lang="zh-CN">可以指定验证码应用对象(管理员除外)。</description>
<description xml:lang="jp">管理者を除き、書き込み・コメントを入力する際にcaptchaイメージを見せる対象を設定します。</description>
<description xml:lang="zh-TW">除了管理員,可以選擇圖形驗證應用的對象。</description>
<description xml:lang="en">You may specify targets CAPTCHA work. It's not applied when administrator writes.</description>
<description xml:lang="ru">You may specify targets CAPTCHA work. It's not applied when administrator writes.</description>
<description xml:lang="ru">You may specify targets CAPTCHA work. It's not applied when administrator writes.</description>
<description xml:lang="vi">Khi gửi bài, bình luận, Capcha sẽ hiển thị để xác nhận hành động của người sử dụng. Chức năng này không hoạt động với người quản lý.</description>
<options value="">
<title xml:lang="ko">로그인하지 않은 사용자</title>
<title xml:lang="zh-CN">非登录用户</title>
<title xml:lang="jp">ログインしてないユーザー</title>
<title xml:lang="zh-TW">非用戶</title>
<title xml:lang="zh-CN">非登录用户</title>
<title xml:lang="jp">ログインしてないユーザー</title>
<title xml:lang="zh-TW">非用戶</title>
<title xml:lang="en">Not logged-in users</title>
<title xml:lang="ru">Not logged-in users</title>
<title xml:lang="ru">Not logged-in users</title>
<title xml:lang="vi">Người dùng chưa đăng nhập</title>
</options>
<options value="all">
<title xml:lang="ko">모든 사용자</title>
<title xml:lang="zh-CN">所有用户</title>
<title xml:lang="jp">すべてのユーザー</title>
<title xml:lang="zh-CN">所有用户</title>
<title xml:lang="jp">すべてのユーザー</title>
<title xml:lang="zh-TW">所有用戶</title>
<title xml:lang="en">All users</title>
<title xml:lang="ru">All users</title>
<title xml:lang="ru">All users</title>
<title xml:lang="vi">Tất cả mọi người</title>
</options>
</var>
@ -86,16 +86,16 @@
<title xml:lang="ko">동작 방식</title>
<title xml:lang="zh-CN">验证方式</title>
<title xml:lang="jp">動作方式</title>
<title xml:lang="zh-TW">行為模式</title>
<title xml:lang="zh-TW">驗證模式</title>
<title xml:lang="en">How it works</title>
<title xml:lang="ru">How it works</title>
<title xml:lang="ru">How it works</title>
<title xml:lang="vi">Sử dụng</title>
<description xml:lang="ko">"1번만 동작"을 선택하시면 1번만 동작후 상태를 저장해서 다음부터 물어보지 않고 그렇지 않으면 매번 물어보게 됩니다</description>
<description xml:lang="zh-CN">"一次"就是每个IP只出现一次验证。</description>
<description xml:lang="zh-CN">"一次"就是每个IP只出现一次验证。</description>
<description xml:lang="jp">「1回だけ表示」を選択すると、最初だけ動作した後、その情報を記憶して次回からはCaptchaを見せないようにします。また、もう一つのオプションは毎回Captchaを表示します。</description>
<description xml:lang="zh-TW">選擇"單次"產生第一次動作後,下次不會再顯示;選擇"每次"則會一直顯示。</description>
<description xml:lang="zh-TW">選擇"單次",下次不會再顯示;選擇"每次"則會一直顯示。</description>
<description xml:lang="en">If you choose "Once", CAPTCHA works only once for the user by storing status. Otherwise, this addon would show an image every time the user writes.</description>
<description xml:lang="ru">If you choose "Once", CAPTCHA works only once for the user by storing status. Otherwise, this addon would show an image every time the user writes.</description>
<description xml:lang="ru">If you choose "Once", CAPTCHA works only once for the user by storing status. Otherwise, this addon would show an image every time the user writes.</description>
<description xml:lang="vi">Nếu chọn "Chỉ một lần" thì sau lần hiển thị đó Capcha sẽ không hiển thị với người sử dụng đó nữa.</description>
<options value="onetime">
<title xml:lang="ko">1번만 동작</title>
@ -104,7 +104,7 @@
<title xml:lang="zh-TW">單次</title>
<title xml:lang="vi">Chỉ một lần</title>
<title xml:lang="en">once</title>
<title xml:lang="ru">1 раз</title>
<title xml:lang="ru">1 раз</title>
</options>
<options value="everytime">
<title xml:lang="ko">매번 동작</title>
@ -112,7 +112,7 @@
<title xml:lang="jp">毎回表示</title>
<title xml:lang="zh-TW">每次</title>
<title xml:lang="en">every time</title>
<title xml:lang="ru">каждый раз</title>
<title xml:lang="ru">каждый раз</title>
<title xml:lang="vi">Luôn sử dụng</title>
</options>
</var>
@ -122,14 +122,14 @@
<title xml:lang="jp">비밀번호 찾기 적용</title>
<title xml:lang="zh-TW">忘記密碼</title>
<title xml:lang="en">applying to an action finding account</title>
<title xml:lang="ru">applying to an action finding account</title>
<title xml:lang="ru">applying to an action finding account</title>
<title xml:lang="vi">Khi lấy lại mật khẩu</title>
<description xml:lang="ko">적용으로 하시면 비밀번호 찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-CN">启用此项功能可以有效地拦截以查找密码名义发送的垃圾邮件。</description>
<description xml:lang="jp">적용으로 하시면 비밀번호찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">적용으로 하시면 비밀번호찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">開啟功能後在忘記密碼時會顯示驗證碼。</description>
<description xml:lang="en">If you set this option as apply, CAPTCHA will work for finding account action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for finding account action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for finding account action, too.</description>
<description xml:lang="vi">Nếu áp dụng, khi thành viên cần lấy lại mật khẩu khi lỡ quên, Capcha sẽ hiện thị để xác nhận việc này.</description>
<options value="">
<title xml:lang="ko">적용하지 않음</title>
@ -137,7 +137,7 @@
<title xml:lang="jp">적용하지 않음</title>
<title xml:lang="zh-TW">關閉</title>
<title xml:lang="en">Not apply</title>
<title xml:lang="ru">Not apply</title>
<title xml:lang="ru">Not apply</title>
<title xml:lang="vi">Không áp dụng</title>
</options>
<options value="apply">
@ -146,7 +146,7 @@
<title xml:lang="jp">적용</title>
<title xml:lang="zh-TW">開啟</title>
<title xml:lang="en">Apply</title>
<title xml:lang="ru">Apply</title>
<title xml:lang="ru">Apply</title>
<title xml:lang="vi">Áp dụng</title>
</options>
</var>
@ -156,14 +156,14 @@
<title xml:lang="jp">인증 메일 재발송 적용</title>
<title xml:lang="zh-TW">重寄認證信</title>
<title xml:lang="en">apply to an action resending authmail</title>
<title xml:lang="ru">apply to an action resending authmail</title>
<title xml:lang="ru">apply to an action resending authmail</title>
<title xml:lang="vi">Khi lấy lại mã kích hoạt</title>
<description xml:lang="ko">적용으로 하시면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-CN">启用此项功能可以有效地拦截以重新发送认证邮件名义发送的垃圾邮件。</description>
<description xml:lang="jp">적용으로 하시면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">적용으로 하시면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">開啟功能後在重寄認證信時會顯示驗證碼。</description>
<description xml:lang="en">If you set this option as apply, CAPTCHA will work for resending authmail action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for resending authmail action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for resending authmail action, too.</description>
<description xml:lang="vi">Nếu áp dụng, khi thành viên cần lấy lại mã kích hoạt thành viên, Capcha sẽ hiện thị để xác nhận việc này.</description>
<options value="">
<title xml:lang="ko">적용하지 않음</title>
@ -171,7 +171,7 @@
<title xml:lang="jp">적용하지 않음</title>
<title xml:lang="zh-TW">關閉</title>
<title xml:lang="en">Not apply</title>
<title xml:lang="ru">Not apply</title>
<title xml:lang="ru">Not apply</title>
<title xml:lang="vi">Không áp dụng</title>
</options>
<options value="apply">
@ -180,7 +180,7 @@
<title xml:lang="jp">적용</title>
<title xml:lang="zh-TW">開啟</title>
<title xml:lang="en">Apply</title>
<title xml:lang="ru">Apply</title>
<title xml:lang="ru">Apply</title>
<title xml:lang="vi">Áp dụng</title>
</options>
</var>
@ -190,12 +190,12 @@
<title xml:lang="jp">인증 메일 재발송 적용</title>
<title xml:lang="zh-TW">會員註冊</title>
<title xml:lang="en">Apply to member signup</title>
<title xml:lang="ru">Apply to member signup</title>
<title xml:lang="ru">Apply to member signup</title>
<title xml:lang="vi">Apply to member signup</title>
<description xml:lang="ko">적용으로 하시면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다.</description>
<description xml:lang="zh-CN">启用此项功能可以有效地拦截自动注册软件的施虐。</description>
<description xml:lang="jp">적용으로 하시면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다.</description>
<description xml:lang="zh-TW">If you set this option as apply, CAPTCHA will work for signup action, too.</description>
<description xml:lang="zh-TW">開啟功能後在註冊時會顯示驗證碼。</description>
<description xml:lang="en">If you set this option as apply, CAPTCHA will work for signup action, too.</description>
<description xml:lang="ru">If you set this option as apply, CAPTCHA will work for signup action, too.</description>
<description xml:lang="vi">If you set this option as apply, CAPTCHA will work for signup action, too.</description>
@ -205,7 +205,7 @@
<title xml:lang="jp">적용하지 않음</title>
<title xml:lang="zh-TW">關閉</title>
<title xml:lang="en">Not apply</title>
<title xml:lang="ru">Not apply</title>
<title xml:lang="ru">Not apply</title>
<title xml:lang="vi">Không áp dụng</title>
</options>
<options value="apply">
@ -214,7 +214,7 @@
<title xml:lang="jp">적용</title>
<title xml:lang="zh-TW">開啟</title>
<title xml:lang="en">Apply</title>
<title xml:lang="ru">Apply</title>
<title xml:lang="ru">Apply</title>
<title xml:lang="vi">Áp dụng</title>
</options>
</var>

BIN
addons/captcha/img/icon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

View file

@ -1,21 +1,6 @@
<?php
/**
* @file en.lang.php
* @author haneul (haneul0318@gmail.com)
* @brief English Language Pack
**/
$lang->about_captcha = "Please choose an image whose name is listed below";
$lang->target_captcha = array(
"airplane" => "airplane",
"apple" => "apple",
"book" => "book",
"camera" => "camera",
"dog" => "dog",
"earth" => "earth",
"flag" => "flag",
"mobile" => "mobile",
"note" => "note",
"skeleton" => "skeleton",
);
$lang->about_captcha = "Please type alphabets above in order. They are not case-sensitive.";
$lang->captcha_reload = 'Refresh Image';
$lang->captcha_play = 'Play sound of words';
$lang->captcha_denied = 'You have typed wrong alphabets.';
?>

View file

@ -1,21 +1,6 @@
<?php
/**
* @file addons/captcha/lang/jp.lang.php
* @author zero (zero@nzeo.com) 翻訳:ミニミ
* @brief 日本語言語パッケージ
**/
$lang->about_captcha = "ボットbotのスパム登録を防ぐため、下の単語と一致するイメージを選択して下さい。";
$lang->target_captcha = array(
"airplane" => "飛行機",
"apple" => "りんご",
"book" => "",
"camera" => "カメラ",
"dog" => "",
"earth" => "地球",
"flag" => "",
"mobile" => "携帯",
"note" => "音符",
"skeleton" => "がいこつ",
);
$lang->about_captcha = "위 영어 알파벳을 순서대로 입력해 주세요. 대소문자는 구분하지 않습니다.";
$lang->captcha_reload = '이미지 새로고침';
$lang->captcha_play = '음성으로 듣기';
$lang->captcha_denied = '잘못 입력하셨습니다';
?>

View file

@ -1,21 +1,6 @@
<?php
/**
* @file ko.lang.php
* @author zero (zero@nzeo.com)
* @brief 한국어 언어팩
**/
$lang->about_captcha = "프로그램 등록을 방지하기 위하여 아래 알려주는 이름과 일치하는 이미지를 선택해주세요";
$lang->target_captcha = array(
"airplane" => "비행기",
"apple" => "사과",
"book" => "",
"camera" => "카메라",
"dog" => "강아지",
"earth" => "지구",
"flag" => "깃발",
"mobile" => "핸드폰",
"note" => "음표",
"skeleton" => "해골",
);
$lang->about_captcha = "위 영어 알파벳을 순서대로 입력해 주세요. 대소문자는 구분하지 않습니다.";
$lang->captcha_reload = '이미지 새로고침';
$lang->captcha_play = '음성으로 듣기';
$lang->captcha_denied = '잘못 입력하셨습니다';
?>

View file

@ -1,21 +1,6 @@
<?php
/**
* @file ko.lang.php
* @author zero (zero@nzeo.com)
* @brief 한국어 언어팩
**/
$lang->about_captcha = "Пожалуйста, выберите картинки, соответсвующие словам внизу";
$lang->target_captcha = array(
"airplane" => "самолет",
"apple" => "яблоко",
"book" => "книга",
"camera" => "камера",
"dog" => "собака",
"earth" => "планета",
"flag" => "флаг",
"mobile" => "мобильный телефон",
"note" => "нота",
"skeleton" => "череп",
);
$lang->about_captcha = "위 영어 알파벳을 순서대로 입력해 주세요. 대소문자는 구분하지 않습니다.";
$lang->captcha_reload = '이미지 새로고침';
$lang->captcha_play = '음성으로 듣기';
$lang->captcha_denied = '잘못 입력하셨습니다';
?>

View file

@ -1,23 +1,6 @@
<?php
/* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░ * @File : common/lang/vi.lang.php ░░
░░ * @Author : zero (zero@nzeo.com) ░░
░░ * @Trans : Đào Đức Duy (ducduy.dao.vn@vietxe.net) ░░
░░ * @Website: http://vietxe.net ░░
░░ * @Brief : Vietnamese Language Pack (Only basic words are included here) ░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ */
$lang->about_captcha = "Xin chọn một ảnh mà có tên được liệt kê ở dưới:";
$lang->target_captcha = array(
"airplane" => "Máy bay",
"apple" => "Trái táo",
"book" => "Sách",
"camera" => "Camera",
"dog" => "Con chó",
"earth" => "Trái đất",
"flag" => "Lá cờ",
"mobile" =>"Di động",
"note" => "Nốt nhạc",
"skeleton" => "Xương",
);
$lang->about_captcha = "위 영어 알파벳을 순서대로 입력해 주세요. 대소문자는 구분하지 않습니다.";
$lang->captcha_reload = '이미지 새로고침';
$lang->captcha_play = '음성으로 듣기';
$lang->captcha_denied = '잘못 입력하셨습니다';
?>

View file

@ -1,21 +1,6 @@
<?php
/**
* @file zh-CN.lang.php
* @author zero (zero@nzeo.com) 翻译guny
* @brief 验证码简体中文语言包
**/
$lang->about_captcha = "请选择与显示名称相一致的图片。";
$lang->target_captcha = array(
"airplane" => "飞机",
"apple" => "苹果",
"book" => "",
"camera" => "摄像机",
"dog" => "",
"earth" => "地球",
"flag" => "旗帜",
"mobile" => "手机",
"note" => "音符",
"skeleton" => "骷髅",
);
$lang->about_captcha = "위 영어 알파벳을 순서대로 입력해 주세요. 대소문자는 구분하지 않습니다.";
$lang->captcha_reload = '이미지 새로고침';
$lang->captcha_play = '음성으로 듣기';
$lang->captcha_denied = '잘못 입력하셨습니다';
?>

View file

@ -1,21 +1,6 @@
<?php
/**
* @file addons/captcha/lang/zh-TW.lang.php
* @author zero (zero@nzeo.com) 翻譯royallin
* @brief 圖形驗證正體中文語言
**/
$lang->about_captcha = "用於防止機器人程式之垃圾留言,請選擇一個符合下列詞語的圖像。";
$lang->target_captcha = array(
"airplane" => "飛機",
"apple" => "蘋果",
"book" => "書本",
"camera" => "照相機",
"dog" => "小狗",
"earth" => "地球",
"flag" => "國旗",
"mobile" => "手機",
"note" => "音符",
"skeleton" => "骷髏",
);
$lang->about_captcha = "위 영어 알파벳을 순서대로 입력해 주세요. 대소문자는 구분하지 않습니다.";
$lang->captcha_reload = '이미지 새로고침';
$lang->captcha_play = '음성으로 듣기';
$lang->captcha_denied = '잘못 입력하셨습니다';
?>

BIN
addons/captcha/swf/play.swf Normal file

Binary file not shown.

View file

@ -44,7 +44,7 @@
<name xml:lang="zh-CN">zero</name>
<name xml:lang="en">zero</name>
<name xml:lang="vi">zero</name>
<name xml:lang="ru">zero</name>
<name xml:lang="ru">zero</name>
<name xml:lang="zh-TW">zero</name>
</author>
@ -55,7 +55,7 @@
<name xml:lang="zh-CN">misol</name>
<name xml:lang="en">misol</name>
<name xml:lang="vi">misol</name>
<name xml:lang="ru">misol</name>
<name xml:lang="ru">misol</name>
<name xml:lang="zh-TW">misol</name>
</author>
<log>언어선택 추가(WML, mHTML)</log>
@ -70,7 +70,7 @@
<title xml:lang="zh-CN">编码</title>
<title xml:lang="en">Charset</title>
<title xml:lang="vi">Charset</title>
<title xml:lang="ru">Charset</title>
<title xml:lang="ru">Charset</title>
<title xml:lang="zh-TW">編碼</title>
<description xml:lang="ko">
모바일 기기의 경우 UTF-8 문자셋을 인식하지 못할 수 있습니다.
@ -97,7 +97,7 @@
Những công cụ di động sẽ trình bày Charset đúng khi bạn nhập vào Charset bạn muốn.
Charset mặc định là UTF-8.
</description>
<description xml:lang="ru">
<description xml:lang="ru">
utf-8 may be read with mobile tools.
Mobile tools will display correct charset when you input charset you want.
Default charset is UTF-8.

View file

@ -914,7 +914,7 @@
if($this->allow_rewrite) {
$var_keys = array_keys($get_vars);
asort($var_keys);
$target = implode('.',$var_keys);
$target = implode('.', $var_keys);
switch($target) {
case 'vid' : $query = $get_vars['vid']; break;
case 'mid' : $query = $get_vars['mid']; break;
@ -927,6 +927,8 @@
case 'document_srl.mid.vid' : $query = $get_vars['vid'].'/'.$get_vars['mid'].'/'.$get_vars['document_srl']; break;
case 'entry.mid.vid' : $query = $get_vars['vid'].'/'.$get_vars['mid'].'/entry/'.$get_vars['entry']; break;
case 'act.document_srl.key.vid' : $query = $get_vars['act']=='trackback'?$get_vars['vid'].'/'.$get_vars['document_srl'].'/'.$get_vars['key'].'/'.$get_vars['act']:''; break;
case 'act.mid' : $query = (in_array($get_vars['act'], array('rss', 'atom', 'api'))) ? $get_vars['mid'].'/'.$get_vars['act'] : ''; break;
case 'act.mid.vid' : $query = (in_array($get_vars['act'], array('rss', 'atom', 'api'))) ? $get_vars['vid'].'/'.$get_vars['mid'].'/'.$get_vars['act']:''; break;
}
}

View file

@ -22,6 +22,7 @@
var $port = 33000; ///< db server port
var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE 설치 가능)
var $cutlen = 12000; ///< 큐브리드의 최대 상수 크기(스트링이 이보다 크면 '...'+'...' 방식을 사용해야 한다
var $comment_syntax = '/* %s */';
/**
* @brief cubrid에서 사용될 column type
@ -335,7 +336,6 @@
// 만약 테이블 이름이 sequence라면 serial 생성
if($table_name == 'sequence') {
$query = sprintf('create serial "%s" start with 1 increment by 1 minvalue 1 maxvalue 10000000000000000000000000000000000000 nocycle;', $this->prefix.$table_name);
return $this->_query($query);
}
@ -374,13 +374,13 @@
break;
}
if($default && (!is_numeric($default) || $default[0] == "+")) $default = "'".$default."'";
if(isset ($default) && ($type == 'varchar' || $type == 'char')) $default = "'".$default."'";
$column_schema[] = sprintf('"%s" %s%s %s %s',
$name,
$this->column_type[$type],
$size?'('.$size.')':'',
$default?"default ".$default:'',
isset($default)?"default ".$default:'',
$notnull?'not null':''
);
@ -788,6 +788,7 @@
}
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) return;
$data = $this->_fetch($result);
@ -943,6 +944,7 @@
}
}
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) {
$buff = new Object();

View file

@ -19,6 +19,7 @@
var $database = NULL; ///< database
var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE 설치 가능)
var $idx_no = 0; // 인덱스 생성시 사용할 카운터
var $comment_syntax = '/* %s */';
/**
* @brief firebird에서 사용될 column type
@ -865,6 +866,7 @@
$query .= ";";
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) {
if(!$this->transaction_started) @ibase_rollback($this->fd);
@ -971,7 +973,7 @@
}
$query .= ";";
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) {
if(!$this->transaction_started) @ibase_rollback($this->fd);

View file

@ -16,6 +16,7 @@
var $database = NULL; ///< database
var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE 설치 가능)
var $param = array();
var $comment_syntax = '/* %s */';
/**
* @brief mssql 에서 사용될 column type
@ -369,7 +370,7 @@
$this->column_type[$type],
!in_array($type,array('number','text'))&&$size?'('.$size.')':'',
$primary_key?'primary key':'',
$default?"default '".$default."'":'',
isset($default)?"default '".$default."'":'',
$notnull?'not null':'null',
$auto_increment?'identity(1,1)':''
);
@ -702,6 +703,7 @@
if($output->list_count['value']) $query = sprintf('select top %d %s', $output->list_count['value'], $query);
else $query = "select ".$query;
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) return;
@ -835,6 +837,7 @@
$query = sprintf('select top %d %s from %s %s %s %s %s', $list_count, $columns, implode(',',$table_list), implode(' ',$left_join), $condition, $group, $order);
}
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) {

View file

@ -18,6 +18,7 @@
var $password = NULL; ///< password
var $database = NULL; ///< database
var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE 설치 가능)
var $comment_syntax = '/* %s */';
/**
* @brief mysql에서 사용될 column type
@ -348,7 +349,7 @@
$name,
$this->column_type[$type],
$size?'('.$size.')':'',
$default?"default '".$default."'":'',
isset($default)?"default '".$default."'":'',
$notnull?'not null':'',
$auto_increment?'auto_increment':''
);
@ -574,6 +575,8 @@
// list_count를 사용할 경우 적용
if($output->list_count['value']) $query = sprintf('%s limit %d', $query, $output->list_count['value']);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) return;
@ -652,6 +655,8 @@
}
$query = sprintf('%s limit %d, %d', $query, $start_count, $list_count);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) {
$buff = new Object();

View file

@ -18,6 +18,7 @@
var $password = NULL; ///< password
var $database = NULL; ///< database
var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE설치 가능)
var $comment_syntax = '/* %s */';
/**
* @brief mysql에서 사용될 column type
@ -357,7 +358,7 @@
$name,
$this->column_type[$type],
$size?'('.$size.')':'',
$default?"default '".$default."'":'',
isset($default)?"default '".$default."'":'',
$notnull?'not null':'',
$auto_increment?'auto_increment':''
);
@ -585,6 +586,7 @@
// list_count를 사용할 경우 적용
if($output->list_count['value']) $query = sprintf('%s limit %d', $query, $output->list_count['value']);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) return;
@ -663,7 +665,8 @@
}
$query = sprintf('%s limit %d, %d', $query, $start_count, $list_count);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) {
$buff = new Object();

View file

@ -18,6 +18,7 @@
var $password = NULL; ///< password
var $database = NULL; ///< database
var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE 설치 가능)
var $comment_syntax = '/* %s */';
/**
* @brief mysql에서 사용될 column type
@ -337,7 +338,7 @@
$name,
$this->column_type[$type],
$size?'('.$size.')':'',
$default?"default '".$default."'":'',
isset($default)?"default '".$default."'":'',
$notnull?'not null':'',
$auto_increment?'auto_increment':''
);
@ -564,6 +565,7 @@
// list_count를 사용할 경우 적용
if($output->list_count['value']) $query = sprintf('%s limit %d', $query, $output->list_count['value']);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) return;
@ -642,6 +644,7 @@
}
$query = sprintf('%s limit %d, %d', $query, $start_count, $list_count);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) {
$buff = new Object();

View file

@ -23,6 +23,7 @@ class DBPostgresql extends DB
var $password = null; ///< password
var $database = null; ///< database
var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE설치 가능)
var $comment_syntax = '/* %s */';
/**
* @brief postgresql에서 사용될 column type
@ -457,7 +458,7 @@ class DBPostgresql extends DB
$size = 0;
$column_schema[] = sprintf('%s %s%s %s %s', $name, $this->column_type[$type], $size ?
'(' . $size . ')' : '', $default ? "default '" . $default . "'" : '', $notnull ?
'(' . $size . ')' : '', isset($default) ? "default '" . $default . "'" : '', $notnull ?
'not null' : '');
if ($primary_key)
@ -757,6 +758,7 @@ class DBPostgresql extends DB
$query .= ' order by ' . implode(',', $index_list);
}
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if ($this->isError())
return;
@ -865,6 +867,7 @@ class DBPostgresql extends DB
}
$query = sprintf('%s offset %d limit %d', $query, $start_count, $list_count);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if ($this->isError()) {

View file

@ -15,6 +15,7 @@
**/
var $database = NULL; ///< database
var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE설치 가능)
var $comment_syntax = '/* %s */';
/**
* @brief sqlite 에서 사용될 column type
@ -334,7 +335,7 @@
$size?'('.$size.')':'',
$notnull?'NOT NULL':'',
$primary_key?'PRIMARY KEY':'',
$default?"DEFAULT '".$default."'":'',
isset($default)?"DEFAULT '".$default."'":'',
$auto_increment?'AUTOINCREMENT':''
);
}
@ -591,6 +592,7 @@
// list_count를 사용할 경우 적용
if($output->list_count['value']) $query = sprintf('%s limit %d', $query, $output->list_count['value']);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) return;
@ -686,6 +688,7 @@
}
$query = sprintf('%s limit %d, %d', $query, $start_count, $list_count);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$result = $this->_query($query);
if($this->isError()) {

View file

@ -13,6 +13,7 @@
**/
var $database = NULL; ///< database
var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE 설치 가능)
var $comment_syntax = '/* %s */';
/**
* PDO 사용시 필요한 변수들
@ -359,7 +360,7 @@
$size?'('.$size.')':'',
$notnull?'NOT NULL':'',
$primary_key?'PRIMARY KEY':'',
$default?"DEFAULT '".$default."'":''
isset($default)?"DEFAULT '".$default."'":''
);
}
@ -634,6 +635,7 @@
// list_count를 사용할 경우 적용
if($output->list_count['value']) $query = sprintf('%s limit %d', $query, $output->list_count['value']);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$this->_prepare($query);
$data = $this->_execute();
if($this->isError()) return;
@ -734,6 +736,8 @@
// 쿼리 실행
$query = sprintf('%s limit %d, %d', $query, $start_count, $list_count);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
$this->_prepare($query);
if($this->isError()) {

View file

@ -23,10 +23,16 @@
var $header = '';
var $eol = '';
var $references = '';
var $additional_params = null;
function Mail() { }
function setAdditionalParams($additional_params)
{
$this->additional_params = $additional_params;
}
function addAttachment($filename, $orgfilename)
{
$this->attachments[$orgfilename] = $filename;
@ -221,7 +227,7 @@
$this->references?("References: <".$this->references.">".$this->eol."In-Reply-To: <".$this->references.">".$this->eol):""
);
$headers .= $this->header;
if($this->additional_params) return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers, $this->additional_params);
return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers);
}

File diff suppressed because it is too large Load diff

View file

@ -3,171 +3,20 @@
// This is licensed under the GNU LGPL, version 2.1 or later.
// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
var IEPNGFix = window.IEPNGFix || {};
IEPNGFix.tileBG = function(elm, pngSrc, ready) {
// Params: A reference to a DOM element, the PNG src file pathname, and a
// hidden "ready-to-run" passed when called back after image preloading.
var data = this.data[elm.uniqueID],
elmW = Math.max(elm.clientWidth, elm.scrollWidth),
elmH = Math.max(elm.clientHeight, elm.scrollHeight),
bgX = elm.currentStyle.backgroundPositionX,
bgY = elm.currentStyle.backgroundPositionY,
bgR = elm.currentStyle.backgroundRepeat;
// Cache of DIVs created per element, and image preloader/data.
if (!data.tiles) {
data.tiles = {
elm: elm,
src: '',
cache: [],
img: new Image(),
old: {}
};
}
var tiles = data.tiles,
pngW = tiles.img.width,
pngH = tiles.img.height;
if (pngSrc) {
if (!ready && pngSrc != tiles.src) {
// New image? Preload it with a callback to detect dimensions.
tiles.img.onload = function() {
this.onload = null;
IEPNGFix.tileBG(elm, pngSrc, 1);
};
return tiles.img.src = pngSrc;
}
} else {
// No image?
if (tiles.src) ready = 1;
pngW = pngH = 0;
}
tiles.src = pngSrc;
if (!ready && elmW == tiles.old.w && elmH == tiles.old.h &&
bgX == tiles.old.x && bgY == tiles.old.y && bgR == tiles.old.r) {
return;
}
// Convert English and percentage positions to pixels.
var pos = {
top: '0%',
left: '0%',
center: '50%',
bottom: '100%',
right: '100%'
},
x,
y,
pc;
x = pos[bgX] || bgX;
y = pos[bgY] || bgY;
if (pc = x.match(/(\d+)%/)) {
x = Math.round((elmW - pngW) * (parseInt(pc[1]) / 100));
}
if (pc = y.match(/(\d+)%/)) {
y = Math.round((elmH - pngH) * (parseInt(pc[1]) / 100));
}
x = parseInt(x);
y = parseInt(y);
// Handle backgroundRepeat.
var repeatX = { 'repeat': 1, 'repeat-x': 1 }[bgR],
repeatY = { 'repeat': 1, 'repeat-y': 1 }[bgR];
if (repeatX) {
x %= pngW;
if (x > 0) x -= pngW;
}
if (repeatY) {
y %= pngH;
if (y > 0) y -= pngH;
}
// Go!
this.hook.enabled = 0;
if (!({ relative: 1, absolute: 1 }[elm.currentStyle.position])) {
elm.style.position = 'relative';
}
var count = 0,
xPos,
maxX = repeatX ? elmW : x + 0.1,
yPos,
maxY = repeatY ? elmH : y + 0.1,
d,
s,
isNew;
if (pngW && pngH) {
for (xPos = x; xPos < maxX; xPos += pngW) {
for (yPos = y; yPos < maxY; yPos += pngH) {
isNew = 0;
if (!tiles.cache[count]) {
tiles.cache[count] = document.createElement('div');
isNew = 1;
}
var clipR = (xPos + pngW > elmW ? elmW - xPos : pngW),
clipB = (yPos + pngH > elmH ? elmH - yPos : pngH);
d = tiles.cache[count];
s = d.style;
s.behavior = 'none';
s.left = xPos + 'px';
s.top = yPos + 'px';
s.width = clipR + 'px';
s.height = clipB + 'px';
s.clip = 'rect(' +
(yPos < 0 ? 0 - yPos : 0) + 'px,' +
clipR + 'px,' +
clipB + 'px,' +
(xPos < 0 ? 0 - xPos : 0) + 'px)';
s.display = 'block';
if (isNew) {
s.position = 'absolute';
s.zIndex = -999;
if (elm.firstChild) {
elm.insertBefore(d, elm.firstChild);
} else {
elm.appendChild(d);
}
}
this.fix(d, pngSrc, 0);
count++;
}
}
}
while (count < tiles.cache.length) {
this.fix(tiles.cache[count], '', 0);
tiles.cache[count++].style.display = 'none';
}
this.hook.enabled = 1;
// Cache so updates are infrequent.
tiles.old = {
w: elmW,
h: elmH,
x: bgX,
y: bgY,
r: bgR
};
};
IEPNGFix.update = function() {
// Update all PNG backgrounds.
for (var i in IEPNGFix.data) {
var t = IEPNGFix.data[i].tiles;
if (t && t.elm && t.src) {
IEPNGFix.tileBG(t.elm, t.src);
}
}
};
IEPNGFix.update.timer = 0;
if (window.attachEvent && !window.opera) {
window.attachEvent('onresize', function() {
clearTimeout(IEPNGFix.update.timer);
IEPNGFix.update.timer = setTimeout(IEPNGFix.update, 100);
});
}
var IEPNGFix=window.IEPNGFix||{};IEPNGFix.tileBG=function(elm,pngSrc,ready){var data=this.data[elm.uniqueID],elmW=Math.max(elm.clientWidth,elm.scrollWidth),elmH=Math.max(elm.clientHeight,elm.scrollHeight),bgX=elm.currentStyle.backgroundPositionX,bgY=elm.currentStyle.backgroundPositionY,bgR=elm.currentStyle.backgroundRepeat;if(!data.tiles){data.tiles={elm:elm,src:'',cache:[],img:new Image(),old:{}};}
var tiles=data.tiles,pngW=tiles.img.width,pngH=tiles.img.height;if(pngSrc){if(!ready&&pngSrc!=tiles.src){tiles.img.onload=function(){this.onload=null;IEPNGFix.tileBG(elm,pngSrc,1);};return tiles.img.src=pngSrc;}}else{if(tiles.src)ready=1;pngW=pngH=0;}
tiles.src=pngSrc;if(!ready&&elmW==tiles.old.w&&elmH==tiles.old.h&&bgX==tiles.old.x&&bgY==tiles.old.y&&bgR==tiles.old.r){return;}
var pos={top:'0%',left:'0%',center:'50%',bottom:'100%',right:'100%'},x,y,pc;x=pos[bgX]||bgX;y=pos[bgY]||bgY;if(pc=x.match(/(\d+)%/)){x=Math.round((elmW-pngW)*(parseInt(pc[1])/100));}
if(pc=y.match(/(\d+)%/)){y=Math.round((elmH-pngH)*(parseInt(pc[1])/100));}
x=parseInt(x);y=parseInt(y);var repeatX={'repeat':1,'repeat-x':1}[bgR],repeatY={'repeat':1,'repeat-y':1}[bgR];if(repeatX){x%=pngW;if(x>0)x-=pngW;}
if(repeatY){y%=pngH;if(y>0)y-=pngH;}
this.hook.enabled=0;if(!({relative:1,absolute:1}[elm.currentStyle.position])){elm.style.position='relative';}
var count=0,xPos,maxX=repeatX?elmW:x+0.1,yPos,maxY=repeatY?elmH:y+0.1,d,s,isNew;if(pngW&&pngH){for(xPos=x;xPos<maxX;xPos+=pngW){for(yPos=y;yPos<maxY;yPos+=pngH){isNew=0;if(!tiles.cache[count]){tiles.cache[count]=document.createElement('div');isNew=1;}
var clipR=(xPos+pngW>elmW?elmW-xPos:pngW),clipB=(yPos+pngH>elmH?elmH-yPos:pngH);d=tiles.cache[count];s=d.style;s.behavior='none';s.left=xPos+'px';s.top=yPos+'px';s.width=clipR+'px';s.height=clipB+'px';s.clip='rect('+
(yPos<0?0-yPos:0)+'px,'+
clipR+'px,'+
clipB+'px,'+
(xPos<0?0-xPos:0)+'px)';s.display='block';if(isNew){s.position='absolute';s.zIndex=-999;if(elm.firstChild){elm.insertBefore(d,elm.firstChild);}else{elm.appendChild(d);}}
this.fix(d,pngSrc,0);count++;}}}
while(count<tiles.cache.length){this.fix(tiles.cache[count],'',0);tiles.cache[count++].style.display='none';}
this.hook.enabled=1;tiles.old={w:elmW,h:elmH,x:bgX,y:bgY,r:bgR};};IEPNGFix.update=function(){for(var i in IEPNGFix.data){var t=IEPNGFix.data[i].tiles;if(t&&t.elm&&t.src){IEPNGFix.tileBG(t.elm,t.src);}}};IEPNGFix.update.timer=0;if(window.attachEvent&&!window.opera){window.attachEvent('onresize',function(){clearTimeout(IEPNGFix.update.timer);IEPNGFix.update.timer=setTimeout(IEPNGFix.update,100);});}

View file

@ -5,272 +5,13 @@
* @namespace xe
* @update 20100701
*/
(function($){
var _xe_base, _app_base, _plugin_base;
var _apps = [];
_xe_base = {
/**
* @brief return the name of Core module
*/
getName : function() {
return 'Core';
},
/**
* @brief Create an application class
*/
createApp : function(sName, oDef) {
var _base = getTypeBase();
$.extend(_base.prototype, _app_base, oDef);
_base.prototype.getName = function() {
return sName;
};
return _base;
},
/**
* @brief Create a plugin class
*/
createPlugin : function(sName, oDef) {
var _base = getTypeBase();
$.extend(_base.prototype, _plugin_base, oDef);
_base.prototype.getName = function() {
return sName;
};
return _base;
},
/**
* @brief Get the array of applications
*/
getApps : function() {
return $.makeArray(_apps);
},
/**
* @brief Get one application
*/
getApp : function(indexOrName) {
indexOrName = (indexOrName||'').toLowerCase();
if(typeof _apps[indexOrName] != 'undefined') {
return _apps[indexOrName];
} else {
return null;
}
},
/**
* @brief Register an application instance
*/
registerApp : function(oApp) {
var sName = oApp.getName().toLowerCase();
_apps.push(oApp);
if (!$.isArray(_apps[sName])) {
_apps[sName] = [];
}
_apps[sName].push(oApp);
oApp.parent = this;
// TODO : register event
},
/**
* @brief Unregister an application instance
*/
unregisterApp : function(oApp) {
var sName = oPlugin.getName().toLowerCase();
var nIndex = $.inArray(oApp, _apps);
if (nIndex >= 0) _apps.splice(nIndex, 1);
if ($.isArray(_apps[sName])) {
nIndex = $.inArray(oApp, _apps[sName]);
if (nIndex >= 0) _apps[sName].splice(nIndex, 1);
}
// TODO : unregister event
},
/**
* @brief overrides broadcast method
*/
broadcast : function(msg, params) {
this._broadcast(this, msg, params);
},
_broadcast : function(sender, msg, params) {
for(var i=0; i < _apps.length; i++) {
_apps[i]._cast(sender, msg, params);
}
// cast to child plugins
this._cast(sender, msg, params);
}
}
_app_base = {
_plugins : [],
_messages : {},
/**
* @brief get plugin
*/
getPlugin : function(sPluginName) {
sPluginName = sPluginsName.toLowerCase();
if ($.isArray(this._plugins[sPluginName])) {
return this._plugins[sPluginName];
} else {
return [];
}
},
/**
* @brief register a plugin instance
*/
registerPlugin : function(oPlugin) {
var self = this;
var sName = oPlugin.getName().toLowerCase();
// check if the plugin is already registered
if ($.inArray(oPlugin, this._plugins) >= 0) return false;
// push the plugin into the _plugins array
this._plugins.push(oPlugin);
if (!$.isArray(this._plugins[sName])) this._plugins[sName] = [];
this._plugins[sName].push(oPlugin);
// register method pool
$.each(oPlugin._binded_fn, function(api, fn){ self.registerHandler(api, fn); });
// binding
oPlugin.oApp = this;
// TODO : registered event
return true;
},
/**
* @brief register api message handler
*/
registerHandler : function(api, func) {
var msgs = this._messages; api = api.toUpperCase();
if (!$.isArray(msgs[api])) msgs[api] = [];
msgs[api].push(func);
},
cast : function(msg, params) {
return this._cast(this, msg, params || []);
},
broadcast : function(sender, msg, params) {
if (this.parent && this.parent._broadcast) {
this.parent._broadcast(sender, msg, params);
}
},
_cast : function(sender, msg, params) {
var i, len;
var aMsg = this._messages;
msg = msg.toUpperCase();
// BEFORE hooker
if (aMsg['BEFORE_'+msg] || this['API_BEFORE_'+msg]) {
var bContinue = this._cast(sender, 'BEFORE_'+msg, params);
if (!bContinue) return;
}
// main api function
var vRet = [], sFn = 'API_'+msg;
if ($.isArray(aMsg[msg])) {
for(i=0; i < aMsg[msg].length; i++) {
vRet.push( aMsg[msg][i](sender, params) );
}
}
if (vRet.length < 2) vRet = vRet[0];
// AFTER hooker
if (aMsg['AFTER_'+msg] || this['API_AFTER_'+msg]) {
this._cast(sender, 'AFTER_'+msg, params);
}
if (!/^(?:AFTER|BEFORE)_/.test(msg)) { // top level function
return vRet;
} else {
return $.isArray(vRet)?($.inArray(false, vRet)<0):((typeof vRet=='undefined')?true:!!vRet);
}
}
};
_plugin_base = {
oApp : null,
cast : function(msg, params) {
if (this.oApp && this.oApp._cast) {
return this.oApp._cast(this, msg, params || []);
}
},
broadcast : function(msg, params) {
if (this.oApp && this.oApp.broadcast) {
this.oApp.broadcast(this, mag, params || []);
}
}
/**
* Event handler prototype
*
* function (oSender, params)
*/
};
function getTypeBase() {
var _base = function() {
var self = this;
var pool = null;
if ($.isArray(this._plugins)) this._plugins = [];
if (this._messages) this._messages = {};
else this._binded_fn = {};
// bind functions
$.each(this, function(key, val){
if (!$.isFunction(val)) return true;
if (!/^API_([A-Z0-9_]+)$/.test(key)) return true;
var api = RegExp.$1;
var fn = function(sender, params){ return self[key](sender, params) };
if (self._messages) self._messages[api] = [fn];
else self._binded_fn[api] = fn;
});
if ($.isFunction(this.init)) this.init.apply(this, arguments);
};
return _base;
}
window.xe = $.extend(_app_base, _xe_base);
window.xe.lang = {}; // language repository
// domready event
$(function(){ xe.broadcast('ONREADY'); });
// load event
$(window).load(function(){ xe.broadcast('ONLOAD'); });
})(jQuery);
(function($){var _xe_base,_app_base,_plugin_base;var _apps=[];_xe_base={getName:function(){return'Core';},createApp:function(sName,oDef){var _base=getTypeBase();$.extend(_base.prototype,_app_base,oDef);_base.prototype.getName=function(){return sName;};return _base;},createPlugin:function(sName,oDef){var _base=getTypeBase();$.extend(_base.prototype,_plugin_base,oDef);_base.prototype.getName=function(){return sName;};return _base;},getApps:function(){return $.makeArray(_apps);},getApp:function(indexOrName){indexOrName=(indexOrName||'').toLowerCase();if(typeof _apps[indexOrName]!='undefined'){return _apps[indexOrName];}else{return null;}},registerApp:function(oApp){var sName=oApp.getName().toLowerCase();_apps.push(oApp);if(!$.isArray(_apps[sName])){_apps[sName]=[];}
_apps[sName].push(oApp);oApp.parent=this;if($.isFunction(oApp.activate))oApp.activate();},unregisterApp:function(oApp){var sName=oPlugin.getName().toLowerCase();var nIndex=$.inArray(oApp,_apps);if(nIndex>=0)_apps.splice(nIndex,1);if($.isArray(_apps[sName])){nIndex=$.inArray(oApp,_apps[sName]);if(nIndex>=0)_apps[sName].splice(nIndex,1);}
if($.isFunction(oApp.deactivate))oApp.deactivate();},broadcast:function(msg,params){this._broadcast(this,msg,params);},_broadcast:function(sender,msg,params){for(var i=0;i<_apps.length;i++){_apps[i]._cast(sender,msg,params);}
this._cast(sender,msg,params);}}
_app_base={_plugins:[],_messages:{},getPlugin:function(sPluginName){sPluginName=sPluginName.toLowerCase();if($.isArray(this._plugins[sPluginName])){return this._plugins[sPluginName];}else{return[];}},registerPlugin:function(oPlugin){var self=this;var sName=oPlugin.getName().toLowerCase();if($.inArray(oPlugin,this._plugins)>=0)return false;this._plugins.push(oPlugin);if(!$.isArray(this._plugins[sName]))this._plugins[sName]=[];this._plugins[sName].push(oPlugin);$.each(oPlugin._binded_fn,function(api,fn){self.registerHandler(api,fn);});oPlugin.oApp=this;if($.isFunction(oPlugin.activate))oPlugin.activate();return true;},registerHandler:function(api,func){var msgs=this._messages;api=api.toUpperCase();if(!$.isArray(msgs[api]))msgs[api]=[];msgs[api].push(func);},cast:function(msg,params){return this._cast(this,msg,params||[]);},broadcast:function(sender,msg,params){if(this.parent&&this.parent._broadcast){this.parent._broadcast(sender,msg,params);}},_cast:function(sender,msg,params){var i,len;var aMsg=this._messages;msg=msg.toUpperCase();if(aMsg['BEFORE_'+msg]||this['API_BEFORE_'+msg]){var bContinue=this._cast(sender,'BEFORE_'+msg,params);if(!bContinue)return;}
var vRet=[],sFn='API_'+msg;if($.isArray(aMsg[msg])){for(i=0;i<aMsg[msg].length;i++){vRet.push(aMsg[msg][i](sender,params));}}
if(vRet.length<2)vRet=vRet[0];if(aMsg['AFTER_'+msg]||this['API_AFTER_'+msg]){this._cast(sender,'AFTER_'+msg,params);}
if(!/^(?:AFTER|BEFORE)_/.test(msg)){return vRet;}else{return $.isArray(vRet)?($.inArray(false,vRet)<0):((typeof vRet=='undefined')?true:!!vRet);}}};_plugin_base={oApp:null,cast:function(msg,params){if(this.oApp&&this.oApp._cast){return this.oApp._cast(this,msg,params||[]);}},broadcast:function(msg,params){if(this.oApp&&this.oApp.broadcast){this.oApp.broadcast(this,mag,params||[]);}}};function getTypeBase(){var _base=function(){var self=this;var pool=null;if($.isArray(this._plugins))this._plugins=[];if(this._messages)this._messages={};else this._binded_fn={};$.each(this,function(key,val){if(!$.isFunction(val))return true;if(!/^API_([A-Z0-9_]+)$/.test(key))return true;var api=RegExp.$1;var fn=function(sender,params){return self[key](sender,params)};if(self._messages)self._messages[api]=[fn];else self._binded_fn[api]=fn;});if($.isFunction(this.init))this.init.apply(this,arguments);};return _base;}
window.xe=$.extend(_app_base,_xe_base);window.xe.lang={};$(function(){xe.broadcast('ONREADY');});$(window).load(function(){xe.broadcast('ONLOAD');});})(jQuery);

981
common/js/src/common.js Normal file
View file

@ -0,0 +1,981 @@
/**
* @file common.js
* @author zero (zero@nzeo.com)
* @brief 몇가지 유용한 & 기본적으로 자주 사용되는 자바스크립트 함수들 모음
**/
/* jQuery 참조변수($) 제거 */
if(jQuery) jQuery.noConflict();
(function($) {
/* OS check */
var UA = navigator.userAgent.toLowerCase();
$.os = {
Linux: /linux/.test(UA),
Unix: /x11/.test(UA),
Mac: /mac/.test(UA),
Windows: /win/.test(UA)
};
$.os.name = ($.os.Windows) ? 'Windows' :
($.os.Linux) ? 'Linux' :
($.os.Unix) ? 'Unix' :
($.os.Mac) ? 'Mac' : '';
/**
* @brief XE 공용 유틸리티 함수
* @namespace XE
*/
window.XE = {
loaded_popup_menus : new Array(),
addedDocument : new Array(),
/**
* @brief 특정 name을 가진 체크박스들의 checked 속성 변경
* @param [itemName='cart',][options={}]
*/
checkboxToggleAll : function() {
var itemName='cart';
var options = {
wrap : null,
checked : 'toggle',
doClick : false
};
switch(arguments.length) {
case 1:
if(typeof(arguments[0]) == "string") {
itemName = arguments[0];
} else {
$.extend(options, arguments[0] || {});
}
break;
case 2:
itemName = arguments[0];
$.extend(options, arguments[1] || {});
}
if(options.doClick == true) options.checked = null;
if(typeof(options.wrap) == "string") options.wrap ='#'+options.wrap;
if(options.wrap) {
var obj = $(options.wrap).find('input[name='+itemName+']:checkbox');
} else {
var obj = $('input[name='+itemName+']:checkbox');
}
if(options.checked == 'toggle') {
obj.each(function() {
$(this).attr('checked', ($(this).attr('checked')) ? false : true);
});
} else {
(options.doClick == true) ? obj.click() : obj.attr('checked', options.checked);
}
},
/**
* @brief 문서/회원 팝업 메뉴 출력
*/
displayPopupMenu : function(ret_obj, response_tags, params) {
var target_srl = params["target_srl"];
var menu_id = params["menu_id"];
var menus = ret_obj['menus'];
var html = "";
if(this.loaded_popup_menus[menu_id]) {
html = this.loaded_popup_menus[menu_id];
} else {
if(menus) {
var item = menus['item'];
if(typeof(item.length)=='undefined' || item.length<1) item = new Array(item);
if(item.length) {
for(var i=0;i<item.length;i++) {
var url = item[i].url;
var str = item[i].str;
var icon = item[i].icon;
var target = item[i].target;
var styleText = "";
var click_str = "";
if(icon) styleText = " style=\"background-image:url('"+icon+"')\" ";
switch(target) {
case "popup" :
click_str = " onclick=\"popopen(this.href,'"+target+"'); return false;\"";
break;
case "self" :
//click_str = " onclick=\"location.href='"+url+"' return false;\"";
break;
case "javascript" :
click_str = " onclick=\""+url+"; return false; \"";
url="#";
break;
default :
click_str = " onclick=\"window.open(this.href); return false;\"";
break;
}
html += '<li '+styleText+'><a href="'+url+'"'+click_str+'>'+str+'</a></li> ';
}
}
}
this.loaded_popup_menus[menu_id] = html;
}
/* 레이어 출력 */
if(html) {
var area = $('#popup_menu_area').html('<ul>'+html+'</ul>');
var areaOffset = {top:params['page_y'], left:params['page_x']};
if(area.outerHeight()+areaOffset.top > $(window).height()+$(window).scrollTop())
areaOffset.top = $(window).height() - area.outerHeight() + $(window).scrollTop();
if(area.outerWidth()+areaOffset.left > $(window).width()+$(window).scrollLeft())
areaOffset.left = $(window).width() - area.outerWidth() + $(window).scrollLeft();
area.css({ top:areaOffset.top, left:areaOffset.left }).show();
}
}
}
}) (jQuery);
/* jQuery(document).ready() */
jQuery(function($) {
/* 팝업메뉴 레이어 생성 */
if(!$('#popup_menu_area').length) {
var menuObj = $('<div>')
.attr('id', 'popup_menu_area')
.css({display:'none', zIndex:9999});
$(document.body).append(menuObj);
}
$(document).click(function(evt) {
var area = $('#popup_menu_area');
if(!area.length) return;
// 이전에 호출되었을지 모르는 팝업메뉴 숨김
area.hide();
var targetObj = $(evt.target);
if(!targetObj.length) return;
// obj의 nodeName이 div나 span이 아니면 나올대까지 상위를 찾음
if(targetObj.length && $.inArray(targetObj.attr('nodeName'), ['DIV', 'SPAN', 'A']) == -1) targetObj = targetObj.parent();
if(!targetObj.length || $.inArray(targetObj.attr('nodeName'), ['DIV', 'SPAN', 'A']) == -1) return;
// 객체의 className값을 구함
var class_name = targetObj.attr('className');
if(class_name.indexOf('_') <= 0) return;
// className을 분리
var class_name_list = class_name.split(' ');
var menu_id = '';
var menu_id_regx = /^([a-zA-Z]+)_([0-9]+)$/;
for(var i = 0, c = class_name_list.length; i < c; i++) {
if(menu_id_regx.test(class_name_list[i])) {
menu_id = class_name_list[i];
}
}
if(!menu_id) return;
// module명과 대상 번호가 없으면 return
var tmp_arr = menu_id.split('_');
var module_name = tmp_arr[0];
var target_srl = tmp_arr[1];
if(!module_name || !target_srl || target_srl < 1) return;
// action이름을 규칙에 맞게 작성
var action_name = "get" + module_name.substr(0,1).toUpperCase() + module_name.substr(1,module_name.length-1) + "Menu";
// 서버에 메뉴를 요청
var params = new Array();
params["target_srl"] = target_srl;
params["mid"] = params["cur_mid"] = current_mid;
params["cur_act"] = current_url.getQuery('act');
params["menu_id"] = menu_id;
params["page_x"] = evt.pageX;
params["page_y"] = evt.pageY;
if(typeof(xeVid)!='undefined') params["vid"] = xeVid;
var response_tags = new Array("error","message","menus");
if(typeof(XE.loaded_popup_menus[menu_id]) != 'undefined') {
XE.displayPopupMenu(params, response_tags, params);
return;
}
show_waiting_message = false;
exec_xml(module_name, action_name, params, XE.displayPopupMenu, response_tags, params);
show_waiting_message = true;
});
/* select - option의 disabled=disabled 속성을 IE에서도 체크하기 위한 함수 */
if($.browser.msie) {
$('select').each(function(i, sels) {
var disabled_exists = false;
var first_enable = new Array();
for(var j=0; j < sels.options.length; j++) {
if(sels.options[j].disabled) {
sels.options[j].style.color = '#CCCCCC';
disabled_exists = true;
}else{
first_enable[i] = (first_enable[i] > -1) ? first_enable[i] : j;
}
}
if(!disabled_exists) return;
sels.oldonchange = sels.onchange;
sels.onchange = function() {
if(this.options[this.selectedIndex].disabled) {
this.selectedIndex = first_enable[i];
/*
if(this.options.length<=1) this.selectedIndex = -1;
else if(this.selectedIndex < this.options.length - 1) this.selectedIndex++;
else this.selectedIndex--;
*/
} else {
if(this.oldonchange) this.oldonchange();
}
};
if(sels.selectedIndex >= 0 && sels.options[ sels.selectedIndex ].disabled) sels.onchange();
});
}
/* 단락에디터 fold 컴포넌트 펼치기/접기 */
var drEditorFold = $('.xe_content .fold_button');
if(drEditorFold.size()) {
var fold_container = $('div.fold_container', drEditorFold);
$('button.more', drEditorFold).click(function() {
$(this).hide().next('button').show().parent().next(fold_container).show();
});
$('button.less', drEditorFold).click(function() {
$(this).hide().prev('button').show().parent().next(fold_container).hide();
});
}
});
/**
* @brief location.href에서 특정 key의 값을 return
**/
String.prototype.getQuery = function(key) {
var idx = this.indexOf('?');
if(idx == -1) return null;
var query_string = this.substr(idx+1, this.length);
var args = {};
query_string.replace(/([^=]+)=([^&]*)(&|$)/g, function() { args[arguments[1]] = arguments[2]; });
var q = args[key];
if(typeof(q)=="undefined") q = "";
return q;
}
/**
* @brief location.href에서 특정 key의 값을 return
**/
String.prototype.setQuery = function(key, val) {
var idx = this.indexOf('?');
var uri = this;
uri = uri.replace(/#$/,'');
if(idx != -1) {
uri = this.substr(0, idx);
var query_string = this.substr(idx+1, this.length);
var args = new Array();
query_string.replace(/([^=]+)=([^&]*)(&|$)/g, function() { args[arguments[1]] = arguments[2]; });
args[key] = val;
var q_list = new Array();
for(var i in args) {
if( !args.hasOwnProperty(i) ) continue;
var arg = args[i];
if(!arg.toString().trim()) continue;
arg = decodeURI(arg);
q_list[q_list.length] = i+'='+arg;
}
uri = uri+"?"+q_list.join("&");
} else {
if(val.toString().trim()) uri = uri+"?"+key+"="+val;
}
var re = /https:\/\/([^:\/]+)(:\d+|)/i;
var check = re.exec(uri);
if(check)
{
var toReplace = "http://"+check[1];
if(typeof(http_port)!='undefined' && http_port != 80)
{
toReplace += ":" + http_port;
}
uri = uri.replace(re,toReplace);
}
var bUseSSL = false;
if(typeof(enforce_ssl)!='undefined' && enforce_ssl)
{
bUseSSL = true;
}
else if(typeof(ssl_actions)!='undefined' && typeof(ssl_actions.length)!='undefined' && uri.getQuery('act')) {
var act = uri.getQuery('act');
for(i=0;i<ssl_actions.length;i++) {
if(ssl_actions[i]==act) {
bUseSSL = true;
break;
}
}
}
if(bUseSSL)
{
var re = /http:\/\/([^:\/]+)(:\d+|)/i;
var check = re.exec(uri);
if(check)
{
var toReplace = "https://"+check[1];
if(typeof(https_port)!='undefined' && https_port != 443)
{
toReplace += ":" + https_port;
}
uri = uri.replace(re,toReplace);
}
}
return encodeURI(uri);
}
/**
* @brief string prototype으로 trim 함수 추가
**/
String.prototype.trim = function() {
return this.replace(/(^\s*)|(\s*$)/g, "");
}
/**
* @brief xSleep(micro time)
**/
function xSleep(sec) {
sec = sec / 1000;
var now = new Date();
var sleep = new Date();
while( sleep.getTime() - now.getTime() < sec) {
sleep = new Date();
}
}
/**
* @brief 주어진 인자가 하나라도 defined되어 있지 않으면 false return
**/
function isDef() {
for(var i=0; i < arguments.length; ++i) {
if(typeof(arguments[i]) == "undefined") return false;
}
return true;
}
/**
* @brief 윈도우 오픈
* 열려진 윈도우의 관리를 통해 window.focus()등을 FF에서도 비슷하게 구현함
**/
var winopen_list = new Array();
function winopen(url, target, attribute) {
if(typeof(xeVid)!='undefined' && url.indexOf(request_uri)>-1 && !url.getQuery('vid')) url = url.setQuery('vid',xeVid);
try {
if(target != "_blank" && winopen_list[target]) {
winopen_list[target].close();
winopen_list[target] = null;
}
} catch(e) {
}
if(typeof(target) == 'undefined') target = '_blank';
if(typeof(attribute) == 'undefined') attribute = '';
var win = window.open(url, target, attribute);
win.focus();
if(target != "_blank") winopen_list[target] = win;
}
/**
* @brief 팝업으로만 띄우기
* common/tpl/popup_layout.html이 요청되는 XE내의 팝업일 경우에 사용
**/
function popopen(url, target) {
if(typeof(target) == "undefined") target = "_blank";
if(typeof(xeVid)!='undefined' && url.indexOf(request_uri)>-1 && !url.getQuery('vid')) url = url.setQuery('vid',xeVid);
winopen(url, target, "left=10,top=10,width=10,height=10,scrollbars=no,resizable=yes,toolbars=no");
}
/**
* @brief 메일 보내기용
**/
function sendMailTo(to) {
location.href="mailto:"+to;
}
/**
* @brief url이동 (open_window 값이 N 아니면 새창으로 띄움)
**/
function move_url(url, open_wnidow) {
if(!url) return false;
if(typeof(open_wnidow) == 'undefined') open_wnidow = 'N';
if(open_wnidow=='N') {
open_wnidow = false;
} else {
open_wnidow = true;
}
if(/^\./.test(url)) url = request_uri+url;
if(open_wnidow) {
winopen(url);
} else {
location.href=url;
}
return false;
}
/**
* @brief 멀티미디어 출력용 (IE에서 플래쉬/동영상 주변에 점선 생김 방지용)
**/
function displayMultimedia(src, width, height, options) {
var html = _displayMultimedia(src, width, height, options);
if(html) document.writeln(html);
}
function _displayMultimedia(src, width, height, options) {
if(src.indexOf('files') == 0) src = request_uri + src;
var defaults = {
wmode : 'transparent',
allowScriptAccess : 'sameDomain',
quality : 'high',
flashvars : '',
autostart : false
};
var params = jQuery.extend(defaults, options || {});
var autostart = (params.autostart && params.autostart != 'false') ? 'true' : 'false';
delete(params.autostart);
var clsid = "";
var codebase = "";
var html = "";
if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(src)){
html = '<img src="'+src+'" width="'+width+'" height="'+height+'" />';
} else if(/\.flv$/i.test(src) || /\.mov$/i.test(src) || /\.moov$/i.test(src) || /\.m4v$/i.test(src)) {
html = '<embed src="'+request_uri+'common/tpl/images/flvplayer.swf" allowfullscreen="true" autostart="'+autostart+'" width="'+width+'" height="'+height+'" flashvars="&file='+src+'&width='+width+'&height='+height+'&autostart='+autostart+'" wmode="'+params.wmode+'" />';
} else if(/\.swf/i.test(src)) {
clsid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
if(typeof(enforce_ssl)!='undefined' && enforce_ssl){ codebase = "https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"; }
else { codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"; }
html = '<object classid="'+clsid+'" codebase="'+codebase+'" width="'+width+'" height="'+height+'" flashvars="'+params.flashvars+'">';
html += '<param name="movie" value="'+src+'" />';
for(var name in params) {
if(params[name] != 'undefined' && params[name] != '') {
html += '<param name="'+name+'" value="'+params[name]+'" />';
}
}
html += ''
+ '<embed src="'+src+'" autostart="'+autostart+'" width="'+width+'" height="'+height+'" flashvars="'+params.flashvars+'" wmode="'+params.wmode+'"></embed>'
+ '</object>';
} else {
if (jQuery.browser.mozilla || jQuery.browser.opera) {
// firefox and opera uses 0 or 1 for autostart parameter.
autostart = (params.autostart && params.autostart != 'false') ? '1' : '0';
}
html = '<embed src="'+src+'" autostart="'+autostart+'" width="'+width+'" height="'+height+'"';
if(params.wmode == 'transparent') {
html += ' windowlessvideo="1"';
}
html += '></embed>';
}
return html;
}
/**
* @brief 에디터에서 사용되는 내용 여닫는 코드 (고정, zbxe용)
**/
function zbxe_folder_open(id) {
jQuery("#folder_open_"+id).hide();
jQuery("#folder_close_"+id).show();
jQuery("#folder_"+id).show();
}
function zbxe_folder_close(id) {
jQuery("#folder_open_"+id).show();
jQuery("#folder_close_"+id).hide();
jQuery("#folder_"+id).hide();
}
/**
* @brief 팝업의 경우 내용에 맞춰 윈도우의 크기를 조절해줌
* 팝업의 내용에 맞게 크기를 늘리는 것은... 쉽게 되지는 않음.. .
* popup_layout 에서 window.onload 자동 요청됨.
**/
function setFixedPopupSize() {
var $ = jQuery;
var $header = $('#popHeader');
var $body = $('#popBody');
if ($body.length) {
if ($body.height() > 400) {
$body.css({ overflow:'auto', overflowX:'hidden', height:400+'px' });
}
}
var $win = $(window);
var $pc = $('#popup_content');
var w = Math.max($pc[0].offsetWidth, 600);
var h = $pc[0].offsetHeight;
var dw = $win.width();
var dh = $win.height();
var _w = 0, _h = 0;
if (w != dw) _w = w - dw;
if (h != dh) _h = h - dh;
if (_w || _h) {
window.resizeBy(_w, _h);
}
if (!arguments.callee.executed) {
setTimeout(setFixedPopupSize, 300);
arguments.callee.executed = true;
}
}
/**
* @brief 추천/비추천,스크랩,신고기능등 특정 srl에 대한 특정 module/action을 호출하는 함수
**/
function doCallModuleAction(module, action, target_srl) {
var params = new Array();
params['target_srl'] = target_srl;
params['cur_mid'] = current_mid;
exec_xml(module, action, params, completeCallModuleAction);
}
function completeCallModuleAction(ret_obj, response_tags) {
if(ret_obj['message']!='success') alert(ret_obj['message']);
location.reload();
}
function completeMessage(ret_obj) {
alert(ret_obj['message']);
location.reload();
}
/* 언어코드 (lang_type) 쿠키값 변경 */
function doChangeLangType(obj) {
if(typeof(obj) == "string") {
setLangType(obj);
} else {
var val = obj.options[obj.selectedIndex].value;
setLangType(val);
}
location.reload();
}
function setLangType(lang_type) {
var expire = new Date();
expire.setTime(expire.getTime()+ (7000 * 24 * 3600000));
xSetCookie('lang_type', lang_type, expire, '/');
}
/* 미리보기 */
function doDocumentPreview(obj) {
var fo_obj = obj;
while(fo_obj.nodeName != "FORM") {
fo_obj = fo_obj.parentNode;
}
if(fo_obj.nodeName != "FORM") return;
var editor_sequence = fo_obj.getAttribute('editor_sequence');
var content = editorGetContent(editor_sequence);
var win = window.open("", "previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes");
var dummy_obj = jQuery("#previewDocument");
if(!dummy_obj.length) {
jQuery(
'<form id="previewDocument" target="previewDocument" method="post" action="'+request_uri+'">'+
'<input type="hidden" name="module" value="document" />'+
'<input type="hidden" name="act" value="dispDocumentPreview" />'+
'<input type="hidden" name="content" />'+
'</form>'
).appendTo(document.body);
dummy_obj = jQuery("#previewDocument")[0];
}
if(dummy_obj) {
dummy_obj.content.value = content;
dummy_obj.submit();
}
}
/* 게시글 저장 */
function doDocumentSave(obj) {
var editor_sequence = obj.form.getAttribute('editor_sequence');
var prev_content = editorRelKeys[editor_sequence]['content'].value;
if(typeof(editor_sequence)!='undefined' && editor_sequence && typeof(editorRelKeys)!='undefined' && typeof(editorGetContent)=='function') {
var content = editorGetContent(editor_sequence);
editorRelKeys[editor_sequence]['content'].value = content;
}
var params={}, responses=['error','message','document_srl'], elms=obj.form.elements, data=jQuery(obj.form).serializeArray();;
jQuery.each(data, function(i, field){
var val = jQuery.trim(field.value);
if(!val) return true;
if(/\[\]$/.test(field.name)) field.name = field.name.replace(/\[\]$/, '');
if(params[field.name]) params[field.name] += '|@|'+val;
else params[field.name] = field.value;
});
exec_xml('member','procMemberSaveDocument', params, completeDocumentSave, responses, params, obj.form);
editorRelKeys[editor_sequence]['content'].value = prev_content;
return false;
}
function completeDocumentSave(ret_obj) {
jQuery('input[name=document_srl]').eq(0).val(ret_obj['document_srl']);
alert(ret_obj['message']);
}
/* 저장된 게시글 불러오기 */
var objForSavedDoc = null;
function doDocumentLoad(obj) {
// 저장된 게시글 목록 불러오기
objForSavedDoc = obj.form;
popopen(request_uri.setQuery('module','member').setQuery('act','dispSavedDocumentList'));
}
/* 저장된 게시글의 선택 */
function doDocumentSelect(document_srl) {
if(!opener || !opener.objForSavedDoc) {
window.close();
return;
}
// 게시글을 가져와서 등록하기
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite');
window.close();
}
/* 스킨 정보 */
function viewSkinInfo(module, skin) {
popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+module+"&skin="+skin, 'SkinInfo');
}
/* 관리자가 문서를 관리하기 위해서 선택시 세션에 넣음 */
var addedDocument = new Array();
function doAddDocumentCart(obj) {
var srl = obj.value;
addedDocument[addedDocument.length] = srl;
setTimeout(function() { callAddDocumentCart(addedDocument.length); }, 100);
}
function callAddDocumentCart(document_length) {
if(addedDocument.length<1 || document_length != addedDocument.length) return;
var params = new Array();
params["srls"] = addedDocument.join(",");
exec_xml("document","procDocumentAddCart", params, null);
addedDocument = new Array();
}
/* ff의 rgb(a,b,c)를 #... 로 변경 */
function transRGB2Hex(value) {
if(!value) return value;
if(value.indexOf('#') > -1) return value.replace(/^#/, '');
if(value.toLowerCase().indexOf('rgb') < 0) return value;
value = value.replace(/^rgb\(/i, '').replace(/\)$/, '');
value_list = value.split(',');
var hex = '';
for(var i = 0; i < value_list.length; i++) {
var color = parseInt(value_list[i], 10).toString(16);
if(color.length == 1) color = '0'+color;
hex += color;
}
return hex;
}
/* 보안 로그인 모드로 전환 */
function toggleSecuritySignIn() {
var href = location.href;
if(/https:\/\//i.test(href)) location.href = href.replace(/^https/i,'http');
else location.href = href.replace(/^http/i,'https');
}
function reloadDocument() {
location.reload();
}
/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/
var Base64 = {
// private property
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
// public method for encoding
encode : function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
input = Base64._utf8_encode(input);
while (i < input.length) {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output = output +
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
}
return output;
},
// public method for decoding
decode : function (input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
while (i < input.length) {
enc1 = this._keyStr.indexOf(input.charAt(i++));
enc2 = this._keyStr.indexOf(input.charAt(i++));
enc3 = this._keyStr.indexOf(input.charAt(i++));
enc4 = this._keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output = output + String.fromCharCode(chr1);
if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
}
output = Base64._utf8_decode(output);
return output;
},
// private method for UTF-8 encoding
_utf8_encode : function (string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
}
else if((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
},
// private method for UTF-8 decoding
_utf8_decode : function (utftext) {
var string = "";
var i = 0;
var c = c1 = c2 = 0;
while ( i < utftext.length ) {
c = utftext.charCodeAt(i);
if (c < 128) {
string += String.fromCharCode(c);
i++;
}
else if((c > 191) && (c < 224)) {
c2 = utftext.charCodeAt(i+1);
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
}
else {
c2 = utftext.charCodeAt(i+1);
c3 = utftext.charCodeAt(i+2);
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return string;
}
}
/* ----------------------------------------------
* DEPRECATED
* 하위호환용으로 남겨 놓음
* ------------------------------------------- */
if(typeof(resizeImageContents) == 'undefined') {
function resizeImageContents() {}
}
if(typeof(activateOptionDisabled) == 'undefined') {
function activateOptionDisabled() {}
}
objectExtend = jQuery.extend;
/**
* @brief 특정 Element의 display 옵션 토글
**/
function toggleDisplay(objId) {
jQuery('#'+objId).toggle();
}
/* 체크박스 선택 */
function checkboxSelectAll(formObj, name, checked) {
var itemName = name;
var option = {};
if(typeof(formObj) != "undefined") option.wrap = formObj;
if(typeof(checked) != "undefined") option.checked = checked;
XE.checkboxToggleAll(itemName, option);
}
/* 체크박스를 실행 */
function clickCheckBoxAll(formObj, name) {
var itemName = name;
var option = { doClick:true };
if(typeof(formObj) != "undefined") option.wrap = formObj;
XE.checkboxToggleAll(itemName, option);
}
/**
* @brief 에디터에서 사용하되 내용 여닫는 코드 (zb5beta beta 호환용으로 남겨 놓음)
**/
function svc_folder_open(id) {
jQuery("#_folder_open_"+id).hide();
jQuery("#_folder_close_"+id).show();
jQuery("#_folder_"+id).show();
}
function svc_folder_close(id) {
jQuery("#_folder_open_"+id).show();
jQuery("#_folder_close_"+id).hide();
jQuery("#_folder_"+id).hide();
}
/**
* @brief 날짜 선택 (달력 열기)
**/
function open_calendar(fo_id, day_str, callback_func) {
if(typeof(day_str)=="undefined") day_str = "";
var url = "./common/tpl/calendar.php?";
if(fo_id) url+="fo_id="+fo_id;
if(day_str) url+="&day_str="+day_str;
if(callback_func) url+="&callback_func="+callback_func;
popopen(url, 'Calendar');
}
var loaded_popup_menus = XE.loaded_popup_menus;
function createPopupMenu() {}
function chkPopupMenu() {}
function displayPopupMenu(ret_obj, response_tags, params) {
XE.displayPopupMenu(ret_obj, response_tags, params);
}
function GetObjLeft(obj) {
return jQuery(obj).offset().left;
}
function GetObjTop(obj) {
return jQuery(obj).offset().top;
}
function replaceOuterHTML(obj, html) {
jQuery(obj).replaceWith(html);
}
function getOuterHTML(obj) {
return jQuery(obj).html().trim();
}
jQuery(function(){
jQuery(".lang_code").each(
function()
{
var objText = jQuery(this);
var targetName = objText.attr("id");
if(typeof(targetName) == "undefined") targetName = objText.attr("name");
if(typeof(targetName) == "undefined") return;
objText.after("<a href='"+request_uri.setQuery('module','module').setQuery('act','dispModuleAdminLangcode').setQuery('target',targetName)+"' class='buttonSet buttonSetting' onclick='popopen(this.href);return false;'><span>find_langcode</span></a>");
}
);
});

View file

@ -0,0 +1,173 @@
// IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support
// (c) 2008 Angus Turnbull http://www.twinhelix.com
// This is licensed under the GNU LGPL, version 2.1 or later.
// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
var IEPNGFix = window.IEPNGFix || {};
IEPNGFix.tileBG = function(elm, pngSrc, ready) {
// Params: A reference to a DOM element, the PNG src file pathname, and a
// hidden "ready-to-run" passed when called back after image preloading.
var data = this.data[elm.uniqueID],
elmW = Math.max(elm.clientWidth, elm.scrollWidth),
elmH = Math.max(elm.clientHeight, elm.scrollHeight),
bgX = elm.currentStyle.backgroundPositionX,
bgY = elm.currentStyle.backgroundPositionY,
bgR = elm.currentStyle.backgroundRepeat;
// Cache of DIVs created per element, and image preloader/data.
if (!data.tiles) {
data.tiles = {
elm: elm,
src: '',
cache: [],
img: new Image(),
old: {}
};
}
var tiles = data.tiles,
pngW = tiles.img.width,
pngH = tiles.img.height;
if (pngSrc) {
if (!ready && pngSrc != tiles.src) {
// New image? Preload it with a callback to detect dimensions.
tiles.img.onload = function() {
this.onload = null;
IEPNGFix.tileBG(elm, pngSrc, 1);
};
return tiles.img.src = pngSrc;
}
} else {
// No image?
if (tiles.src) ready = 1;
pngW = pngH = 0;
}
tiles.src = pngSrc;
if (!ready && elmW == tiles.old.w && elmH == tiles.old.h &&
bgX == tiles.old.x && bgY == tiles.old.y && bgR == tiles.old.r) {
return;
}
// Convert English and percentage positions to pixels.
var pos = {
top: '0%',
left: '0%',
center: '50%',
bottom: '100%',
right: '100%'
},
x,
y,
pc;
x = pos[bgX] || bgX;
y = pos[bgY] || bgY;
if (pc = x.match(/(\d+)%/)) {
x = Math.round((elmW - pngW) * (parseInt(pc[1]) / 100));
}
if (pc = y.match(/(\d+)%/)) {
y = Math.round((elmH - pngH) * (parseInt(pc[1]) / 100));
}
x = parseInt(x);
y = parseInt(y);
// Handle backgroundRepeat.
var repeatX = { 'repeat': 1, 'repeat-x': 1 }[bgR],
repeatY = { 'repeat': 1, 'repeat-y': 1 }[bgR];
if (repeatX) {
x %= pngW;
if (x > 0) x -= pngW;
}
if (repeatY) {
y %= pngH;
if (y > 0) y -= pngH;
}
// Go!
this.hook.enabled = 0;
if (!({ relative: 1, absolute: 1 }[elm.currentStyle.position])) {
elm.style.position = 'relative';
}
var count = 0,
xPos,
maxX = repeatX ? elmW : x + 0.1,
yPos,
maxY = repeatY ? elmH : y + 0.1,
d,
s,
isNew;
if (pngW && pngH) {
for (xPos = x; xPos < maxX; xPos += pngW) {
for (yPos = y; yPos < maxY; yPos += pngH) {
isNew = 0;
if (!tiles.cache[count]) {
tiles.cache[count] = document.createElement('div');
isNew = 1;
}
var clipR = (xPos + pngW > elmW ? elmW - xPos : pngW),
clipB = (yPos + pngH > elmH ? elmH - yPos : pngH);
d = tiles.cache[count];
s = d.style;
s.behavior = 'none';
s.left = xPos + 'px';
s.top = yPos + 'px';
s.width = clipR + 'px';
s.height = clipB + 'px';
s.clip = 'rect(' +
(yPos < 0 ? 0 - yPos : 0) + 'px,' +
clipR + 'px,' +
clipB + 'px,' +
(xPos < 0 ? 0 - xPos : 0) + 'px)';
s.display = 'block';
if (isNew) {
s.position = 'absolute';
s.zIndex = -999;
if (elm.firstChild) {
elm.insertBefore(d, elm.firstChild);
} else {
elm.appendChild(d);
}
}
this.fix(d, pngSrc, 0);
count++;
}
}
}
while (count < tiles.cache.length) {
this.fix(tiles.cache[count], '', 0);
tiles.cache[count++].style.display = 'none';
}
this.hook.enabled = 1;
// Cache so updates are infrequent.
tiles.old = {
w: elmW,
h: elmH,
x: bgX,
y: bgY,
r: bgR
};
};
IEPNGFix.update = function() {
// Update all PNG backgrounds.
for (var i in IEPNGFix.data) {
var t = IEPNGFix.data[i].tiles;
if (t && t.elm && t.src) {
IEPNGFix.tileBG(t.elm, t.src);
}
}
};
IEPNGFix.update.timer = 0;
if (window.attachEvent && !window.opera) {
window.attachEvent('onresize', function() {
clearTimeout(IEPNGFix.update.timer);
IEPNGFix.update.timer = setTimeout(IEPNGFix.update, 100);
});
}

279
common/js/src/js_app.js Normal file
View file

@ -0,0 +1,279 @@
/**
* @file js_app.js
* @author taggon (gonom9@gmail.com)
* @brief XE JavaScript Application Framework (JAF)
* @namespace xe
* @update 20100701
*/
(function($){
var _xe_base, _app_base, _plugin_base;
var _apps = [];
_xe_base = {
/**
* @brief return the name of Core module
*/
getName : function() {
return 'Core';
},
/**
* @brief Create an application class
*/
createApp : function(sName, oDef) {
var _base = getTypeBase();
$.extend(_base.prototype, _app_base, oDef);
_base.prototype.getName = function() {
return sName;
};
return _base;
},
/**
* @brief Create a plugin class
*/
createPlugin : function(sName, oDef) {
var _base = getTypeBase();
$.extend(_base.prototype, _plugin_base, oDef);
_base.prototype.getName = function() {
return sName;
};
return _base;
},
/**
* @brief Get the array of applications
*/
getApps : function() {
return $.makeArray(_apps);
},
/**
* @brief Get one application
*/
getApp : function(indexOrName) {
indexOrName = (indexOrName||'').toLowerCase();
if(typeof _apps[indexOrName] != 'undefined') {
return _apps[indexOrName];
} else {
return null;
}
},
/**
* @brief Register an application instance
*/
registerApp : function(oApp) {
var sName = oApp.getName().toLowerCase();
_apps.push(oApp);
if (!$.isArray(_apps[sName])) {
_apps[sName] = [];
}
_apps[sName].push(oApp);
oApp.parent = this;
// register event
if ($.isFunction(oApp.activate)) oApp.activate();
},
/**
* @brief Unregister an application instance
*/
unregisterApp : function(oApp) {
var sName = oPlugin.getName().toLowerCase();
var nIndex = $.inArray(oApp, _apps);
if (nIndex >= 0) _apps.splice(nIndex, 1);
if ($.isArray(_apps[sName])) {
nIndex = $.inArray(oApp, _apps[sName]);
if (nIndex >= 0) _apps[sName].splice(nIndex, 1);
}
// unregister event
if ($.isFunction(oApp.deactivate)) oApp.deactivate();
},
/**
* @brief overrides broadcast method
*/
broadcast : function(msg, params) {
this._broadcast(this, msg, params);
},
_broadcast : function(sender, msg, params) {
for(var i=0; i < _apps.length; i++) {
_apps[i]._cast(sender, msg, params);
}
// cast to child plugins
this._cast(sender, msg, params);
}
}
_app_base = {
_plugins : [],
_messages : {},
/**
* @brief get plugin
*/
getPlugin : function(sPluginName) {
sPluginName = sPluginName.toLowerCase();
if ($.isArray(this._plugins[sPluginName])) {
return this._plugins[sPluginName];
} else {
return [];
}
},
/**
* @brief register a plugin instance
*/
registerPlugin : function(oPlugin) {
var self = this;
var sName = oPlugin.getName().toLowerCase();
// check if the plugin is already registered
if ($.inArray(oPlugin, this._plugins) >= 0) return false;
// push the plugin into the _plugins array
this._plugins.push(oPlugin);
if (!$.isArray(this._plugins[sName])) this._plugins[sName] = [];
this._plugins[sName].push(oPlugin);
// register method pool
$.each(oPlugin._binded_fn, function(api, fn){ self.registerHandler(api, fn); });
// binding
oPlugin.oApp = this;
// registered event
if ($.isFunction(oPlugin.activate)) oPlugin.activate();
return true;
},
/**
* @brief register api message handler
*/
registerHandler : function(api, func) {
var msgs = this._messages; api = api.toUpperCase();
if (!$.isArray(msgs[api])) msgs[api] = [];
msgs[api].push(func);
},
cast : function(msg, params) {
return this._cast(this, msg, params || []);
},
broadcast : function(sender, msg, params) {
if (this.parent && this.parent._broadcast) {
this.parent._broadcast(sender, msg, params);
}
},
_cast : function(sender, msg, params) {
var i, len;
var aMsg = this._messages;
msg = msg.toUpperCase();
// BEFORE hooker
if (aMsg['BEFORE_'+msg] || this['API_BEFORE_'+msg]) {
var bContinue = this._cast(sender, 'BEFORE_'+msg, params);
if (!bContinue) return;
}
// main api function
var vRet = [], sFn = 'API_'+msg;
if ($.isArray(aMsg[msg])) {
for(i=0; i < aMsg[msg].length; i++) {
vRet.push( aMsg[msg][i](sender, params) );
}
}
if (vRet.length < 2) vRet = vRet[0];
// AFTER hooker
if (aMsg['AFTER_'+msg] || this['API_AFTER_'+msg]) {
this._cast(sender, 'AFTER_'+msg, params);
}
if (!/^(?:AFTER|BEFORE)_/.test(msg)) { // top level function
return vRet;
} else {
return $.isArray(vRet)?($.inArray(false, vRet)<0):((typeof vRet=='undefined')?true:!!vRet);
}
}
};
_plugin_base = {
oApp : null,
cast : function(msg, params) {
if (this.oApp && this.oApp._cast) {
return this.oApp._cast(this, msg, params || []);
}
},
broadcast : function(msg, params) {
if (this.oApp && this.oApp.broadcast) {
this.oApp.broadcast(this, mag, params || []);
}
}
/**
* Event handler prototype
*
* function (oSender, params)
*/
};
function getTypeBase() {
var _base = function() {
var self = this;
var pool = null;
if ($.isArray(this._plugins)) this._plugins = [];
if (this._messages) this._messages = {};
else this._binded_fn = {};
// bind functions
$.each(this, function(key, val){
if (!$.isFunction(val)) return true;
if (!/^API_([A-Z0-9_]+)$/.test(key)) return true;
var api = RegExp.$1;
var fn = function(sender, params){ return self[key](sender, params) };
if (self._messages) self._messages[api] = [fn];
else self._binded_fn[api] = fn;
});
if ($.isFunction(this.init)) this.init.apply(this, arguments);
};
return _base;
}
window.xe = $.extend(_app_base, _xe_base);
window.xe.lang = {}; // language repository
// domready event
$(function(){ xe.broadcast('ONREADY'); });
// load event
$(window).load(function(){ xe.broadcast('ONLOAD'); });
})(jQuery);

676
common/js/src/x.js Normal file
View file

@ -0,0 +1,676 @@
/**
* x.js compiled from X 4.0 with XC 0.27b.
* Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com
* Copyright 2001-2005 Michael Foster (Cross-Browser.com)
**/
function xDeprecate(funcName) {
var msg = 'DEPRECATED : '+funcName+'() is deprecated function.';
if (typeof console == 'object' && typeof console.log == 'function') {
console.log(msg);
}
}
var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
var i=xUA.indexOf('opera');
if(i!=-1){
var v=parseInt(xUA.charAt(i+6));
xOp7Up=v>=7;
xOp6Dn=v<7;
}
}
else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){
xIE4Up=parseFloat(navigator.appVersion)>=4;
xIE4=xUA.indexOf('msie 4')!=-1;
xIE5=xUA.indexOf('msie 5')!=-1;
xIE6=xUA.indexOf('msie 6')!=-1;
}
else if(document.layers){xNN4=true;}
var xMac=xUA.indexOf('mac')!=-1;
var xFF=xUA.indexOf('firefox')!=-1;
// (element, event(without 'on'), event listener(function name)[, caption])
function xAddEventListener(e,eT,eL,cap)
{
xDeprecate('xAddEventListener');
if(!(e=xGetElementById(e))) return;
eT=eT.toLowerCase();
if((!xIE4Up && !xOp7Up) && e==window) {
if(eT=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eL; xResizeEvent(); return; }
if(eT=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eL; xScrollEvent(); return; }
}
var eh='e.on'+eT+'=eL';
if(e.addEventListener) e.addEventListener(eT,eL,cap);
else if(e.attachEvent) e.attachEvent('on'+eT,eL);
else eval(eh);
}
// called only from the above
function xResizeEvent()
{
xDeprecate('xResizeEvent');
if (window.xREL) setTimeout('xResizeEvent()', 250);
var cw = xClientWidth(), ch = xClientHeight();
if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); }
}
function xScrollEvent()
{
xDeprecate('xScrollEvent');
if (window.xSEL) setTimeout('xScrollEvent()', 250);
var sl = xScrollLeft(), st = xScrollTop();
if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); }
}
function xAppendChild(oParent, oChild)
{
xDeprecate('xAppendChild');
if (oParent.appendChild) return oParent.appendChild(oChild);
else return null;
}
function xClientHeight()
{
xDeprecate('xClientHeight');
var h=0;
if(xOp6Dn) h=window.innerHeight;
else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight)
h=document.documentElement.clientHeight;
else if(document.body && document.body.clientHeight)
h=document.body.clientHeight;
else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
h=window.innerHeight;
if(document.width>window.innerWidth) h-=16;
}
return h;
}
function xClientWidth()
{
xDeprecate('xClientWidth');
var w=0;
if(xOp6Dn) w=window.innerWidth;
else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth)
w=document.documentElement.clientWidth;
else if(document.body && document.body.clientWidth)
w=document.body.clientWidth;
else if(xDef(window.innerWidth,window.innerHeight,document.height)) {
w=window.innerWidth;
if(document.height>window.innerHeight) w-=16;
}
return w;
}
function xCreateElement(sTag)
{
xDeprecate('xCreateElement');
if (document.createElement) return document.createElement(sTag);
else return null;
}
function xDef()
{
xDeprecate('xDef');
for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
return true;
}
function xDeleteCookie(name, path)
{
xDeprecate('xDeleteCookie');
if (xGetCookie(name)) {
document.cookie = name + "=" +
"; path=" + ((!path) ? "/" : path) +
"; expires=" + new Date(0).toGMTString();
}
}
function xDisplay(e,s)
{
xDeprecate('xDisplay');
if(!(e=xGetElementById(e))) return null;
if(e.style && xDef(e.style.display)) {
if (xStr(s)) e.style.display = s;
return e.style.display;
}
return null;
}
function xEvent(evt) // object prototype
{
xDeprecate('xEvent');
var e = evt || window.event;
if(!e) return;
if(e.type) this.type = e.type;
if(e.target) this.target = e.target;
else if(e.srcElement) this.target = e.srcElement;
// Section B
if (e.relatedTarget) this.relatedTarget = e.relatedTarget;
else if (e.type == 'mouseover' && e.fromElement) this.relatedTarget = e.fromElement;
else if (e.type == 'mouseout') this.relatedTarget = e.toElement;
// End Section B
if(xOp6Dn) { this.pageX = e.clientX; this.pageY = e.clientY; }
else if(xDef(e.pageX,e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; }
else if(xDef(e.clientX,e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); }
// Section A
if (xDef(e.offsetX,e.offsetY)) {
this.offsetX = e.offsetX;
this.offsetY = e.offsetY;
}
else if (xDef(e.layerX,e.layerY)) {
this.offsetX = e.layerX;
this.offsetY = e.layerY;
}
else {
this.offsetX = this.pageX - xPageX(this.target);
this.offsetY = this.pageY - xPageY(this.target);
}
// End Section A
if (e.keyCode) { this.keyCode = e.keyCode; } // for moz/fb, if keyCode==0 use which
else if (xDef(e.which) && e.type.indexOf('key')!=-1) { this.keyCode = e.which; }
this.shiftKey = e.shiftKey;
this.ctrlKey = e.ctrlKey;
this.altKey = e.altKey;
}
function xFirstChild(e, t)
{
xDeprecate('xFirstChild');
var c = e ? e.firstChild : null;
if (t) while (c && c.nodeName != t) { c = c.nextSibling; }
else while (c && c.nodeType != 1) { c = c.nextSibling; }
return c;
}
function xGetBodyWidth() {
xDeprecate('xGetBodyWidth');
var cw = xClientWidth();
var sw = window.document.body.scrollWidth;
return cw>sw?cw:sw;
}
function xGetBodyHeight() {
xDeprecate('xGetBodyHeight');
var cw = xClientHeight();
var sw = window.document.body.scrollHeight;
return cw>sw?cw:sw;
}
function xGetComputedStyle(oEle, sProp, bInt)
{
xDeprecate('xGetComputedStyle');
var s, p = 'undefined';
var dv = document.defaultView;
if(dv && dv.getComputedStyle){
s = dv.getComputedStyle(oEle,'');
if (s) p = s.getPropertyValue(sProp);
}
else if(oEle.currentStyle) {
// convert css property name to object property name for IE
var a = sProp.split('-');
sProp = a[0];
for (var i=1; i<a.length; ++i) {
c = a[i].charAt(0);
sProp += a[i].replace(c, c.toUpperCase());
}
p = oEle.currentStyle[sProp];
}
else return null;
return bInt ? (parseInt(p) || 0) : p;
}
function xGetCookie(name)
{
xDeprecate('xGetCookie');
var value=null, search=name+"=";
if (document.cookie.length > 0) {
var offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
var end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
value = unescape(document.cookie.substring(offset, end));
}
}
return value;
}
function xGetElementById(e)
{
xDeprecate('xGetElementById');
if(typeof(e)!='string') return e;
if(document.getElementById) e=document.getElementById(e);
else if(document.all) e=document.all[e];
else e=null;
return e;
}
function xGetElementsByAttribute(sTag, sAtt, sRE, fn)
{
xDeprecate('xGetElementsByAttribute');
var a, list, found = new Array(), re = new RegExp(sRE, 'i');
list = xGetElementsByTagName(sTag);
for (var i = 0; i < list.length; ++i) {
a = list[i].getAttribute(sAtt);
if (!a) {a = list[i][sAtt];}
if (typeof(a)=='string' && a.search(re) != -1) {
found[found.length] = list[i];
if (fn) fn(list[i]);
}
}
return found;
}
function xGetElementsByClassName(c,p,t,f)
{
xDeprecate('xGetElementsByClassName');
var found = new Array();
var re = new RegExp('\\b'+c+'\\b', 'i');
var list = xGetElementsByTagName(t, p);
for (var i = 0; i < list.length; ++i) {
if (list[i].className && list[i].className.search(re) != -1) {
found[found.length] = list[i];
if (f) f(list[i]);
}
}
return found;
}
function xGetElementsByTagName(t,p)
{
xDeprecate('xGetElementsByTagName');
var list = null;
t = t || '*';
p = p || document;
if (xIE4 || xIE5) {
if (t == '*') list = p.all;
else list = p.all.tags(t);
}
else if (p.getElementsByTagName) list = p.getElementsByTagName(t);
return list || new Array();
}
function xGetURLArguments()
{
xDeprecate('xGetURLArguments');
var idx = location.href.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = location.href.substring(idx+1, location.href.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[i] = nameVal[1];
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
function xHeight(e,h)
{
xDeprecate('xHeight');
if(!(e=xGetElementById(e))) return 0;
if (xNum(h)) {
if (h<0) h = 0;
else h=Math.round(h);
}
else h=-1;
var css=xDef(e.style);
if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
h = xClientHeight();
}
else if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {
if(h>=0) {
var pt=0,pb=0,bt=0,bb=0;
if (document.compatMode=='CSS1Compat') {
var gcs = xGetComputedStyle;
pt=gcs(e,'padding-top',1);
if (pt !== null) {
pb=gcs(e,'padding-bottom',1);
bt=gcs(e,'border-top-width',1);
bb=gcs(e,'border-bottom-width',1);
}
// Should we try this as a last resort?
// At this point getComputedStyle and currentStyle do not exist.
else if(xDef(e.offsetHeight,e.style.height)){
e.style.height=h+'px';
pt=e.offsetHeight-h;
}
}
h-=(pt+pb+bt+bb);
if(isNaN(h)||h<0) return null;
else e.style.height=h+'px';
}
h=e.offsetHeight;
}
else if(css && xDef(e.style.pixelHeight)) {
if(h>=0) e.style.pixelHeight=h;
h=e.style.pixelHeight;
}
return h;
}
function xHex(sn, digits, prefix)
{
xDeprecate('xHex');
var p = '';
var n = Math.ceil(sn);
if (prefix) p = prefix;
n = n.toString(16);
for (var i=0; i < digits - n.length; ++i) {
p += '0';
}
return p + n;
}
function xHide(e){ xDeprecate('xHide'); return xVisibility(e,0);}
function xInnerHtml(e,h)
{
xDeprecate('xInnerHtml');
if(!(e=xGetElementById(e)) || !xStr(e.innerHTML)) return null;
var s = e.innerHTML;
if (xStr(h)) {e.innerHTML = h;}
return s;
}
function xLeft(e, iX)
{
xDeprecate('xLeft');
if(!(e=xGetElementById(e))) return 0;
var css=xDef(e.style);
if (css && xStr(e.style.left)) {
if(xNum(iX)) e.style.left=iX+'px';
else {
iX=parseInt(e.style.left);
if(isNaN(iX)) iX=0;
}
}
else if(css && xDef(e.style.pixelLeft)) {
if(xNum(iX)) e.style.pixelLeft=iX;
else iX=e.style.pixelLeft;
}
return iX;
}
function xMoveTo(e,x,y)
{
xDeprecate('xMoveTo');
xLeft(e,x);
xTop(e,y);
}
function xName(e)
{
xDeprecate('xName');
if (!e) return e;
else if (e.id && e.id != "") return e.id;
else if (e.name && e.name != "") return e.name;
else if (e.nodeName && e.nodeName != "") return e.nodeName;
else if (e.tagName && e.tagName != "") return e.tagName;
else return e;
}
function xNextSib(e,t)
{
xDeprecate('xNextSib');
var s = e ? e.nextSibling : null;
if (t) while (s && s.nodeName != t) { s = s.nextSibling; }
else while (s && s.nodeType != 1) { s = s.nextSibling; }
return s;
}
function xNum()
{
xDeprecate('xNum');
for(var i=0; i<arguments.length; ++i){if(isNaN(arguments[i]) || typeof(arguments[i])!='number') return false;}
return true;
}
function xOffsetLeft(e)
{
xDeprecate('xOffsetLeft');
if (!(e=xGetElementById(e))) return 0;
if (xDef(e.offsetLeft)) return e.offsetLeft;
else return 0;
}
function xOffsetTop(e)
{
xDeprecate('xOffsetTop');
if (!(e=xGetElementById(e))) return 0;
if (xDef(e.offsetTop)) return e.offsetTop;
else return 0;
}
function xPad(s,len,c,left)
{
xDeprecate('xPad');
if(typeof s != 'string') s=s+'';
if(left) {for(var i=s.length; i<len; ++i) s=c+s;}
else {for (i=s.length; i<len; ++i) s+=c;}
return s;
}
function xPageX(e)
{
xDeprecate('xPageX');
if (!(e=xGetElementById(e))) return 0;
var x = 0;
while (e) {
if (xDef(e.offsetLeft)) x += e.offsetLeft;
e = xDef(e.offsetParent) ? e.offsetParent : null;
}
return x;
}
function xPageY(e)
{
xDeprecate('xPageY');
if (!(e=xGetElementById(e))) return 0;
var y = 0;
while (e) {
if (xDef(e.offsetTop)) y += e.offsetTop;
e = xDef(e.offsetParent) ? e.offsetParent : null;
}
// if (xOp7Up) return y - document.body.offsetTop; // v3.14, temporary hack for opera bug 130324 (reported 1nov03)
return y;
}
function xParent(e, bNode)
{
xDeprecate('xParent');
if (!(e=xGetElementById(e))) return null;
var p=null;
if (!bNode && xDef(e.offsetParent)) p=e.offsetParent;
else if (xDef(e.parentNode)) p=e.parentNode;
else if (xDef(e.parentElement)) p=e.parentElement;
return p;
}
function xPreventDefault(e)
{
xDeprecate('xPreventDefault');
if (e && e.preventDefault) e.preventDefault()
else if (window.event) window.event.returnValue = false;
}
function xPrevSib(e,t)
{
xDeprecate('xPrevSib');
var s = e ? e.previousSibling : null;
if (t) while(s && s.nodeName != t) {s=s.previousSibling;}
else while(s && s.nodeType != 1) {s=s.previousSibling;}
return s;
}
function xRemoveEventListener(e,eT,eL,cap)
{
xDeprecate('xRemoveEventListener');
if(!(e=xGetElementById(e))) return;
eT=eT.toLowerCase();
if((!xIE4Up && !xOp7Up) && e==window) {
if(eT=='resize') { window.xREL=null; return; }
if(eT=='scroll') { window.xSEL=null; return; }
}
var eh='e.on'+eT+'=null';
if(e.removeEventListener) e.removeEventListener(eT,eL,cap);
else if(e.detachEvent) e.detachEvent('on'+eT,eL);
else eval(eh);
}
function xResizeTo(e,w,h)
{
xDeprecate('xResizeTo');
xWidth(e,w);
xHeight(e,h);
}
function xScrollLeft(e, bWin)
{
xDeprecate('xScrollLeft');
var offset=0;
if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
var w = window;
if (bWin && e) w = e;
if(w.document.documentElement && w.document.documentElement.scrollLeft) offset=w.document.documentElement.scrollLeft;
else if(w.document.body && xDef(w.document.body.scrollLeft)) offset=w.document.body.scrollLeft;
}
else {
e = xGetElementById(e);
if (e && xNum(e.scrollLeft)) offset = e.scrollLeft;
}
return offset;
}
function xScrollTop(e, bWin)
{
xDeprecate('xScrollTop');
var offset=0;
if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
var w = window;
if (bWin && e) w = e;
if(w.document.documentElement && w.document.documentElement.scrollTop) offset=w.document.documentElement.scrollTop;
else if(w.document.body && xDef(w.document.body.scrollTop)) offset=w.document.body.scrollTop;
}
else {
e = xGetElementById(e);
if (e && xNum(e.scrollTop)) offset = e.scrollTop;
}
return offset;
}
function xSetCookie(name, value, expire, path)
{
xDeprecate('xSetCookie');
document.cookie = name + "=" + escape(value) +
((!expire) ? "" : ("; expires=" + expire.toGMTString())) +
"; path=" + ((!path) ? "/" : path);
}
function xShow(e) { xDeprecate('xShow'); return xVisibility(e,1);}
function xStr(s)
{
xDeprecate('xStr');
for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}
return true;
}
function xTop(e, iY)
{
xDeprecate('xTop');
if(!(e=xGetElementById(e))) return 0;
var css=xDef(e.style);
if(css && xStr(e.style.top)) {
if(xNum(iY)) e.style.top=iY+'px';
else {
iY=parseInt(e.style.top);
if(isNaN(iY)) iY=0;
}
}
else if(css && xDef(e.style.pixelTop)) {
if(xNum(iY)) e.style.pixelTop=iY;
else iY=e.style.pixelTop;
}
return iY;
}
function xVisibility(e, bShow)
{
xDeprecate('xVisibility');
if(!(e=xGetElementById(e))) return null;
if(e.style && xDef(e.style.visibility)) {
if (xDef(bShow)) e.style.visibility = bShow ? 'visible' : 'hidden';
return e.style.visibility;
}
return null;
}
function xWidth(e,w)
{
xDeprecate('xWidth');
if(!(e=xGetElementById(e))) return 0;
if (xNum(w)) {
if (w<0) w = 0;
else w=Math.round(w);
}
else w=-1;
var css=xDef(e.style);
if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
w = xClientWidth();
}
else if(css && xDef(e.offsetWidth) && xStr(e.style.width)) {
if(w>=0) {
var pl=0,pr=0,bl=0,br=0;
if (document.compatMode=='CSS1Compat') {
var gcs = xGetComputedStyle;
pl=gcs(e,'padding-left',1);
if (pl !== null) {
pr=gcs(e,'padding-right',1);
bl=gcs(e,'border-left-width',1);
br=gcs(e,'border-right-width',1);
}
// Should we try this as a last resort?
// At this point getComputedStyle and currentStyle do not exist.
else if(xDef(e.offsetWidth,e.style.width)){
e.style.width=w+'px';
pl=e.offsetWidth-w;
}
}
w-=(pl+pr+bl+br);
if(isNaN(w)||w<0) return null;
else e.style.width=w+'px';
}
w=e.offsetWidth;
}
else if(css && xDef(e.style.pixelWidth)) {
if(w>=0) e.style.pixelWidth=w;
w=e.style.pixelWidth;
}
return w;
}
function xZIndex(e,uZ)
{
xDeprecate('xZIndex');
if(!(e=xGetElementById(e))) return 0;
if(e.style && xDef(e.style.zIndex)) {
if(xNum(uZ)) e.style.zIndex=uZ;
uZ=parseInt(e.style.zIndex);
}
return uZ;
}
function xStopPropagation(evt)
{
xDeprecate('xStopPropagation');
if (evt && evt.stopPropagation) evt.stopPropagation();
else if (window.event) window.event.cancelBubble = true;
}

View file

@ -0,0 +1,409 @@
/**
* @file common/js/xml_handler.js
* @brief XE에서 ajax기능을 이용함에 있어 module, act를 사용하기 위한 자바스크립트
**/
// xml handler을 이용하는 user function
var show_waiting_message = true;
/* This work is licensed under Creative Commons GNU LGPL License.
License: http://creativecommons.org/licenses/LGPL/2.1/
Version: 0.9
Author: Stefan Goessner/2006
Web: http://goessner.net/
*/
function xml2json(xml, tab, ignoreAttrib) {
var X = {
toObj: function(xml) {
var o = {};
if (xml.nodeType==1) { // element node ..
if (ignoreAttrib && xml.attributes.length) // element with attributes ..
for (var i=0; i<xml.attributes.length; i++)
o["@"+xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue||"").toString();
if (xml.firstChild) { // element has child nodes ..
var textChild=0, cdataChild=0, hasElementChild=false;
for (var n=xml.firstChild; n; n=n.nextSibling) {
if (n.nodeType==1) hasElementChild = true;
else if (n.nodeType==3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) textChild++; // non-whitespace text
else if (n.nodeType==4) cdataChild++; // cdata section node
}
if (hasElementChild) {
if (textChild < 2 && cdataChild < 2) { // structured element with evtl. a single text or/and cdata node ..
X.removeWhite(xml);
for (var n=xml.firstChild; n; n=n.nextSibling) {
if (n.nodeType == 3) // text node
o = X.escape(n.nodeValue);
else if (n.nodeType == 4) // cdata node
// o["#cdata"] = X.escape(n.nodeValue);
o = X.escape(n.nodeValue);
else if (o[n.nodeName]) { // multiple occurence of element ..
if (o[n.nodeName] instanceof Array)
o[n.nodeName][o[n.nodeName].length] = X.toObj(n);
else
o[n.nodeName] = [o[n.nodeName], X.toObj(n)];
}
else // first occurence of element..
o[n.nodeName] = X.toObj(n);
}
}
else { // mixed content
if (!xml.attributes.length)
o = X.escape(X.innerXml(xml));
else
o["#text"] = X.escape(X.innerXml(xml));
}
}
else if (textChild) { // pure text
if (!xml.attributes.length)
o = X.escape(X.innerXml(xml));
else
o["#text"] = X.escape(X.innerXml(xml));
}
else if (cdataChild) { // cdata
if (cdataChild > 1)
o = X.escape(X.innerXml(xml));
else
for (var n=xml.firstChild; n; n=n.nextSibling){
//o["#cdata"] = X.escape(n.nodeValue);
o = X.escape(n.nodeValue);
}
}
}
if (!xml.attributes.length && !xml.firstChild) o = null;
}
else if (xml.nodeType==9) { // document.node
o = X.toObj(xml.documentElement);
}
else
alert("unhandled node type: " + xml.nodeType);
return o;
},
toJson: function(o, name, ind) {
var json = name ? ("\""+name+"\"") : "";
if (o instanceof Array) {
for (var i=0,n=o.length; i<n; i++)
o[i] = X.toJson(o[i], "", ind+"\t");
json += (name?":[":"[") + (o.length > 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]";
}
else if (o == null)
json += (name&&":") + "null";
else if (typeof(o) == "object") {
var arr = [];
for (var m in o)
arr[arr.length] = X.toJson(o[m], m, ind+"\t");
json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}";
}
else if (typeof(o) == "string")
json += (name&&":") + "\"" + o.toString() + "\"";
else
json += (name&&":") + o.toString();
return json;
},
innerXml: function(node) {
var s = ""
if ("innerHTML" in node)
s = node.innerHTML;
else {
var asXml = function(n) {
var s = "";
if (n.nodeType == 1) {
s += "<" + n.nodeName;
for (var i=0; i<n.attributes.length;i++)
s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue||"").toString() + "\"";
if (n.firstChild) {
s += ">";
for (var c=n.firstChild; c; c=c.nextSibling)
s += asXml(c);
s += "</"+n.nodeName+">";
}
else
s += "/>";
}
else if (n.nodeType == 3)
s += n.nodeValue;
else if (n.nodeType == 4)
s += "<![CDATA[" + n.nodeValue + "]]>";
return s;
};
for (var c=node.firstChild; c; c=c.nextSibling)
s += asXml(c);
}
return s;
},
escape: function(txt) {
return txt.replace(/[\\]/g, "\\\\")
.replace(/[\"]/g, '\\"')
.replace(/[\n]/g, '\\n')
.replace(/[\r]/g, '\\r');
},
removeWhite: function(e) {
e.normalize();
for (var n = e.firstChild; n; ) {
if (n.nodeType == 3) { // text node
if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node
var nxt = n.nextSibling;
e.removeChild(n);
n = nxt;
}
else
n = n.nextSibling;
}
else if (n.nodeType == 1) { // element node
X.removeWhite(n);
n = n.nextSibling;
}
else // any other node
n = n.nextSibling;
}
return e;
}
};
if (xml.nodeType == 9) // document node
xml = xml.documentElement;
var json_obj = X.toObj(X.removeWhite(xml)), json_str;
if (typeof(JSON)=='object' && jQuery.isFunction(JSON.stringify) && false) {
var obj = {}; obj[xml.nodeName] = json_obj;
json_str = JSON.stringify(obj);
return json_str;
} else {
json_str = X.toJson(json_obj, xml.nodeName, "");
return "{" + (tab ? json_str.replace(/\t/g, tab) : json_str.replace(/\t|\n/g, "")) + "}";
}
}
(function($){
/**
* @brief exec_xml
* @author taggon <gonom9@gmail.com>
**/
$.exec_xml = window.exec_xml = function(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj) {
var xml_path = request_uri+"index.php"
if(!params) params = {};
// {{{ set parameters
if($.isArray(params)) params = arr2obj(params);
params['module'] = module;
params['act'] = act;
if(typeof(xeVid)!='undefined') params['vid'] = xeVid;
if(typeof(response_tags)=="undefined" || response_tags.length<1) response_tags = ['error','message'];
else {
response_tags.push('error', 'message');
}
// }}} set parameters
// use ssl?
if ($.isArray(ssl_actions) && params['act'] && $.inArray(params['act'], ssl_actions) >= 0)
{
var url = default_url || request_uri;
var port = window.https_port || 443;
var _ul = $('<a>').attr('href', url)[0];
var target = 'https://' + _ul.hostname.replace(/:\d+$/, '');
if(port != 443) target += ':'+port;
if(_ul.pathname[0] != '/') target += '/';
target += _ul.pathname;
xml_path = target.replace(/\/$/, '')+'/index.php';
}
var _u1 = $('<a>').attr('href', location.href)[0];
var _u2 = $('<a>').attr('href', xml_path)[0];
// 현 url과 ajax call 대상 url의 schema 또는 port가 다르면 직접 form 전송
if(_u1.protocol != _u2.protocol || _u1.port != _u2.port) return send_by_form(xml_path, params);
var xml = [], i = 0;
xml[i++] = '<?xml version="1.0" encoding="utf-8" ?>';
xml[i++] = '<methodCall>';
xml[i++] = '<params>';
$.each(params, function(key, val) {
xml[i++] = '<'+key+'><![CDATA['+val+']]></'+key+'>';
});
xml[i++] = '</params>';
xml[i++] = '</methodCall>';
var _xhr = null;
if (_xhr && _xhr.readyState != 0) _xhr.abort();
// 전송 성공시
function onsuccess(data, textStatus, xhr) {
var resp_xml = $(data).find('response')[0], resp_obj, txt='', ret=[], tags={}, json_str='';
waiting_obj.css('visibility', 'hidden');
if(!resp_xml) {
alert(_xhr.responseText);
return null;
}
json_str = xml2json(resp_xml, false, false);
resp_obj = (typeof(JSON)=='object' && $.isFunction(JSON.parse))?JSON.parse(json_str):eval('('+json_str+')');
resp_obj = resp_obj.response;
if (typeof(resp_obj)=='undefined') {
ret['error'] = -1;
ret['message'] = 'Unexpected error occured.';
try {
if(typeof(txt=resp_xml.childNodes[0].firstChild.data)!='undefined') ret['message'] += '\r\n'+txt;
} catch(e){};
return ret;
}
$.each(response_tags, function(key, val){ tags[val] = true; });
tags["redirect_url"] = true;
tags["act"] = true;
$.each(resp_obj, function(key, val){ if(tags[key]) ret[key] = val; });
if(ret['error'] != 0) {
if ($.isFunction($.exec_xml.onerror)) {
return $.exec_xml.onerror(module, act, ret, callback_func, response_tags, callback_func_arg, fo_obj);
}
alert(ret['message'] || 'error!');
return null;
}
if(ret['redirect_url']) {
location.href = ret['redirect_url'].replace(/&amp;/g, '&');
return null;
}
if($.isFunction(callback_func)) callback_func(ret, response_tags, callback_func_arg, fo_obj);
}
// 모든 xml데이터는 POST방식으로 전송. try-catch문으로 오류 발생시 대처
try {
$.ajax({
url : xml_path,
type : 'POST',
dataType : 'xml',
data : xml.join('\n'),
contentType : 'text/plain',
beforeSend : function(xhr){ _xhr = xhr; },
success : onsuccess,
error : function(xhr, textStatus) {
waiting_obj.css('visibility', 'hidden');
var msg = '';
if (textStatus == 'parsererror') {
msg = 'The result is not valid XML :\n-------------------------------------\n';
if(xhr.responseText == "") return;
msg += xhr.responseText.replace(/<[^>]+>/g, '');
} else {
msg = textStatus;
}
alert(msg);
}
});
} catch(e) {
alert(e);
return;
}
// ajax 통신중 대기 메세지 출력 (show_waiting_message값을 false로 세팅시 보이지 않음)
var waiting_obj = $('#waitingforserverresponse');
if(show_waiting_message && waiting_obj.length) {
var d = $(document);
waiting_obj.html(waiting_message).css({
'top' : (d.scrollTop()+20)+'px',
'left' : (d.scrollLeft()+20)+'px',
'visibility' : 'visible'
});
}
}
function send_by_form(url, params) {
var frame_id = 'xeTmpIframe';
var form_id = 'xeVirtualForm';
if (!$('#'+frame_id).length) {
$('<iframe name="%id%" id="%id%" style="position:absolute;left:-1px;top:1px;width:1px;height:1px"></iframe>'.replace(/%id%/g, frame_id)).appendTo(document.body);
}
$('#'+form_id).remove();
var form = $('<form id="%id%"></form>'.replace(/%id%/g, form_id)).attr({
'id' : form_id,
'method' : 'post',
'action' : url,
'target' : frame_id
});
params['xeVirtualRequestMethod'] = 'xml';
params['xeRequestURI'] = location.href.replace(/#(.*)$/i,'');
params['xeVirtualRequestUrl'] = request_uri;
$.each(params, function(key, value){
$('<input type="hidden">').attr('name', key).attr('value', value).appendTo(form);
});
form.appendTo(document.body).submit();
}
function arr2obj(arr) {
var ret = {};
for(var key in arr) {
if(arr.hasOwnProperty(key)) ret[key] = arr[key];
}
return ret;
}
/**
* @brief exec_json (exec_xml와 같은 용도)
**/
$.exec_json = function(action,data,func){
if(typeof(data) == 'undefined') data = {};
action = action.split(".");
if(action.length == 2){
if(show_waiting_message) {
$("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible');
}
$.extend(data,{module:action[0],act:action[1]});
if(typeof(xeVid)!='undefined') $.extend(data,{vid:xeVid});
$.ajax({
type:"POST"
,dataType:"json"
,url:request_uri
,contentType:"application/json"
,data:$.param(data)
,success : function(data){
$("#waitingforserverresponse").css('visibility','hidden');
if(data.error > 0) alert(data.message);
if($.isFunction(func)) func(data);
}
});
}
};
$.fn.exec_html = function(action,data,type,func,args){
if(typeof(data) == 'undefined') data = {};
if(!$.inArray(type, ['html','append','prepend'])) type = 'html';
var self = $(this);
action = action.split(".");
if(action.length == 2){
if(show_waiting_message) {
$("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible');
}
$.extend(data,{module:action[0],act:action[1]});
$.ajax({
type:"POST"
,dataType:"html"
,url:request_uri
,data:$.param(data)
,success : function(html){
$("#waitingforserverresponse").css('visibility','hidden');
self[type](html);
if($.isFunction(func)) func(args);
}
});
}
};
})(jQuery);

View file

@ -0,0 +1,301 @@
/**
* @file common/js/xml_js_filter.js
* @author taggon (taggon@gmail.com)
* @brief xml filter (validator) plugin
*
* A rule is a method validate one field.
* A filter is made up of one or more rules.
**/
(function($){
var messages = [];
var rules = [];
var filters = [];
var callbacks = [];
var extras = {};
var Validator = xe.createApp('Validator', {
init : function() {
// {{{ add filters
// email
var regEmail = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*$/;
this.cast('ADD_RULE', ['email', regEmail]);
this.cast('ADD_RULE', ['email_address', regEmail]);
// userid
var regUserid = /^[a-z]+[\w-]*[a-z0-9_]+$/i;
this.cast('ADD_RULE', ['userid', regUserid]);
this.cast('ADD_RULE', ['user_id', regUserid]);
// url
var regUrl = /^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/;
this.cast('ADD_RULE', ['url', regUrl]);
this.cast('ADD_RULE', ['homepage', regUrl]);
// korean
var regKor = /^[가-힣]*$/;
this.cast('ADD_RULE', ['korean', regKor]);
// korean_number
var regKorNum = /^[가-힣0-9]*$/;
this.cast('ADD_RULE', ['korean_number', regKorNum]);
// alpha
var regAlpha = /^[a-z]*$/i;
this.cast('ADD_RULE', ['alpha', regAlpha]);
// alpha_number
var regAlphaNum = /^[a-z][a-z0-9_]*$/i;
this.cast('ADD_RULE', ['alpha_number', regAlphaNum]);
// number
var regNum = /^[0-9]*$/;
this.cast('ADD_RULE', ['number', regNum]);
// }}} add filters
},
// run validator
run : function(oForm) {
var filter = '';
if (oForm._filter) filter = oForm._filter.value;
var params = [oForm, filter];
var result = this.cast('VALIDATE', params);
if (typeof result == 'undefined') result = false;
return result;
},
API_ONREADY : function() {
var self = this;
// hook form submit event
$('form')
.each(function(){
if (this.onsubmit) {
this['xe:onsubmit'] = this.onsubmit;
this.onsubmit = null;
}
})
.submit(function(){
var legacyFn = this['xe:onsubmit'];
var hasLegacyFn = $.isFunction(legacyFn);
var bResult = hasLegacyFn?legacyFn.apply(this):self.run(this);
return bResult;
});
},
API_VALIDATE : function(sender, params) {
var self = this, result = true, form = params[0], filter=null, callback=null;
if (form.elements['_filter']) filter = form.elements['_filter'].value;
if (!filter) return true;
if ($.isFunction(callbacks[filter])) callback = callbacks[filter];
filter = $.extend({}, filters[filter.toLowerCase()] || {}, extras);
$.each(filter, function(name) {
var _el = form.elements[name];
if (!_el) return true;
var el = $(_el), val = $.trim(get_value(el));
var minlen = parseInt(this.minlength) || 0;
var maxlen = parseInt(this.maxlength) || 0;
var rule = (this.rule || '').split(',');
if (this.required && !val) return (result = (!!self.cast('ALERT', [form, name, 'isnull']) && false));
if (!this.required && !val) return (result = true);
if ((minlen && val.length < minlen) || (maxlen && val.length > maxlen)) return (result = (!!self.cast('ALERT', [form, name, 'outofrange', minlen, maxlen]) && false));
if (this.equalto) {
var eq_val = get_value($(form.elements[this.equalto]));
if (eq_val != val) return (result = (!!self.cast('ALERT', [form, name, 'equalto']) && false));
}
$.each(rule, function() {
var ret = self.cast('APPLY_RULE', [this, val]);
if (!ret) {
self.cast('ALERT', [form, name, 'invalid_'+this]);
return (result = false);
}
});
if (!result) return false;
});
if (!result) return false;
if ($.isFunction(callback)) return callback(form);
return true;
},
API_ADD_RULE : function(sender, params) {
var name = params[0].toLowerCase();
rules[name] = params[1];
},
API_DEL_RULE : function(sender, params) {
var name = params[0].toLowerCase();
delete rules[name];
},
API_GET_RULE : function(sender, params) {
var name = params[0].toLowerCase();
if (rules[name]) {
return rules[name];
} else {
return null;
}
},
API_ADD_FILTER : function(sender, params) {
var name = params[0].toLowerCase();
var filter = params[1];
filters[name] = filter;
},
API_DEL_FILTER : function(sender, params) {
var name = params[0].toLowerCase();
delete filters[name];
},
API_GET_FILTER : function(sender, params) {
var name = params[0].toLowerCase();
if (filters[name]) {
return filters[name];
} else {
return null;
}
},
API_ADD_EXTRA_FIELD : function(sender, params) {
var name = params[0].toLowerCase();
var prop = params[1];
extras[name] = prop;
},
API_GET_EXTRA_FIELD : function(sender, params) {
var name = params[0].toLowerCase();
return extras[name];
},
API_DEL_EXTRA_FIELD : function(sender, params) {
var name = params[0].toLowerCase();
delete extras[name];
},
API_APPLY_RULE : function(sender, params) {
var name = params[0].toLowerCase();
var value = params[1];
if (typeof(rules[name]) == 'undefined') return true; // no filter
if ($.isFunction(rules[name])) return rules[name](value);
if (rules[name] instanceof RegExp) return rules[name].test(value);
return true;
},
API_ALERT : function(sender, params) {
var form = params[0];
var field_name = params[1];
var msg_code = params[2];
var minlen = params[3];
var maxlen = params[4];
var field_msg = this.cast('GET_MESSAGE', [field_name]);
var msg = this.cast('GET_MESSAGE', [msg_code]);
if (msg != msg_code) msg = (msg.indexOf('%s')<0)?(field_msg+msg):(msg.replace('%s',field_msg));
if (minlen||maxlen) msg += '('+(minlen||'')+'~'+(maxlen||'')+')';
this.cast('SHOW_ALERT', [msg]);
// set focus
$(form.elements[field_name]).focus();
},
API_SHOW_ALERT : function(sender, params) {
alert(params[0]);
},
API_ADD_MESSAGE : function(sender, params) {
var msg_code = params[0];
var msg_str = params[1];
messages[msg_code] = msg_str;
},
API_GET_MESSAGE : function(sender, params) {
var msg_code = params[0];
return messages[msg_code] || msg_code;
},
API_ADD_CALLBACK : function(sender, params) {
var name = params[0];
var func = params[1];
callbacks[name] = func;
},
API_REMOVE_CALLBACK : function(sender, params) {
var name = params[0];
delete callbacks[name];
}
});
var oValidator = new Validator;
// register validator
xe.registerApp(oValidator);
// 호환성을 위해 추가한 플러그인 - 에디터에서 컨텐트를 가져와서 설정한다.
var EditorStub = xe.createPlugin('editor_stub', {
API_BEFORE_VALIDATE : function(sender, params) {
var form = params[0];
var seq = form.getAttribute('editor_sequence');
if (seq) {
try {
editorRelKeys[seq].content.value = editorRelKeys[seq].func(seq) || '';
} catch(e) { }
}
}
});
oValidator.registerPlugin(new EditorStub);
// functions
function get_value(elem) {
var vals = [];
if (elem.is(':radio')){
return elem.filter(':checked').val();
} else if (elem.is(':checkbox')) {
elem.filter(':checked').each(function(){
vals.push(this.value);
});
return vals.join('|@|');
} else {
return elem.val();
}
}
})(jQuery);
/**
* @function filterAlertMessage
* @brief ajax로 서버에 요청후 결과를 처리할 callback_function을 지정하지 않았을 호출되는 기본 함수
**/
function filterAlertMessage(ret_obj) {
var error = ret_obj["error"];
var message = ret_obj["message"];
var act = ret_obj["act"];
var redirect_url = ret_obj["redirect_url"];
var url = location.href;
if(typeof(message)!="undefined"&&message&&message!="success") alert(message);
if(typeof(act)!="undefined" && act) url = current_url.setQuery("act", act);
else if(typeof(redirect_url)!="undefined" && redirect_url) url = redirect_url;
if(url == location.href) url = url.replace(/#(.*)$/,'');
location.href = url;
}
/**
* @brief Function to process filters
* @deprecated
*/
function procFilter(fo_obj, filter_func)
{
filter_func(fo_obj);
return false;
}

View file

@ -1,676 +1,174 @@
/**
* x.js compiled from X 4.0 with XC 0.27b.
* Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com
* Copyright 2001-2005 Michael Foster (Cross-Browser.com)
**/
function xDeprecate(funcName) {
var msg = 'DEPRECATED : '+funcName+'() is deprecated function.';
if (typeof console == 'object' && typeof console.log == 'function') {
console.log(msg);
}
}
var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
var i=xUA.indexOf('opera');
if(i!=-1){
var v=parseInt(xUA.charAt(i+6));
xOp7Up=v>=7;
xOp6Dn=v<7;
}
}
else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){
xIE4Up=parseFloat(navigator.appVersion)>=4;
xIE4=xUA.indexOf('msie 4')!=-1;
xIE5=xUA.indexOf('msie 5')!=-1;
xIE6=xUA.indexOf('msie 6')!=-1;
}
else if(document.layers){xNN4=true;}
var xMac=xUA.indexOf('mac')!=-1;
var xFF=xUA.indexOf('firefox')!=-1;
// (element, event(without 'on'), event listener(function name)[, caption])
function xAddEventListener(e,eT,eL,cap)
{
xDeprecate('xAddEventListener');
if(!(e=xGetElementById(e))) return;
eT=eT.toLowerCase();
if((!xIE4Up && !xOp7Up) && e==window) {
if(eT=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eL; xResizeEvent(); return; }
if(eT=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eL; xScrollEvent(); return; }
}
var eh='e.on'+eT+'=eL';
if(e.addEventListener) e.addEventListener(eT,eL,cap);
else if(e.attachEvent) e.attachEvent('on'+eT,eL);
else eval(eh);
}
// called only from the above
function xResizeEvent()
{
xDeprecate('xResizeEvent');
if (window.xREL) setTimeout('xResizeEvent()', 250);
var cw = xClientWidth(), ch = xClientHeight();
if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); }
}
function xScrollEvent()
{
xDeprecate('xScrollEvent');
if (window.xSEL) setTimeout('xScrollEvent()', 250);
var sl = xScrollLeft(), st = xScrollTop();
if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); }
}
function xAppendChild(oParent, oChild)
{
xDeprecate('xAppendChild');
if (oParent.appendChild) return oParent.appendChild(oChild);
else return null;
}
function xClientHeight()
{
xDeprecate('xClientHeight');
var h=0;
if(xOp6Dn) h=window.innerHeight;
else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight)
h=document.documentElement.clientHeight;
else if(document.body && document.body.clientHeight)
h=document.body.clientHeight;
else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
h=window.innerHeight;
if(document.width>window.innerWidth) h-=16;
}
return h;
}
function xClientWidth()
{
xDeprecate('xClientWidth');
var w=0;
if(xOp6Dn) w=window.innerWidth;
else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth)
w=document.documentElement.clientWidth;
else if(document.body && document.body.clientWidth)
w=document.body.clientWidth;
else if(xDef(window.innerWidth,window.innerHeight,document.height)) {
w=window.innerWidth;
if(document.height>window.innerHeight) w-=16;
}
return w;
}
function xCreateElement(sTag)
{
xDeprecate('xCreateElement');
if (document.createElement) return document.createElement(sTag);
else return null;
}
function xDef()
{
xDeprecate('xDef');
for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
return true;
}
function xDeleteCookie(name, path)
{
xDeprecate('xDeleteCookie');
if (xGetCookie(name)) {
document.cookie = name + "=" +
"; path=" + ((!path) ? "/" : path) +
"; expires=" + new Date(0).toGMTString();
}
}
function xDisplay(e,s)
{
xDeprecate('xDisplay');
if(!(e=xGetElementById(e))) return null;
if(e.style && xDef(e.style.display)) {
if (xStr(s)) e.style.display = s;
return e.style.display;
}
return null;
}
function xEvent(evt) // object prototype
{
xDeprecate('xEvent');
var e = evt || window.event;
if(!e) return;
if(e.type) this.type = e.type;
if(e.target) this.target = e.target;
else if(e.srcElement) this.target = e.srcElement;
// Section B
if (e.relatedTarget) this.relatedTarget = e.relatedTarget;
else if (e.type == 'mouseover' && e.fromElement) this.relatedTarget = e.fromElement;
else if (e.type == 'mouseout') this.relatedTarget = e.toElement;
// End Section B
if(xOp6Dn) { this.pageX = e.clientX; this.pageY = e.clientY; }
else if(xDef(e.pageX,e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; }
else if(xDef(e.clientX,e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); }
// Section A
if (xDef(e.offsetX,e.offsetY)) {
this.offsetX = e.offsetX;
this.offsetY = e.offsetY;
}
else if (xDef(e.layerX,e.layerY)) {
this.offsetX = e.layerX;
this.offsetY = e.layerY;
}
else {
this.offsetX = this.pageX - xPageX(this.target);
this.offsetY = this.pageY - xPageY(this.target);
}
// End Section A
if (e.keyCode) { this.keyCode = e.keyCode; } // for moz/fb, if keyCode==0 use which
else if (xDef(e.which) && e.type.indexOf('key')!=-1) { this.keyCode = e.which; }
this.shiftKey = e.shiftKey;
this.ctrlKey = e.ctrlKey;
this.altKey = e.altKey;
}
function xFirstChild(e, t)
{
xDeprecate('xFirstChild');
var c = e ? e.firstChild : null;
if (t) while (c && c.nodeName != t) { c = c.nextSibling; }
else while (c && c.nodeType != 1) { c = c.nextSibling; }
return c;
}
function xGetBodyWidth() {
xDeprecate('xGetBodyWidth');
var cw = xClientWidth();
var sw = window.document.body.scrollWidth;
return cw>sw?cw:sw;
}
function xGetBodyHeight() {
xDeprecate('xGetBodyHeight');
var cw = xClientHeight();
var sw = window.document.body.scrollHeight;
return cw>sw?cw:sw;
}
function xGetComputedStyle(oEle, sProp, bInt)
{
xDeprecate('xGetComputedStyle');
var s, p = 'undefined';
var dv = document.defaultView;
if(dv && dv.getComputedStyle){
s = dv.getComputedStyle(oEle,'');
if (s) p = s.getPropertyValue(sProp);
}
else if(oEle.currentStyle) {
// convert css property name to object property name for IE
var a = sProp.split('-');
sProp = a[0];
for (var i=1; i<a.length; ++i) {
c = a[i].charAt(0);
sProp += a[i].replace(c, c.toUpperCase());
}
p = oEle.currentStyle[sProp];
}
else return null;
return bInt ? (parseInt(p) || 0) : p;
}
function xGetCookie(name)
{
xDeprecate('xGetCookie');
var value=null, search=name+"=";
if (document.cookie.length > 0) {
var offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
var end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
value = unescape(document.cookie.substring(offset, end));
}
}
return value;
}
function xGetElementById(e)
{
xDeprecate('xGetElementById');
if(typeof(e)!='string') return e;
if(document.getElementById) e=document.getElementById(e);
else if(document.all) e=document.all[e];
else e=null;
return e;
}
function xGetElementsByAttribute(sTag, sAtt, sRE, fn)
{
xDeprecate('xGetElementsByAttribute');
var a, list, found = new Array(), re = new RegExp(sRE, 'i');
list = xGetElementsByTagName(sTag);
for (var i = 0; i < list.length; ++i) {
a = list[i].getAttribute(sAtt);
if (!a) {a = list[i][sAtt];}
if (typeof(a)=='string' && a.search(re) != -1) {
found[found.length] = list[i];
if (fn) fn(list[i]);
}
}
return found;
}
function xGetElementsByClassName(c,p,t,f)
{
xDeprecate('xGetElementsByClassName');
var found = new Array();
var re = new RegExp('\\b'+c+'\\b', 'i');
var list = xGetElementsByTagName(t, p);
for (var i = 0; i < list.length; ++i) {
if (list[i].className && list[i].className.search(re) != -1) {
found[found.length] = list[i];
if (f) f(list[i]);
}
}
return found;
}
function xGetElementsByTagName(t,p)
{
xDeprecate('xGetElementsByTagName');
var list = null;
t = t || '*';
p = p || document;
if (xIE4 || xIE5) {
if (t == '*') list = p.all;
else list = p.all.tags(t);
}
else if (p.getElementsByTagName) list = p.getElementsByTagName(t);
return list || new Array();
}
function xGetURLArguments()
{
xDeprecate('xGetURLArguments');
var idx = location.href.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = location.href.substring(idx+1, location.href.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[i] = nameVal[1];
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
function xHeight(e,h)
{
xDeprecate('xHeight');
if(!(e=xGetElementById(e))) return 0;
if (xNum(h)) {
if (h<0) h = 0;
else h=Math.round(h);
}
else h=-1;
var css=xDef(e.style);
if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
h = xClientHeight();
}
else if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {
if(h>=0) {
var pt=0,pb=0,bt=0,bb=0;
if (document.compatMode=='CSS1Compat') {
var gcs = xGetComputedStyle;
pt=gcs(e,'padding-top',1);
if (pt !== null) {
pb=gcs(e,'padding-bottom',1);
bt=gcs(e,'border-top-width',1);
bb=gcs(e,'border-bottom-width',1);
}
// Should we try this as a last resort?
// At this point getComputedStyle and currentStyle do not exist.
else if(xDef(e.offsetHeight,e.style.height)){
e.style.height=h+'px';
pt=e.offsetHeight-h;
}
}
h-=(pt+pb+bt+bb);
if(isNaN(h)||h<0) return null;
else e.style.height=h+'px';
}
h=e.offsetHeight;
}
else if(css && xDef(e.style.pixelHeight)) {
if(h>=0) e.style.pixelHeight=h;
h=e.style.pixelHeight;
}
return h;
}
function xHex(sn, digits, prefix)
{
xDeprecate('xHex');
var p = '';
var n = Math.ceil(sn);
if (prefix) p = prefix;
n = n.toString(16);
for (var i=0; i < digits - n.length; ++i) {
p += '0';
}
return p + n;
}
function xHide(e){ xDeprecate('xHide'); return xVisibility(e,0);}
function xInnerHtml(e,h)
{
xDeprecate('xInnerHtml');
if(!(e=xGetElementById(e)) || !xStr(e.innerHTML)) return null;
var s = e.innerHTML;
if (xStr(h)) {e.innerHTML = h;}
return s;
}
function xLeft(e, iX)
{
xDeprecate('xLeft');
if(!(e=xGetElementById(e))) return 0;
var css=xDef(e.style);
if (css && xStr(e.style.left)) {
if(xNum(iX)) e.style.left=iX+'px';
else {
iX=parseInt(e.style.left);
if(isNaN(iX)) iX=0;
}
}
else if(css && xDef(e.style.pixelLeft)) {
if(xNum(iX)) e.style.pixelLeft=iX;
else iX=e.style.pixelLeft;
}
return iX;
}
function xMoveTo(e,x,y)
{
xDeprecate('xMoveTo');
xLeft(e,x);
xTop(e,y);
}
function xName(e)
{
xDeprecate('xName');
if (!e) return e;
else if (e.id && e.id != "") return e.id;
else if (e.name && e.name != "") return e.name;
else if (e.nodeName && e.nodeName != "") return e.nodeName;
else if (e.tagName && e.tagName != "") return e.tagName;
else return e;
}
function xNextSib(e,t)
{
xDeprecate('xNextSib');
var s = e ? e.nextSibling : null;
if (t) while (s && s.nodeName != t) { s = s.nextSibling; }
else while (s && s.nodeType != 1) { s = s.nextSibling; }
return s;
}
function xNum()
{
xDeprecate('xNum');
for(var i=0; i<arguments.length; ++i){if(isNaN(arguments[i]) || typeof(arguments[i])!='number') return false;}
return true;
}
function xOffsetLeft(e)
{
xDeprecate('xOffsetLeft');
if (!(e=xGetElementById(e))) return 0;
if (xDef(e.offsetLeft)) return e.offsetLeft;
else return 0;
}
function xOffsetTop(e)
{
xDeprecate('xOffsetTop');
if (!(e=xGetElementById(e))) return 0;
if (xDef(e.offsetTop)) return e.offsetTop;
else return 0;
}
function xPad(s,len,c,left)
{
xDeprecate('xPad');
if(typeof s != 'string') s=s+'';
if(left) {for(var i=s.length; i<len; ++i) s=c+s;}
else {for (i=s.length; i<len; ++i) s+=c;}
return s;
}
function xPageX(e)
{
xDeprecate('xPageX');
if (!(e=xGetElementById(e))) return 0;
var x = 0;
while (e) {
if (xDef(e.offsetLeft)) x += e.offsetLeft;
e = xDef(e.offsetParent) ? e.offsetParent : null;
}
return x;
}
function xPageY(e)
{
xDeprecate('xPageY');
if (!(e=xGetElementById(e))) return 0;
var y = 0;
while (e) {
if (xDef(e.offsetTop)) y += e.offsetTop;
e = xDef(e.offsetParent) ? e.offsetParent : null;
}
// if (xOp7Up) return y - document.body.offsetTop; // v3.14, temporary hack for opera bug 130324 (reported 1nov03)
return y;
}
function xParent(e, bNode)
{
xDeprecate('xParent');
if (!(e=xGetElementById(e))) return null;
var p=null;
if (!bNode && xDef(e.offsetParent)) p=e.offsetParent;
else if (xDef(e.parentNode)) p=e.parentNode;
else if (xDef(e.parentElement)) p=e.parentElement;
return p;
}
function xPreventDefault(e)
{
xDeprecate('xPreventDefault');
if (e && e.preventDefault) e.preventDefault()
else if (window.event) window.event.returnValue = false;
}
function xPrevSib(e,t)
{
xDeprecate('xPrevSib');
var s = e ? e.previousSibling : null;
if (t) while(s && s.nodeName != t) {s=s.previousSibling;}
else while(s && s.nodeType != 1) {s=s.previousSibling;}
return s;
}
function xRemoveEventListener(e,eT,eL,cap)
{
xDeprecate('xRemoveEventListener');
if(!(e=xGetElementById(e))) return;
eT=eT.toLowerCase();
if((!xIE4Up && !xOp7Up) && e==window) {
if(eT=='resize') { window.xREL=null; return; }
if(eT=='scroll') { window.xSEL=null; return; }
}
var eh='e.on'+eT+'=null';
if(e.removeEventListener) e.removeEventListener(eT,eL,cap);
else if(e.detachEvent) e.detachEvent('on'+eT,eL);
else eval(eh);
}
function xResizeTo(e,w,h)
{
xDeprecate('xResizeTo');
xWidth(e,w);
xHeight(e,h);
}
function xScrollLeft(e, bWin)
{
xDeprecate('xScrollLeft');
var offset=0;
if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
var w = window;
if (bWin && e) w = e;
if(w.document.documentElement && w.document.documentElement.scrollLeft) offset=w.document.documentElement.scrollLeft;
else if(w.document.body && xDef(w.document.body.scrollLeft)) offset=w.document.body.scrollLeft;
}
else {
e = xGetElementById(e);
if (e && xNum(e.scrollLeft)) offset = e.scrollLeft;
}
return offset;
}
function xScrollTop(e, bWin)
{
xDeprecate('xScrollTop');
var offset=0;
if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
var w = window;
if (bWin && e) w = e;
if(w.document.documentElement && w.document.documentElement.scrollTop) offset=w.document.documentElement.scrollTop;
else if(w.document.body && xDef(w.document.body.scrollTop)) offset=w.document.body.scrollTop;
}
else {
e = xGetElementById(e);
if (e && xNum(e.scrollTop)) offset = e.scrollTop;
}
return offset;
}
function xSetCookie(name, value, expire, path)
{
xDeprecate('xSetCookie');
document.cookie = name + "=" + escape(value) +
((!expire) ? "" : ("; expires=" + expire.toGMTString())) +
"; path=" + ((!path) ? "/" : path);
}
function xShow(e) { xDeprecate('xShow'); return xVisibility(e,1);}
function xStr(s)
{
xDeprecate('xStr');
for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}
return true;
}
function xTop(e, iY)
{
xDeprecate('xTop');
if(!(e=xGetElementById(e))) return 0;
var css=xDef(e.style);
if(css && xStr(e.style.top)) {
if(xNum(iY)) e.style.top=iY+'px';
else {
iY=parseInt(e.style.top);
if(isNaN(iY)) iY=0;
}
}
else if(css && xDef(e.style.pixelTop)) {
if(xNum(iY)) e.style.pixelTop=iY;
else iY=e.style.pixelTop;
}
return iY;
}
function xVisibility(e, bShow)
{
xDeprecate('xVisibility');
if(!(e=xGetElementById(e))) return null;
if(e.style && xDef(e.style.visibility)) {
if (xDef(bShow)) e.style.visibility = bShow ? 'visible' : 'hidden';
return e.style.visibility;
}
return null;
}
function xWidth(e,w)
{
xDeprecate('xWidth');
if(!(e=xGetElementById(e))) return 0;
if (xNum(w)) {
if (w<0) w = 0;
else w=Math.round(w);
}
else w=-1;
var css=xDef(e.style);
if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
w = xClientWidth();
}
else if(css && xDef(e.offsetWidth) && xStr(e.style.width)) {
if(w>=0) {
var pl=0,pr=0,bl=0,br=0;
if (document.compatMode=='CSS1Compat') {
var gcs = xGetComputedStyle;
pl=gcs(e,'padding-left',1);
if (pl !== null) {
pr=gcs(e,'padding-right',1);
bl=gcs(e,'border-left-width',1);
br=gcs(e,'border-right-width',1);
}
// Should we try this as a last resort?
// At this point getComputedStyle and currentStyle do not exist.
else if(xDef(e.offsetWidth,e.style.width)){
e.style.width=w+'px';
pl=e.offsetWidth-w;
}
}
w-=(pl+pr+bl+br);
if(isNaN(w)||w<0) return null;
else e.style.width=w+'px';
}
w=e.offsetWidth;
}
else if(css && xDef(e.style.pixelWidth)) {
if(w>=0) e.style.pixelWidth=w;
w=e.style.pixelWidth;
}
return w;
}
function xZIndex(e,uZ)
{
xDeprecate('xZIndex');
if(!(e=xGetElementById(e))) return 0;
if(e.style && xDef(e.style.zIndex)) {
if(xNum(uZ)) e.style.zIndex=uZ;
uZ=parseInt(e.style.zIndex);
}
return uZ;
}
function xStopPropagation(evt)
{
xDeprecate('xStopPropagation');
if (evt && evt.stopPropagation) evt.stopPropagation();
else if (window.event) window.event.cancelBubble = true;
}
/**
* x.js compiled from X 4.0 with XC 0.27b.
* Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com
* Copyright 2001-2005 Michael Foster (Cross-Browser.com)
**/
function xDeprecate(funcName){var msg='DEPRECATED : '+funcName+'() is deprecated function.';if(typeof console=='object'&&typeof console.log=='function'){console.log(msg);}}
var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf('opera');if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7;}}
else if(navigator.vendor!='KDE'&&document.all&&xUA.indexOf('msie')!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;xIE6=xUA.indexOf('msie 6')!=-1;}
else if(document.layers){xNN4=true;}
var xMac=xUA.indexOf('mac')!=-1;var xFF=xUA.indexOf('firefox')!=-1;function xAddEventListener(e,eT,eL,cap)
{xDeprecate('xAddEventListener');if(!(e=xGetElementById(e)))return;eT=eT.toLowerCase();if((!xIE4Up&&!xOp7Up)&&e==window){if(eT=='resize'){window.xPCW=xClientWidth();window.xPCH=xClientHeight();window.xREL=eL;xResizeEvent();return;}
if(eT=='scroll'){window.xPSL=xScrollLeft();window.xPST=xScrollTop();window.xSEL=eL;xScrollEvent();return;}}
var eh='e.on'+eT+'=eL';if(e.addEventListener)e.addEventListener(eT,eL,cap);else if(e.attachEvent)e.attachEvent('on'+eT,eL);else eval(eh);}
function xResizeEvent()
{xDeprecate('xResizeEvent');if(window.xREL)setTimeout('xResizeEvent()',250);var cw=xClientWidth(),ch=xClientHeight();if(window.xPCW!=cw||window.xPCH!=ch){window.xPCW=cw;window.xPCH=ch;if(window.xREL)window.xREL();}}
function xScrollEvent()
{xDeprecate('xScrollEvent');if(window.xSEL)setTimeout('xScrollEvent()',250);var sl=xScrollLeft(),st=xScrollTop();if(window.xPSL!=sl||window.xPST!=st){window.xPSL=sl;window.xPST=st;if(window.xSEL)window.xSEL();}}
function xAppendChild(oParent,oChild)
{xDeprecate('xAppendChild');if(oParent.appendChild)return oParent.appendChild(oChild);else return null;}
function xClientHeight()
{xDeprecate('xClientHeight');var h=0;if(xOp6Dn)h=window.innerHeight;else if(document.compatMode=='CSS1Compat'&&!window.opera&&document.documentElement&&document.documentElement.clientHeight)
h=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)
h=document.body.clientHeight;else if(xDef(window.innerWidth,window.innerHeight,document.width)){h=window.innerHeight;if(document.width>window.innerWidth)h-=16;}
return h;}
function xClientWidth()
{xDeprecate('xClientWidth');var w=0;if(xOp6Dn)w=window.innerWidth;else if(document.compatMode=='CSS1Compat'&&!window.opera&&document.documentElement&&document.documentElement.clientWidth)
w=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)
w=document.body.clientWidth;else if(xDef(window.innerWidth,window.innerHeight,document.height)){w=window.innerWidth;if(document.height>window.innerHeight)w-=16;}
return w;}
function xCreateElement(sTag)
{xDeprecate('xCreateElement');if(document.createElement)return document.createElement(sTag);else return null;}
function xDef()
{xDeprecate('xDef');for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])=='undefined')return false;}
return true;}
function xDeleteCookie(name,path)
{xDeprecate('xDeleteCookie');if(xGetCookie(name)){document.cookie=name+"="+"; path="+((!path)?"/":path)+"; expires="+new Date(0).toGMTString();}}
function xDisplay(e,s)
{xDeprecate('xDisplay');if(!(e=xGetElementById(e)))return null;if(e.style&&xDef(e.style.display)){if(xStr(s))e.style.display=s;return e.style.display;}
return null;}
function xEvent(evt)
{xDeprecate('xEvent');var e=evt||window.event;if(!e)return;if(e.type)this.type=e.type;if(e.target)this.target=e.target;else if(e.srcElement)this.target=e.srcElement;if(e.relatedTarget)this.relatedTarget=e.relatedTarget;else if(e.type=='mouseover'&&e.fromElement)this.relatedTarget=e.fromElement;else if(e.type=='mouseout')this.relatedTarget=e.toElement;if(xOp6Dn){this.pageX=e.clientX;this.pageY=e.clientY;}
else if(xDef(e.pageX,e.pageY)){this.pageX=e.pageX;this.pageY=e.pageY;}
else if(xDef(e.clientX,e.clientY)){this.pageX=e.clientX+xScrollLeft();this.pageY=e.clientY+xScrollTop();}
if(xDef(e.offsetX,e.offsetY)){this.offsetX=e.offsetX;this.offsetY=e.offsetY;}
else if(xDef(e.layerX,e.layerY)){this.offsetX=e.layerX;this.offsetY=e.layerY;}
else{this.offsetX=this.pageX-xPageX(this.target);this.offsetY=this.pageY-xPageY(this.target);}
if(e.keyCode){this.keyCode=e.keyCode;}
else if(xDef(e.which)&&e.type.indexOf('key')!=-1){this.keyCode=e.which;}
this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey;this.altKey=e.altKey;}
function xFirstChild(e,t)
{xDeprecate('xFirstChild');var c=e?e.firstChild:null;if(t)while(c&&c.nodeName!=t){c=c.nextSibling;}
else while(c&&c.nodeType!=1){c=c.nextSibling;}
return c;}
function xGetBodyWidth(){xDeprecate('xGetBodyWidth');var cw=xClientWidth();var sw=window.document.body.scrollWidth;return cw>sw?cw:sw;}
function xGetBodyHeight(){xDeprecate('xGetBodyHeight');var cw=xClientHeight();var sw=window.document.body.scrollHeight;return cw>sw?cw:sw;}
function xGetComputedStyle(oEle,sProp,bInt)
{xDeprecate('xGetComputedStyle');var s,p='undefined';var dv=document.defaultView;if(dv&&dv.getComputedStyle){s=dv.getComputedStyle(oEle,'');if(s)p=s.getPropertyValue(sProp);}
else if(oEle.currentStyle){var a=sProp.split('-');sProp=a[0];for(var i=1;i<a.length;++i){c=a[i].charAt(0);sProp+=a[i].replace(c,c.toUpperCase());}
p=oEle.currentStyle[sProp];}
else return null;return bInt?(parseInt(p)||0):p;}
function xGetCookie(name)
{xDeprecate('xGetCookie');var value=null,search=name+"=";if(document.cookie.length>0){var offset=document.cookie.indexOf(search);if(offset!=-1){offset+=search.length;var end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;value=unescape(document.cookie.substring(offset,end));}}
return value;}
function xGetElementById(e)
{xDeprecate('xGetElementById');if(typeof(e)!='string')return e;if(document.getElementById)e=document.getElementById(e);else if(document.all)e=document.all[e];else e=null;return e;}
function xGetElementsByAttribute(sTag,sAtt,sRE,fn)
{xDeprecate('xGetElementsByAttribute');var a,list,found=new Array(),re=new RegExp(sRE,'i');list=xGetElementsByTagName(sTag);for(var i=0;i<list.length;++i){a=list[i].getAttribute(sAtt);if(!a){a=list[i][sAtt];}
if(typeof(a)=='string'&&a.search(re)!=-1){found[found.length]=list[i];if(fn)fn(list[i]);}}
return found;}
function xGetElementsByClassName(c,p,t,f)
{xDeprecate('xGetElementsByClassName');var found=new Array();var re=new RegExp('\\b'+c+'\\b','i');var list=xGetElementsByTagName(t,p);for(var i=0;i<list.length;++i){if(list[i].className&&list[i].className.search(re)!=-1){found[found.length]=list[i];if(f)f(list[i]);}}
return found;}
function xGetElementsByTagName(t,p)
{xDeprecate('xGetElementsByTagName');var list=null;t=t||'*';p=p||document;if(xIE4||xIE5){if(t=='*')list=p.all;else list=p.all.tags(t);}
else if(p.getElementsByTagName)list=p.getElementsByTagName(t);return list||new Array();}
function xGetURLArguments()
{xDeprecate('xGetURLArguments');var idx=location.href.indexOf('?');var params=new Array();if(idx!=-1){var pairs=location.href.substring(idx+1,location.href.length).split('&');for(var i=0;i<pairs.length;i++){nameVal=pairs[i].split('=');params[i]=nameVal[1];params[nameVal[0]]=nameVal[1];}}
return params;}
function xHeight(e,h)
{xDeprecate('xHeight');if(!(e=xGetElementById(e)))return 0;if(xNum(h)){if(h<0)h=0;else h=Math.round(h);}
else h=-1;var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){h=xClientHeight();}
else if(css&&xDef(e.offsetHeight)&&xStr(e.style.height)){if(h>=0){var pt=0,pb=0,bt=0,bb=0;if(document.compatMode=='CSS1Compat'){var gcs=xGetComputedStyle;pt=gcs(e,'padding-top',1);if(pt!==null){pb=gcs(e,'padding-bottom',1);bt=gcs(e,'border-top-width',1);bb=gcs(e,'border-bottom-width',1);}
else if(xDef(e.offsetHeight,e.style.height)){e.style.height=h+'px';pt=e.offsetHeight-h;}}
h-=(pt+pb+bt+bb);if(isNaN(h)||h<0)return null;else e.style.height=h+'px';}
h=e.offsetHeight;}
else if(css&&xDef(e.style.pixelHeight)){if(h>=0)e.style.pixelHeight=h;h=e.style.pixelHeight;}
return h;}
function xHex(sn,digits,prefix)
{xDeprecate('xHex');var p='';var n=Math.ceil(sn);if(prefix)p=prefix;n=n.toString(16);for(var i=0;i<digits-n.length;++i){p+='0';}
return p+n;}
function xHide(e){xDeprecate('xHide');return xVisibility(e,0);}
function xInnerHtml(e,h)
{xDeprecate('xInnerHtml');if(!(e=xGetElementById(e))||!xStr(e.innerHTML))return null;var s=e.innerHTML;if(xStr(h)){e.innerHTML=h;}
return s;}
function xLeft(e,iX)
{xDeprecate('xLeft');if(!(e=xGetElementById(e)))return 0;var css=xDef(e.style);if(css&&xStr(e.style.left)){if(xNum(iX))e.style.left=iX+'px';else{iX=parseInt(e.style.left);if(isNaN(iX))iX=0;}}
else if(css&&xDef(e.style.pixelLeft)){if(xNum(iX))e.style.pixelLeft=iX;else iX=e.style.pixelLeft;}
return iX;}
function xMoveTo(e,x,y)
{xDeprecate('xMoveTo');xLeft(e,x);xTop(e,y);}
function xName(e)
{xDeprecate('xName');if(!e)return e;else if(e.id&&e.id!="")return e.id;else if(e.name&&e.name!="")return e.name;else if(e.nodeName&&e.nodeName!="")return e.nodeName;else if(e.tagName&&e.tagName!="")return e.tagName;else return e;}
function xNextSib(e,t)
{xDeprecate('xNextSib');var s=e?e.nextSibling:null;if(t)while(s&&s.nodeName!=t){s=s.nextSibling;}
else while(s&&s.nodeType!=1){s=s.nextSibling;}
return s;}
function xNum()
{xDeprecate('xNum');for(var i=0;i<arguments.length;++i){if(isNaN(arguments[i])||typeof(arguments[i])!='number')return false;}
return true;}
function xOffsetLeft(e)
{xDeprecate('xOffsetLeft');if(!(e=xGetElementById(e)))return 0;if(xDef(e.offsetLeft))return e.offsetLeft;else return 0;}
function xOffsetTop(e)
{xDeprecate('xOffsetTop');if(!(e=xGetElementById(e)))return 0;if(xDef(e.offsetTop))return e.offsetTop;else return 0;}
function xPad(s,len,c,left)
{xDeprecate('xPad');if(typeof s!='string')s=s+'';if(left){for(var i=s.length;i<len;++i)s=c+s;}
else{for(i=s.length;i<len;++i)s+=c;}
return s;}
function xPageX(e)
{xDeprecate('xPageX');if(!(e=xGetElementById(e)))return 0;var x=0;while(e){if(xDef(e.offsetLeft))x+=e.offsetLeft;e=xDef(e.offsetParent)?e.offsetParent:null;}
return x;}
function xPageY(e)
{xDeprecate('xPageY');if(!(e=xGetElementById(e)))return 0;var y=0;while(e){if(xDef(e.offsetTop))y+=e.offsetTop;e=xDef(e.offsetParent)?e.offsetParent:null;}
return y;}
function xParent(e,bNode)
{xDeprecate('xParent');if(!(e=xGetElementById(e)))return null;var p=null;if(!bNode&&xDef(e.offsetParent))p=e.offsetParent;else if(xDef(e.parentNode))p=e.parentNode;else if(xDef(e.parentElement))p=e.parentElement;return p;}
function xPreventDefault(e)
{xDeprecate('xPreventDefault');if(e&&e.preventDefault)e.preventDefault()
else if(window.event)window.event.returnValue=false;}
function xPrevSib(e,t)
{xDeprecate('xPrevSib');var s=e?e.previousSibling:null;if(t)while(s&&s.nodeName!=t){s=s.previousSibling;}
else while(s&&s.nodeType!=1){s=s.previousSibling;}
return s;}
function xRemoveEventListener(e,eT,eL,cap)
{xDeprecate('xRemoveEventListener');if(!(e=xGetElementById(e)))return;eT=eT.toLowerCase();if((!xIE4Up&&!xOp7Up)&&e==window){if(eT=='resize'){window.xREL=null;return;}
if(eT=='scroll'){window.xSEL=null;return;}}
var eh='e.on'+eT+'=null';if(e.removeEventListener)e.removeEventListener(eT,eL,cap);else if(e.detachEvent)e.detachEvent('on'+eT,eL);else eval(eh);}
function xResizeTo(e,w,h)
{xDeprecate('xResizeTo');xWidth(e,w);xHeight(e,h);}
function xScrollLeft(e,bWin)
{xDeprecate('xScrollLeft');var offset=0;if(!xDef(e)||bWin||e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){var w=window;if(bWin&&e)w=e;if(w.document.documentElement&&w.document.documentElement.scrollLeft)offset=w.document.documentElement.scrollLeft;else if(w.document.body&&xDef(w.document.body.scrollLeft))offset=w.document.body.scrollLeft;}
else{e=xGetElementById(e);if(e&&xNum(e.scrollLeft))offset=e.scrollLeft;}
return offset;}
function xScrollTop(e,bWin)
{xDeprecate('xScrollTop');var offset=0;if(!xDef(e)||bWin||e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){var w=window;if(bWin&&e)w=e;if(w.document.documentElement&&w.document.documentElement.scrollTop)offset=w.document.documentElement.scrollTop;else if(w.document.body&&xDef(w.document.body.scrollTop))offset=w.document.body.scrollTop;}
else{e=xGetElementById(e);if(e&&xNum(e.scrollTop))offset=e.scrollTop;}
return offset;}
function xSetCookie(name,value,expire,path)
{xDeprecate('xSetCookie');document.cookie=name+"="+escape(value)+
((!expire)?"":("; expires="+expire.toGMTString()))+"; path="+((!path)?"/":path);}
function xShow(e){xDeprecate('xShow');return xVisibility(e,1);}
function xStr(s)
{xDeprecate('xStr');for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])!='string')return false;}
return true;}
function xTop(e,iY)
{xDeprecate('xTop');if(!(e=xGetElementById(e)))return 0;var css=xDef(e.style);if(css&&xStr(e.style.top)){if(xNum(iY))e.style.top=iY+'px';else{iY=parseInt(e.style.top);if(isNaN(iY))iY=0;}}
else if(css&&xDef(e.style.pixelTop)){if(xNum(iY))e.style.pixelTop=iY;else iY=e.style.pixelTop;}
return iY;}
function xVisibility(e,bShow)
{xDeprecate('xVisibility');if(!(e=xGetElementById(e)))return null;if(e.style&&xDef(e.style.visibility)){if(xDef(bShow))e.style.visibility=bShow?'visible':'hidden';return e.style.visibility;}
return null;}
function xWidth(e,w)
{xDeprecate('xWidth');if(!(e=xGetElementById(e)))return 0;if(xNum(w)){if(w<0)w=0;else w=Math.round(w);}
else w=-1;var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){w=xClientWidth();}
else if(css&&xDef(e.offsetWidth)&&xStr(e.style.width)){if(w>=0){var pl=0,pr=0,bl=0,br=0;if(document.compatMode=='CSS1Compat'){var gcs=xGetComputedStyle;pl=gcs(e,'padding-left',1);if(pl!==null){pr=gcs(e,'padding-right',1);bl=gcs(e,'border-left-width',1);br=gcs(e,'border-right-width',1);}
else if(xDef(e.offsetWidth,e.style.width)){e.style.width=w+'px';pl=e.offsetWidth-w;}}
w-=(pl+pr+bl+br);if(isNaN(w)||w<0)return null;else e.style.width=w+'px';}
w=e.offsetWidth;}
else if(css&&xDef(e.style.pixelWidth)){if(w>=0)e.style.pixelWidth=w;w=e.style.pixelWidth;}
return w;}
function xZIndex(e,uZ)
{xDeprecate('xZIndex');if(!(e=xGetElementById(e)))return 0;if(e.style&&xDef(e.style.zIndex)){if(xNum(uZ))e.style.zIndex=uZ;uZ=parseInt(e.style.zIndex);}
return uZ;}
function xStopPropagation(evt)
{xDeprecate('xStopPropagation');if(evt&&evt.stopPropagation)evt.stopPropagation();else if(window.event)window.event.cancelBubble=true;}

View file

@ -2,408 +2,71 @@
* @file common/js/xml_handler.js
* @brief XE에서 ajax기능을 이용함에 있어 module, act를 사용하기 위한 자바스크립트
**/
// xml handler을 이용하는 user function
var show_waiting_message = true;
/* This work is licensed under Creative Commons GNU LGPL License.
License: http://creativecommons.org/licenses/LGPL/2.1/
Version: 0.9
Author: Stefan Goessner/2006
Web: http://goessner.net/
*/
function xml2json(xml, tab, ignoreAttrib) {
var X = {
toObj: function(xml) {
var o = {};
if (xml.nodeType==1) { // element node ..
if (ignoreAttrib && xml.attributes.length) // element with attributes ..
for (var i=0; i<xml.attributes.length; i++)
o["@"+xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue||"").toString();
if (xml.firstChild) { // element has child nodes ..
var textChild=0, cdataChild=0, hasElementChild=false;
for (var n=xml.firstChild; n; n=n.nextSibling) {
if (n.nodeType==1) hasElementChild = true;
else if (n.nodeType==3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) textChild++; // non-whitespace text
else if (n.nodeType==4) cdataChild++; // cdata section node
}
if (hasElementChild) {
if (textChild < 2 && cdataChild < 2) { // structured element with evtl. a single text or/and cdata node ..
X.removeWhite(xml);
for (var n=xml.firstChild; n; n=n.nextSibling) {
if (n.nodeType == 3) // text node
o = X.escape(n.nodeValue);
else if (n.nodeType == 4) // cdata node
// o["#cdata"] = X.escape(n.nodeValue);
o = X.escape(n.nodeValue);
else if (o[n.nodeName]) { // multiple occurence of element ..
if (o[n.nodeName] instanceof Array)
o[n.nodeName][o[n.nodeName].length] = X.toObj(n);
else
o[n.nodeName] = [o[n.nodeName], X.toObj(n)];
}
else // first occurence of element..
o[n.nodeName] = X.toObj(n);
}
}
else { // mixed content
if (!xml.attributes.length)
o = X.escape(X.innerXml(xml));
else
o["#text"] = X.escape(X.innerXml(xml));
}
}
else if (textChild) { // pure text
if (!xml.attributes.length)
o = X.escape(X.innerXml(xml));
else
o["#text"] = X.escape(X.innerXml(xml));
}
else if (cdataChild) { // cdata
if (cdataChild > 1)
o = X.escape(X.innerXml(xml));
else
for (var n=xml.firstChild; n; n=n.nextSibling){
//o["#cdata"] = X.escape(n.nodeValue);
o = X.escape(n.nodeValue);
}
}
}
if (!xml.attributes.length && !xml.firstChild) o = null;
}
else if (xml.nodeType==9) { // document.node
o = X.toObj(xml.documentElement);
}
else
alert("unhandled node type: " + xml.nodeType);
return o;
},
toJson: function(o, name, ind) {
var json = name ? ("\""+name+"\"") : "";
if (o instanceof Array) {
for (var i=0,n=o.length; i<n; i++)
o[i] = X.toJson(o[i], "", ind+"\t");
json += (name?":[":"[") + (o.length > 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]";
}
else if (o == null)
json += (name&&":") + "null";
else if (typeof(o) == "object") {
var arr = [];
for (var m in o)
arr[arr.length] = X.toJson(o[m], m, ind+"\t");
json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}";
}
else if (typeof(o) == "string")
json += (name&&":") + "\"" + o.toString() + "\"";
else
json += (name&&":") + o.toString();
return json;
},
innerXml: function(node) {
var s = ""
if ("innerHTML" in node)
s = node.innerHTML;
else {
var asXml = function(n) {
var s = "";
if (n.nodeType == 1) {
s += "<" + n.nodeName;
for (var i=0; i<n.attributes.length;i++)
s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue||"").toString() + "\"";
if (n.firstChild) {
s += ">";
for (var c=n.firstChild; c; c=c.nextSibling)
s += asXml(c);
s += "</"+n.nodeName+">";
}
else
s += "/>";
}
else if (n.nodeType == 3)
s += n.nodeValue;
else if (n.nodeType == 4)
s += "<![CDATA[" + n.nodeValue + "]]>";
return s;
};
for (var c=node.firstChild; c; c=c.nextSibling)
s += asXml(c);
}
return s;
},
escape: function(txt) {
return txt.replace(/[\\]/g, "\\\\")
.replace(/[\"]/g, '\\"')
.replace(/[\n]/g, '\\n')
.replace(/[\r]/g, '\\r');
},
removeWhite: function(e) {
e.normalize();
for (var n = e.firstChild; n; ) {
if (n.nodeType == 3) { // text node
if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node
var nxt = n.nextSibling;
e.removeChild(n);
n = nxt;
}
else
n = n.nextSibling;
}
else if (n.nodeType == 1) { // element node
X.removeWhite(n);
n = n.nextSibling;
}
else // any other node
n = n.nextSibling;
}
return e;
}
};
if (xml.nodeType == 9) // document node
xml = xml.documentElement;
var json_obj = X.toObj(X.removeWhite(xml)), json_str;
if (typeof(JSON)=='object' && jQuery.isFunction(JSON.stringify) && false) {
var obj = {}; obj[xml.nodeName] = json_obj;
json_str = JSON.stringify(obj);
return json_str;
} else {
json_str = X.toJson(json_obj, xml.nodeName, "");
return "{" + (tab ? json_str.replace(/\t/g, tab) : json_str.replace(/\t|\n/g, "")) + "}";
}
}
(function($){
/**
* @brief exec_xml
* @author taggon <gonom9@gmail.com>
**/
$.exec_xml = window.exec_xml = function(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj) {
var xml_path = request_uri+"index.php"
if(!params) params = {};
// {{{ set parameters
if($.isArray(params)) params = arr2obj(params);
params['module'] = module;
params['act'] = act;
if(typeof(xeVid)!='undefined') params['vid'] = xeVid;
if(typeof(response_tags)=="undefined" || response_tags.length<1) response_tags = ['error','message'];
else {
response_tags.push('error', 'message');
}
// }}} set parameters
// use ssl?
if ($.isArray(ssl_actions) && params['act'] && $.inArray(params['act'], ssl_actions) >= 0)
{
var url = default_url || request_uri;
var port = window.https_port || 443;
var _ul = $('<a>').attr('href', url)[0];
var target = 'https://' + _ul.hostname.replace(/:\d+$/, '');
if(port != 443) target += ':'+port;
if(_ul.pathname[0] != '/') target += '/';
target += _ul.pathname;
xml_path = target.replace(/\/$/, '')+'/index.php';
}
var _u1 = $('<a>').attr('href', location.href)[0];
var _u2 = $('<a>').attr('href', xml_path)[0];
// 현 url과 ajax call 대상 url의 schema 또는 port가 다르면 직접 form 전송
if(_u1.protocol != _u2.protocol || _u1.port != _u2.port) return send_by_form(xml_path, params);
var xml = [], i = 0;
xml[i++] = '<?xml version="1.0" encoding="utf-8" ?>';
xml[i++] = '<methodCall>';
xml[i++] = '<params>';
$.each(params, function(key, val) {
xml[i++] = '<'+key+'><![CDATA['+val+']]></'+key+'>';
});
xml[i++] = '</params>';
xml[i++] = '</methodCall>';
var _xhr = null;
if (_xhr && _xhr.readyState != 0) _xhr.abort();
// 전송 성공시
function onsuccess(data, textStatus, xhr) {
var resp_xml = $(data).find('response')[0], resp_obj, txt='', ret=[], tags={}, json_str='';
waiting_obj.css('visibility', 'hidden');
if(!resp_xml) {
alert(_xhr.responseText);
return null;
}
json_str = xml2json(resp_xml, false, false);
resp_obj = (typeof(JSON)=='object' && $.isFunction(JSON.parse))?JSON.parse(json_str):eval('('+json_str+')');
resp_obj = resp_obj.response;
if (typeof(resp_obj)=='undefined') {
ret['error'] = -1;
ret['message'] = 'Unexpected error occured.';
try {
if(typeof(txt=resp_xml.childNodes[0].firstChild.data)!='undefined') ret['message'] += '\r\n'+txt;
} catch(e){};
return ret;
}
$.each(response_tags, function(key, val){ tags[val] = true; });
tags["redirect_url"] = true;
tags["act"] = true;
$.each(resp_obj, function(key, val){ if(tags[key]) ret[key] = val; });
if(ret['error'] != 0) {
if ($.isFunction($.exec_xml.onerror)) {
return $.exec_xml.onerror(module, act, ret, callback_func, response_tags, callback_func_arg, fo_obj);
}
alert(ret['message'] || 'error!');
return null;
}
if(ret['redirect_url']) {
location.href = ret['redirect_url'].replace(/&amp;/g, '&');
return null;
}
if($.isFunction(callback_func)) callback_func(ret, response_tags, callback_func_arg, fo_obj);
}
// 모든 xml데이터는 POST방식으로 전송. try-catch문으로 오류 발생시 대처
try {
$.ajax({
url : xml_path,
type : 'POST',
dataType : 'xml',
data : xml.join('\n'),
contentType : 'text/plain',
beforeSend : function(xhr){ _xhr = xhr; },
success : onsuccess,
error : function(xhr, textStatus) {
waiting_obj.css('visibility', 'hidden');
var msg = '';
if (textStatus == 'parsererror') {
msg = 'The result is not valid XML :\n-------------------------------------\n';
if(xhr.responseText == "") return;
msg += xhr.responseText.replace(/<[^>]+>/g, '');
} else {
msg = textStatus;
}
alert(msg);
}
});
} catch(e) {
alert(e);
return;
}
// ajax 통신중 대기 메세지 출력 (show_waiting_message값을 false로 세팅시 보이지 않음)
var waiting_obj = $('#waitingforserverresponse');
if(show_waiting_message && waiting_obj.length) {
var d = $(document);
waiting_obj.html(waiting_message).css({
'top' : (d.scrollTop()+20)+'px',
'left' : (d.scrollLeft()+20)+'px',
'visibility' : 'visible'
});
}
}
function send_by_form(url, params) {
var frame_id = 'xeTmpIframe';
var form_id = 'xeVirtualForm';
if (!$('#'+frame_id).length) {
$('<iframe name="%id%" id="%id%" style="position:absolute;left:-1px;top:1px;width:1px;height:1px"></iframe>'.replace(/%id%/g, frame_id)).appendTo(document.body);
}
$('#'+form_id).remove();
var form = $('<form id="%id%"></form>'.replace(/%id%/g, form_id)).attr({
'id' : form_id,
'method' : 'post',
'action' : url,
'target' : frame_id
});
params['xeVirtualRequestMethod'] = 'xml';
params['xeRequestURI'] = location.href.replace(/#(.*)$/i,'');
params['xeVirtualRequestUrl'] = request_uri;
$.each(params, function(key, value){
$('<input type="hidden">').attr('name', key).attr('value', value).appendTo(form);
});
form.appendTo(document.body).submit();
}
function arr2obj(arr) {
var ret = {};
for(var key in arr) {
if(arr.hasOwnProperty(key)) ret[key] = arr[key];
}
return ret;
}
/**
* @brief exec_json (exec_xml와 같은 용도)
**/
$.exec_json = function(action,data,func){
if(typeof(data) == 'undefined') data = {};
action = action.split(".");
if(action.length == 2){
if(show_waiting_message) {
$("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible');
}
$.extend(data,{module:action[0],act:action[1]});
if(typeof(xeVid)!='undefined') $.extend(data,{vid:xeVid});
$.ajax({
type:"POST"
,dataType:"json"
,url:request_uri
,contentType:"application/json"
,data:$.param(data)
,success : function(data){
$("#waitingforserverresponse").css('visibility','hidden');
if(data.error > 0) alert(data.message);
if($.isFunction(func)) func(data);
}
});
}
};
$.fn.exec_html = function(action,data,type,func,args){
if(typeof(data) == 'undefined') data = {};
if(!$.inArray(type, ['html','append','prepend'])) type = 'html';
var self = $(this);
action = action.split(".");
if(action.length == 2){
if(show_waiting_message) {
$("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible');
}
$.extend(data,{module:action[0],act:action[1]});
$.ajax({
type:"POST"
,dataType:"html"
,url:request_uri
,data:$.param(data)
,success : function(html){
$("#waitingforserverresponse").css('visibility','hidden');
self[type](html);
if($.isFunction(func)) func(args);
}
});
}
};
})(jQuery);
var show_waiting_message=true;function xml2json(xml,tab,ignoreAttrib){var X={toObj:function(xml){var o={};if(xml.nodeType==1){if(ignoreAttrib&&xml.attributes.length)
for(var i=0;i<xml.attributes.length;i++)
o["@"+xml.attributes[i].nodeName]=(xml.attributes[i].nodeValue||"").toString();if(xml.firstChild){var textChild=0,cdataChild=0,hasElementChild=false;for(var n=xml.firstChild;n;n=n.nextSibling){if(n.nodeType==1)hasElementChild=true;else if(n.nodeType==3&&n.nodeValue.match(/[^ \f\n\r\t\v]/))textChild++;else if(n.nodeType==4)cdataChild++;}
if(hasElementChild){if(textChild<2&&cdataChild<2){X.removeWhite(xml);for(var n=xml.firstChild;n;n=n.nextSibling){if(n.nodeType==3)
o=X.escape(n.nodeValue);else if(n.nodeType==4)
o=X.escape(n.nodeValue);else if(o[n.nodeName]){if(o[n.nodeName]instanceof Array)
o[n.nodeName][o[n.nodeName].length]=X.toObj(n);else
o[n.nodeName]=[o[n.nodeName],X.toObj(n)];}
else
o[n.nodeName]=X.toObj(n);}}
else{if(!xml.attributes.length)
o=X.escape(X.innerXml(xml));else
o["#text"]=X.escape(X.innerXml(xml));}}
else if(textChild){if(!xml.attributes.length)
o=X.escape(X.innerXml(xml));else
o["#text"]=X.escape(X.innerXml(xml));}
else if(cdataChild){if(cdataChild>1)
o=X.escape(X.innerXml(xml));else
for(var n=xml.firstChild;n;n=n.nextSibling){o=X.escape(n.nodeValue);}}}
if(!xml.attributes.length&&!xml.firstChild)o=null;}
else if(xml.nodeType==9){o=X.toObj(xml.documentElement);}
else
alert("unhandled node type: "+xml.nodeType);return o;},toJson:function(o,name,ind){var json=name?("\""+name+"\""):"";if(o instanceof Array){for(var i=0,n=o.length;i<n;i++)
o[i]=X.toJson(o[i],"",ind+"\t");json+=(name?":[":"[")+(o.length>1?("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind):o.join(""))+"]";}
else if(o==null)
json+=(name&&":")+"null";else if(typeof(o)=="object"){var arr=[];for(var m in o)
arr[arr.length]=X.toJson(o[m],m,ind+"\t");json+=(name?":{":"{")+(arr.length>1?("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind):arr.join(""))+"}";}
else if(typeof(o)=="string")
json+=(name&&":")+"\""+o.toString()+"\"";else
json+=(name&&":")+o.toString();return json;},innerXml:function(node){var s=""
if("innerHTML"in node)
s=node.innerHTML;else{var asXml=function(n){var s="";if(n.nodeType==1){s+="<"+n.nodeName;for(var i=0;i<n.attributes.length;i++)
s+=" "+n.attributes[i].nodeName+"=\""+(n.attributes[i].nodeValue||"").toString()+"\"";if(n.firstChild){s+=">";for(var c=n.firstChild;c;c=c.nextSibling)
s+=asXml(c);s+="</"+n.nodeName+">";}
else
s+="/>";}
else if(n.nodeType==3)
s+=n.nodeValue;else if(n.nodeType==4)
s+="<![CDATA["+n.nodeValue+"]]>";return s;};for(var c=node.firstChild;c;c=c.nextSibling)
s+=asXml(c);}
return s;},escape:function(txt){return txt.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,'\\n').replace(/[\r]/g,'\\r');},removeWhite:function(e){e.normalize();for(var n=e.firstChild;n;){if(n.nodeType==3){if(!n.nodeValue.match(/[^ \f\n\r\t\v]/)){var nxt=n.nextSibling;e.removeChild(n);n=nxt;}
else
n=n.nextSibling;}
else if(n.nodeType==1){X.removeWhite(n);n=n.nextSibling;}
else
n=n.nextSibling;}
return e;}};if(xml.nodeType==9)
xml=xml.documentElement;var json_obj=X.toObj(X.removeWhite(xml)),json_str;if(typeof(JSON)=='object'&&jQuery.isFunction(JSON.stringify)&&false){var obj={};obj[xml.nodeName]=json_obj;json_str=JSON.stringify(obj);return json_str;}else{json_str=X.toJson(json_obj,xml.nodeName,"");return"{"+(tab?json_str.replace(/\t/g,tab):json_str.replace(/\t|\n/g,""))+"}";}}
(function($){$.exec_xml=window.exec_xml=function(module,act,params,callback_func,response_tags,callback_func_arg,fo_obj){var xml_path=request_uri+"index.php"
if(!params)params={};if($.isArray(params))params=arr2obj(params);params['module']=module;params['act']=act;if(typeof(xeVid)!='undefined')params['vid']=xeVid;if(typeof(response_tags)=="undefined"||response_tags.length<1)response_tags=['error','message'];else{response_tags.push('error','message');}
if($.isArray(ssl_actions)&&params['act']&&$.inArray(params['act'],ssl_actions)>=0)
{var url=default_url||request_uri;var port=window.https_port||443;var _ul=$('<a>').attr('href',url)[0];var target='https://'+_ul.hostname.replace(/:\d+$/,'');if(port!=443)target+=':'+port;if(_ul.pathname[0]!='/')target+='/';target+=_ul.pathname;xml_path=target.replace(/\/$/,'')+'/index.php';}
var _u1=$('<a>').attr('href',location.href)[0];var _u2=$('<a>').attr('href',xml_path)[0];if(_u1.protocol!=_u2.protocol||_u1.port!=_u2.port)return send_by_form(xml_path,params);var xml=[],i=0;xml[i++]='<?xml version="1.0" encoding="utf-8" ?>';xml[i++]='<methodCall>';xml[i++]='<params>';$.each(params,function(key,val){xml[i++]='<'+key+'><![CDATA['+val+']]></'+key+'>';});xml[i++]='</params>';xml[i++]='</methodCall>';var _xhr=null;if(_xhr&&_xhr.readyState!=0)_xhr.abort();function onsuccess(data,textStatus,xhr){var resp_xml=$(data).find('response')[0],resp_obj,txt='',ret=[],tags={},json_str='';waiting_obj.css('visibility','hidden');if(!resp_xml){alert(_xhr.responseText);return null;}
json_str=xml2json(resp_xml,false,false);resp_obj=(typeof(JSON)=='object'&&$.isFunction(JSON.parse))?JSON.parse(json_str):eval('('+json_str+')');resp_obj=resp_obj.response;if(typeof(resp_obj)=='undefined'){ret['error']=-1;ret['message']='Unexpected error occured.';try{if(typeof(txt=resp_xml.childNodes[0].firstChild.data)!='undefined')ret['message']+='\r\n'+txt;}catch(e){};return ret;}
$.each(response_tags,function(key,val){tags[val]=true;});tags["redirect_url"]=true;tags["act"]=true;$.each(resp_obj,function(key,val){if(tags[key])ret[key]=val;});if(ret['error']!=0){if($.isFunction($.exec_xml.onerror)){return $.exec_xml.onerror(module,act,ret,callback_func,response_tags,callback_func_arg,fo_obj);}
alert(ret['message']||'error!');return null;}
if(ret['redirect_url']){location.href=ret['redirect_url'].replace(/&amp;/g,'&');return null;}
if($.isFunction(callback_func))callback_func(ret,response_tags,callback_func_arg,fo_obj);}
try{$.ajax({url:xml_path,type:'POST',dataType:'xml',data:xml.join('\n'),contentType:'text/plain',beforeSend:function(xhr){_xhr=xhr;},success:onsuccess,error:function(xhr,textStatus){waiting_obj.css('visibility','hidden');var msg='';if(textStatus=='parsererror'){msg='The result is not valid XML :\n-------------------------------------\n';if(xhr.responseText=="")return;msg+=xhr.responseText.replace(/<[^>]+>/g,'');}else{msg=textStatus;}
alert(msg);}});}catch(e){alert(e);return;}
var waiting_obj=$('#waitingforserverresponse');if(show_waiting_message&&waiting_obj.length){var d=$(document);waiting_obj.html(waiting_message).css({'top':(d.scrollTop()+20)+'px','left':(d.scrollLeft()+20)+'px','visibility':'visible'});}}
function send_by_form(url,params){var frame_id='xeTmpIframe';var form_id='xeVirtualForm';if(!$('#'+frame_id).length){$('<iframe name="%id%" id="%id%" style="position:absolute;left:-1px;top:1px;width:1px;height:1px"></iframe>'.replace(/%id%/g,frame_id)).appendTo(document.body);}
$('#'+form_id).remove();var form=$('<form id="%id%"></form>'.replace(/%id%/g,form_id)).attr({'id':form_id,'method':'post','action':url,'target':frame_id});params['xeVirtualRequestMethod']='xml';params['xeRequestURI']=location.href.replace(/#(.*)$/i,'');params['xeVirtualRequestUrl']=request_uri;$.each(params,function(key,value){$('<input type="hidden">').attr('name',key).attr('value',value).appendTo(form);});form.appendTo(document.body).submit();}
function arr2obj(arr){var ret={};for(var key in arr){if(arr.hasOwnProperty(key))ret[key]=arr[key];}
return ret;}
$.exec_json=function(action,data,func){if(typeof(data)=='undefined')data={};action=action.split(".");if(action.length==2){if(show_waiting_message){$("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible');}
$.extend(data,{module:action[0],act:action[1]});if(typeof(xeVid)!='undefined')$.extend(data,{vid:xeVid});$.ajax({type:"POST",dataType:"json",url:request_uri,contentType:"application/json",data:$.param(data),success:function(data){$("#waitingforserverresponse").css('visibility','hidden');if(data.error>0)alert(data.message);if($.isFunction(func))func(data);}});}};$.fn.exec_html=function(action,data,type,func,args){if(typeof(data)=='undefined')data={};if(!$.inArray(type,['html','append','prepend']))type='html';var self=$(this);action=action.split(".");if(action.length==2){if(show_waiting_message){$("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible');}
$.extend(data,{module:action[0],act:action[1]});$.ajax({type:"POST",dataType:"html",url:request_uri,data:$.param(data),success:function(html){$("#waitingforserverresponse").css('visibility','hidden');self[type](html);if($.isFunction(func))func(args);}});}};})(jQuery);

View file

@ -6,296 +6,7 @@
* A rule is a method validate one field.
* A filter is made up of one or more rules.
**/
(function($){
var messages = [];
var rules = [];
var filters = [];
var callbacks = [];
var extras = {};
var Validator = xe.createApp('Validator', {
init : function() {
// {{{ add filters
// email
var regEmail = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*$/;
this.cast('ADD_RULE', ['email', regEmail]);
this.cast('ADD_RULE', ['email_address', regEmail]);
// userid
var regUserid = /^[a-z]+[\w-]*[a-z0-9_]+$/i;
this.cast('ADD_RULE', ['userid', regUserid]);
this.cast('ADD_RULE', ['user_id', regUserid]);
// url
var regUrl = /^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/;
this.cast('ADD_RULE', ['url', regUrl]);
this.cast('ADD_RULE', ['homepage', regUrl]);
// korean
var regKor = /^[가-힣]*$/;
this.cast('ADD_RULE', ['korean', regKor]);
// korean_number
var regKorNum = /^[가-힣0-9]*$/;
this.cast('ADD_RULE', ['korean_number', regKorNum]);
// alpha
var regAlpha = /^[a-z]*$/i;
this.cast('ADD_RULE', ['alpha', regAlpha]);
// alpha_number
var regAlphaNum = /^[a-z][a-z0-9_]*$/i;
this.cast('ADD_RULE', ['alpha_number', regAlphaNum]);
// number
var regNum = /^[0-9]*$/;
this.cast('ADD_RULE', ['number', regNum]);
// }}} add filters
},
// run validator
run : function(oForm) {
var filter = '';
if (oForm._filter) filter = oForm._filter.value;
var params = [oForm, filter];
var result = this.cast('VALIDATE', params);
if (typeof result == 'undefined') result = false;
return result;
},
API_ONREADY : function() {
var self = this;
// hook form submit event
$('form')
.each(function(){
if (this.onsubmit) {
this['xe:onsubmit'] = this.onsubmit;
this.onsubmit = null;
}
})
.submit(function(){
var legacyFn = this['xe:onsubmit'];
var hasLegacyFn = $.isFunction(legacyFn);
var bResult = hasLegacyFn?legacyFn.apply(this):self.run(this);
return bResult;
});
},
API_VALIDATE : function(sender, params) {
var self = this, result = true, form = params[0], filter=null, callback=null;
if (form.elements['_filter']) filter = form.elements['_filter'].value;
if (!filter) return true;
if ($.isFunction(callbacks[filter])) callback = callbacks[filter];
filter = $.extend({}, filters[filter.toLowerCase()] || {}, extras);
$.each(filter, function(name) {
var _el = form.elements[name];
if (!_el) return true;
var el = $(_el), val = $.trim(get_value(el));
var minlen = parseInt(this.minlength) || 0;
var maxlen = parseInt(this.maxlength) || 0;
var rule = (this.rule || '').split(',');
if (this.required && !val) return (result = (!!self.cast('ALERT', [form, name, 'isnull']) && false));
if (!this.required && !val) return (result = true);
if ((minlen && val.length < minlen) || (maxlen && val.length > maxlen)) return (result = (!!self.cast('ALERT', [form, name, 'outofrange', minlen, maxlen]) && false));
if (this.equalto) {
var eq_val = get_value($(form.elements[this.equalto]));
if (eq_val != val) return (result = (!!self.cast('ALERT', [form, name, 'equalto']) && false));
}
$.each(rule, function() {
var ret = self.cast('APPLY_RULE', [this, val]);
if (!ret) {
self.cast('ALERT', [form, name, 'invalid_'+this]);
return (result = false);
}
});
if (!result) return false;
});
if (!result) return false;
if ($.isFunction(callback)) return callback(form);
return true;
},
API_ADD_RULE : function(sender, params) {
var name = params[0].toLowerCase();
rules[name] = params[1];
},
API_DEL_RULE : function(sender, params) {
var name = params[0].toLowerCase();
delete rules[name];
},
API_GET_RULE : function(sender, params) {
var name = params[0].toLowerCase();
if (rules[name]) {
return rules[name];
} else {
return null;
}
},
API_ADD_FILTER : function(sender, params) {
var name = params[0].toLowerCase();
var filter = params[1];
filters[name] = filter;
},
API_DEL_FILTER : function(sender, params) {
var name = params[0].toLowerCase();
delete filters[name];
},
API_GET_FILTER : function(sender, params) {
var name = params[0].toLowerCase();
if (filters[name]) {
return filters[name];
} else {
return null;
}
},
API_ADD_EXTRA_FIELD : function(sender, params) {
var name = params[0].toLowerCase();
var prop = params[1];
extras[name] = prop;
},
API_GET_EXTRA_FIELD : function(sender, params) {
var name = params[0].toLowerCase();
return extras[name];
},
API_DEL_EXTRA_FIELD : function(sender, params) {
var name = params[0].toLowerCase();
delete extras[name];
},
API_APPLY_RULE : function(sender, params) {
var name = params[0].toLowerCase();
var value = params[1];
if (typeof(rules[name]) == 'undefined') return true; // no filter
if ($.isFunction(rules[name])) return rules[name](value);
if (rules[name] instanceof RegExp) return rules[name].test(value);
return true;
},
API_ALERT : function(sender, params) {
var form = params[0];
var field_name = params[1];
var msg_code = params[2];
var minlen = params[3];
var maxlen = params[4];
var field_msg = this.cast('GET_MESSAGE', [field_name]);
var msg = this.cast('GET_MESSAGE', [msg_code]);
if (msg != msg_code) msg = (msg.indexOf('%s')<0)?(field_msg+msg):(msg.replace('%s',field_msg));
if (minlen||maxlen) msg += '('+(minlen||'')+'~'+(maxlen||'')+')';
this.cast('SHOW_ALERT', [msg]);
// set focus
$(form.elements[field_name]).focus();
},
API_SHOW_ALERT : function(sender, params) {
alert(params[0]);
},
API_ADD_MESSAGE : function(sender, params) {
var msg_code = params[0];
var msg_str = params[1];
messages[msg_code] = msg_str;
},
API_GET_MESSAGE : function(sender, params) {
var msg_code = params[0];
return messages[msg_code] || msg_code;
},
API_ADD_CALLBACK : function(sender, params) {
var name = params[0];
var func = params[1];
callbacks[name] = func;
},
API_REMOVE_CALLBACK : function(sender, params) {
var name = params[0];
delete callbacks[name];
}
});
var oValidator = new Validator;
// register validator
xe.registerApp(oValidator);
// 호환성을 위해 추가한 플러그인 - 에디터에서 컨텐트를 가져와서 설정한다.
var EditorStub = xe.createPlugin('editor_stub', {
API_BEFORE_VALIDATE : function(sender, params) {
var form = params[0];
var seq = form.getAttribute('editor_sequence');
if (seq) {
try {
editorRelKeys[seq].content.value = editorRelKeys[seq].func(seq) || '';
} catch(e) { }
}
}
});
oValidator.registerPlugin(new EditorStub);
// functions
function get_value(elem) {
var vals = [];
if (elem.is(':radio')){
return elem.filter(':checked').val();
} else if (elem.is(':checkbox')) {
elem.filter(':checked').each(function(){
vals.push(this.value);
});
return vals.join('|@|');
} else {
return elem.val();
}
}
})(jQuery);
/**
* @function filterAlertMessage
* @brief ajax로 서버에 요청후 결과를 처리할 callback_function을 지정하지 않았을 호출되는 기본 함수
**/
function filterAlertMessage(ret_obj) {
var error = ret_obj["error"];
var message = ret_obj["message"];
var act = ret_obj["act"];
var redirect_url = ret_obj["redirect_url"];
var url = location.href;
if(typeof(message)!="undefined"&&message&&message!="success") alert(message);
if(typeof(act)!="undefined" && act) url = current_url.setQuery("act", act);
else if(typeof(redirect_url)!="undefined" && redirect_url) url = redirect_url;
if(url == location.href) url = url.replace(/#(.*)$/,'');
location.href = url;
}
/**
* @brief Function to process filters
* @deprecated
*/
function procFilter(fo_obj, filter_func)
{
filter_func(fo_obj);
return false;
}
(function($){var messages=[];var rules=[];var filters=[];var callbacks=[];var extras={};var Validator=xe.createApp('Validator',{init:function(){var regEmail=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*$/;this.cast('ADD_RULE',['email',regEmail]);this.cast('ADD_RULE',['email_address',regEmail]);var regUserid=/^[a-z]+[\w-]*[a-z0-9_]+$/i;this.cast('ADD_RULE',['userid',regUserid]);this.cast('ADD_RULE',['user_id',regUserid]);var regUrl=/^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/;this.cast('ADD_RULE',['url',regUrl]);this.cast('ADD_RULE',['homepage',regUrl]);var regKor=/^[가-힣]*$/;this.cast('ADD_RULE',['korean',regKor]);var regKorNum=/^[가-힣0-9]*$/;this.cast('ADD_RULE',['korean_number',regKorNum]);var regAlpha=/^[a-z]*$/i;this.cast('ADD_RULE',['alpha',regAlpha]);var regAlphaNum=/^[a-z][a-z0-9_]*$/i;this.cast('ADD_RULE',['alpha_number',regAlphaNum]);var regNum=/^[0-9]*$/;this.cast('ADD_RULE',['number',regNum]);},run:function(oForm){var filter='';if(oForm._filter)filter=oForm._filter.value;var params=[oForm,filter];var result=this.cast('VALIDATE',params);if(typeof result=='undefined')result=false;return result;},API_ONREADY:function(){var self=this;$('form').each(function(){if(this.onsubmit){this['xe:onsubmit']=this.onsubmit;this.onsubmit=null;}}).submit(function(){var legacyFn=this['xe:onsubmit'];var hasLegacyFn=$.isFunction(legacyFn);var bResult=hasLegacyFn?legacyFn.apply(this):self.run(this);return bResult;});},API_VALIDATE:function(sender,params){var self=this,result=true,form=params[0],filter=null,callback=null;if(form.elements['_filter'])filter=form.elements['_filter'].value;if(!filter)return true;if($.isFunction(callbacks[filter]))callback=callbacks[filter];filter=$.extend({},filters[filter.toLowerCase()]||{},extras);$.each(filter,function(name){var _el=form.elements[name];if(!_el)return true;var el=$(_el),val=$.trim(get_value(el));var minlen=parseInt(this.minlength)||0;var maxlen=parseInt(this.maxlength)||0;var rule=(this.rule||'').split(',');if(this.required&&!val)return(result=(!!self.cast('ALERT',[form,name,'isnull'])&&false));if(!this.required&&!val)return(result=true);if((minlen&&val.length<minlen)||(maxlen&&val.length>maxlen))return(result=(!!self.cast('ALERT',[form,name,'outofrange',minlen,maxlen])&&false));if(this.equalto){var eq_val=get_value($(form.elements[this.equalto]));if(eq_val!=val)return(result=(!!self.cast('ALERT',[form,name,'equalto'])&&false));}
$.each(rule,function(){var ret=self.cast('APPLY_RULE',[this,val]);if(!ret){self.cast('ALERT',[form,name,'invalid_'+this]);return(result=false);}});if(!result)return false;});if(!result)return false;if($.isFunction(callback))return callback(form);return true;},API_ADD_RULE:function(sender,params){var name=params[0].toLowerCase();rules[name]=params[1];},API_DEL_RULE:function(sender,params){var name=params[0].toLowerCase();delete rules[name];},API_GET_RULE:function(sender,params){var name=params[0].toLowerCase();if(rules[name]){return rules[name];}else{return null;}},API_ADD_FILTER:function(sender,params){var name=params[0].toLowerCase();var filter=params[1];filters[name]=filter;},API_DEL_FILTER:function(sender,params){var name=params[0].toLowerCase();delete filters[name];},API_GET_FILTER:function(sender,params){var name=params[0].toLowerCase();if(filters[name]){return filters[name];}else{return null;}},API_ADD_EXTRA_FIELD:function(sender,params){var name=params[0].toLowerCase();var prop=params[1];extras[name]=prop;},API_GET_EXTRA_FIELD:function(sender,params){var name=params[0].toLowerCase();return extras[name];},API_DEL_EXTRA_FIELD:function(sender,params){var name=params[0].toLowerCase();delete extras[name];},API_APPLY_RULE:function(sender,params){var name=params[0].toLowerCase();var value=params[1];if(typeof(rules[name])=='undefined')return true;if($.isFunction(rules[name]))return rules[name](value);if(rules[name]instanceof RegExp)return rules[name].test(value);return true;},API_ALERT:function(sender,params){var form=params[0];var field_name=params[1];var msg_code=params[2];var minlen=params[3];var maxlen=params[4];var field_msg=this.cast('GET_MESSAGE',[field_name]);var msg=this.cast('GET_MESSAGE',[msg_code]);if(msg!=msg_code)msg=(msg.indexOf('%s')<0)?(field_msg+msg):(msg.replace('%s',field_msg));if(minlen||maxlen)msg+='('+(minlen||'')+'~'+(maxlen||'')+')';this.cast('SHOW_ALERT',[msg]);$(form.elements[field_name]).focus();},API_SHOW_ALERT:function(sender,params){alert(params[0]);},API_ADD_MESSAGE:function(sender,params){var msg_code=params[0];var msg_str=params[1];messages[msg_code]=msg_str;},API_GET_MESSAGE:function(sender,params){var msg_code=params[0];return messages[msg_code]||msg_code;},API_ADD_CALLBACK:function(sender,params){var name=params[0];var func=params[1];callbacks[name]=func;},API_REMOVE_CALLBACK:function(sender,params){var name=params[0];delete callbacks[name];}});var oValidator=new Validator;xe.registerApp(oValidator);var EditorStub=xe.createPlugin('editor_stub',{API_BEFORE_VALIDATE:function(sender,params){var form=params[0];var seq=form.getAttribute('editor_sequence');if(seq){try{editorRelKeys[seq].content.value=editorRelKeys[seq].func(seq)||'';}catch(e){}}}});oValidator.registerPlugin(new EditorStub);function get_value(elem){var vals=[];if(elem.is(':radio')){return elem.filter(':checked').val();}else if(elem.is(':checkbox')){elem.filter(':checked').each(function(){vals.push(this.value);});return vals.join('|@|');}else{return elem.val();}}})(jQuery);function filterAlertMessage(ret_obj){var error=ret_obj["error"];var message=ret_obj["message"];var act=ret_obj["act"];var redirect_url=ret_obj["redirect_url"];var url=location.href;if(typeof(message)!="undefined"&&message&&message!="success")alert(message);if(typeof(act)!="undefined"&&act)url=current_url.setQuery("act",act);else if(typeof(redirect_url)!="undefined"&&redirect_url)url=redirect_url;if(url==location.href)url=url.replace(/#(.*)$/,'');location.href=url;}
function procFilter(fo_obj,filter_func)
{filter_func(fo_obj);return false;}

View file

@ -130,6 +130,7 @@
$lang->widget = 'Widget';
$lang->module = 'Module';
$lang->skin = 'Theme';
$lang->mobile_skin = 'Mobile Theme';
$lang->colorset = 'Colorset';
$lang->extra_vars = 'Extra Vars';

View file

@ -129,6 +129,7 @@
$lang->widget = 'Widget';
$lang->module = 'Módulo';
$lang->skin = 'Tema'; //máscara,
$lang->mobile_skin = 'Mobile Tema';
$lang->colorset = 'Conjunto de Colores';
$lang->extra_vars = 'Variables Extra';

View file

@ -130,6 +130,7 @@
$lang->widget = 'Gadget';
$lang->module = 'Module';
$lang->skin = 'Habillage';
$lang->mobile_skin = 'Mobile Habillage';
$lang->colorset = 'Arrangement de couleur';
$lang->extra_vars = 'Variables Supplémentaires';

View file

@ -130,6 +130,7 @@
$lang->widget = 'Widget';
$lang->module = 'Modul';
$lang->skin = 'Thema';
$lang->mobile_skin = 'Mobile Theme';
$lang->colorset = 'Colorset';
$lang->extra_vars = 'Extra Vars';

View file

@ -130,6 +130,7 @@
$lang->widget = 'ウィジェット';
$lang->module = 'モジュール';
$lang->skin = 'スキン';
$lang->mobile_skin = 'Mobile Theme';
$lang->colorset = 'カラーセット';
$lang->extra_vars = '拡張変数';

View file

@ -130,6 +130,7 @@
$lang->widget = '위젯 ';
$lang->module = '모듈';
$lang->skin = '스킨';
$lang->mobile_skin = '모바일 스킨';
$lang->colorset = '컬러셋';
$lang->extra_vars = '확장변수';

View file

@ -132,6 +132,7 @@
$lang->widget = 'Вижет ';
$lang->module = 'Модиул';
$lang->skin = 'Скин';
$lang->mobile_skin = 'Mobile Theme';
$lang->colorset = 'Өнгө тохируулах';
$lang->extra_vars = 'Өргөжүүлэх тоо';
$lang->domain = 'Domain';

View file

@ -130,6 +130,7 @@
$lang->widget = 'Виджет';
$lang->module = 'Модуль';
$lang->skin = 'Тема';
$lang->mobile_skin = 'Mobile Theme';
$lang->colorset = 'Цветовой набор';
$lang->extra_vars = 'Дополнительные переменные.';

View file

@ -127,6 +127,7 @@
$lang->widget = 'Widget';
$lang->module = 'Module';
$lang->skin = 'Skin';
$lang->mobile_skin = 'Mobile Skin';
$lang->colorset = 'Tạo màu';
$lang->extra_vars = 'Bổ xung';

View file

@ -130,6 +130,7 @@
$lang->widget = '控件 ';
$lang->module = '模块';
$lang->skin = '皮肤';
$lang->mobile_skin = '移动版皮肤';
$lang->colorset = '颜色设定';
$lang->extra_vars = '扩展变量';

View file

@ -126,10 +126,11 @@
$lang->mid = '模組名稱';
$lang->sid = '網站名稱';
$lang->layout = '版面';
$lang->mobile_layout = 'Mobile Layout';
$lang->mobile_layout = '手機版面';
$lang->widget = 'Widget';
$lang->module = '模組';
$lang->skin = '面板';
$lang->mobile_skin = '手機面板';
$lang->colorset = '顏色設定';
$lang->extra_vars = '延伸變數';

View file

@ -13,7 +13,7 @@
* @brief XE의 전체 버전 표기
* 파일의 수정이 없더라도 공식 릴리즈시에 수정되어 함께 배포되어야
**/
define('__ZBXE_VERSION__', '1.4.3');
define('__ZBXE_VERSION__', '1.4.3.1');
/**
* @brief zbXE가 설치된 장소의 base path를 구함
@ -79,6 +79,13 @@
**/
if(!defined('__LOG_SLOW_QUERY__')) define('__LOG_SLOW_QUERY__', 0);
/**
* @brief DB 쿼리 정보를 남김
* 0 : 쿼리에 정보를 추가하지 않음
* 1 : XML Query ID를 쿼리 주석으로 남김
**/
if(!defined('__DEBUG_QUERY__')) define('__DEBUG_QUERY__', 0);
/**
* @brief ob_gzhandler를 이용한 압축 기능을 강제로 사용하거나 끄는 옵션
* 0 : 사용하지 않음

View file

@ -622,7 +622,7 @@
**/
function removeHackTag($content) {
// 특정 태그들을 일반 문자로 변경
$content = preg_replace('/<(\/?)(iframe|script|meta|style|applet|link|base|html)/is', '&lt;$1$2', $content);
$content = preg_replace('/<(\/?)(iframe|script|meta|style|applet|link|base|html|body)/is', '&lt;$1$2', $content);
/**
* 이미지나 동영상등의 태그에서 src에 관리자 세션을 악용하는 코드를 제거
@ -639,7 +639,7 @@
$buff = trim(preg_replace('/(\/>|>)/','/>',$matches[0]));
$buff = str_replace(array('&','&amp;'),array('&amp;','&amp;'),$buff);
$buff = preg_replace_callback('/([^=^"^ ]*)=([^ ^>]*)/i', fixQuotation, $buff);
$buff = preg_replace_callback('/([^=^"^ ]*)=([^ ^>]*)/i', 'fixQuotation', $buff);
$oXmlParser = new XmlParser();
$xml_doc = $oXmlParser->parse($buff);
@ -665,7 +665,7 @@
}
if(_isHackedSrc($src) || _isHackedSrc($dynsrc) || _isHackedSrc($lowsrc) || _isHackedSrc($href) || _isHackedSrc($data) || _isHackedSrc($background) || _isHackedSrcExp($style)) return sprintf("<%s>",$tag);
return $matches[0];
return $buff;
}
function _isHackedSrcExp($style) {
@ -705,8 +705,21 @@
function fixQuotation($matches) {
$key = $matches[1];
$val = $matches[2];
if(substr($val,0,1)!='"') $val = '"'.$val.'"';
return sprintf('%s=%s', $key, $val);
if(substr($val,0,1)!='"'){
if(substr($val,-1)=='/'){
$val = '"'.substr($val,0,-1).'" /';
}else{
$val = '"'.$val.'"';
}
}
// attribute on* remove
if(preg_match('/^on(click|load|unload|blur|dbclick|focus|resize|keypress|keyup|keydown|mouseover|mouseout|mouseup|select|change|error)/',preg_replace('/[^a-zA-Z_]/','',$key))) return '';
$output = sprintf('%s=%s', $key, $val);
return $output;
}
// hexa값을 RGB로 변환

View file

@ -89,7 +89,7 @@
<title xml:lang="ge">Colorset</title>
<title xml:lang="ru">Colorset</title>
<title xml:lang="es">Set de colores</title>
<title xml:lang="vi">Màu sắc</title>
<title xml:lang="vi">Màu sắc</title>
<description xml:lang="ko">원하시는 컬러셋을 선택해주세요.</description>
<description xml:lang="jp">希望するカラーセットを選択して下さい。</description>
<description xml:lang="zh-CN">请选择颜色。</description>
@ -119,7 +119,7 @@
<title xml:lang="es">Negro</title>
<title xml:lang="zh-CN">黑色</title>
<title xml:lang="zh-TW">黑色</title>
<title xml:lang="vi">Black</title>
<title xml:lang="vi">Black</title>
</options>
<options value="white">
<title xml:lang="ko">하얀색</title>
@ -130,7 +130,7 @@
<title xml:lang="es">Blanco</title>
<title xml:lang="zh-CN">白色</title>
<title xml:lang="zh-TW">白色</title>
<title xml:lang="vi">White</title>
<title xml:lang="vi">White</title>
</options>
</var>
<var name="logo_image" type="image">
@ -142,7 +142,7 @@
<title xml:lang="ge">Logobildes</title>
<title xml:lang="ru">Изображения логотипа</title>
<title xml:lang="es">Imagen del logotipo</title>
<title xml:lang="vi">Hình Logo</title>
<title xml:lang="vi">Hình Logo</title>
<description xml:lang="ko">레이아웃의 상단에 표시될 로고이미지를 입력하세요. (세로길이가 23px인 투명이미지가 가장 어울립니다)</description>
<description xml:lang="jp">レイアウトの上段に表示されるロゴイメージを入力して下さい。 (縦幅が23pxである透明イメージをお勧めします。。)</description>
<description xml:lang="zh-CN">请输入显示在布局顶部的LOGO图片(高度为23px的透明图片为适)。</description>
@ -151,7 +151,7 @@
<description xml:lang="ge">Bitte geben Sie ein Logo das Bild wird auf dem oberen Layout. (Transparent Bild mit einer Höhe von 23px wird empfohlen).</description>
<description xml:lang="ru">Введите логотип изображение, которое будет отображаться в верхней части формы. (Прозрачный изображение с высотой 23px рекомендуется.)</description>
<description xml:lang="es">Ingresar una imagen para logotipo. ( Se recomienda una imagen de fondo transparente con una altura de 23px.</description>
<description xml:lang="vi">Hãy chọn Logo hiển thị phía trên cùng của giao diện. (Đề nghị: Hình ảnh có nền trong suốt và kích thước 23px.)</description>
<description xml:lang="vi">Hãy chọn Logo hiển thị phía trên cùng của giao diện. (Đề nghị: Hình ảnh có nền trong suốt và kích thước 23px.)</description>
</var>
<var name="index_url" type="text">
<title xml:lang="ko">홈 페이지 URL</title>
@ -162,7 +162,7 @@
<title xml:lang="ge">Homepage URL</title>
<title xml:lang="ru">Домашняя страница URL</title>
<title xml:lang="es">URL de la página web</title>
<title xml:lang="vi">URL Trang chủ</title>
<title xml:lang="vi">URL Trang chủ</title>
<description xml:lang="ko">로고를 클릭시에 이동할 홈 페이지 URL을 입력해 주세요.</description>
<description xml:lang="jp">ロゴをクリックした時に移動するホームページのURLを入力して下さい。</description>
<description xml:lang="zh-CN">点击网站LOGO时要移动的页面URL。</description>
@ -171,7 +171,7 @@
<description xml:lang="ge">Bitte geben Sie die URL umzuleiten, wenn Benutzer klickt das Logo</description>
<description xml:lang="ru">Пожалуйста, введите URL для перенаправления, когда пользователь нажимает логотип</description>
<description xml:lang="es">Ingresar el URL de la página web para redireccionar al pulsar el logotipo</description>
<description xml:lang="vi">Hãy nhập địa chỉ bạn muốn chuyển đến khi bấm vào Logo</description>
<description xml:lang="vi">Hãy nhập địa chỉ bạn muốn chuyển đến khi bấm vào Logo</description>
</var>
<var name="background_image" type="image">
<title xml:lang="ko">배경 이미지</title>
@ -182,7 +182,7 @@
<title xml:lang="ge">Hintergrundbild</title>
<title xml:lang="ru">Фоновое изображение</title>
<title xml:lang="es">Imagen de fondo</title>
<title xml:lang="vi">Hình nền</title>
<title xml:lang="vi">Hình nền</title>
<description xml:lang="ko">배경 이미지를 사용하시려면 등록해주세요.</description>
<description xml:lang="jp">背景イメージを使う場合は、登録して下さい。</description>
<description xml:lang="zh-CN">要想使用背景图片请在这里上传。</description>
@ -205,7 +205,7 @@
<title xml:lang="ge">Top Menü</title>
<title xml:lang="ru">Верхнее меню</title>
<title xml:lang="es">Menú Principal</title>
<title xml:lang="vi">Menu trên</title>
<title xml:lang="vi">Menu trên</title>
</menu>
<menu name="bottom_menu" maxdepth="1">
<title xml:lang="ko">하단 메뉴 </title>
@ -216,7 +216,7 @@
<title xml:lang="ge">Bottom-Menü</title>
<title xml:lang="ru">Внизу меню</title>
<title xml:lang="es">Menú Inferior </title>
<title xml:lang="vi">Menu dưới</title>
<title xml:lang="vi">Menu dưới</title>
</menu>
</menus>
</layout>

View file

@ -6,32 +6,32 @@
<title xml:lang="zh-TW">XE Mobile 官方版面</title>
<description xml:lang="ko">
XE 공식 모바일 레이아웃입니다.
디자인, 퍼블리싱 : 정찬명
디자인, 퍼블리싱 : 전영선, 정찬명
레이아웃 제작 : haneul
</description>
<description xml:lang="en">
This layout is the XE Official website layout.
Design, HTML/CSS : Chan-Myung Jeong
Design, HTML/CSS : Jeon Young-Seon, Jeong Chan-Myeong
Layout producer : haneul
</description>
<description xml:lang="zh-CN">
官方移动版布局。
Design, HTML/CSS : Chan-Myung Jeong
Design, HTML/CSS : Jeon Young-Seon, Jeong Chan-Myeong
Layout producer : haneul
</description>
<description xml:lang="zh-TW">
這是 XE 官方網站版面。
Design, HTML/CSS : Chan-Myung Jeong
XE Mobile 官方網站版面。
Design, HTML/CSS : Jeon Young-Seon, Jeong Chan-Myeong
Layout producer : haneul
</description>
<version>0.1</version>
<date>2010-06-10</date>
<date>2010-08-20</date>
<link>http://xpressengine.com</link>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com">
<name xml:lang="ko">XE</name>
<name xml:lang="en">XE</name>
<name xml:lang="zh-CN">XE</name>
<name xml:lang="zh-CN">XE</name>
<name xml:lang="zh-TW">XE</name>
</author>
<extra_vars>
@ -40,7 +40,27 @@
<title xml:lang="en">Homepage Title</title>
<title xml:lang="zh-CN">网站标题</title>
<title xml:lang="zh-TW">首頁標題</title>
</var>
</var>
<var name="logo_image" type="image">
<title xml:lang="ko">로고이미지</title>
<title xml:lang="jp">ロゴイメージ</title>
<title xml:lang="zh-CN">LOGO图片</title>
<title xml:lang="zh-TW">Logo圖片</title>
<title xml:lang="en">Logo image</title>
<title xml:lang="ge">Logobildes</title>
<title xml:lang="ru">Изображения логотипа</title>
<title xml:lang="es">Imagen del logotipo</title>
<title xml:lang="vi">Hình Logo</title>
<description xml:lang="ko">레이아웃의 상단에 표시될 로고이미지를 입력하세요. (세로길이가 28px인 투명 이미지가 가장 어울립니다)</description>
<description xml:lang="jp">レイアウトの上段に表示されるロゴイメージを入力して下さい。 (縦幅が28pxである透明イメージをお勧めします。。)</description>
<description xml:lang="zh-CN">请输入显示在布局顶部的LOGO图片(高度为28px的透明图片为适)。</description>
<description xml:lang="zh-TW">請輸入要顯示在版面上端的 Logo 圖片。(適當高度為28px的透明圖片。)</description>
<description xml:lang="en">Please input a logo image which will be displayed on the top of layout. (Transparent image with height of 28px is recommended.)</description>
<description xml:lang="ge">Bitte geben Sie ein Logo das Bild wird auf dem oberen Layout. (Transparent Bild mit einer Höhe von 28px wird empfohlen).</description>
<description xml:lang="ru">Введите логотип изображение, которое будет отображаться в верхней части формы. (Прозрачный изображение с высотой 28px рекомендуется.)</description>
<description xml:lang="es">Ingresar una imagen para logotipo. ( Se recomienda una imagen de fondo transparente con una altura de 28px.</description>
<description xml:lang="vi">Hãy chọn Logo hiển thị phía trên cùng của giao diện. (Đề nghị: Hình ảnh có nền trong suốt và kích thước 28px.)</description>
</var>
<var name="index_url" type="text">
<title xml:lang="ko">홈 페이지 URL</title>
<title xml:lang="jp">ホームページURL</title>
@ -50,7 +70,7 @@
<title xml:lang="ge">Homepage URL</title>
<title xml:lang="ru">Домашняя страница URL</title>
<title xml:lang="es">URL de la página web</title>
<title xml:lang="vi">URL Trang chủ</title>
<title xml:lang="vi">URL Trang chủ</title>
<description xml:lang="ko">로고를 클릭시에 이동할 홈 페이지 URL을 입력해 주세요.</description>
<description xml:lang="jp">ロゴをクリックした時に移動するホームページのURLを入力して下さい。</description>
<description xml:lang="zh-CN">点击网站LOGO时要移动的页面URL。</description>
@ -59,7 +79,7 @@
<description xml:lang="ge">Bitte geben Sie die URL umzuleiten, wenn Benutzer klickt das Logo</description>
<description xml:lang="ru">Пожалуйста, введите URL для перенаправления, когда пользователь нажимает логотип</description>
<description xml:lang="es">Ingresar el URL de la página web para redireccionar al pulsar el logotipo</description>
<description xml:lang="vi">Hãy nhập địa chỉ bạn muốn chuyển đến khi bấm vào Logo</description>
<description xml:lang="vi">Hãy nhập địa chỉ bạn muốn chuyển đến khi bấm vào Logo</description>
</var>
</extra_vars>
<menus>

View file

@ -1,15 +1,25 @@
<!--%import("mx.css")-->
<div class="eg hd">
<div class="hd">
<!--@if($layout_info->logo_image)-->
<h1 class="h1"><a href="{$layout_info->index_url}"><img src="{$layout_info->logo_image}" alt="{$layout_info->index_title}" /></a></h1>
<!--@elseif($layout_info->index_title)-->
<h1 class="h1"><a href="{$layout_info->index_url}">{$layout_info->index_title}</a></h1>
<!--@else-->
<h1 class="h1"><a href="{$layout_info->index_url}">Mobile XE</a></h1>
<!--@end-->
<!--@if($layout_info->menu->main_menu->menu_srl)-->
<div class="fr"><a href="{getUrl('act','dispMenuMenu','menu_srl',$layout_info->menu->main_menu->menu_srl)}" class="bn">{$lang->menu}</a></div>
<!--@if($act=='dispMenuMenu')-->
<div class="fr"><button type="button" class="muon" onclick="history.back()">{$lang->cmd_back}</button></div>
<!--@else-->
<div class="fr"><a href="{getUrl('act','dispMenuMenu','menu_srl',$layout_info->menu->main_menu->menu_srl)}" class="mu">Menu</a></div>
<!--@end-->
<!--@end-->
</div>
{$content}
<ul class="eg ft">
<ul class="ft">
<!--@if($is_logged)-->
<li class="fl"><a href="{getUrl('act','dispMemberLogout')}">{$lang->cmd_logout}</a></li>
<!--@else-->
<!--@elseif($act!='dispMemberLoginForm')-->
<li class="fl"><a href="{getUrl('act','dispMemberLoginForm')}">{$lang->cmd_login}</a></li>
<!--@end-->
<li class="fr"><a href="{getUrl('m',0)}">PC</a></li>

View file

@ -1,36 +1,24 @@
@charset "utf-8";
/* Mobile XE */
/* Mobile XE (/m.layouts/default/) */
body{margin:0;background:#fff;color:#000;word-wrap:break-word}
body,input,textarea,select,button,table{font-family:Tahoma, Geneva, sans-serif}
/* Common Class */
body,input,textarea,select,button,table{font-family:Tahoma,Geneva,sans-serif}
/* Common */
.fl{float:left}
.fr{float:right}
.cb{clear:both}
/* Edge = Header/Footer */
.eg{position:relative;background:#666;*zoom:1}
.eg:after{content:"";display:block;clear:both}
.eg a{text-decoration:none}
/* Header */
.hd{padding:10px;border-top:3px solid #444}
.hd .h1{float:left;display:inline;color:#fff;font-size:24px;margin:0;font-weight:bold;text-shadow:0 0 3px #000}
.hd{min-height:28px;line-height:28px;padding:6px;margin:0 0 1px 0;border-bottom:2px solid #f46e07;background:#444 -webkit-gradient(linear,0% 0%,0% 100%,from(#636363),to(#2d2d2d));background:#444 -moz-linear-gradient(top,#636363,#2d2d2d);background-color:#444;*zoom:1}
.hd:after{content:"";margin:0 -6px;position:relative;top:9px;display:block;clear:both;height:1px;background:#d04715}
.hd .h1{float:left;display:inline;color:#fff;font-size:24px;margin:0;font-weight:bold}
.hd .h1 a{color:#fff}
.hd .bn{font-size:12px}
.hd .h1 img{border:0}
.hd .mu{display:inline-block;height:26px;line-height:26px;padding:0 10px;font-size:12px;font-weight:bold;color:#fff;border:1px solid #232323;text-decoration:none;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#777),to(#373737),color-stop(0.5,#323232),color-stop(0.5,#1b1b1b));background:#1b1b1b -moz-linear-gradient(top,#777,#373737);background-color:#1b1b1b}
.hd .mu:after{content:"";margin:0 0 0 3px;font-size:24px;vertical-align:middle;position:relative;top:-2px}
.hd .muon{cursor:pointer;display:inline-block;height:26px;line-height:26px;padding:0 10px;font-size:12px;font-weight:bold;color:#fff;border:1px solid #232323;text-decoration:none;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#777),to(#373737),color-stop(0.5,#323232),color-stop(0.5,#1b1b1b));background:#1b1b1b -moz-linear-gradient(top,#777,#373737);background-color:#1b1b1b}
.hd .muon:before{content:"";font-weight:bold;font-size:16px;line-height:16px;margin:0 2px 0 0;font-family:Verdana, Geneva, sans-serif}
/* Footer */
.ft{padding:0 5px;margin:0;list-style:none}
.ft a{display:inline-block;padding:10px;color:#fff;text-shadow:0 0 2px #000;font-size:14px;font-weight:bold}
.ft{padding:0;margin:0;list-style:none;background:#868686;overflow:hidden;zoom:1}
.ft:after{content:"";display:block;clear:both}
.ft li{margin:0;padding:0;border:1px solid #9c9a99;border-top:0;border-bottom:0;margin:0 -1px;background:#868686}
.ft a{display:inline-block;padding:0 15px;color:#fff;text-shadow:0 0 2px #000;font-size:12px;font-weight:bold;line-height:32px;text-decoration:none}
/* Copyright */
.cr{margin:0;padding:5px 15px;text-align:center;background:#444;color:#ccc;text-shadow:0 0 2px #000;font-size:12px;font-weight:bold}
/* Search */
.sh{position:relative;text-align:center}
.sh .itx{width:80%;background:none;border:5px solid #333;margin:10px}
/* Definition */
.dl{margin:10px}
.dl dt{margin:0;padding:0;font-weight:bold}
.dl dd{margin:0 0 10px 0;padding:0;color:#666}
/* Graph Horizontal */
.gh{list-style:none;margin:10px;padding:0}
.gh li{position:relative;margin:5px 0}
.gh .bar{position:absolute;z-index:-1;height:100%;width:0;background:#ddd}
.gh em{color:#f60}
/* Button */
.bn{display:inline-block;padding:5px 10px;font-weight:normal;font-size:14px;border:1px solid #333;background:#eee;color:#000;text-shadow:1px 1px 0 #fff;box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;-webkit-box-shadow:0 0 3px #333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;text-decoration:none}
.cr{margin:0;text-align:center;background:#f2f0ec;color:#494949;font-size:11px;line-height:26px}

View file

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.2">
<title xml:lang="ko">XE 심플 그레이 레이아웃</title>
<title xml:lang="en">XE simple gray layout</title>
<title xml:lang="zh-CN">官方移动版布局</title>
<title xml:lang="zh-TW">XE Mobile 官方版面</title>
<description xml:lang="ko">
XE 심플 그레이 레이아웃입니다.
디자인, 퍼블리싱 : 정찬명
레이아웃 제작 : haneul
</description>
<description xml:lang="en">
This layout is the XE Official website layout.
Design, HTML/CSS : Chan-Myung Jeong
Layout producer : haneul
</description>
<description xml:lang="zh-CN">
官方移动版布局。
Design, HTML/CSS : Chan-Myung Jeong
Layout producer : haneul
</description>
<description xml:lang="zh-TW">
XE Mobile 官方網站版面。
Design, HTML/CSS : Chan-Myung Jeong
Layout producer : haneul
</description>
<version>0.1</version>
<date>2010-06-10</date>
<link>http://xpressengine.com</link>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com">
<name xml:lang="ko">XE</name>
<name xml:lang="en">XE</name>
<name xml:lang="zh-CN">XE</name>
<name xml:lang="zh-TW">XE</name>
</author>
<extra_vars>
<var name="index_title" type="text">
<title xml:lang="ko">홈페이지 Title</title>
<title xml:lang="en">Homepage Title</title>
<title xml:lang="zh-CN">网站标题</title>
<title xml:lang="zh-TW">首頁標題</title>
</var>
<var name="index_url" type="text">
<title xml:lang="ko">홈 페이지 URL</title>
<title xml:lang="jp">ホームページURL</title>
<title xml:lang="zh-CN">主页地址</title>
<title xml:lang="zh-TW">主頁網址</title>
<title xml:lang="en">Homepage URL</title>
<title xml:lang="ge">Homepage URL</title>
<title xml:lang="ru">Домашняя страница URL</title>
<title xml:lang="es">URL de la página web</title>
<title xml:lang="vi">URL Trang chủ</title>
<description xml:lang="ko">로고를 클릭시에 이동할 홈 페이지 URL을 입력해 주세요.</description>
<description xml:lang="jp">ロゴをクリックした時に移動するホームページのURLを入力して下さい。</description>
<description xml:lang="zh-CN">点击网站LOGO时要移动的页面URL。</description>
<description xml:lang="zh-TW">請輸入當用戶按了網站 Logo 後,要前往的頁面網址。</description>
<description xml:lang="en">Please input the URL to redirect when user clicks the logo</description>
<description xml:lang="ge">Bitte geben Sie die URL umzuleiten, wenn Benutzer klickt das Logo</description>
<description xml:lang="ru">Пожалуйста, введите URL для перенаправления, когда пользователь нажимает логотип</description>
<description xml:lang="es">Ingresar el URL de la página web para redireccionar al pulsar el logotipo</description>
<description xml:lang="vi">Hãy nhập địa chỉ bạn muốn chuyển đến khi bấm vào Logo</description>
</var>
</extra_vars>
<menus>
<menu name="main_menu" maxdepth="3" default="true">
<title xml:lang="ko">상단 메뉴</title>
<title xml:lang="jp">上段用メニュー</title>
<title xml:lang="zh-CN">主菜单</title>
<title xml:lang="zh-TW">主選單</title>
<title xml:lang="en">Top menu</title>
<title xml:lang="ge">Top Menü</title>
<title xml:lang="ru">Верхнее меню</title>
<title xml:lang="es">Menú Principal</title>
<title xml:lang="vi">Menu trên</title>
</menu>
</menus>
</layout>

View file

@ -0,0 +1,18 @@
<!--%import("mx.css")-->
<div class="eg hd">
<h1 class="h1"><a href="{$layout_info->index_url}">{$layout_info->index_title}</a></h1>
<!--@if($layout_info->menu->main_menu->menu_srl)-->
<div class="fr"><a href="{getUrl('act','dispMenuMenu','menu_srl',$layout_info->menu->main_menu->menu_srl)}" class="bn">{$lang->menu}</a></div>
<!--@end-->
</div>
{$content}
<ul class="eg ft">
<!--@if($is_logged)-->
<li class="fl"><a href="{getUrl('act','dispMemberLogout')}">{$lang->cmd_logout}</a></li>
<!--@elseif($act!='dispMemberLoginForm')-->
<li class="fl"><a href="{getUrl('act','dispMemberLoginForm')}">{$lang->cmd_login}</a></li>
<!--@end-->
<li class="fr"><a href="{getUrl('m',0)}">PC</a></li>
<li class="fr"><a href="{getUrl('act','dispModuleChangeLang','oldact',$act)}">LANG</a></li>
</ul>
<p class="cr">{$layout_info->index_title}</p>

View file

@ -0,0 +1,36 @@
@charset "utf-8";
/* Mobile XE */
body{margin:0;background:#fff;color:#000;word-wrap:break-word}
body,input,textarea,select,button,table{font-family:Tahoma, Geneva, sans-serif}
/* Common Class */
.fl{float:left}
.fr{float:right}
.cb{clear:both}
/* Edge = Header/Footer */
.eg{position:relative;background:#666;*zoom:1}
.eg:after{content:"";display:block;clear:both}
.eg a{text-decoration:none}
/* Header */
.hd{padding:10px;border-top:3px solid #444}
.hd .h1{float:left;display:inline;color:#fff;font-size:24px;margin:0;font-weight:bold;text-shadow:0 0 3px #000}
.hd .h1 a{color:#fff}
.hd .bn{font-size:12px}
/* Footer */
.ft{padding:0 5px;margin:0;list-style:none}
.ft a{display:inline-block;padding:10px;color:#fff;text-shadow:0 0 2px #000;font-size:14px;font-weight:bold}
/* Copyright */
.cr{margin:0;padding:5px 15px;text-align:center;background:#444;color:#ccc;text-shadow:0 0 2px #000;font-size:12px;font-weight:bold}
/* Search */
.sh{position:relative;text-align:center}
.sh .itx{width:80%;background:none;border:5px solid #333;margin:10px}
/* Definition */
.dl{margin:10px}
.dl dt{margin:0;padding:0;font-weight:bold}
.dl dd{margin:0 0 10px 0;padding:0;color:#666}
/* Graph Horizontal */
.gh{list-style:none;margin:10px;padding:0}
.gh li{position:relative;margin:5px 0}
.gh .bar{position:absolute;z-index:-1;height:100%;width:0;background:#ddd}
.gh em{color:#f60}
/* Button */
.bn{display:inline-block;padding:5px 10px;font-weight:normal;font-size:14px;border:1px solid #333;background:#eee;color:#000;text-shadow:1px 1px 0 #fff;box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;-webkit-box-shadow:0 0 3px #333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;text-decoration:none}

View file

@ -7,6 +7,42 @@
class adminAdminView extends admin {
/**
* @brief Initilization
* @return none
**/
function init() {
// forbit access if the user is not an administrator
$oMemberModel = &getModel('member');
$logged_info = $oMemberModel->getLoggedInfo();
if($logged_info->is_admin!='Y') return $this->stop("msg_is_not_administrator");
// change into administration layout
$this->setTemplatePath($this->module_path.'tpl');
$this->setLayoutPath($this->getTemplatePath());
$this->setLayoutFile('layout.html');
$this->loadSideBar();
// Retrieve the list of installed modules
$db_info = Context::getDBInfo();
Context::set('time_zone_list', $GLOBALS['time_zone']);
Context::set('time_zone', $GLOBALS['_time_zone']);
Context::set('use_rewrite', $db_info->use_rewrite=='Y'?'Y':'N');
Context::set('use_optimizer', $db_info->use_optimizer!='N'?'Y':'N');
Context::set('use_spaceremover', $db_info->use_spaceremover?$db_info->use_spaceremover:'Y');
Context::set('qmail_compatibility', $db_info->qmail_compatibility=='Y'?'Y':'N');
Context::set('use_db_session', $db_info->use_db_session=='N'?'N':'Y');
Context::set('use_mobile_view', $db_info->use_mobile_view =='Y'?'Y':'N');
Context::set('use_ssl', $db_info->use_ssl?$db_info->use_ssl:"none");
if($db_info->http_port) Context::set('http_port', $db_info->http_port);
if($db_info->https_port) Context::set('https_port', $db_info->https_port);
}
function loadSideBar()
{
$oModuleModel = &getModel('module');
@ -15,6 +51,10 @@
$installed_modules = $package_modules = array();
$package_idx = 0;
foreach($installed_module_list as $key => $val) {
if($val->category == 'migration') $val->category = 'system';
if($val->category == 'interlock') $val->category = 'accessory';
if($val->category == 'statistics') $val->category = 'accessory';
if($val->module == 'admin' || !$val->admin_index_act) continue;
// get action information
$action_spec = $oModuleModel->getModuleActionXml($val->module);
@ -56,41 +96,6 @@
Context::loadJavascriptPlugin('watchinput');
}
/**
* @brief Initilization
* @return none
**/
function init() {
// forbit access if the user is not an administrator
$oMemberModel = &getModel('member');
$logged_info = $oMemberModel->getLoggedInfo();
if($logged_info->is_admin!='Y') return $this->stop("msg_is_not_administrator");
// change into administration layout
$this->setTemplatePath($this->module_path.'tpl');
$this->setLayoutPath($this->getTemplatePath());
$this->setLayoutFile('layout.html');
$this->loadSideBar();
// Retrieve the list of installed modules
$db_info = Context::getDBInfo();
Context::set('time_zone_list', $GLOBALS['time_zone']);
Context::set('time_zone', $GLOBALS['_time_zone']);
Context::set('use_rewrite', $db_info->use_rewrite=='Y'?'Y':'N');
Context::set('use_optimizer', $db_info->use_optimizer!='N'?'Y':'N');
Context::set('use_spaceremover', $db_info->use_spaceremover?$db_info->use_spaceremover:'Y');
Context::set('qmail_compatibility', $db_info->qmail_compatibility=='Y'?'Y':'N');
Context::set('use_db_session', $db_info->use_db_session=='N'?'N':'Y');
Context::set('use_ssl', $db_info->use_ssl?$db_info->use_ssl:"none");
if($db_info->http_port) Context::set('http_port', $db_info->http_port);
if($db_info->https_port) Context::set('https_port', $db_info->https_port);
}
/**
* @brief Display main administration page
* @return none
@ -146,6 +151,97 @@
$addon_list = $oAddonModel->getAddonList();
Context::set('addon_list', $addon_list);
// 방문자수
$time = time();
$w = date("D");
while(date("D",$time) != "Sat") {
$time += 60*60*24;
}
$end_time = $time;
$end_date = date("Ymd",$time);
$time -= 60*60*24;
while(date("D",$time)!="Sun") {
$thisWeek[] = date("Ymd",$time);
$time -= 60*60*24;
}
$start_time = $time;
$start_date = date("Ymd",$time-60*60*24*7);
$args->start_date = $start_date;
$args->end_date = $end_date;
$output = executeQueryArray('admin.getVisitors', $args);
if(count($output->data)) {
foreach($output->data as $key => $val) {
$visitors[$val->regdate] = $val->unique_visitor;
}
}
$output = executeQueryArray('admin.getSiteVisitors', $args);
if(count($output->data)) {
foreach($output->data as $key => $val) {
$visitors[$val->regdate] += $val->unique_visitor;
}
}
$status->week_max = 0;
if(count($visitors)) {
foreach($visitors as $key => $val) {
if($val>$status->week_max) $status->week_max = $val;
}
}
for($i=$start_time;$i<$end_time;$i+=60*60*24) {
$status->thisWeekSum += $visitors[date("Ymd",$i)];
$status->week[date("Y.m.d",$i)]->this = (int)$visitors[date("Ymd",$i)];
$status->week[date("Y.m.d",$i)]->last = (int)$visitors[date("Ymd",$i-60*60*24*7)];
}
// 각종 통계 정보를 구함
$output = executeQuery('admin.getTotalVisitors');
$status->total_visitor = $output->data->count;
$output = executeQuery('admin.getTotalSiteVisitors');
$status->total_visitor += $output->data->count;
$status->visitor = $visitors[date("Ymd")];
// 오늘의 댓글 수
$args->regdate = date("Ymd");
$output = executeQuery('admin.getTodayCommentCount', $args);
$status->comment_count = $output->data->count;
// 오늘의 엮인글 수
$args->regdate = date("Ymd");
$output = executeQuery('admin.getTodayTrackbackCount', $args);
$status->trackback_count = $output->data->count;
Context::set('status', $status);
// 최근글 추출
$oDocumentModel = &getModel('document');
$doc_args->sort_index = 'list_order';
$doc_args->order_type = 'asc';
$doc_args->list_count = 3;
$output = $oDocumentModel->getDocumentList($doc_args, false, false);
Context::set('newest_documents', $output->data);
// 최근 댓글 추출
$oCommentModel = &getModel('comment');
$com_args->sort_index = 'list_order';
$com_args->order_type = 'asc';
$com_args->list_count = 5;
$output = $oCommentModel->getTotalCommentList($com_args);
Context::set('newest_comments', $output->data);
// Get statistics
$args->date = date("Ymd000000", time()-60*60*24);
$today = date("Ymd");

View file

@ -86,4 +86,7 @@
$lang->mobile_view = 'Mobile View';
$lang->about_mobile_view = 'Mobile View will display the best layout when accessing with smartphones.';
$lang->autoinstall = 'EasyInstall';
$lang->last_week = 'Last week';
$lang->this_week = 'This week';
?>

View file

@ -88,4 +88,7 @@
$lang->mobile_view = 'Use Mobile View';
$lang->about_mobile_view = 'If accessing with a smartphone, display content with mobile layout.';
$lang->autoinstall = 'EasyInstall';
$lang->last_week = 'Last week';
$lang->this_week = 'This week';
?>

View file

@ -87,4 +87,7 @@
$lang->mobile_view = 'Use Mobile View';
$lang->about_mobile_view = 'If accessing with a smartphone, display content with mobile layout.';
$lang->autoinstall = 'EasyInstall';
$lang->last_week = 'Last week';
$lang->this_week = 'This week';
?>

View file

@ -86,4 +86,7 @@
$lang->mobile_view = 'Use Mobile View';
$lang->about_mobile_view = 'If accessing with a smartphone, display content with mobile layout.';
$lang->autoinstall = 'イージーインストール';
$lang->last_week = 'Last week';
$lang->this_week = 'This week';
?>

View file

@ -87,4 +87,7 @@
$lang->about_mobile_view = '스마트폰 등을 이용하여 접속할 때 모바일 화면에 최적화된 레이아웃을 이용하도록 합니다.';
$lang->autoinstall = '쉬운 설치';
$lang->last_week = '지난 주';
$lang->this_week = '이번 주';
?>

View file

@ -85,4 +85,7 @@
$lang->mobile_view = 'Use Mobile View';
$lang->about_mobile_view = 'If accessing with a smartphone, display content with mobile layout.';
$lang->autoinstall = 'EasyInstall';
$lang->last_week = 'Last week';
$lang->this_week = 'This week';
?>

View file

@ -89,4 +89,7 @@
$lang->mobile_view = 'Xem bằng di động';
$lang->about_mobile_view = 'Nếu truy cập bằng thiết bị di động, nội dung sẽ được bố trí theo từng loại thiết bị.';
$lang->autoinstall = 'Cập nhật tự động';
$lang->last_week = 'Last week';
$lang->this_week = 'This week';
?>

View file

@ -86,4 +86,7 @@
$lang->mobile_view = '开启移动版';
$lang->about_mobile_view = '为智能手机访问网站,提供最佳视觉效果。';
$lang->autoinstall = '安装·更新';
$lang->last_week = 'Last week';
$lang->this_week = 'This week';
?>

View file

@ -86,4 +86,7 @@
$lang->mobile_view = '手機瀏覽';
$lang->about_mobile_view = '使用手機瀏覽時將會顯示最適當的畫面。';
$lang->autoinstall = '自動安裝';
$lang->last_week = 'Last week';
$lang->this_week = 'This week';
?>

View file

@ -0,0 +1,9 @@
<query id="getSiteVisitors" action="select">
<tables>
<table name="counter_site_status" />
</tables>
<conditions>
<condition operation="more" column="regdate" var="start_date" notnull="notnull" pipe="and" />
<condition operation="less" column="regdate" var="end_date" notnull="notnull" pipe="and" />
</conditions>
</query>

View file

@ -0,0 +1,12 @@
<query id="getTodayCommentCount" action="select">
<tables>
<table name="comments" />
</tables>
<columns>
<column name="count(*)" alias="count" />
</columns>
<conditions>
<condition operation="like_prefix" column="regdate" var="regdate" notnull="notnull" pipe="and" />
</conditions>
</query>

View file

@ -0,0 +1,12 @@
<query id="getTodayTrackbackCount" action="select">
<tables>
<table name="trackbacks" />
</tables>
<columns>
<column name="count(*)" alias="count" />
</columns>
<conditions>
<condition operation="like_prefix" column="regdate" var="regdate" notnull="notnull" pipe="and" />
</conditions>
</query>

View file

@ -0,0 +1,8 @@
<query id="getTotalSiteVisitors" action="select">
<tables>
<table name="counter_site_status" />
</tables>
<columns>
<column name="sum(unique_visitor)" alias="count" />
</columns>
</query>

View file

@ -0,0 +1,8 @@
<query id="getTotalVisitors" action="select">
<tables>
<table name="counter_status" />
</tables>
<columns>
<column name="sum(unique_visitor)" alias="count" />
</columns>
</query>

View file

@ -0,0 +1,9 @@
<query id="getVisitors" action="select">
<tables>
<table name="counter_status" />
</tables>
<conditions>
<condition operation="more" column="regdate" var="start_date" notnull="notnull" pipe="and" />
<condition operation="less" column="regdate" var="end_date" notnull="notnull" pipe="and" />
</conditions>
</query>

View file

@ -1,6 +1,6 @@
<!--%import("css/layout.css")-->
<!--%import("js/admin.js")-->
<div id="xeAdmin" class="<!--@if(!$act || ($act == 'dispAdminIndex' || $act == 'dispAdminConfig'))-->ece<!--@else-->ec<!--@end-->">
<div id="xeAdmin" class="<!--@if($package_selected || strstr($act,'Autoinstall'))-->c<!--@elseif(!$act || ($act == 'dispAdminIndex' || $act == 'dispAdminConfig'))-->ece<!--@else-->ec<!--@end-->">
<div class="header">
<h1 class="xeAdmin"><a href="{getUrl('','module','admin')}">XpressEngine</a></h1>
<ul class="gnb">
@ -27,13 +27,23 @@
<div class="body">
<div class="extension e1">
<div class="section">
<div id="search_nav">
<input type="text" size="12" />
<button type="button"></button>
</div>
<ul class="navigation">
{@$_c = explode(',',$_COOKIE['XEAM'])}
<!--@foreach($lang->module_category_title as $key => $val)-->
<li id="module_{$key}" class="<!--@if($selected_module_category == $key)-->open<!--@end-->"><a href="#" onclick="toggleModuleMenu('{$key}'); return false;">{$val}</a>
<!--@if($key != 'migration' && $key != 'interlock' && $key != 'statistics')-->
<!--@if(in_array($key,$_c)&&$key!=$selected_module_category)-->
{@$_cs = true;}
<!--@else-->
{@$_cs = false;}
<!--@end-->
<li id="module_{$key}" class="parent <!--@if($_cs)-->close<!--@end--> <!--@if($key==$selected_module_category)-->active<!--@end-->"><a href="#" onclick="toggleModuleMenu('{$key}'); return false;" class="parent">{$val}</a>
<ul>
<!--@foreach($installed_modules as $k => $v)-->
<!--@if($v->category == $key)-->
@ -43,6 +53,7 @@
</ul>
</li>
<!--@end-->
<!--@end-->
</ul>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show more