From 571766a8aac8470324985d3c84524e26b863fbf9 Mon Sep 17 00:00:00 2001 From: misol Date: Tue, 15 Dec 2009 09:55:42 +0000 Subject: [PATCH] =?UTF-8?q?#18544647=20=EC=BA=A1=EC=B0=A8=20=EC=95=A0?= =?UTF-8?q?=EB=93=9C=EC=98=A8=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20?= =?UTF-8?q?=EC=95=95=EC=B6=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7044 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- addons/captcha/captcha.addon.php | 2 +- addons/captcha/captcha.min.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 addons/captcha/captcha.min.js diff --git a/addons/captcha/captcha.addon.php b/addons/captcha/captcha.addon.php index 06d2f9816..be31532d6 100644 --- a/addons/captcha/captcha.addon.php +++ b/addons/captcha/captcha.addon.php @@ -102,7 +102,7 @@ exit(); } - Context::addJsFile('./addons/captcha/captcha.js',false); + Context::addJsFile('./addons/captcha/captcha.min.js',false); // 게시판/ 이슈트래커의 글쓰기/댓글쓰기 액션 호출시 세션 비교 if(in_array(Context::get('act'), $target_acts)) { diff --git a/addons/captcha/captcha.min.js b/addons/captcha/captcha.min.js new file mode 100644 index 000000000..c345a0bf4 --- /dev/null +++ b/addons/captcha/captcha.min.js @@ -0,0 +1,8 @@ +/** + * procFilter 함수를 가로채서 captcha 이미지 및 폼을 출력 + **/ +var oldExecXml=null;var calledArgs=null;(function($){$(function(){var captchaXE=null;function xeCaptcha(){var body=$(document.body);var captchaIma;if(!captchaXE){captchaXE=$("
").attr("id","captcha_screen").css({position:"absolute",display:"none",backgroundColor:"#111",backgroundRepeat:"repeat",backgroundPosition:"0 0",zIndex:500});$('').appendTo(captchaXE);body.append(captchaXE);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){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,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"})};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;oldExecXml(calledArgs.module,calledArgs.act,params,function(){$("#captcha_screen").css({display:"none"});oldExecXml(calledArgs.module,calledArgs.act,calledArgs.params,calledArgs.callback_func,calledArgs.response_tags,calledArgs.callback_func_arg,calledArgs.fo_obj);});};} +return captchaXE;} +$(window).ready(function(){oldExecXml=exec_xml;exec_xml=xeCaptcha().exec;});});})(jQuery); \ No newline at end of file