diff --git a/adm/config_form.php b/adm/config_form.php
index 02da0575d..aaec76ca8 100644
--- a/adm/config_form.php
+++ b/adm/config_form.php
@@ -1282,7 +1282,10 @@ if($config['cf_cert_use']) {
// kcp일 때
if($config['cf_cert_hp'] == 'kcp') {
- $exe = G5_KCPCERT_PATH.'/bin/ct_cli';
+ if(PHP_INT_MAX == 2147483647) // 32-bit
+ $exe = G5_KCPCERT_PATH . '/bin/ct_cli';
+ else
+ $exe = G5_KCPCERT_PATH . '/bin/ct_cli_x64';
echo module_exec_check($exe, 'ct_cli');
}
diff --git a/adm/contentform.php b/adm/contentform.php
index 8f00030ff..a20bf373e 100644
--- a/adm/contentform.php
+++ b/adm/contentform.php
@@ -19,6 +19,20 @@ if(!sql_query(" select co_tag_filter_use from {$g5['content_table']} limit 1 ",
sql_query(" update {$g5['content_table']} set co_tag_filter_use = '1' ");
}
+// 모바일 내용 추가
+if(!sql_query(" select co_mobile_content from {$g5['content_table']} limit 1", false)) {
+ sql_query(" ALTER TABLE `{$g5['content_table']}`
+ ADD `co_mobile_content` longtext NOT NULL AFTER `co_content` ", true);
+}
+
+// 스킨 설정 추가
+if(!sql_query(" select co_skin from {$g5['content_table']} limit 1 ", false)) {
+ sql_query(" ALTER TABLE `{$g5['content_table']}`
+ ADD `co_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_mobile_content`,
+ ADD `co_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_skin` ", true);
+ sql_query(" update {$g5['content_table']} set co_skin = 'basic', co_mobile_skin = 'basic' ");
+}
+
$html_title = "내용";
$g5['title'] = $html_title.' 관리';
@@ -36,6 +50,8 @@ else
{
$html_title .= ' 입력';
$co['co_html'] = 2;
+ $co['co_skin'] = 'basic';
+ $co['co_mobile_skin'] = 'basic';
}
include_once (G5_ADMIN_PATH.'/admin.head.php');
@@ -69,6 +85,22 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
|
@@ -160,6 +192,7 @@ function frmcontentform_check(f)
+
check_field(f.co_id, "ID를 입력하세요.");
check_field(f.co_subject, "제목을 입력하세요.");
diff --git a/adm/contentformupdate.php b/adm/contentformupdate.php
index 4f9786ffd..57c26e172 100644
--- a/adm/contentformupdate.php
+++ b/adm/contentformupdate.php
@@ -21,7 +21,10 @@ $sql_common = " co_include_head = '$co_include_head',
co_html = '$co_html',
co_tag_filter_use = '$co_tag_filter_use',
co_subject = '$co_subject',
- co_content = '$co_content' ";
+ co_content = '$co_content',
+ co_mobile_content = '$co_mobile_content',
+ co_skin = '$co_skin',
+ co_mobile_skin = '$co_mobile_skin' ";
if ($w == "")
{
diff --git a/adm/member_list_delete.php b/adm/member_list_delete.php
index 0deced561..c4810fc8f 100644
--- a/adm/member_list_delete.php
+++ b/adm/member_list_delete.php
@@ -16,7 +16,7 @@ for ($i=0; $i= $board['bo_list_level'] && $board['bo_use_list_view']
include_once('./board_tail.php');
-echo "\n\n";
+echo "\n\n";
include_once(G5_PATH.'/tail.sub.php');
?>
diff --git a/bbs/content.php b/bbs/content.php
index a8ba46f2a..f712cffc6 100644
--- a/bbs/content.php
+++ b/bbs/content.php
@@ -30,7 +30,6 @@ $str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use'])
unset($src);
unset($dst);
$src[] = "/{{쇼핑몰명}}|{{홈페이지제목}}/";
-//$dst[] = $default[de_subject];
$dst[] = $config['cf_title'];
$src[] = "/{{회사명}}|{{상호}}/";
$dst[] = $default['de_admin_company_name'];
@@ -59,39 +58,33 @@ $dst[] = $default['de_admin_info_email'];
$str = preg_replace($src, $dst, $str);
-if ($is_admin)
- echo '';
-?>
+// 스킨경로
+if(trim($co['co_skin']) == '')
+ $co['co_skin'] = 'basic';
-
- ';
-?>
-
-
-
-
-
-
-
-
-
-
- ';
+$content_skin_path = G5_SKIN_PATH.'/content/'.$co['co_skin'];
+$content_skin_url = G5_SKIN_URL.'/content/'.$co['co_skin'];
+$skin_file = $content_skin_path.'/content.skin.php';
if ($is_admin)
echo '';
?>
-
';
+
+ include($skin_file);
+
+ $timg = G5_DATA_PATH.'/content/'.$co_id.'_t';
+ if (file_exists($timg)) // 하단 이미지
+ echo '';
+} else {
+ echo ''.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다. ';
+}
+
if ($co['co_include_tail'])
@include_once($co['co_include_tail']);
else
diff --git a/bbs/db_table.optimize.php b/bbs/db_table.optimize.php
index f676ce4ef..3d0c38c3a 100644
--- a/bbs/db_table.optimize.php
+++ b/bbs/db_table.optimize.php
@@ -50,6 +50,13 @@ if($config['cf_leave_day'] > 0) {
}
}
+// 음성 캡챠 파일 삭제
+foreach (glob(G5_PATH.'/data/cache/kcaptcha-*.mp3') as $file) {
+ if (filemtime($file) + 86400 < G5_SERVER_TIME) {
+ @unlink($file);
+ }
+}
+
// 실행일 기록
if(isset($config['cf_optimize_date'])) {
sql_query(" update {$g5['config_table']} set cf_optimize_date = '".G5_TIME_YMD."' ");
diff --git a/css/default.css b/css/default.css
index a90193c32..9a9e4288c 100644
--- a/css/default.css
+++ b/css/default.css
@@ -252,13 +252,6 @@ a.btn_admin:focus, a.btn_admin:hover {text-decoration:none}
.new_win .win_btn a {display:inline-block;padding:0 10px;height:30px;background:#4b545e;color:#fff;vertical-align:middle;line-height:2.4em}
.new_win .win_btn a:focus, .new_win .win_btn a:hover {text-decoration:none}
-/* 내용관리 */
-#ctt {margin:10px 0;padding:10px;border:1px solid #e9e9e9}
-.ctt_admin {text-align:right}
-#ctt header h1 {position:absolute;font-size:0;line-height:0;overflow:hidden}
-#ctt_con {padding:10px 0}
-.ctt_img {text-align:center}
-
/* 검색결과 색상 */
.sch_word {color:#ff3061}
diff --git a/css/mobile.css b/css/mobile.css
index 9d2b3328a..feb6f507f 100644
--- a/css/mobile.css
+++ b/css/mobile.css
@@ -225,13 +225,6 @@ a.btn_admin:focus, a.btn_admin:hover {text-decoration:none}
.new_win .win_btn button {display:inline-block;padding:0 10px;height:2.5em;border:0;background:#666;color:#fff;text-decoration:none;line-height:2.5em}
.new_win .win_btn input {padding:0 10px;height:2.5em;line-height:2.5em}
-/* 내용관리 */
-#ctt {margin:10px 0;padding:10px;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9}
-.ctt_admin {margin:0 5px;text-align:right}
-#ctt header h1 {position:absolute;font-size:0;line-height:0;overflow:hidden}
-#ctt_con {padding:10px 0}
-.ctt_img {text-align:center}
-
/* 검색결과 색상 */
.sch_word {color:#ff3061}
diff --git a/install/gnuboard5.sql b/install/gnuboard5.sql
index 5c1a5a2bb..731e6f53b 100644
--- a/install/gnuboard5.sql
+++ b/install/gnuboard5.sql
@@ -781,6 +781,9 @@ CREATE TABLE IF NOT EXISTS `g5_content` (
`co_html` tinyint(4) NOT NULL DEFAULT '0',
`co_subject` varchar(255) NOT NULL DEFAULT '',
`co_content` longtext NOT NULL,
+ `co_mobile_content` longtext NOT NULL,
+ `co_skin` varchar(255) NOT NULL DEFAULT '',
+ `co_mobile_skin` varchar(255) NOT NULL DEFAULT '',
`co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0',
`co_hit` int(11) NOT NULL DEFAULT '0',
`co_include_head` varchar(255) NOT NULL,
diff --git a/lib/common.lib.php b/lib/common.lib.php
index 4d9660b77..8b8b0a7a1 100644
--- a/lib/common.lib.php
+++ b/lib/common.lib.php
@@ -141,7 +141,7 @@ function get_cookie($cookie_name)
{
$cookie = md5($cookie_name);
if (array_key_exists($cookie, $_COOKIE))
- return base64_decode($_COOKIE[md5($cookie_name)]);
+ return base64_decode($_COOKIE[$cookie]);
else
return "";
}
@@ -214,11 +214,12 @@ function url_auto_link($str)
// 140326 유창화님 제안코드로 수정
// http://sir.co.kr/bbs/board.php?bo_table=pg_lecture&wr_id=461
// http://sir.co.kr/bbs/board.php?bo_table=pg_lecture&wr_id=463
- $str = str_replace(array("<", ">", "&", """, " "), array("\t_lt_\t", "\t_gt_\t", "&", "\"", "\t_nbsp_\t"), $str);
- $str = preg_replace("`(?:(?:(?:href|src)\s*=\s*(?:\"|'|)){0})((http|https|ftp|telnet|news|mms)://[^\"'\s()]+)`", "\\1", $str);
- $str = preg_replace("/(^|[\"'\s(])(www\.[^\"'\s()]+)/i", "\\1\\2", $str);
- $str = preg_replace("/[0-9a-z_-]+@[a-z0-9._-]{4,}/i", "\\0", $str);
- $str = str_replace(array("\t_nbsp_\t", "\t_lt_\t", "\t_gt_\t"), array(" ", "<", ">"), $str);
+ $str = str_replace(array("<", ">", "&", """, " ", "'"), array("\t_lt_\t", "\t_gt_\t", "&", "\"", "\t_nbsp_\t", "'"), $str);
+ //$str = preg_replace("`(?:(?:(?:href|src)\s*=\s*(?:\"|'|)){0})((http|https|ftp|telnet|news|mms)://[^\"'\s()]+)`", "\\1", $str);
+ $str = preg_replace("/([^(href=\"?'?)|(src=\"?'?)]|\(|^)((http|https|ftp|telnet|news|mms):\/\/[a-zA-Z0-9\.-]+\.[가-힣\xA1-\xFEa-zA-Z0-9\.:=_\?\/~\+%@;\-\|\,\(\)]+)/i", "\\1\\2", $str);
+ $str = preg_replace("/(^|[\"'\s(])(www\.[^\"'\s()]+)/i", "\\1\\2", $str);
+ $str = preg_replace("/[0-9a-z_-]+@[a-z0-9._-]{4,}/i", "\\0", $str);
+ $str = str_replace(array("\t_nbsp_\t", "\t_lt_\t", "\t_gt_\t", "'"), array(" ", "<", ">", "'"), $str);
/*
// 속도 향상 031011
@@ -483,7 +484,7 @@ function search_font($stx, $str)
// 제목을 변환
function conv_subject($subject, $len, $suffix='')
{
- return cut_str(get_text($subject), $len, $suffix);
+ return get_text(cut_str($subject, $len, $suffix));
}
// 내용을 변환
@@ -528,7 +529,6 @@ function conv_content($content, $html, $filter=true)
$content = str_replace("\n ", "\n ", $content);
$content = get_text($content, 1);
-
$content = url_auto_link($content);
}
diff --git a/mobile/content.php b/mobile/content.php
index 4ca181961..c789834b8 100644
--- a/mobile/content.php
+++ b/mobile/content.php
@@ -10,13 +10,13 @@ if (!$co['co_id'])
$g5['title'] = $co['co_subject'];
include_once('./_head.php');
-$str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']);
+$co_content = $co['co_mobile_content'] ? $co['co_mobile_content'] : $co['co_content'];
+$str = conv_content($co_content, $co['co_html'], $co['co_tag_filter_use']);
// $src 를 $dst 로 변환
unset($src);
unset($dst);
$src[] = "/{{쇼핑몰명}}|{{홈페이지제목}}/";
-//$dst[] = $default[de_subject];
$dst[] = $config['cf_title'];
$src[] = "/{{회사명}}|{{상호}}/";
$dst[] = $default['de_admin_company_name'];
@@ -44,21 +44,20 @@ $src[] = "/{{정보관리책임자e-mail}}|{{정보책임자e-mail}}/i";
$dst[] = $default['de_admin_info_email'];
$str = preg_replace($src, $dst, $str);
-?>
-
-
-
+// 스킨경로
+if(trim($co['co_mobile_skin']) == '')
+ $co['co_mobile_skin'] = 'basic';
-
-
-
+$content_skin_path = G5_MOBILE_PATH .'/'.G5_SKIN_DIR.'/content/'.$co['co_mobile_skin'];
+$content_skin_url = G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/content/'.$co['co_mobile_skin'];
+$skin_file = $content_skin_path.'/content.skin.php';
-
-
+if(is_file($skin_file)) {
+ include($skin_file);
+} else {
+ echo ''.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다. ';
+}
-
diff --git a/mobile/skin/content/basic/content.skin.php b/mobile/skin/content/basic/content.skin.php
new file mode 100644
index 000000000..79d47d932
--- /dev/null
+++ b/mobile/skin/content/basic/content.skin.php
@@ -0,0 +1,18 @@
+', 0);
+
+?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/skin/content/basic/style.css b/mobile/skin/content/basic/style.css
new file mode 100644
index 000000000..638229597
--- /dev/null
+++ b/mobile/skin/content/basic/style.css
@@ -0,0 +1,8 @@
+@charset "utf-8";
+
+/* 내용관리 */
+#ctt {margin:10px 0;padding:10px;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9}
+.ctt_admin {margin:0 5px;text-align:right}
+#ctt header h1 {position:absolute;font-size:0;line-height:0;overflow:hidden}
+#ctt_con {padding:10px 0}
+.ctt_img {text-align:center}
\ No newline at end of file
diff --git a/mobile/skin/latest/basic/latest.skin.php b/mobile/skin/latest/basic/latest.skin.php
index 89ac1b4b8..6a2e4e9c2 100644
--- a/mobile/skin/latest/basic/latest.skin.php
+++ b/mobile/skin/latest/basic/latest.skin.php
@@ -6,7 +6,7 @@ add_stylesheet('',
?>
-
+
-
diff --git a/mobile/tail.php b/mobile/tail.php
index faa5a9ddb..6ada54bbd 100644
--- a/mobile/tail.php
+++ b/mobile/tail.php
@@ -52,6 +52,15 @@ if(G5_DEVICE_BUTTON_DISPLAY && G5_IS_MOBILE) {
if ($config['cf_analytics']) {
echo $config['cf_analytics'];
}
+?>
+
+
+
\ No newline at end of file
diff --git a/perms.sh b/perms.sh
index 6542ef41b..8719b01c4 100644
--- a/perms.sh
+++ b/perms.sh
@@ -2,6 +2,7 @@
# kcp 본인확인 실행 파일
chmod 755 plugin/kcpcert/bin/ct_cli
+chmod 755 plugin/kcpcert/bin/ct_cli_x64
# okname 본인확인 실행 파일
chmod 755 plugin/okname/bin/okname
diff --git a/plugin/editor/smarteditor2/SmartEditor2Skin.html b/plugin/editor/smarteditor2/SmartEditor2Skin.html
index 03c99f4eb..febc72e54 100644
--- a/plugin/editor/smarteditor2/SmartEditor2Skin.html
+++ b/plugin/editor/smarteditor2/SmartEditor2Skin.html
@@ -15,7 +15,7 @@
-
+
diff --git a/plugin/editor/smarteditor2/js/smarteditor2.js b/plugin/editor/smarteditor2/js/smarteditor2.js
index 45585d59a..4151b3999 100644
--- a/plugin/editor/smarteditor2/js/smarteditor2.js
+++ b/plugin/editor/smarteditor2/js/smarteditor2.js
@@ -12138,9 +12138,19 @@ nhn.husky.SE2M_Hyperlink = jindo.$Class({
var sResult;
if (sWWWURL){
- sResult = ''+sURL+'';
+ var exp = /([-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)/gi;
+ if( sWWWURL.match(exp) ){
+ sResult = sWWWURL.replace(exp, '$1');
+ } else {
+ sResult = ''+sURL+'';
+ }
} else {
- sResult = ''+sURL+'';
+ var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
+ if( sHTTPURL.match(exp) ){
+ sResult = sHTTPURL.replace(exp,"$1");
+ } else {
+ sResult = ''+sURL+'';
+ }
}
return sBreaker+sResult;
diff --git a/plugin/editor/smarteditor2/js/smarteditor2.min.js b/plugin/editor/smarteditor2/js/smarteditor2.min.js
index 310d882f3..66b6517ad 100644
--- a/plugin/editor/smarteditor2/js/smarteditor2.min.js
+++ b/plugin/editor/smarteditor2/js/smarteditor2.min.js
@@ -1 +1 @@
-var nSE2Version=11329;if(typeof window.nhn=="undefined"){window.nhn={}}nhn.FindReplace=jindo.$Class({sKeyword:"",window:null,document:null,bBrowserSupported:false,bEOC:false,$init:function(c){this.sInlineContainer="SPAN|B|U|I|S|STRIKE";this.rxInlineContainer=new RegExp("^("+this.sInlineContainer+")$");this.window=c;this.document=this.window.document;if(this.document.domain!=this.document.location.hostname){var a=jindo.$Agent();var b=a.navigator();if(b.firefox&&b.version<3){this.bBrowserSupported=false;this.find=function(){return 3};return}}this.bBrowserSupported=true},_findNextElement:function(b){if(!b||b.tagName=="BODY"){return null}var a=b.nextSibling;if(a){return(a.nodeType==1?a:this._findNextElement(a))}else{return this._findNextElement(b.parentNode)}},find:function(a,c,d,e){var f,b;this.window.focus();if(!a){return 2}this.bEOC=false;f=this.findNext(a,c,d,e);if(f){return 0}this.bEOC=true;f=this.findNew(a,c,d,e);if(f){return 0}return 1},findNew:function(a,b,c,d){this.findReset();return this.findNext(a,b,c,d)},findNext:function(g,f,b,a){var c;f=f||false;a=a||false;b=b||false;if(this.window.find){var k=false;return this.window.find(g,f,b,k,a)}if(this.document.body.createTextRange){try{var j=0;if(b){j+=1}if(a){j+=2}if(f){j+=4}this.window.focus();if(this.document.selection){this._range=this.document.selection.createRangeCollection().item(0);this._range.collapse(false)}else{this._range=this.document.body.createTextRange();var d=this._findNextElement(this.window.getSelection().focusNode);if(d){this._range.moveToElementText(d)}}c=this._range.findText(g,1,j);this._range.select();return c}catch(h){return false}}return false},findReset:function(){if(this.window.find){this.window.getSelection().removeAllRanges();return}if(this.document.body.createTextRange){if(this.document.selection){this._range=this.document.body.createTextRange();this._range.collapse(true);this._range.select()}else{if(this.window.getSelection){var a=this.window.getSelection();a.removeAllRanges();a.selectAllChildren(this.document.body);a.collapseToStart()}}}},replace:function(b,d,a,c,e){return this._replace(b,d,a,c,e)},_replace:function(c,f,b,d,g,e){if(!c){return 4}e=e||new nhn.HuskyRange(this.window);e.setFromSelection();b=b||false;var a,h=e.toString();if(b){a=(h==c)}else{a=(h.toLowerCase()==c.toLowerCase())}if(!a){return this.find(c,b,d,g)+2}if(typeof f=="function"){e=f(e)}else{e.pasteText(f)}e.select();return this.find(c,b,d,g)},replaceAll:function(e,h,j,b){if(!e){return -1}var c=false;var l;var a=0;var k=this.window;if(this.find(e,j,c,b)!==0){return a}var g=new nhn.HuskyRange(this.window);g.setFromSelection();g.collapseToStart();var m=this.window.document.createElement("SPAN");m.innerHTML=unescape("%uFEFF");g.insertNode(m);g.select();var d=g.placeStringBookmark();this.bEOC=false;while(!this.bEOC){l=this._replace(e,h,j,c,b,g);if(l==0||l==1){a++}}var f=function(){var n=new nhn.HuskyRange(k);n.setFromSelection();g.moveToBookmark(d);var o=g.compareBoundaryPoints(nhn.W3CDOMRange.START_TO_END,n);if(o==1){return false}return true};l=0;this.bEOC=false;while(!f()&&l==0&&!this.bEOC){l=this._replace(e,h,j,c,b,g);if(l==0||l==1){a++}}g.moveToBookmark(d);g.deleteContents();g.removeStringBookmark(d);setTimeout(function(){m.parentNode.removeChild(m)},0);return a},_isBlankTextNode:function(a){if(a.nodeType==3&&a.nodeValue==""){return true}return false},_getNextNode:function(a,b){if(!a||a.tagName=="BODY"){return{elNextNode:null,bDisconnected:false}}if(a.nextSibling){a=a.nextSibling;while(a.firstChild){if(a.tagName&&!this.rxInlineContainer.test(a.tagName)){b=true}a=a.firstChild}return{elNextNode:a,bDisconnected:b}}return this._getNextNode(nhn.DOMFix.parentNode(a),b)},_getNextTextNode:function(a,b){var c,a;while(true){c=this._getNextNode(a,b);a=c.elNextNode;b=c.bDisconnected;if(a&&a.nodeType!=3&&!this.rxInlineContainer.test(a.tagName)){b=true}if(!a||(a.nodeType==3&&!this._isBlankTextNode(a))){break}}return{elNextText:a,bDisconnected:b}},_getFirstTextNode:function(){var b=this.document.body.firstChild;while(!!b&&b.firstChild){b=b.firstChild}if(!b){return null}if(b.nodeType!=3||this._isBlankTextNode(b)){var a=this._getNextTextNode(b,false);b=a.elNextText}return b},_addToTextMap:function(b,d,g,f){var e=d[f].length;for(var c=0,a=b.nodeValue.length;c=0;q--){var d=o.substring(q,q+a);if(u&&(q>0&&o.charAt(q-1).match(/[a-zA-Z가-힣]/))){continue}if(d==t){h++;var b=new nhn.HuskyRange(this.window);var p,m;if(q+a=0&&nhn.DOMFix.parentNode(l[m])==l[k]){m=this._recurConstructClonedTree(l,m,h)}j.insertBefore(h,j.firstChild);return m};this._recurConstructClonedTree=g;b[b.length]=nhn.DOMFix.parentNode(b[b.length-1]);this._recurConstructClonedTree(b,b.length-1,d);return{oStartContainer:a,oEndContainer:c}},cloneRange:function(){return this._copyRange(new nhn.W3CDOMRange(this._window))},_copyRange:function(a){a.collapsed=this.collapsed;a.commonAncestorContainer=this.commonAncestorContainer;a.endContainer=this.endContainer;a.endOffset=this.endOffset;a.startContainer=this.startContainer;a.startOffset=this.startOffset;a._document=this._document;return a},collapse:function(a){if(a){this.endContainer=this.startContainer;this.endOffset=this.startOffset}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset}this._updateRangeInfo()},compareBoundaryPoints:function(a,b){switch(a){case nhn.W3CDOMRange.START_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,b.startContainer,b.startOffset);case nhn.W3CDOMRange.START_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,b.startContainer,b.startOffset);case nhn.W3CDOMRange.END_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,b.endContainer,b.endOffset);case nhn.W3CDOMRange.END_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,b.endContainer,b.endOffset)}},_findBody:function(a){if(!a){return null}while(a){if(a.tagName=="BODY"){return a}a=nhn.DOMFix.parentNode(a)}return null},_compareEndPoint:function(d,g,c,e){return this.oBrowserSelection.compareEndPoints(d,g,c,e);var l,j;if(!d||this._findBody(d)!=this._document.body){d=this._document.body;g=0}if(!c||this._findBody(c)!=this._document.body){c=this._document.body;e=0}var f=function(n,m){if(m==-1){m=n+1}if(nb.nodeValue.length){a=b.nodeValue.length}}else{if(a>nhn.DOMFix.childNodes(b).length){a=nhn.DOMFix.childNodes(b).length}}return a},setEnd:function(a,d,c,b){if(!c){d=this._endsNodeValidation(a,d)}this.endContainer=a;this.endOffset=d;if(!b){if(!this.startContainer||this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)!=-1){this.collapse(false)}else{this._updateRangeInfo()}}},setEndAfter:function(a,b){if(!a){throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter")}if(a.tagName=="BODY"){this.setEnd(a,nhn.DOMFix.childNodes(a).length,true,b);return}this.setEnd(nhn.DOMFix.parentNode(a),this._getPosIdx(a)+1,true,b)},setEndBefore:function(a,b){if(!a){throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore")}if(a.tagName=="BODY"){this.setEnd(a,0,true,b);return}this.setEnd(nhn.DOMFix.parentNode(a),this._getPosIdx(a),true,b)},setStart:function(a,d,c,b){if(!c){d=this._endsNodeValidation(a,d)}this.startContainer=a;this.startOffset=d;if(!b){if(!this.endContainer||this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)!=-1){this.collapse(true)}else{this._updateRangeInfo()}}},setStartAfter:function(a,b){if(!a){throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter")}if(a.tagName=="BODY"){this.setStart(a,nhn.DOMFix.childNodes(a).length,true,b);return}this.setStart(nhn.DOMFix.parentNode(a),this._getPosIdx(a)+1,true,b)},setStartBefore:function(a,b){if(!a){throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore")}if(a.tagName=="BODY"){this.setStart(a,0,true,b);return}this.setStart(nhn.DOMFix.parentNode(a),this._getPosIdx(a),true,b)},surroundContents:function(a){a.appendChild(this.extractContents());this.insertNode(a);this.selectNode(a)},toString:function(){var a=this._document.createElement("DIV");a.appendChild(this.cloneContents());return a.textContent||a.innerText||""},fixCommonAncestorContainer:function(){if(!jindo.$Agent().navigator().ie){return}this.commonAncestorContainer=this._getCommonAncestorContainer()},_isBlankTextNode:function(a){if(a.nodeType==3&&a.nodeValue==""){return true}return false},_isAllChildBlankText:function(a){for(var b=0,c=a.childNodes.length;b=c.nodeValue.length){return b}if(a===0){return b}c.splitText(a);return{oStartContainer:e,iStartOffset:d,oEndContainer:c,iEndOffset:a}},_getNodesInRange:function(){if(this.collapsed){return[]}var b=this._getActualStartNode(this.startContainer,this.startOffset);var a=this._getActualEndNode(this.endContainer,this.endOffset);return this._getNodesBetween(b,a)},_getActualStartNode:function(c,b){var a=c;if(c.nodeType==3){if(b>=c.nodeValue.length){a=this._getNextNode(c);if(a.tagName=="BODY"){a=null}}else{a=c}}else{if(b)$/i,setWindow:function(a){this.reset(a||window)},$init:function(a){this.HUSKY_BOOMARK_START_ID_PREFIX="husky_bookmark_start_";this.HUSKY_BOOMARK_END_ID_PREFIX="husky_bookmark_end_";this.sBlockElement="P|DIV|LI|H[1-6]|PRE";this.sBlockContainer="BODY|TABLE|TH|TR|TD|UL|OL|BLOCKQUOTE|FORM";this.rxBlockElement=new RegExp("^("+this.sBlockElement+")$");this.rxBlockContainer=new RegExp("^("+this.sBlockContainer+")$");this.rxLineBreaker=new RegExp("^("+this.sBlockElement+"|"+this.sBlockContainer+")$");this.setWindow(a)},select:function(){try{this.oBrowserSelection.selectRange(this)}catch(a){}},setFromSelection:function(a){this.setRange(this.oBrowserSelection.getRangeAt(a),true)},setRange:function(a,b){this.reset(this._window);this.setStart(a.startContainer,a.startOffset,b,true);this.setEnd(a.endContainer,a.endOffset,b)},setEndNodes:function(b,a){this.reset(this._window);this.setEndAfter(a,true);this.setStartBefore(b)},splitTextAtBothEnds:function(){this._splitTextEndNodesOfTheRange()},getStartNode:function(){if(this.collapsed){if(this.startContainer.nodeType==3){if(this.startOffset===0){return null}if(this.startContainer.nodeValue.length<=this.startOffset){return null}return this.startContainer}return null}if(this.startContainer.nodeType==3){if(this.startOffset>=this.startContainer.nodeValue.length){return this._getNextNode(this.startContainer)}return this.startContainer}else{if(this.startOffset>=nhn.DOMFix.childNodes(this.startContainer).length){return this._getNextNode(this.startContainer)}return nhn.DOMFix.childNodes(this.startContainer)[this.startOffset]}},getEndNode:function(){if(this.collapsed){return this.getStartNode()}if(this.endContainer.nodeType==3){if(this.endOffset===0){return this._getPrevNode(this.endContainer)}return this.endContainer}else{if(this.endOffset===0){return this._getPrevNode(this.endContainer)}return nhn.DOMFix.childNodes(this.endContainer)[this.endOffset-1]}},getNodeAroundRange:function(d,a){if(!this.collapsed){return this.getStartNode()}if(this.startContainer&&this.startContainer.nodeType==3){return this.startContainer}var e,c,b;if(this.startOffset>=nhn.DOMFix.childNodes(this.startContainer).length){c=this._getNextNode(this.startContainer)}else{c=nhn.DOMFix.childNodes(this.startContainer)[this.startOffset]}if(this.endOffset===0){e=this._getPrevNode(this.endContainer)}else{e=nhn.DOMFix.childNodes(this.endContainer)[this.endOffset-1]}if(d){b=e;if(!b&&!a){b=c}}else{b=c;if(!b&&!a){b=e}}return b},_getXPath:function(b){var a="";while(b&&b.nodeType==1){a="/"+b.tagName+"["+this._getPosIdx4XPath(b)+"]"+a;b=nhn.DOMFix.parentNode(b)}return a},_getPosIdx4XPath:function(b){var a=0;for(var c=b.previousSibling;c;c=c.previousSibling){if(c.tagName==b.tagName){a++}}return a},_evaluateXPath:function(l,j){l=l.substring(1,l.length-1);var f=l.split(/\//);var d=j.body;for(var e=2;e-1&&e){var g=nhn.DOMFix.childNodes(e);var d=null;var b=a;var f=c;while((d=g[b])&&d.nodeType==3&&d.nodeValue.length=0){return true}if(f){if(c==1){return false}if(d==-1){return false}return true}return false},isNodeInRange:function(d,c,b){var a=new nhn.HuskyRange(this._window);if(b&&d.firstChild){a.setStartBefore(d.firstChild);a.setEndAfter(d.lastChild)}else{a.selectNode(d)}return this.isRangeInRange(a,c)},pasteText:function(a){this.pasteHTML(a.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/"/g,"""))},pasteHTML:function(c){var b=this._document.createElement("DIV");b.innerHTML=c;if(!b.firstChild){this.deleteContents();return}var e=b.firstChild;var d=b.lastChild;var f=this.cloneRange();var a=f.placeStringBookmark();this.collapseToStart();while(b.lastChild){this.insertNode(b.lastChild)}this.setEndNodes(e,d);f.moveToBookmark(a);f.deleteContents();f.removeStringBookmark(a)},toString:function(){this.toString=nhn.W3CDOMRange.prototype.toString;return this.toString()},toHTMLString:function(){var a=this._document.createElement("DIV");a.appendChild(this.cloneContents());return a.innerHTML},findAncestorByTagName:function(a){var b=this.commonAncestorContainer;while(b&&b.tagName!=a){b=nhn.DOMFix.parentNode(b)}return b},selectNodeContents:function(c){if(!c){return}var b=c.firstChild?c.firstChild:c;var a=c.lastChild?c.lastChild:c;this.reset(this._window);if(b.nodeType==3){this.setStart(b,0,true)}else{this.setStartBefore(b)}if(a.nodeType==3){this.setEnd(a,a.nodeValue.length,true)}else{this.setEndAfter(a)}},_hasTextDecoration:function(a,b){if(!a||!a.style){return false}if(a.style.textDecoration.indexOf(b)>-1){return true}if(b==="underline"&&a.tagName==="U"){return true}if(b==="line-through"&&(a.tagName==="S"||a.tagName==="STRIKE")){return true}return false},_setTextDecoration:function(a,b){if(jindo.$Agent().navigator().firefox){a.style.textDecoration=(a.style.textDecoration)?a.style.textDecoration+" "+b:b}else{if(b==="underline"){a.innerHTML=""+a.innerHTML+""}else{if(b==="line-through"){a.innerHTML="
"+a.innerHTML+""}}}},_checkTextDecoration:function(e){if(e.tagName!=="SPAN"){return}var c=false,a=false,d="",b=null;oChildNode=e.firstChild;while(oChildNode){if(oChildNode.nodeType===1){c=(c||oChildNode.tagName==="U");a=(a||oChildNode.tagName==="S"||oChildNode.tagName==="STRIKE")}if(c&&a){return}oChildNode=oChildNode.nextSibling}b=nhn.DOMFix.parentNode(e);while(b&&b.tagName!=="BODY"){if(b.nodeType!==1){b=nhn.DOMFix.parentNode(b);continue}if(!c&&this._hasTextDecoration(b,"underline")){c=true;this._setTextDecoration(e,"underline")}if(!a&&this._hasTextDecoration(b,"line-through")){a=true;this._setTextDecoration(e,"line-through")}if(c&&a){return}b=nhn.DOMFix.parentNode(b)}},styleRange:function(k,f,b,a,e){var j=this.aStyleParents=this._getStyleParentNodes(b,a);if(j.length<1){return}var d,h;for(var c=0;c1){return null}}if(e.nodeName==="SPAN"){return e}else{return this._findParentSingleSpan(e.parentNode)}},_isFullyContained:function(d,c,f){var a,e;var b=this._getVeryFirstRealChild(d);if(f&&b==f){a=1}else{a=c.indexOf(b)}if(a!=-1){b=this._getVeryLastRealChild(d);if(f&&b==f){e=1}else{e=c.indexOf(b)}}return(a!=-1&&e!=-1)},_getVeryFirstChild:function(a){if(a.firstChild){return this._getVeryFirstChild(a.firstChild)}return a},_getVeryLastChild:function(a){if(a.lastChild){return this._getVeryLastChild(a.lastChild)}return a},_getFirstRealChild:function(b){var a=b.firstChild;while(a&&a.nodeType==3&&a.nodeValue==""){a=a.nextSibling}return a},_getLastRealChild:function(b){var a=b.lastChild;while(a&&a.nodeType==3&&a.nodeValue==""){a=a.previousSibling}return a},_getVeryFirstRealChild:function(b){var a=this._getFirstRealChild(b);if(a){return this._getVeryFirstRealChild(a)}return b},_getVeryLastRealChild:function(b){var a=this._getLastRealChild(b);if(a){return this._getVeryLastChild(a)}return b},_getLineStartInfo:function(f){var h=null;var a=f;var g=f;var e=false;var d=this.rxLineBreaker;function b(j){if(!j){return}if(h){return}if(d.test(j.tagName)){g=j;h=a;e=true;return}else{a=j}c(j.previousSibling);if(h){return}b(nhn.DOMFix.parentNode(j))}function c(k){if(!k){return}if(h){return}if(d.test(k.tagName)){g=k;h=a;e=false;return}if(k.firstChild&&k.tagName!="TABLE"){var j=k.lastChild;while(j&&!h){c(j);j=j.previousSibling}}else{a=k}if(!h){c(k.previousSibling)}}if(d.test(f.tagName)){h=f}else{b(f)}return{oNode:h,oLineBreaker:g,bParentBreak:e}},_getLineEndInfo:function(f){var b=null;var a=f;var g=f;var e=false;var d=this.rxLineBreaker;function h(j){if(!j){return}if(b){return}if(d.test(j.tagName)){g=j;b=a;e=true;return}else{a=j}c(j.nextSibling);if(b){return}h(nhn.DOMFix.parentNode(j))}function c(k){if(!k){return}if(b){return}if(d.test(k.tagName)){g=k;b=a;e=false;return}if(k.firstChild&&k.tagName!="TABLE"){var j=k.firstChild;while(j&&!b){c(j);j=j.nextSibling}}else{a=k}if(!b){c(k.nextSibling)}}if(d.test(f.tagName)){b=f}else{h(f)}return{oNode:b,oLineBreaker:g,bParentBreak:e}},getLineInfo:function(h){var h=h||false;var b=this.getStartNode();var e=this.getEndNode();if(!b){b=this.getNodeAroundRange(!h,true)}if(!e){e=this.getNodeAroundRange(!h,true)}var j=this._getLineStartInfo(b);var f=j.oNode;var c=this._getLineEndInfo(e);var a=c.oNode;if(b!=f||e!=a){var g=this._compareEndPoint(nhn.DOMFix.parentNode(f),this._getPosIdx(f),this.endContainer,this.endOffset);var d=this._compareEndPoint(nhn.DOMFix.parentNode(a),this._getPosIdx(a)+1,this.startContainer,this.startOffset);if(!(g<=0&&d>=0)){b=this.getNodeAroundRange(false,true);e=this.getNodeAroundRange(false,true);j=this._getLineStartInfo(b);c=this._getLineEndInfo(e)}}return{oStart:j,oEnd:c}},_findSingleChild:function(f){if(!f){return null}var b=null;for(var c=0,a=0,g,d,e=f.childNodes;(d=e[c]);c++){g=d.nodeValue;if(this._rxCursorHolder.test(g)){continue}else{b=d;a++}if(a>1){return null}}return b},_hasCursorHolderOnly:function(a){if(!a||a.nodeType!==1){return false}if(this._rxCursorHolder.test(a.innerHTML)){return true}else{return this._hasCursorHolderOnly(this._findSingleChild(a))}}}).extend(nhn.W3CDOMRange);nhn.BrowserSelection=function(a){this.init=function(b){this._window=b||window;this._document=this._window.document};this.init(a);if(!!this._document.createRange){nhn.BrowserSelectionImpl_FF.apply(this)}else{nhn.BrowserSelectionImpl_IE.apply(this)}this.selectRange=function(b){this.selectNone();this.addRange(b)};this.selectionLoaded=true;if(!this._oSelection){this.selectionLoaded=false}};nhn.BrowserSelectionImpl_FF=function(){this._oSelection=this._window.getSelection();this.getRangeAt=function(a){a=a||0;try{var b=this._oSelection.getRangeAt(a)}catch(c){return new nhn.W3CDOMRange(this._window)}return this._FFRange2W3CRange(b)};this.addRange=function(a){var b=this._W3CRange2FFRange(a);this._oSelection.addRange(b)};this.selectNone=function(){this._oSelection.removeAllRanges()};this.getCommonAncestorContainer=function(a){var b=this._W3CRange2FFRange(a);return b.commonAncestorContainer};this.isCollapsed=function(a){var b=this._W3CRange2FFRange(a);return b.collapsed};this.compareEndPoints=function(g,d,c,a){var f=this._document.createRange();var b=this._document.createRange();f.setStart(g,d);b.setStart(c,a);f.collapse(true);b.collapse(true);try{return f.compareBoundaryPoints(1,b)}catch(h){return 1}};this._FFRange2W3CRange=function(b){var a=new nhn.W3CDOMRange(this._window);a.setStart(b.startContainer,b.startOffset,true);a.setEnd(b.endContainer,b.endOffset,true);return a};this._W3CRange2FFRange=function(a){var b=this._document.createRange();b.setStart(a.startContainer,a.startOffset);b.setEnd(a.endContainer,a.endOffset);return b}};nhn.BrowserSelectionImpl_IE=function(){this._oSelection=this._document.selection;this.oLastRange={oBrowserRange:null,elStartContainer:null,nStartOffset:-1,elEndContainer:null,nEndOffset:-1};this._updateLastRange=function(b,a){this.oLastRange.oBrowserRange=b;this.oLastRange.elStartContainer=a.startContainer;this.oLastRange.nStartOffset=a.startOffset;this.oLastRange.elEndContainer=a.endContainer;this.oLastRange.nEndOffset=a.endOffset};this.getRangeAt=function(b){b=b||0;var a,c;if(this._oSelection.type=="Control"){a=new nhn.W3CDOMRange(this._window);var d=this._oSelection.createRange().item(b);if(!d||d.ownerDocument!=this._document){return a}a.selectNode(d);return a}else{c=this._oSelection.createRange();var d=c.parentElement();if(!d||d.ownerDocument!=this._document){a=new nhn.W3CDOMRange(this._window);return a}a=this._IERange2W3CRange(c);return a}};this.addRange=function(a){var b=this._W3CRange2IERange(a);b.select()};this.selectNone=function(){this._oSelection.empty()};this.getCommonAncestorContainer=function(a){return this._W3CRange2IERange(a).parentElement()};this.isCollapsed=function(a){var c=this._W3CRange2IERange(a);var b=c.duplicate();b.collapse();return c.isEqual(b)};this.compareEndPoints=function(d,c,b,a){var f,e;if(d===this.oLastRange.elStartContainer&&c===this.oLastRange.nStartOffset){f=this.oLastRange.oBrowserRange.duplicate();f.collapse(true)}else{if(d===this.oLastRange.elEndContainer&&c===this.oLastRange.nEndOffset){f=this.oLastRange.oBrowserRange.duplicate();f.collapse(false)}else{f=this._getIERangeAt(d,c)}}if(b===this.oLastRange.elStartContainer&&a===this.oLastRange.nStartOffset){e=this.oLastRange.oBrowserRange.duplicate();e.collapse(true)}else{if(b===this.oLastRange.elEndContainer&&a===this.oLastRange.nEndOffset){e=this.oLastRange.oBrowserRange.duplicate();e.collapse(false)}else{e=this._getIERangeAt(b,a)}}return f.compareEndPoints("StartToStart",e)};this._W3CRange2IERange=function(a){if(this.oLastRange.elStartContainer===a.startContainer&&this.oLastRange.nStartOffset===a.startOffset&&this.oLastRange.elEndContainer===a.endContainer&&this.oLastRange.nEndOffset===a.endOffset){return this.oLastRange.oBrowserRange}var b=this._getIERangeAt(a.startContainer,a.startOffset);var c=this._getIERangeAt(a.endContainer,a.endOffset);b.setEndPoint("EndToEnd",c);this._updateLastRange(b,a);return b};this._getIERangeAt=function(f,d){var c=this._document.body.createTextRange();var b=this._getSelectableNodeAndOffsetForIE(f,d);var e=b.oSelectableNodeForIE;var a=b.iOffsetForIE;c.moveToElementText(e);c.collapse(b.bCollapseToStart);c.moveStart("character",a);return c};this._getSelectableNodeAndOffsetForIE=function(e,g){var a=null;var d=null;var b=0;if(e.nodeType==3){a=nhn.DOMFix.parentNode(e);d=nhn.DOMFix.childNodes(a);b=d.length}else{a=e;d=nhn.DOMFix.childNodes(a);b=(g=0){break}g=k[j]}var n=j;if(n!==0&&k[n-1].nodeType==3){var a=this._document.body.createTextRange();var d=null;if(g){a.moveToElementText(g);a.collapse(false);d=g.nextSibling}else{a.moveToElementText(o);a.collapse(true);d=o.firstChild}var m=p.duplicate();m.setEndPoint("StartToStart",a);var b=m.text.replace(/[\r\n]/g,"").length;while(b>d.nodeValue.length&&d.nextSibling){b-=d.nodeValue.length;d=d.nextSibling}var l=d.nodeValue;if(f&&d.nextSibling&&d.nextSibling.nodeType==3&&b==d.nodeValue.length){b-=d.nodeValue.length;d=d.nextSibling}o=d;h=b}else{o=p.parentElement();h=n}return{oContainer:o,iOffset:h}}};nhn.DOMFix=new (jindo.$Class({$init:function(){if(jindo.$Agent().navigator().ie||jindo.$Agent().navigator().opera){this.childNodes=this._childNodes_Fix;this.parentNode=this._parentNode_Fix}else{this.childNodes=this._childNodes_Native;this.parentNode=this._parentNode_Native}},_parentNode_Native:function(a){return a.parentNode},_parentNode_Fix:function(a){if(!a){return a}while(a.previousSibling){a=a.previousSibling}return a.parentNode},_childNodes_Native:function(a){return a.childNodes},_childNodes_Fix:function(a){var c=null;var b=0;if(a){var c=[];a=a.firstChild;while(a){c[b++]=a;a=a.nextSibling}}return c}}))();nhn.husky.CorePlugin=jindo.$Class({name:"CorePlugin",htLazyLoadRequest_plugins:{},htLazyLoadRequest_allFiles:{},htHTMLLoaded:{},$AFTER_MSG_APP_READY:function(){this.oApp.exec("EXEC_ON_READY_FUNCTION",[])},$ON_ADD_APP_PROPERTY:function(a,b){this.oApp[a]=b},$ON_REGISTER_BROWSER_EVENT:function(d,e,b,c,a){this.oApp.registerBrowserEvent(d,e,b,c,a)},$ON_DISABLE_MESSAGE:function(a){this.oApp.disableMessage(a,true)},$ON_ENABLE_MESSAGE:function(a){this.oApp.disableMessage(a,false)},$ON_LOAD_FULL_PLUGIN:function(f,b,e,c,d){var g=c.$this||c;var a=f[0];if(!this.htLazyLoadRequest_plugins[a]){this.htLazyLoadRequest_plugins[a]={nStatus:1,sContents:""}}if(this.htLazyLoadRequest_plugins[a].nStatus===2){this.oApp.exec("MSG_FULL_PLUGIN_LOADED",[a,b,e,c,d,false])}else{this._loadFullPlugin(f,b,e,c,d,0)}},_loadFullPlugin:function(f,a,e,c,d,b){jindo.LazyLoading.load(nhn.husky.SE2M_Configuration.LazyLoad.sJsBaseURI+"/"+f[b],jindo.$Fn(function(o,h,n,l,m,k){var j=o[k];var g=o[0];if(k==o.length-1){this.htLazyLoadRequest_plugins[g].nStatus=2;this.oApp.exec("MSG_FULL_PLUGIN_LOADED",[o,h,n,l,m]);return}this._loadFullPlugin(o,h,n,l,m,k+1)},this).bind(f,a,e,c,d,b),"utf-8")},$ON_MSG_FULL_PLUGIN_LOADED:function(aFilenames,sClassName,sMsgName,oThisRef,oArguments,oRes){var oPluginRef=oThisRef.$this||oThisRef;var sFilename=aFilenames;for(var i=0,nLen=oThisRef._huskyFLT.length;ili>button")}},$LOCAL_BEFORE_FIRST:function(a){var c=jindo.$$(">ul>li[class*="+this.sUIClassPrefix+"]>button",this.elTextTool);var b=c.length;this.elFirstToolbarItem=this.elFirstToolbarItem||c[0];this.elLastToolbarItem=c[b-1];this.oApp.registerBrowserEvent(this.toolbarArea,"keydown","NAVIGATE_TOOLBAR",[])},$init:function(a){this.htUIList={};this.htWrappedUIList={};this.aUICmdMap={};this._assignHTMLElements(a);this._setRoundedCornerButton()},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.toolbarArea,"mouseover","EVENT_TOOLBAR_MOUSEOVER",[]);this.oApp.registerBrowserEvent(this.toolbarArea,"mouseout","EVENT_TOOLBAR_MOUSEOUT",[]);this.oApp.registerBrowserEvent(this.toolbarArea,"mousedown","EVENT_TOOLBAR_MOUSEDOWN",[]);this.oApp.exec("ADD_APP_PROPERTY",["getToolbarButtonByUIName",jindo.$Fn(this.getToolbarButtonByUIName,this).bind()]);var a=jindo.$$.getSingle(".se2_tool");this.oApp.exec("REGISTER_HOTKEY",["esc","FOCUS_EDITING_AREA",[],a])},$ON_NAVIGATE_TOOLBAR:function(b){var a=9;if((b.element==this.elLastToolbarItem)&&(b.key().keyCode==a)){if(b.key().shift){}else{this.elFirstToolbarItem.focus();b.stopDefault()}}if(b.element==this.elFirstToolbarItem&&(b.key().keyCode==a)){if(b.key().shift){b.stopDefault();this.elLastToolbarItem.focus()}}},$ON_FOCUS_EDITING_AREA:function(){this.oApp.exec("FOCUS")},$ON_TOGGLE_TOOLBAR_ACTIVE_LAYER:function(b,d,e,a,f,c){this.oApp.exec("TOGGLE_ACTIVE_LAYER",[b,"MSG_TOOLBAR_LAYER_SHOWN",[b,d,e,a],f,c])},$ON_MSG_TOOLBAR_LAYER_SHOWN:function(c,d,b,a){this.oApp.exec("POSITION_TOOLBAR_LAYER",[c,d]);if(b){this.oApp.exec(b,a)}},$ON_SHOW_TOOLBAR_ACTIVE_LAYER:function(a,d,c,b){this.oApp.exec("SHOW_ACTIVE_LAYER",[a,d,c]);this.oApp.exec("POSITION_TOOLBAR_LAYER",[a,b])},$ON_ENABLE_UI:function(a){this._enableUI(a)},$ON_DISABLE_UI:function(a){this._disableUI(a)},$ON_SELECT_UI:function(a){var b=this.htWrappedUIList[a];if(!b){return}b.removeClass("hover");b.addClass("active")},$ON_DESELECT_UI:function(a){var b=this.htWrappedUIList[a];if(!b){return}b.removeClass("active")},$ON_TOGGLE_UI_SELECTED:function(a){var b=this.htWrappedUIList[a];if(!b){return}if(b.hasClass("active")){b.removeClass("active")}else{b.removeClass("hover");b.addClass("active")}},$ON_ENABLE_ALL_UI:function(b){if(this.nUIStatus===1){return}var c,a;b=b||{};var d=jindo.$A(b.aExceptions||[]);for(c in this.htUIList){if(c&&!d.has(c)){this._enableUI(c)}}this.nUIStatus=1},$ON_DISABLE_ALL_UI:function(b){if(this.nUIStatus===2){return}var c;b=b||{};var d=jindo.$A(b.aExceptions||[]);var a=b.bLeaveActiveLayer||false;if(!a){this.oApp.exec("HIDE_ACTIVE_LAYER",[])}for(c in this.htUIList){if(c&&!d.has(c)){this._disableUI(c)}}this.nUIStatus=2},$ON_MSG_STYLE_CHANGED:function(b,a){if(a==="@^"){this.oApp.exec("SELECT_UI",[b])}else{this.oApp.exec("DESELECT_UI",[b])}},$ON_POSITION_TOOLBAR_LAYER:function(f,j){var b,k,e,a;f=jindo.$(f);j=j||{};var d=jindo.$(j.elBtn);var g=j.sAlign;var c=-1;if(!f){return}if(d&&d.tagName&&d.tagName=="BUTTON"){d.parentNode.appendChild(f)}var h=jindo.$Element(f);if(g!="right"){f.style.left="0";b=h.offset().left;k=b+f.offsetWidth;e=this.welToolbarArea.offset().left;a=e+this.toolbarArea.offsetWidth;if(k>a){h.css("left",(a-k-c)+"px")}if(ba){h.css("right",-1*(a-k-c)+"px")}if(b2||a.parentNode.className.match(/se2_pair/))){return}a=a.parentNode}this.oApp.exec("HIDE_ACTIVE_LAYER_IF_NOT_CHILD",[b.element])},_enableUI:function(d){var b,c;this.nUIStatus=0;var e=this.htWrappedUIList[d];var g=this.htUIList[d];if(!e){return}e.removeClass("off");var a=g.getElementsByTagName("BUTTON");for(b=0,c=a.length;bul>li[class*="+this.sUIClassPrefix+"]:only-child",this.elTextTool);for(e=0,g=f.length;espan._buttonRound",d)).addClass("tool_bg")}b=jindo.$$("ul>li[class*="+this.sUIClassPrefix+"]:first-child",this.elTextTool);for(e=0,g=b.length;espan._buttonRound",d)).addClass("tool_bg")}h=jindo.$$("ul>li[class*="+this.sUIClassPrefix+"]:last-child",this.elTextTool);for(e=0,g=h.length;espan._buttonRound",d)).addClass("tool_bg")}},$ON_REGISTER_UI_EVENT:function(c,d,e,b){if(!this.htUIList[c]){return}var a;if(!this.aUICmdMap[c]){this.aUICmdMap[c]=[]}this.aUICmdMap[c][this.aUICmdMap[c].length]=e;a=jindo.$$.getSingle("button",this.htUIList[c]);if(!a){return}this.oApp.registerBrowserEvent(a,d,e,b)},getToolbarButtonByUIName:function(a){return jindo.$$.getSingle("BUTTON",this.htUIList[a])}});nhn.husky.SE2M_EditingModeChanger=jindo.$Class({name:"SE2M_EditingModeChanger",htConversionMode:null,$init:function(b,a){this.htConversionMode=a;this._assignHTMLElements(b)},_assignHTMLElements:function(a){a=jindo.$(a)||document;this.elWYSIWYGButton=jindo.$$.getSingle("BUTTON.se2_to_editor",a);this.elHTMLSrcButton=jindo.$$.getSingle("BUTTON.se2_to_html",a);this.elTEXTButton=jindo.$$.getSingle("BUTTON.se2_to_text",a);this.elModeToolbar=jindo.$$.getSingle("DIV.se2_conversion_mode",a);this.welWYSIWYGButtonLi=jindo.$Element(this.elWYSIWYGButton.parentNode);this.welHTMLSrcButtonLi=jindo.$Element(this.elHTMLSrcButton.parentNode);this.welTEXTButtonLi=jindo.$Element(this.elTEXTButton.parentNode)},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["isUseModeChanger",jindo.$Fn(this.isUseModeChanger,this).bind()])},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elWYSIWYGButton,"click","EVENT_CHANGE_EDITING_MODE_CLICKED",["WYSIWYG"]);this.oApp.registerBrowserEvent(this.elHTMLSrcButton,"click","EVENT_CHANGE_EDITING_MODE_CLICKED",["HTMLSrc"]);this.oApp.registerBrowserEvent(this.elTEXTButton,"click","EVENT_CHANGE_EDITING_MODE_CLICKED",["TEXT",false]);this.showModeChanger();if(this.isUseModeChanger()===false&&this.oApp.isUseVerticalResizer()===false){this.elModeToolbar.style.display="none"}},showModeChanger:function(){if(this.isUseModeChanger()){this.elWYSIWYGButton.style.display="block";this.elHTMLSrcButton.style.display="block";this.elTEXTButton.style.display="block"}else{this.elWYSIWYGButton.style.display="none";this.elHTMLSrcButton.style.display="none";this.elTEXTButton.style.display="none"}},isUseModeChanger:function(){return(typeof(this.htConversionMode)==="undefined"||typeof(this.htConversionMode.bUseModeChanger)==="undefined"||this.htConversionMode.bUseModeChanger===true)?true:false},$ON_EVENT_CHANGE_EDITING_MODE_CLICKED:function(b,a){if(b=="TEXT"){var c=this.oApp.getIR();if(c.length>0&&!a){if(!confirm(this.oApp.$MSG("SE2M_EditingModeChanger.confirmTextMode"))){return false}}this.oApp.exec("CHANGE_EDITING_MODE",[b])}else{this.oApp.exec("CHANGE_EDITING_MODE",[b])}if("HTMLSrc"==b){this.oApp.exec("MSG_NOTIFY_CLICKCR",["htmlmode"])}else{if("TEXT"==b){this.oApp.exec("MSG_NOTIFY_CLICKCR",["textmode"])}else{this.oApp.exec("MSG_NOTIFY_CLICKCR",["editormode"])}}},$ON_DISABLE_ALL_UI:function(a){a=a||{};var b=jindo.$A(a.aExceptions||[]);if(b.has("mode_switcher")){return}if(this.oApp.getEditingMode()=="WYSIWYG"){this.welWYSIWYGButtonLi.removeClass("active");this.elHTMLSrcButton.disabled=true;this.elTEXTButton.disabled=true}else{if(this.oApp.getEditingMode()=="TEXT"){this.welTEXTButtonLi.removeClass("active");this.elWYSIWYGButton.disabled=true;this.elHTMLSrcButton.disabled=true}else{this.welHTMLSrcButtonLi.removeClass("active");this.elWYSIWYGButton.disabled=true;this.elTEXTButton.disabled=true}}},$ON_ENABLE_ALL_UI:function(){if(this.oApp.getEditingMode()=="WYSIWYG"){this.welWYSIWYGButtonLi.addClass("active");this.elHTMLSrcButton.disabled=false;this.elTEXTButton.disabled=false}else{if(this.oApp.getEditingMode()=="TEXT"){this.welTEXTButtonLi.addClass("active");this.elWYSIWYGButton.disabled=false;this.elHTMLSrcButton.disabled=false}else{this.welHTMLSrcButtonLi.addClass("active");this.elWYSIWYGButton.disabled=false;this.elTEXTButton.disabled=false}}},$ON_CHANGE_EDITING_MODE:function(a){if(a=="HTMLSrc"){this.welWYSIWYGButtonLi.removeClass("active");this.welHTMLSrcButtonLi.addClass("active");this.welTEXTButtonLi.removeClass("active");this.elWYSIWYGButton.disabled=false;this.elHTMLSrcButton.disabled=true;this.elTEXTButton.disabled=false;this.oApp.exec("HIDE_ALL_DIALOG_LAYER");this.oApp.exec("DISABLE_ALL_UI",[{aExceptions:["mode_switcher"]}])}else{if(a=="TEXT"){this.welWYSIWYGButtonLi.removeClass("active");this.welHTMLSrcButtonLi.removeClass("active");this.welTEXTButtonLi.addClass("active");this.elWYSIWYGButton.disabled=false;this.elHTMLSrcButton.disabled=false;this.elTEXTButton.disabled=true;this.oApp.exec("HIDE_ALL_DIALOG_LAYER");this.oApp.exec("DISABLE_ALL_UI",[{aExceptions:["mode_switcher"]}])}else{this.welWYSIWYGButtonLi.addClass("active");this.welHTMLSrcButtonLi.removeClass("active");this.welTEXTButtonLi.removeClass("active");this.elWYSIWYGButton.disabled=true;this.elHTMLSrcButton.disabled=false;this.elTEXTButton.disabled=false;this.oApp.exec("RESET_STYLE_STATUS");this.oApp.exec("ENABLE_ALL_UI",[])}}}});nhn.husky.SE_EditingAreaManager=jindo.$Class({name:"SE_EditingAreaManager",oActivePlugin:null,elContentsField:null,bIsDirty:false,bAutoResize:false,$init:function(g,f,a,e,d){this.sDefaultEditingMode=g;this.elContentsField=jindo.$(f);this._assignHTMLElements(d);this.fOnBeforeUnload=e;this.oEditingMode={};this.elContentsField.style.display="none";this.nMinWidth=parseInt((a.nMinWidth||60),10);this.nMinHeight=parseInt((a.nMinHeight||60),10);var b=this._getSize([a.nWidth,a.width,this.elEditingAreaContainer.offsetWidth],this.nMinWidth);var c=this._getSize([a.nHeight,a.height,this.elEditingAreaContainer.offsetHeight],this.nMinHeight);this.elEditingAreaContainer.style.width=b.nSize+b.sUnit;this.elEditingAreaContainer.style.height=c.nSize+c.sUnit;if(b.sUnit==="px"){d.style.width=(b.nSize+2)+"px"}else{if(b.sUnit==="%"){d.style.minWidth=this.nMinWidth+"px"}}},_getSize:function(c,b){var e,g,h,d,a,f="px";b=parseInt(b,10);for(e=0,g=c.length;eli.active",this.toolbarArea,{oneTimeOffCache:true});if(b){var a=b.parentNode}if(a&&(a.className=="se2_itool2"||a.className=="se2_itool4")){this._isLayerReasonablyShown=true}this._fitElementInEditingArea(this.elEditingAreaContainer);this.oApp.exec("STOP_AUTORESIZE_EDITING_AREA");this.oApp.exec("SHOW_EDITING_AREA_COVER");this.elEditingAreaContainer.style.overflow="hidden";this.iStartingHeight=parseInt(this.elEditingAreaContainer.style.height,10)},$ON_STOP_AUTORESIZE_EDITING_AREA:function(){if(!this.bAutoResize){return}this.stopAutoResize();this.bAutoResize=false},startAutoResize:function(){if(!this.bAutoResize||!this.oActivePlugin||typeof this.oActivePlugin.startAutoResize!="function"){return}this.oActivePlugin.startAutoResize()},stopAutoResize:function(){if(!this.bAutoResize||!this.oActivePlugin||typeof this.oActivePlugin.stopAutoResize!="function"){return}this.oActivePlugin.stopAutoResize()},$ON_RESIZE_EDITING_AREA:function(b,a){if(b!==null&&typeof b!=="undefined"){this._resizeWidth(b,"px")}if(a!==null&&typeof a!=="undefined"){this._resizeHeight(a,"px")}this._fitElementInEditingArea(this.elResizingBoard);this._setEditingAreaDimension()},_resizeWidth:function(c,a){var b=parseInt(c,10);if(bthis.oApp.elEditingAreaContainer.offsetHeight){if(typeof a=="number"){b.style.top=c-b.offsetHeight-a+"px"}else{b.style.top=this.oApp.elEditingAreaContainer.offsetHeight-b.offsetHeight+"px"}}var d=parseInt(b.style.left,10);if(d+b.offsetWidth>this.oApp.elEditingAreaContainer.offsetWidth){b.style.left=this.oApp.elEditingAreaContainer.offsetWidth-b.offsetWidth+"px"}},$ON_EVENT_EDITING_AREA_KEYDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_EVENT_EDITING_AREA_MOUSEDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_EVENT_EDITING_AREA_SCROLL:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},_setEditingAreaDimension:function(a){a=a||this.oActivePlugin;this._fitElementInEditingArea(a.elEditingArea)},_fitElementInEditingArea:function(a){a.style.height=this.elEditingAreaContainer.offsetHeight+"px"},attachDocumentEvents:function(a){this.oApp.registerBrowserEvent(a,"click","EVENT_EDITING_AREA_CLICK");this.oApp.registerBrowserEvent(a,"dblclick","EVENT_EDITING_AREA_DBLCLICK");this.oApp.registerBrowserEvent(a,"mousedown","EVENT_EDITING_AREA_MOUSEDOWN");this.oApp.registerBrowserEvent(a,"mousemove","EVENT_EDITING_AREA_MOUSEMOVE");this.oApp.registerBrowserEvent(a,"mouseup","EVENT_EDITING_AREA_MOUSEUP");this.oApp.registerBrowserEvent(a,"mouseout","EVENT_EDITING_AREA_MOUSEOUT");this.oApp.registerBrowserEvent(a,"mousewheel","EVENT_EDITING_AREA_MOUSEWHEEL");this.oApp.registerBrowserEvent(a,"keydown","EVENT_EDITING_AREA_KEYDOWN");this.oApp.registerBrowserEvent(a,"keypress","EVENT_EDITING_AREA_KEYPRESS");this.oApp.registerBrowserEvent(a,"keyup","EVENT_EDITING_AREA_KEYUP");this.oApp.registerBrowserEvent(a,"scroll","EVENT_EDITING_AREA_SCROLL")},createCoverDiv:function(){this.elResizingBoard=document.createElement("DIV");this.elEditingAreaContainer.insertBefore(this.elResizingBoard,this.elEditingAreaContainer.firstChild);this.elResizingBoard.style.position="absolute";this.elResizingBoard.style.background="#000000";this.elResizingBoard.style.zIndex=100;this.elResizingBoard.style.border=1;this.elResizingBoard.style.opacity=0;this.elResizingBoard.style.filter="alpha(opacity=0.0)";this.elResizingBoard.style.MozOpacity=0;this.elResizingBoard.style["-moz-opacity"]=0;this.elResizingBoard.style["-khtml-opacity"]=0;this._fitElementInEditingArea(this.elResizingBoard);this.elResizingBoard.style.width=this.elEditingAreaContainer.offsetWidth+"px";this.elResizingBoard.style.display="none"},$ON_GET_COVER_DIV:function(a,b){if(!!this.elResizingBoard){b[a]=this.elResizingBoard}},getIR:function(){if(!this.oActivePlugin){return""}return this.oActivePlugin.getIR()},setIR:function(b,a){this.oApp.exec("SET_IR",[b,a])},getRawContents:function(){if(!this.oActivePlugin){return""}return this.oActivePlugin.getRawContents()},getContents:function(){var b=this.oApp.getIR();var a;if(this.oApp.applyConverter){a=this.oApp.applyConverter("IR_TO_DB",b,this.oApp.getWYSIWYGDocument())}else{a=b}a=this._cleanContents(a);return a},_cleanContents:function(a){return a.replace(new RegExp("( ]*>)"+unescape("%uFEFF")+"","ig"),"$1")},setContents:function(a,b){var c;if(this.oApp.applyConverter){c=this.oApp.applyConverter("DB_TO_IR",a,this.oApp.getWYSIWYGDocument())}else{c=a}this.oApp.exec("SET_IR",[c,b])},getEditingMode:function(){return this.oActivePlugin.sMode},getEditingAreaWidth:function(){return this.elEditingAreaContainer.offsetWidth},getEditingAreaHeight:function(){return this.elEditingAreaContainer.offsetHeight}});nhn.husky.SE_EditingAreaVerticalResizer=jindo.$Class({name:"SE_EditingAreaVerticalResizer",oResizeGrip:null,sCookieNotice:"bHideResizeNotice",nEditingAreaMinHeight:null,htConversionMode:null,$init:function(b,a){this.htConversionMode=a;this._assignHTMLElements(b)},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["isUseVerticalResizer",jindo.$Fn(this.isUseVerticalResizer,this).bind()])},$ON_MSG_APP_READY:function(){if(jindo.$Agent().navigator().msafari){jindo.$Element(this.oResizeGrip).first().text("입력창 높이 자동 조정 바");this.oResizeGrip.disabled=true;return}this.$FnMouseDown=jindo.$Fn(this._mousedown,this);this.$FnMouseMove=jindo.$Fn(this._mousemove,this);this.$FnMouseUp=jindo.$Fn(this._mouseup,this);this.$FnMouseOver=jindo.$Fn(this._mouseover,this);this.$FnMouseOut=jindo.$Fn(this._mouseout,this);this.$FnMouseDown.attach(this.oResizeGrip,"mousedown");this.$FnMouseOver.attach(this.oResizeGrip,"mouseover");this.$FnMouseOut.attach(this.oResizeGrip,"mouseout");this.oApp.exec("REGISTER_HOTKEY",["shift+esc","FOCUS_RESIZER"]);this.oApp.exec("ADD_APP_PROPERTY",["checkResizeGripPosition",jindo.$Fn(this.checkResizeGripPosition,this).bind()]);if(!!this.welNoticeLayer&&!Number(jindo.$Cookie().get(this.sCookieNotice))){this.welNoticeLayer.delegate("click","BUTTON.bt_clse",jindo.$Fn(this._closeNotice,this).bind());this.welNoticeLayer.show()}if(!!this.oApp.getEditingAreaHeight){this.nEditingAreaMinHeight=this.oApp.getEditingAreaHeight()}this.showVerticalResizer();if(this.isUseVerticalResizer()===false&&this.oApp.isUseModeChanger()===false){this.elModeToolbar.style.display="none"}},showVerticalResizer:function(){if(this.isUseVerticalResizer()){this.oResizeGrip.style.display="block"}else{this.oResizeGrip.style.display="none"}},isUseVerticalResizer:function(){return(typeof(this.htConversionMode)==="undefined"||typeof(this.htConversionMode.bUseVerticalResizer)==="undefined"||this.htConversionMode.bUseVerticalResizer===true)?true:false},checkResizeGripPosition:function(b){var a=jindo.$Document();var c=(jindo.$Element(this.oResizeGrip).offset().top-a.scrollPosition().top+25)-a.clientSize().height;if(c<=0){return}if(b){if(this.nEditingAreaMinHeight>this.oApp.getEditingAreaHeight()-c){c=(-1)*(this.nEditingAreaMinHeight-this.oApp.getEditingAreaHeight())}this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED");this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,(-1)*c]);this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED")}this.oApp.exec("STOP_AUTORESIZE_EDITING_AREA")},$ON_FOCUS_RESIZER:function(){this.oApp.exec("IE_HIDE_CURSOR");this.oResizeGrip.focus()},_assignHTMLElements:function(b,a){this.oResizeGrip=jindo.$$.getSingle("BUTTON.husky_seditor_editingArea_verticalResizer",b);this.elModeToolbar=jindo.$$.getSingle("DIV.se2_conversion_mode",b);this.welNoticeLayer=jindo.$Element(jindo.$$.getSingle("DIV.husky_seditor_resize_notice",b));this.welConversionMode=jindo.$Element(this.oResizeGrip.parentNode)},_mouseover:function(a){a.stopBubble();this.welConversionMode.addClass("controller_on")},_mouseout:function(a){a.stopBubble();this.welConversionMode.removeClass("controller_on")},_mousedown:function(a){this.iStartHeight=a.pos().clientY;this.iStartHeightOffset=a.pos().layerY;this.$FnMouseMove.attach(document,"mousemove");this.$FnMouseUp.attach(document,"mouseup");this.iStartHeight=a.pos().clientY;this.oApp.exec("HIDE_ACTIVE_LAYER");this.oApp.exec("HIDE_ALL_DIALOG_LAYER");this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])},_mousemove:function(b){var a=b.pos().clientY-this.iStartHeight;this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,a])},_mouseup:function(a){this.$FnMouseMove.detach(document,"mousemove");this.$FnMouseUp.detach(document,"mouseup");this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])},_closeNotice:function(){this.welNoticeLayer.hide();jindo.$Cookie().set(this.sCookieNotice,1,365*10)}});nhn.husky.SE_EditingArea_HTMLSrc=jindo.$Class({name:"SE_EditingArea_HTMLSrc",sMode:"HTMLSrc",bAutoResize:false,nMinHeight:null,$init:function(a){this.elEditingArea=jindo.$(a)},$BEFORE_MSG_APP_READY:function(){this.oNavigator=jindo.$Agent().navigator();this.oApp.exec("REGISTER_EDITING_AREA",[this])},$ON_MSG_APP_READY:function(){if(!!this.oApp.getEditingAreaHeight){this.nMinHeight=this.oApp.getEditingAreaHeight()}},$ON_CHANGE_EDITING_MODE:function(a){if(a==this.sMode){this.elEditingArea.style.display="block"}else{this.elEditingArea.style.display="none"}},$AFTER_CHANGE_EDITING_MODE:function(a,b){if(a==this.sMode&&!b){var c=new TextRange(this.elEditingArea);c.setSelection(0,0)}},startAutoResize:function(){var a={nMinHeight:this.nMinHeight,wfnCallback:jindo.$Fn(this.oApp.checkResizeGripPosition,this).bind()};if(this.oNavigator.msafari){a.wfnCallback=function(){}}this.bAutoResize=true;this.AutoResizer=new nhn.husky.AutoResizer(this.elEditingArea,a);this.AutoResizer.bind()},stopAutoResize:function(){this.AutoResizer.unbind()},getIR:function(){var a=this.getRawContents();if(this.oApp.applyConverter){a=this.oApp.applyConverter(this.sMode+"_TO_IR",a,this.oApp.getWYSIWYGDocument())}return a},setIR:function(c){if(c.toLowerCase()===" "||c.toLowerCase()===" "||c.toLowerCase()==="
"||c.toLowerCase()===""){c=""}var b=jindo.$Agent().navigator();if(b.ie&&b.nativeVersion==11&&document.documentMode==11){c=c.replace(/(
$)/,"")}var a=c;if(this.oApp.applyConverter){a=this.oApp.applyConverter("IR_TO_"+this.sMode,a,this.oApp.getWYSIWYGDocument())}this.setRawContents(a)},setRawContents:function(a){if(typeof a!=="undefined"){this.elEditingArea.value=a}},getRawContents:function(){return this.elEditingArea.value},focus:function(){this.elEditingArea.focus()}});if(typeof window.TextRange=="undefined"){window.TextRange={}}TextRange=function(b,a){this._o=b;this._oDoc=(a||document)};TextRange.prototype.getSelection=function(){var d=this._o;var b=[-1,-1];if(isNaN(this._o.selectionStart)){d.focus();var a=this._oDoc.body.createTextRange();var c=null;c=this._oDoc.selection.createRange().duplicate();a.moveToElementText(d);c.collapse(true);a.setEndPoint("EndToEnd",c);b[0]=a.text.length;c=this._oDoc.selection.createRange().duplicate();a.moveToElementText(d);c.collapse(false);a.setEndPoint("EndToEnd",c);b[1]=a.text.length;d.blur()}else{b[0]=d.selectionStart;b[1]=d.selectionEnd}return b};TextRange.prototype.setSelection=function(d,a){var c=this._o;if(typeof a=="undefined"){a=d}if(c.setSelectionRange){c.setSelectionRange(d,a)}else{if(c.createTextRange){var b=c.createTextRange();b.collapse(true);b.moveStart("character",d);b.moveEnd("character",a-d);b.select();c.blur()}}};TextRange.prototype.copy=function(){var a=this.getSelection();return this._o.value.substring(a[0],a[1])};TextRange.prototype.paste=function(c){var h=this._o;var f=this.getSelection();var e=h.value;var g=e.substr(0,f[0]);var d=e.substr(f[1]);e=g+c+d;h.value=e;var j=0;if(typeof this._oDoc.body.style.maxHeight=="undefined"){var b=g.match(/\n/gi);j=(b!==null?b.length:0)}this.setSelection(f[0]+c.length-j)};TextRange.prototype.cut=function(){var a=this.copy();this.paste("");return a};nhn.husky.SE_EditingArea_TEXT=jindo.$Class({name:"SE_EditingArea_TEXT",sMode:"TEXT",sRxConverter:"@[0-9]+@",bAutoResize:false,nMinHeight:null,$init:function(a){this.elEditingArea=jindo.$(a)},$BEFORE_MSG_APP_READY:function(){this.oNavigator=jindo.$Agent().navigator();this.oApp.exec("REGISTER_EDITING_AREA",[this]);this.oApp.exec("ADD_APP_PROPERTY",["getTextAreaContents",jindo.$Fn(this.getRawContents,this).bind()])},$ON_MSG_APP_READY:function(){if(!!this.oApp.getEditingAreaHeight){this.nMinHeight=this.oApp.getEditingAreaHeight()}},$ON_REGISTER_CONVERTERS:function(){this.oApp.exec("ADD_CONVERTER",["IR_TO_TEXT",jindo.$Fn(this.irToText,this).bind()]);this.oApp.exec("ADD_CONVERTER",["TEXT_TO_IR",jindo.$Fn(this.textToIr,this).bind()])},$ON_CHANGE_EDITING_MODE:function(a){if(a==this.sMode){this.elEditingArea.style.display="block"}else{this.elEditingArea.style.display="none"}},$AFTER_CHANGE_EDITING_MODE:function(a,b){if(a==this.sMode&&!b){var c=new TextRange(this.elEditingArea);c.setSelection(0,0)}},irToText:function(d){var a=d,b=0;var c=a.match(new RegExp(this.sRxConverter));if(c!==null){a=a.replace(new RegExp(this.sRxConverter),"")}a=a.replace(/\r/g,"");a=a.replace(/[\n|\t]/g,"");a=a.replace(/[\v|\f]/g,"");a=a.replace(/ <\/p>/gi,"\n");a=a.replace(/
<\/P>/gi,"\n");a=a.replace(/ /gi,"\n");a=a.replace(/ /gi,"\n");a=a.replace(/<\/p(\s[^\/]*)?>/gi,"\n");a=a.replace(/<\/li(\s[^\/]*)?>/gi,"\n");a=a.replace(/<\/tr(\s[^\/]*)?>/gi,"\n");b=a.lastIndexOf("\n");if(b>-1&&a.substring(b)=="\n"){a=a.substring(0,b)}a=jindo.$S(a).stripTags().toString();a=this.unhtmlSpecialChars(a);if(c!==null){a=c[0]+a}return a},textToIr:function(c){if(!c){return}var a=c,b=null;b=a.match(new RegExp(this.sRxConverter));if(b!==null){a=a.replace(b[0],"")}a=this.htmlSpecialChars(a);a=this._addLineBreaker(a);if(b!==null){a=b[0]+a}return a},_addLineBreaker:function(b){if(this.oApp.sLineBreaker==="BR"){return b.replace(/\r?\n/g," ")}var c=new StringBuffer(),f=b.split("\n"),e=f.length,d="";for(var a=0;a");c.append(f[a]);c.append(" ")}else{if(!jindo.$Agent().navigator().ie){c.append("
")}else{c.append(" ")}}}return c.toString()},startAutoResize:function(){var a={nMinHeight:this.nMinHeight,wfnCallback:jindo.$Fn(this.oApp.checkResizeGripPosition,this).bind()};if(this.oNavigator.msafari){a.wfnCallback=function(){}}this.bAutoResize=true;this.AutoResizer=new nhn.husky.AutoResizer(this.elEditingArea,a);this.AutoResizer.bind()},stopAutoResize:function(){this.AutoResizer.unbind()},getIR:function(){var a=this.getRawContents();if(this.oApp.applyConverter){a=this.oApp.applyConverter(this.sMode+"_TO_IR",a,this.oApp.getWYSIWYGDocument())}return a},setIR:function(b){var a=b;if(this.oApp.applyConverter){a=this.oApp.applyConverter("IR_TO_"+this.sMode,a,this.oApp.getWYSIWYGDocument())}this.setRawContents(a)},setRawContents:function(a){if(typeof a!=="undefined"){this.elEditingArea.value=a}},getRawContents:function(){return this.elEditingArea.value},focus:function(){this.elEditingArea.focus()},htmlSpecialChars:function(a){return a.replace(/&/g,"&").replace(//g,">").replace(/ /g," ")},unhtmlSpecialChars:function(a){return a.replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/&/g,"&")}});nhn.husky.SE_EditingArea_WYSIWYG=jindo.$Class({name:"SE_EditingArea_WYSIWYG",status:nhn.husky.PLUGIN_STATUS.NOT_READY,sMode:"WYSIWYG",iframe:null,doc:null,bStopCheckingBodyHeight:false,bAutoResize:false,nBodyMinHeight:0,nScrollbarWidth:0,iLastUndoRecorded:0,_nIFrameReadyCount:50,bWYSIWYGEnabled:false,$init:function(b){this.iframe=jindo.$(b);var a=jindo.$Agent().navigator();if(a.ie){this.iframe.style.display="none"}this.sBlankPageURL="smart_editor2_inputarea.html";this.sBlankPageURL_EmulateIE7="smart_editor2_inputarea_ie8.html";this.aAddtionalEmulateIE7=[];this.htOptions=nhn.husky.SE2M_Configuration.SE_EditingAreaManager;if(this.htOptions){this.sBlankPageURL=this.htOptions.sBlankPageURL||this.sBlankPageURL;this.sBlankPageURL_EmulateIE7=this.htOptions.sBlankPageURL_EmulateIE7||this.sBlankPageURL_EmulateIE7;this.aAddtionalEmulateIE7=this.htOptions.aAddtionalEmulateIE7||this.aAddtionalEmulateIE7}this.aAddtionalEmulateIE7.push(8);this.sIFrameSrc=this.sBlankPageURL;if(a.ie&&jindo.$A(this.aAddtionalEmulateIE7).has(a.nativeVersion)){this.sIFrameSrc=this.sBlankPageURL_EmulateIE7}var e=this.sIFrameSrc,b=this.iframe,d=jindo.$Fn(this.initIframe,this).bind(),c=jindo.$Fn(function(){this.iframe.src=e},this).bind();if(!a.ie||(a.version>=9&&!!document.addEventListener)){b.addEventListener("load",d,false);b.addEventListener("error",c,false)}else{b.attachEvent("onload",d);b.attachEvent("onerror",c)}b.src=e;this.elEditingArea=b},$BEFORE_MSG_APP_READY:function(){this.oEditingArea=this.iframe.contentWindow.document;this.oApp.exec("REGISTER_EDITING_AREA",[this]);this.oApp.exec("ADD_APP_PROPERTY",["getWYSIWYGWindow",jindo.$Fn(this.getWindow,this).bind()]);this.oApp.exec("ADD_APP_PROPERTY",["getWYSIWYGDocument",jindo.$Fn(this.getDocument,this).bind()]);this.oApp.exec("ADD_APP_PROPERTY",["isWYSIWYGEnabled",jindo.$Fn(this.isWYSIWYGEnabled,this).bind()]);this.oApp.exec("ADD_APP_PROPERTY",["getRawHTMLContents",jindo.$Fn(this.getRawHTMLContents,this).bind()]);this.oApp.exec("ADD_APP_PROPERTY",["setRawHTMLContents",jindo.$Fn(this.setRawHTMLContents,this).bind()]);if(!!this.isWYSIWYGEnabled()){this.oApp.exec("ENABLE_WYSIWYG_RULER",[])}this.oApp.registerBrowserEvent(this.getDocument().body,"paste","EVENT_EDITING_AREA_PASTE")},$ON_MSG_APP_READY:function(){if(!this.oApp.hasOwnProperty("saveSnapShot")){this.$ON_EVENT_EDITING_AREA_MOUSEUP=function(){};this._recordUndo=function(){}}this._bIERangeReset=true;if(this.oApp.oNavigator.ie){jindo.$Fn(function(b){var a=this.iframe.contentWindow.document.selection;if(a&&a.type.toLowerCase()==="control"&&b.key().keyCode===8){this.oApp.exec("EXECCOMMAND",["delete",false,false]);b.stop()}this._bIERangeReset=false},this).attach(this.iframe.contentWindow.document,"keydown");jindo.$Fn(function(a){this._oIERange=null;this._bIERangeReset=true},this).attach(this.iframe.contentWindow.document.body,"mousedown");jindo.$Fn(this._onIEBeforeDeactivate,this).attach(this.iframe.contentWindow.document.body,"beforedeactivate");jindo.$Fn(function(a){this._bIERangeReset=false},this).attach(this.iframe.contentWindow.document.body,"mouseup")}else{}this.fnSetBodyHeight=jindo.$Fn(this._setBodyHeight,this).bind();this.fnCheckBodyChange=jindo.$Fn(this._checkBodyChange,this).bind();this.fnSetBodyHeight();this._setScrollbarWidth()},_setScrollbarWidth:function(){var a=this.getDocument(),b=a.createElement("div");b.style.width="100px";b.style.height="100px";b.style.overflow="scroll";b.style.position="absolute";b.style.top="-9999px";a.body.appendChild(b);this.nScrollbarWidth=b.offsetWidth-b.clientWidth;a.body.removeChild(b)},$AFTER_EVENT_EDITING_AREA_KEYUP:function(a){if(!this.bAutoResize){return}var b=a.key();if((b.keyCode>=33&&b.keyCode<=40)||b.alt||b.ctrl||b.keyCode===16){return}this._setAutoResize()},$AFTER_PASTE_HTML:function(){if(!this.bAutoResize){return}this._setAutoResize()},startAutoResize:function(){this.oApp.exec("STOP_CHECKING_BODY_HEIGHT");this.bAutoResize=true;var a=this.oApp.oNavigator;if(a.ie&&a.version<9){jindo.$Element(this.getDocument().body).css({overflow:"visible"})}else{jindo.$Element(this.getDocument().body).css({overflowX:"visible",overflowY:"hidden"})}this._setAutoResize();this.nCheckBodyInterval=setInterval(this.fnCheckBodyChange,500);this.oApp.exec("START_FLOAT_TOOLBAR")},stopAutoResize:function(){this.bAutoResize=false;clearInterval(this.nCheckBodyInterval);this.oApp.exec("STOP_FLOAT_TOOLBAR");jindo.$Element(this.getDocument().body).css({overflow:"visible",overflowY:"visible"});this.oApp.exec("START_CHECKING_BODY_HEIGHT")},_checkBodyChange:function(){if(!this.bAutoResize){return}var a=this.getDocument().body.innerHTML.length;if(a!==this.nBodyLength){this.nBodyLength=a;this._setAutoResize()}},_getResizeHeight:function(){var d=this.getDocument().body,b,f,a=["width","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textTransform","wordSpacing"],e,c;if(!this.oApp.oNavigator.firefox&&!this.oApp.oNavigator.safari){if(this.oApp.oNavigator.ie&&this.oApp.oNavigator.version===8&&document.documentMode===8){jindo.$Element(d).css("height","0px")}f=parseInt(d.scrollHeight,10);if(f-1){e.lineHeight=(parseInt(e.lineHeight,10)/parseInt(e.fontSize,10))}jindo.$Element(this.elDummy).css(e);this.elDummy.innerHTML=d.innerHTML;f=this.elDummy.scrollHeight;return f},_setAutoResize:function(){var g=this.getDocument().body,c=jindo.$Element(g),h,d,b,f,e=false,a=this.oApp.oNavigator;this.nTopBottomMargin=this.nTopBottomMargin||(parseInt(c.css("marginTop"),10)+parseInt(c.css("marginBottom"),10));this.nBodyMinHeight=this.nBodyMinHeight||(this.oApp.getEditingAreaHeight()-this.nTopBottomMargin);if((a.ie&&a.nativeVersion>=9)||a.chrome){c.css("height","0px");this.iframe.style.height="0px"}h=this._getResizeHeight();if(a.ie){if(h>this.nBodyMinHeight){b=this.oApp.getCurrentStyle();f=parseInt(b.fontSize,10)*b.lineHeight;if(fthis.nBodyMinHeight){b=this.oApp.getCurrentStyle();f=parseInt(b.fontSize,10)*b.lineHeight;if(fa?f-h:d);if(this._isHorizontalScrollbarVisible()){c-=this.nScrollbarWidth}b.css("height",c+"px");setTimeout(this.fnSetBodyHeight,500)},_isHorizontalScrollbarVisible:function(){var a=this.getDocument();if(a.documentElement.clientWidth8){var d=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container").childNodes[0];if((d.tagName=="DIV")&&(d.style.zIndex==1000)){d.parentNode.removeChild(d)}}this.iframe.style.display="block";this.oApp.exec("REFRESH_WYSIWYG",[]);this.oApp.exec("SET_EDITING_WINDOW",[this.getWindow()]);this.oApp.exec("START_CHECKING_BODY_HEIGHT")}else{this.iframe.style.display="none";this.oApp.exec("STOP_CHECKING_BODY_HEIGHT")}},$AFTER_CHANGE_EDITING_MODE:function(a,b){this._oIERange=null},$ON_REFRESH_WYSIWYG:function(){if(!jindo.$Agent().navigator().firefox){return}this._disableWYSIWYG();this._enableWYSIWYG()},$ON_ENABLE_WYSIWYG:function(){this._enableWYSIWYG()},$ON_DISABLE_WYSIWYG:function(){this._disableWYSIWYG()},$ON_IE_HIDE_CURSOR:function(){if(!this.oApp.oNavigator.ie){return}this._onIEBeforeDeactivate();var a=this.oApp.getWYSIWYGDocument().selection;if(a&&a.createRange){try{a.empty()}catch(b){a=this.oApp.getSelection();a.select();a.oBrowserSelection.selectNone()}}else{this.oApp.getEmptySelection().oBrowserSelection.selectNone()}},$AFTER_SHOW_ACTIVE_LAYER:function(){this.oApp.exec("IE_HIDE_CURSOR",[]);this.bActiveLayerShown=true},$BEFORE_EVENT_EDITING_AREA_KEYDOWN:function(a){this._bKeyDown=true},$ON_EVENT_EDITING_AREA_KEYDOWN:function(a){if(this.oApp.getEditingMode()!==this.sMode){return}var b=a.key();if(this.oApp.oNavigator.ie){switch(b.keyCode){case 33:this._pageUp(a);break;case 34:this._pageDown(a);break;case 8:this._backspace(a);break;default:}}else{if(this.oApp.oNavigator.firefox){if(b.keyCode===8){this._backspace(a)}}}this._recordUndo(b)},_backspace:function(b){var a=this.oApp.getSelection(),c=null;if(!a.collapsed){return}c=a.getNodeAroundRange(true,false);if(c&&c.nodeType===3){if(/^[\n]*$/.test(c.nodeValue)){c=c.previousSibling}else{if(c.nodeValue==="\u200B"||c.nodeValue==="\uFEFF"){c.nodeValue=""}}}if(!!c&&c.nodeType===1&&c.tagName==="TABLE"){jindo.$Element(c).leave();b.stop(jindo.$Event.CANCEL_ALL)}},$BEFORE_EVENT_EDITING_AREA_KEYUP:function(a){if(!this._bKeyDown){return false}this._bKeyDown=false},$ON_EVENT_EDITING_AREA_MOUSEUP:function(a){this.oApp.saveSnapShot()},$BEFORE_PASTE_HTML:function(){if(this.oApp.getEditingMode()!==this.sMode){this.oApp.exec("CHANGE_EDITING_MODE",[this.sMode])}},$ON_PASTE_HTML:function(b,g,e){var c,j,f,l,h,d,k,a;if(this.oApp.getEditingMode()!==this.sMode){return}if(!e){this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["PASTE HTML"])}j=jindo.$Agent().navigator();c=g||this.oApp.getSelection();if(j.ie&&j.nativeVersion==8&&document.documentMode==8){b=b+unescape("%uFEFF")}c.pasteHTML(b);if(!j.ie){f=c.placeStringBookmark();this.oApp.getWYSIWYGDocument().body.innerHTML=this.oApp.getWYSIWYGDocument().body.innerHTML;c.moveToBookmark(f);c.collapseToEnd();c.select();c.removeStringBookmark(f);c=this.oApp.getSelection();if(!!g){g.setRange(c)}}else{c.collapseToEnd();c.select();this._oIERange=null;this._bIERangeReset=false}if(b.indexOf(" -1){l=c.startContainer;if(l.nodeType===1&&l.tagName==="P"){h=jindo.$Element(l).child(function(m){return(m.$value().nodeType===1&&m.$value().tagName==="IMG")},1);if(h.length>0){d=h[h.length-1].$value();k=d.nextSibling;while(k){a=k.nextSibling;if(k.nodeType===3&&(k.nodeValue===" "||k.nodeValue===unescape("%u00A0"))){l.removeChild(k)}k=a}}}}if(!e){this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["PASTE HTML"])}},$ON_FOCUS_N_CURSOR:function(d,a){var b,c;if(a&&(b=jindo.$(a,this.getDocument()))){clearTimeout(this._nTimerFocus);this._nTimerFocus=setTimeout(jindo.$Fn(function(e){this._scrollIntoView(e);this.oApp.exec("FOCUS")},this).bind(b),300);return}c=this.oApp.getSelection();if(!c.collapsed){if(d){c.collapseToEnd()}else{c.collapseToStart()}c.select()}else{if(d){this.oApp.exec("FOCUS");b=this.getDocument().body;c.selectNode(b);c.collapseToEnd();c.select();this._scrollIntoView(b)}else{this.oApp.exec("FOCUS")}}},_getElementVerticalPosition:function(b){var a=0,c=b,d={nTop:0,nBottom:0};if(!b){return d}while(c){a+=c.offsetTop;c=c.offsetParent}d.nTop=a;d.nBottom=a+jindo.$Element(b).height();return d},_getVisibleVerticalPosition:function(){var a,b,d,c={nTop:0,nBottom:0};a=this.getWindow();b=this.getDocument();d=a.innerHeight?a.innerHeight:b.documentElement.clientHeight||b.body.clientHeight;c.nTop=a.pageYOffset||b.documentElement.scrollTop;c.nBottom=c.nTop+d;return c},_isElementVisible:function(b,a){return(b.nTop>=a.nTop&&b.nBottom<=a.nBottom)},_scrollIntoView:function(c){var d=this._getElementVerticalPosition(c),b=this._getVisibleVerticalPosition(),a=0;if(this._isElementVisible(d,b)){return}if((a=d.nBottom-b.nBottom)>0){this.getWindow().scrollTo(0,b.nTop+a);return}this.getWindow().scrollTo(0,d.nTop)},$BEFORE_MSG_EDITING_AREA_RESIZE_STARTED:function(){if(!jindo.$Agent().navigator().ie){var a=null;a=this.oApp.getSelection();this.sBM=a.placeStringBookmark()}},$AFTER_MSG_EDITING_AREA_RESIZE_ENDED:function(a,b,d){if(this.oApp.getEditingMode()!==this.sMode){return}this.oApp.exec("REFRESH_WYSIWYG",[]);if(!jindo.$Agent().navigator().ie){var c=this.oApp.getEmptySelection();c.moveToBookmark(this.sBM);c.select();c.removeStringBookmark(this.sBM)}},$ON_CLEAR_IE_BACKUP_SELECTION:function(){this._oIERange=null},$ON_RESTORE_IE_SELECTION:function(){if(this._oIERange){try{this._oIERange.select();this._oPrevIERange=this._oIERange;this._oIERange=null}catch(a){}}},$ON_EVENT_EDITING_AREA_PASTE:function(a){this.oApp.delayedExec("EVENT_EDITING_AREA_PASTE_DELAY",[a],0)},$ON_EVENT_EDITING_AREA_PASTE_DELAY:function(a){this._replaceBlankToNbsp(a.element)},_replaceBlankToNbsp:function(c){var b=this.oApp.oNavigator;if(!b.ie){return}if(b.nativeVersion!==9||document.documentMode!==7){return}if(c.nodeType!==1){return}if(c.tagName==="BR"){return}var a=jindo.$$("p:empty()",this.oApp.getWYSIWYGDocument().body,{oneTimeOffCache:true});jindo.$A(a).forEach(function(e,d,f){e.innerHTML=" "})},_pageUp:function(c){var b=this._getEditorHeight(),d=jindo.$Document(this.oApp.getWYSIWYGDocument()).scrollPosition(),a;if(d.top<=b){a=0}else{a=d.top-b}this.oApp.getWYSIWYGWindow().scrollTo(0,a);c.stop()},_pageDown:function(c){var b=this._getEditorHeight(),d=jindo.$Document(this.oApp.getWYSIWYGDocument()).scrollPosition(),e=this._getBodyHeight(),a;if(d.top+b>=e){a=e-b}else{a=d.top+b}this.oApp.getWYSIWYGWindow().scrollTo(0,a);c.stop()},_getEditorHeight:function(){return this.oApp.elEditingAreaContainer.offsetHeight-this.nTopBottomMargin},_getBodyHeight:function(){return parseInt(this.getDocument().body.scrollHeight,10)},initIframe:function(){try{if(!this.iframe.contentWindow.document||!this.iframe.contentWindow.document.body||this.iframe.contentWindow.document.location.href==="about:blank"){throw new Error("Access denied")}var b=(!!nhn.husky.SE2M_Configuration.SE2M_CSSLoader&&nhn.husky.SE2M_Configuration.SE2M_CSSLoader.sCSSBaseURI)?nhn.husky.SE2M_Configuration.SE2M_CSSLoader.sCSSBaseURI:"";if(!!nhn.husky.SE2M_Configuration.SE_EditingAreaManager.sCSSBaseURI){b=nhn.husky.SE2M_Configuration.SE_EditingAreaManager.sCSSBaseURI}if(b){var f=this.getDocument();var c=f.getElementsByTagName("head")[0];var a=f.createElement("link");a.type="text/css";a.rel="stylesheet";a.href=b+"/smart_editor2_in.css";c.appendChild(a)}this._enableWYSIWYG();this.status=nhn.husky.PLUGIN_STATUS.READY}catch(d){if(this._nIFrameReadyCount-->0){setTimeout(jindo.$Fn(this.initIframe,this).bind(),100)}else{throw ("iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). ")}}},getIR:function(){var a=this.iframe.contentWindow.document.body.innerHTML,b;if(this.oApp.applyConverter){b=this.oApp.applyConverter(this.sMode+"_TO_IR",a,this.oApp.getWYSIWYGDocument())}else{b=a}return b},setIR:function(a){var f,g=this.oApp.oNavigator,h=jindo.$Agent().navigator(),d=g.ie&&h.nativeVersion<11,j=d?"":" ";if(this.oApp.applyConverter){f=this.oApp.applyConverter("IR_TO_"+this.sMode,a,this.oApp.getWYSIWYGDocument())}else{f=a}this.iframe.contentWindow.document.body.innerHTML=f;if((this.iframe.contentWindow.document.body.innerHTML).replace(/[\r\n\t\s]*/,"")===""){if(this.oApp.sLineBreaker!=="BR"){j=""+j+" "}this.iframe.contentWindow.document.body.innerHTML=j}if(d&&this.oApp.getEditingMode()===this.sMode){var c=this.oApp.getWYSIWYGDocument().body.getElementsByTagName("P");for(var e=0,b=c.length;e=33&&a.keyCode<=40){this.oApp.saveSnapShot();return}if(a.alt||a.ctrl||a.keyCode===16){return}if(this.oApp.getLastKey()===a.keyCode){return}this.oApp.setLastKey(a.keyCode);if(!a.enter&&a.keyCode!==46&&a.keyCode!==8){return}this.oApp.exec("RECORD_UNDO_ACTION",["KEYPRESS("+a.keyCode+")",{bMustBlockContainer:true}])},_enableWYSIWYG:function(){if(this.iframe.contentWindow.document.body.contentEditable!==null){this.iframe.contentWindow.document.body.contentEditable=true}else{this.iframe.contentWindow.document.designMode="on"}this.bWYSIWYGEnabled=true;if(jindo.$Agent().navigator().firefox){setTimeout(jindo.$Fn(function(){this.iframe.contentWindow.document.execCommand("enableInlineTableEditing",false,false)},this).bind(),0)}},_disableWYSIWYG:function(){if(this.iframe.contentWindow.document.body.contentEditable!==null){this.iframe.contentWindow.document.body.contentEditable=false}else{this.iframe.contentWindow.document.designMode="off"}this.bWYSIWYGEnabled=false},isWYSIWYGEnabled:function(){return this.bWYSIWYGEnabled}});nhn.husky.SE_PasteHandler=jindo.$Class({name:"SE_PasteHandler",$init:function(a){this.sParagraphContainer=a||"P";this.aConversionTarget=["TABLE"];this.htBrowser=jindo.$Agent().navigator()},$ON_MSG_APP_READY:function(){if(!this.htBrowser.safari||(this.htBrowser.safari&&this.htBrowser.version>=6)){this.elBody=this.oApp.getWYSIWYGDocument().body;this.wfnPasteHandler=jindo.$Fn(this._handlePaste,this);this.wfnPasteHandler.attach(this.elBody,"paste");this.elEditingAreaContainer=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container",null,{oneTimeOffCache:true});if(this.htBrowser.ie&&this.htBrowser.nativeVersion<=10&&this.htBrowser.version<=10){this.wfnBeforePasteHandler=jindo.$Fn(this._handleBeforePaste,this);this.wfnBeforePasteHandler.attach(this.elBody,"beforePaste")}}},_handleBeforePaste:function(d){if(!d){var d=window.event}var f=d.key(),b=this.oApp.getSelection();if(!b.collapsed&&f.ctrl!=false){b.deleteContents()}this._sBM_IE=b.placeStringBookmark();var c=b.getStringBookmark(this._sBM_IE,true);var a=document.createTextNode("");this.zwspStart=a.cloneNode(true);this.zwspStart.nodeValue="\u200b";this.zwspEnd=this.zwspStart.cloneNode(true);c.parentNode.insertBefore(this.zwspEnd,c);c.parentNode.insertBefore(this.zwspStart,this.zwspEnd);b.setEndBefore(this.zwspEnd);b.collapseToEnd();if(f.ctrl){b.select()}},_handlePaste:function(c){if(this.htBrowser.chrome||(this.htBrowser.safari&&this.htBrowser.version>=6)){var b=c._event.clipboardData.getData("text/html");var d=document.createElement("DIV");d.innerHTML=b;var a=jindo.$$.getSingle("style",d,{oneTimeOffCache:true});if(a){var e=a.innerHTML;e=e.replace(/"/g,"'");this._sStyleFromClipboard=e}}this._preparePaste();setTimeout(jindo.$Fn(function(){var m=new RegExp("^[\u200b]");if(!!this.zwspStart&&!!this.zwspStart.nodeValue){this.zwspStart.nodeValue=this.zwspStart.nodeValue.replace(m,"");if(this.zwspStart.nodeValue==""&&!!this.zwspStart.paretNode){this.zwspStart.parentNode.removeChild(this.zwspStart)}}var g=new RegExp("[\u200b]$");if(!!this.zwspEnd&&!!this.zwspEnd.nodeValue){this.zwspEnd.nodeValue=this.zwspEnd.nodeValue.replace(g,"");if(this.zwspEnd.nodeValue==""&&!!this.zwspEnd.parentNode){this.zwspEnd.parentNode.removeChild(this.zwspEnd)}}try{this._processPaste()}catch(l){if(typeof(JEagleEyeClient)!="undefined"){var f=l.lineNumber;if(!f){f=0}var j="hp_SE_PasteHandler.js/_handlePaste";if(j){var h="http://blog.naver.com/";h+=j;j=h}JEagleEyeClient.sendError(l,j,f)}}var k=this.oApp.getSelection();this._moveToStringBookmark(k);k.collapseToEnd();k.select();this._removeStringBookmark(k)},this).bind(),0)},_preparePaste:function(){this._saveOriginalContents()},_saveOriginalContents:function(){var b=this.oApp.getSelection();if(!b.isCollapsed){b.deleteContents()}if(!this._sBM_IE){this._sBM=b.placeStringBookmark();var c=b.getStringBookmark(this._sBM,true);var d=b.getStringBookmark(this._sBM);var a=document.createTextNode("");this.zwspStart=a.cloneNode(true);this.zwspStart.nodeValue="\u200b";this.zwspEnd=this.zwspStart.cloneNode(true);c.parentNode.insertBefore(this.zwspEnd,c);c.parentNode.insertBefore(this.zwspStart,this.zwspEnd);b.setEndBefore(this.zwspEnd);b.collapseToEnd();b.select();if(this.htBrowser.ie&&this.htBrowser.nativeVersion==11&&this.htBrowser.version==11){}}},_processPaste:function(){this._savePastedContents();try{if(!!this.elPasteHelper){this._clearPasteHelper();this._showPasteHelper()}else{this._createPasteHelper()}this._loadToPasteHelper();this._loadToBody();this._hidePasteHelper()}catch(a){this._hidePasteHelper();throw a}this._hidePasteHelper()},_savePastedContents:function(){var c=this.oApp.getSelection();this._moveToStringBookmark(c);c.select();this.oSelectionClone=c.cloneContents();c.collapseToEnd();c.select();var a=this._outerHTML(this.oSelectionClone);this._isPastedContentsEmpty=true;if(a!=""){this._isPastedContentsEmpty=false;if(this.htBrowser.firefox||(this.htBrowser.safari&&this.htBrowser.version>=6)){var b=a.match(/ |