diff --git a/addons/blogapi/blogapi.addon.php b/addons/blogapi/blogapi.addon.php index 3e85be7a1..09237dd5d 100644 --- a/addons/blogapi/blogapi.addon.php +++ b/addons/blogapi/blogapi.addon.php @@ -243,6 +243,7 @@ } } + debugPrint($obj->content); // 문서 번호 설정 $document_srl = getNextSequence(); @@ -409,8 +410,7 @@ $content = getXmlRpcFailure(1, 'post not founded'); printContent($content); } else { - $oContext = &Context::getInstance(); - + $oEditorController = &getController('editor'); $posts = array(); foreach($output->data as $key => $oDocument) { @@ -419,7 +419,7 @@ $post->userid = $oDocument->get('user_id'); $post->mt_allow_pings = 0; $post->mt_allow_comments = $oDocument->allowComment()=='Y'?1:0; - $post->description = htmlspecialchars($oContext->transContent($oDocument->get('content'))); + $post->description = htmlspecialchars($oEditorController->transComponent($oDocument->get('content'))); $post->postid = $oDocument->document_srl; $post->title = htmlspecialchars($oDocument->get('title')); diff --git a/addons/captcha/conf/info.xml b/addons/captcha/conf/info.xml index 3a32ead43..69ff99544 100644 --- a/addons/captcha/conf/info.xml +++ b/addons/captcha/conf/info.xml @@ -3,22 +3,21 @@ Captcha 애드온 验证码插件 Captchaアドオン - Captcha元件 + 圖形驗證 프로그램 글 등록기를 막기 위해 게시판/ issueTracker에서 글/ 댓글을 입력하려 할 때 이미지를 보여주고 글에 해당하는 이미지를 선택하게 하는 애드온입니다. 로그인하지 않은 경우에만 해당됩니다. 为了解决互联网垃圾而开发的验证码机制。 - 非登录用户发布话题或评论时将会弹出验证图片选择框,选择正确的图片才可以正常发布(适用于版面/issueTracker)。 + 非登录用户发布话题或评论时将会弹出验证图片选择框,选择正确的图片才可以正常发布(适用于版面/issueTracker)。 ボット(bot)がプログラムによるスパム行為を防ぐために、掲示板/issueTrackerで書き込み・コメントを登録する際、ランダムな文字や数字の列を画面に表示し、表示されたものと一致した情報を入力した時、登録が出来るようにするアドオンです。 ログインしてない時だけ、動作します。 - 此元件可防止機器人程式的垃圾留言,在討論板/問題追蹤發表主題或評論時,請同時輸入畫面中所顯示的隨機數字與文字。 - 只適用於無法登入時。 + 此元件可防止機器人程式的垃圾留言,非註冊用戶在討論板/問題追蹤發表主題或評論時,必須要先選對畫面中所顯示的圖案才能發表。 0.1 2009-02-20 @@ -35,16 +34,16 @@ Captcha 표시 대상 应用对象 Captchaを表示する対象 - Captcha顯示的目標 + 選擇目標 글/댓글 등록시 captcha가 동작할 대상을 정할 수 있습니다. 관리자는 무조건 제외됩니다 可以指定验证码应用对象(管理员除外)。 管理者を除き、書き込み・コメントを入力する際captchaイメージを見せる対象を設定します。 - 管理者以外、書き込み・コメントを入力する際captchaを見せる対象を設定します。 + 除了管理員,在發表主題或評論時,設定圖形驗證應用的對象。 로그인하지 않은 사용자 非登录用户 ログインしてないユーザー - 無法登入的用戶 + 非用戶 모든 사용자 @@ -61,7 +60,7 @@ "1번만 동작"을 선택하시면 1번만 동작후 상태를 저장해서 다음부터 물어보지 않고 그렇지 않으면 매번 물어보게 됩니다 "一次"就是每个IP只出现一次验证。 "1回だけ表示"を選択すると、1回だけ動作した後、その情報を保存して次回からはCaptchaを見せないようにします。また、もう一つのオプションは毎回Captchaを表示します。 - 選擇"單次",在發生第一次行為後,該行為會儲存,下次不會再顯示;選擇"每次"則會一直顯示。 + 選擇"單次",產生第一次動作後,下次不會再顯示;選擇"每次"則會一直顯示。 1번만 동작 一次 diff --git a/addons/captcha/lang/zh-TW.lang.php b/addons/captcha/lang/zh-TW.lang.php index c81cb55e4..606e73f0b 100644 --- a/addons/captcha/lang/zh-TW.lang.php +++ b/addons/captcha/lang/zh-TW.lang.php @@ -2,7 +2,7 @@ /** * @file addons/captcha/lang/zh-TW.lang.php * @author zero (zero@nzeo.com) 翻譯:royallin - * @brief captcha正體中文語言 + * @brief 圖形驗證正體中文語言 **/ $lang->about_captcha = "用於防止機器人程式之垃圾留言,請選擇一個符合下列詞語的圖像。"; diff --git a/addons/member_communication/member_communication.addon.php b/addons/member_communication/member_communication.addon.php index 46b58c9f5..bfbcdf818 100644 --- a/addons/member_communication/member_communication.addon.php +++ b/addons/member_communication/member_communication.addon.php @@ -45,7 +45,7 @@ /** * 기능 수행 : 사용자 이름을 클릭시 요청되는 팝업메뉴의 메뉴에 쪽지 발송, 친구추가등의 링크 추가 **/ - } elseif($called_position == 'before_module_proc' && $this->module == 'member' && $this->act == 'getMemberMenu') { + } elseif($called_position == 'before_module_proc' && $this->act == 'getMemberMenu') { $oMemberController = &getController('member'); $member_srl = Context::get('target_srl'); @@ -66,7 +66,8 @@ // 아니라면 쪽지 발송, 친구 등록 추가 } else { // 대상 회원의 정보를 가져옴 - $target_member_info = $this->getMemberInfoByMemberSrl($member_srl); + $oMemberModel = &getModel('member'); + $target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); if(!$target_member_info->member_srl) return; // 로그인된 사용자 정보를 구함 diff --git a/addons/mobile/classes/mobile.class.php b/addons/mobile/classes/mobile.class.php index 2a655b0bf..bc5974fdb 100644 --- a/addons/mobile/classes/mobile.class.php +++ b/addons/mobile/classes/mobile.class.php @@ -480,7 +480,6 @@ $oContext = &Context::getInstance(); $content = $oTemplate->compile($this->oModule->getTemplatePath(), $this->oModule->getTemplateFile()); - $content = $oContext->transContent($content); $this->setContent($content); // 출력 diff --git a/addons/smartphone/classes/smartphone.class.php b/addons/smartphone/classes/smartphone.class.php new file mode 100644 index 000000000..9ba8f7f0f --- /dev/null +++ b/addons/smartphone/classes/smartphone.class.php @@ -0,0 +1,106 @@ +oModule) return; + $this->oModule = $oModule; + } + + function setContent($content) { + $this->content = $content; + } + + function setModuleInfo(&$module_info) + { + if($this->module_info) return; + $this->module_info = $module_info; + } + + function procSmartPhone() + { + if(!$this->module_info) return; + $oModule =& getModule($this->module_info->module, 'smartphone'); + if(!$oModule || !method_exists($oModule, 'procSmartPhone') ) return; + $vars = get_object_vars($this->oModule); + if(count($vars)) foreach($vars as $key => $val) $oModule->{$key} = $val; + return $oModule->procSmartPhone($this); + } + + function getAllItems(&$menu_list, $node_srl = 0, $node_text= "Main Menu") + { + if($node_srl == 0) $this->menuList = array(); + + $obj = null; + $obj->text = $node_text; + $obj->list = array(); + foreach($menu_list as $menu_node_srl => $menu_item) + { + $it = null; + if(!preg_match('/^([a-zA-Z0-9\_\-]+)$/', $menu_item['url'])) { continue; } + if($menu_item["list"] && count($menu_item["list"]) > 0) + { + $this->getAllItems($menu_item["list"], $menu_node_srl, $menu_item["text"]); + } + $it->text = $menu_item["text"]; + $it->url = $menu_item["url"]; + $obj->list[$menu_node_srl] = $it; + } + $this->menuList[$node_srl] = $obj; + } + + function setMenu() + { + $menu_cache_file = sprintf(_XE_PATH_.'files/cache/menu/%d.php', $this->module_info->menu_srl); + if(!file_exists($menu_cache_file)) return; + + include $menu_cache_file; + + $this->getAllItems($menu->list); + Context::set('menus', $this->menuList); + } + + function display() + { + Context::set('layout', 'none'); + $act = Context::get('act'); + if($act) + { + $content = $this->procSmartPhone(); + } + else + { + Context::set('module_info', $this->module_info); + $this->setMenu(); + $oModule =& getModule($this->module_info->module, 'smartphone'); + if($oModule && method_exists($oModule, 'procSmartPhone') ) Context::set('bHavePhoneMethod', true); + $oTemplate = new TemplateHandler(); + $oContext = &Context::getInstance(); + $content = $oTemplate->compile(_XE_PATH_."addons/smartphone/tpl", "layout"); + } + print $content; + + exit(); + } + } +?> diff --git a/addons/smartphone/conf/info.xml b/addons/smartphone/conf/info.xml new file mode 100644 index 000000000..a894d840e --- /dev/null +++ b/addons/smartphone/conf/info.xml @@ -0,0 +1,12 @@ + + + SmartphonePhone XE 애드온 + + IPhone (touch) 등, smartphone 에서 접속시 최적화된 화면을 보여줍니다. + + 0.1 + 2009-04-20 + + haneul + + diff --git a/addons/smartphone/iui/LICENSE.txt b/addons/smartphone/iui/LICENSE.txt new file mode 100644 index 000000000..c43b26eec --- /dev/null +++ b/addons/smartphone/iui/LICENSE.txt @@ -0,0 +1,21 @@ +Copyright (c) 2007, iUI Project Members + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of the iUI Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/addons/smartphone/iui/backButton.png b/addons/smartphone/iui/backButton.png new file mode 100644 index 000000000..e27ea8cdf Binary files /dev/null and b/addons/smartphone/iui/backButton.png differ diff --git a/addons/smartphone/iui/blueButton.png b/addons/smartphone/iui/blueButton.png new file mode 100644 index 000000000..0f92dfd94 Binary files /dev/null and b/addons/smartphone/iui/blueButton.png differ diff --git a/addons/smartphone/iui/cancel.png b/addons/smartphone/iui/cancel.png new file mode 100644 index 000000000..5f6dcc87d Binary files /dev/null and b/addons/smartphone/iui/cancel.png differ diff --git a/addons/smartphone/iui/grayButton.png b/addons/smartphone/iui/grayButton.png new file mode 100644 index 000000000..0ce6a30d4 Binary files /dev/null and b/addons/smartphone/iui/grayButton.png differ diff --git a/addons/smartphone/iui/image/next.png b/addons/smartphone/iui/image/next.png new file mode 100644 index 000000000..1b2c6e4ef Binary files /dev/null and b/addons/smartphone/iui/image/next.png differ diff --git a/addons/smartphone/iui/image/next_New.png b/addons/smartphone/iui/image/next_New.png new file mode 100644 index 000000000..eefc826dd Binary files /dev/null and b/addons/smartphone/iui/image/next_New.png differ diff --git a/addons/smartphone/iui/image/previous.png b/addons/smartphone/iui/image/previous.png new file mode 100644 index 000000000..8095e0928 Binary files /dev/null and b/addons/smartphone/iui/image/previous.png differ diff --git a/addons/smartphone/iui/image/previous_New.png b/addons/smartphone/iui/image/previous_New.png new file mode 100644 index 000000000..36b1752c0 Binary files /dev/null and b/addons/smartphone/iui/image/previous_New.png differ diff --git a/addons/smartphone/iui/iui.css b/addons/smartphone/iui/iui.css new file mode 100644 index 000000000..6470d9b59 --- /dev/null +++ b/addons/smartphone/iui/iui.css @@ -0,0 +1,486 @@ +/* iui.css (c) 2007 by iUI Project Members, see LICENSE.txt for license */ +body { + margin: 0; + font-family: Helvetica; + background: #FFFFFF; + color: #000000; + overflow-x: hidden; + -webkit-user-select: none; + -webkit-text-size-adjust: none; +} + +body > *:not(.toolbar) { + display: none; + position: absolute; + margin: 0; + padding: 0; + left: 0; + top: 45px; + width: 100%; + min-height: 372px; +} + +body[orient="landscape"] > *:not(.toolbar) { + min-height: 268px; +} + +body > *[selected="true"] { + display: block; +} + +a[selected].link, a:active, link { + background-color: #194fdb !important; + background-image: url(listArrowSel.png), url(selection.png) !important; + background-repeat: no-repeat, repeat-x; + background-position: right center, left top; + color: #FFFFFF !important; +} + +a[selected="progress"].link { + background-image: url(loading.gif), url(selection.png) !important; +} + +/************************************************************************************************/ + +body > .toolbar { + box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + border-bottom: 1px solid #2d3642; + border-top: 1px solid #6d84a2; + padding: 10px; + height: 45px; + background: url(toolbar.png) #6d84a2 repeat-x; +} + +.toolbar > h1 { + position: absolute; + overflow: hidden; + left: 50%; + margin: 1px 0 0 -75px; + height: 45px; + font-size: 20px; + width: 150px; + font-weight: bold; + text-shadow: rgba(0, 0, 0, 0.4) 0px -1px 0; + text-align: center; + text-overflow: ellipsis; + white-space: nowrap; + color: #FFFFFF; +} + +body[orient="landscape"] > .toolbar > h1 { + margin-left: -125px; + width: 250px; +} + +.button { + position: absolute; + overflow: hidden; + top: 8px; + right: 6px; + margin: 0; + border-width: 0 5px; + padding: 0 3px; + width: auto; + height: 30px; + line-height: 30px; + font-family: inherit; + font-size: 12px; + font-weight: bold; + color: #FFFFFF; + text-shadow: rgba(0, 0, 0, 0.6) 0px -1px 0; + text-overflow: ellipsis; + text-decoration: none; + white-space: nowrap; + background: none; + -webkit-border-image: url(toolButton.png) 0 5 0 5; +} + +.blueButton { + -webkit-border-image: url(blueButton.png) 0 5 0 5; + border-width: 0 5px; +} + +.leftButton { + left: 6px; + right: auto; +} + +#backButton { + display: none; + left: 6px; + right: auto; + padding: 0; + max-width: 55px; + border-width: 0 8px 0 14px; + -webkit-border-image: url(backButton.png) 0 8 0 14; +} + +.whiteButton, +.grayButton { + display: block; + border-width: 0 12px; + padding: 10px; + text-align: center; + font-size: 20px; + font-weight: bold; + text-decoration: inherit; + color: inherit; +} + +.whiteButton { + -webkit-border-image: url(whiteButton.png) 0 12 0 12; + text-shadow: rgba(255, 255, 255, 0.7) 0 1px 0; +} + +.grayButton { + -webkit-border-image: url(grayButton.png) 0 12 0 12; + color: #FFFFFF; +} + +/************************************************************************************************/ + +body > ul > li { + position: relative; + margin: 0; + border-bottom: 1px solid #E0E0E0; + padding: 8px 0 8px 10px; + font-size: 18px; + font-weight: bold; + list-style: none; +} + +body > ul > li.group { + position: relative; + top: -1px; + margin-bottom: -2px; + border-top: 1px solid #7d7d7d; + border-bottom: 1px solid #999999; + padding: 1px 10px; + background: url(listGroup.png) repeat-x; + font-size: 17px; + font-weight: bold; + text-shadow: rgba(0, 0, 0, 0.4) 0 1px 0; + color: #FFFFFF; +} + +body > ul > li.group:first-child { + top: 0; + border-top: none; +} + +body > ul > li > a { + display: block; + margin: -8px 0 -8px -10px; + padding: 8px 32px 8px 10px; + text-decoration: none; + color: inherit; + background: url(listArrow.png) no-repeat right center; +} + +a[target="_replace"] { + box-sizing: border-box; + -webkit-box-sizing: border-box; + padding-top: 25px; + padding-bottom: 25px; + font-size: 18px; + color: cornflowerblue; + background-color: #FFFFFF; + background-image: none; +} + +/************************************************************************************************/ + +body > .dialog { + top: 0; + width: 100%; + min-height: 417px; + z-index: 2; + background: rgba(0, 0, 0, 0.8); + padding: 0; + text-align: right; +} + +.dialog > fieldset { + box-sizing: border-box; + -webkit-box-sizing: border-box; + width: 100%; + margin: 0; + border: none; + border-top: 1px solid #6d84a2; + padding: 10px 6px; + background: url(toolbar.png) #7388a5 repeat-x; +} + +.dialog > fieldset > h1 { + margin: 0 10px 0 10px; + padding: 0; + font-size: 20px; + font-weight: bold; + color: #FFFFFF; + text-shadow: rgba(0, 0, 0, 0.4) 0px -1px 0; + text-align: center; +} + +.dialog > fieldset > label { + position: absolute; + margin: 16px 0 0 6px; + font-size: 14px; + color: #999999; +} + +input { + box-sizing: border-box; + -webkit-box-sizing: border-box; + width: 100%; + margin: 8px 0 0 0; + padding: 6px 6px 6px 44px; + font-size: 16px; + font-weight: normal; +} + +/************************************************************************************************/ + +body > .panel { + box-sizing: border-box; + -webkit-box-sizing: border-box; + padding: 10px; + background: #c8c8c8 url(pinstripes.png); +} + +.panel > fieldset { + position: relative; + margin: 0 0 20px 0; + padding: 0; + background: #FFFFFF; + -webkit-border-radius: 8px; + border: 1px solid #999999; + text-align: right; + font-size: 16px; +} + +.row { + position: relative; + min-height: 42px; + border-bottom: 1px solid #999999; + -webkit-border-radius: 0; + text-align: right; +} + +fieldset > .row:last-child { + border-bottom: none !important; +} + +.row > input { + box-sizing: border-box; + -webkit-box-sizing: border-box; + margin: 0; + border: none; + padding: 12px 10px 0 110px; + height: 42px; + background: none; +} + +.row > label { + position: absolute; + margin: 0 0 0 14px; + line-height: 42px; + font-weight: bold; +} + +.row > .toggle { + position: absolute; + top: 6px; + right: 6px; + width: 100px; + height: 28px; +} + +.toggle { + border: 1px solid #888888; + -webkit-border-radius: 6px; + background: #FFFFFF url(toggle.png) repeat-x; + font-size: 19px; + font-weight: bold; + line-height: 30px; +} + +.toggle[toggled="true"] { + border: 1px solid #143fae; + background: #194fdb url(toggleOn.png) repeat-x; +} + +.toggleOn { + display: none; + position: absolute; + width: 60px; + text-align: center; + left: 0; + top: 0; + color: #FFFFFF; + text-shadow: rgba(0, 0, 0, 0.4) 0px -1px 0; +} + +.toggleOff { + position: absolute; + width: 60px; + text-align: center; + right: 0; + top: 0; + color: #666666; +} + +.toggle[toggled="true"] > .toggleOn { + display: block; +} + +.toggle[toggled="true"] > .toggleOff { + display: none; +} + +.thumb { + position: absolute; + top: -1px; + left: -1px; + width: 40px; + height: 28px; + border: 1px solid #888888; + -webkit-border-radius: 6px; + background: #ffffff url(thumb.png) repeat-x; +} + +.toggle[toggled="true"] > .thumb { + left: auto; + right: -1px; +} + +.panel > h2 { + margin: 0 0 8px 14px; + font-size: inherit; + font-weight: bold; + color: #4d4d70; + text-shadow: rgba(255, 255, 255, 0.75) 2px 2px 0; +} + +.panel > .content { + background: #FFFFFF; + -webkit-border-radius: 8px; + border: 1px solid #999999; + padding: 10px; +} + +/************************************************************************************************/ + +#preloader { + display: none; + background-image: url(loading.gif), url(selection.png), + url(blueButton.png), url(listArrowSel.png), url(listGroup.png); +} + +body > ul > li.post_item > a > .post > span.title { + font-size:13px; + font-weight:normal; + display:block; +} +body > ul > li.post_item > a > .post > span.description { + font-size:10px; + font-weight:normal; + color:#bbb; + display:block; + margin-top:2px; + letter-spacing:0px; +} + +.next, .previous { + display: block; + text-decoration: none; + font-size: 16px; + padding: 7px 0; + background: url(image/previous_New.png) no-repeat; + color: #fff; + margin: 8px 12px; + width: 110px; + height: 21px; + text-align: center; + margin-bottom: 30px; + font-weight:normal; +} + +.next { + float: right; + background: url(image/next_New.png) no-repeat; +} + +.previous { + float: left; + opacity: 0.7; + margin: 8px 0px; +} + +.pagination { + background: none; + border: none; + text-align: center; +} + +.pagination strong { + font-size: 32px; + color: #ccc; + position: relative; + top: 5px; +} + +.siteinfo .description +{ + display: block; + font-size: 16px; + color: #6699FF; + text-align: right; +} + +.siteinfo .xe +{ + display: block; + text-align: right; + font-size:11px; + color: #999; +} + +ul.navigation { + margin:0; + padding:0; + list-style: none; +} + +ul.navigation > li { + position: relative; + font-size: 14px; + border-bottom: 1px solid #E0E0E0; + text-align: left; +} + +ul.navigation > li > a { + display: block; + background-image: url(listArrow.png); + background-repeat: no-repeat; + background-position: right center; + color: inherit; + text-decoration: none; + padding: 8px 32px 8px 10px; +} + +.comment_item > .author { + color: #3074A5; +} + +.comment_item > .regdate { + float:right; + font-size: 12px; + color: #CCC; +} + +.comment_item > .re { + font-size: 12px; + color: #DCC; +} diff --git a/addons/smartphone/iui/iui.js b/addons/smartphone/iui/iui.js new file mode 100644 index 000000000..e479fefa6 --- /dev/null +++ b/addons/smartphone/iui/iui.js @@ -0,0 +1,383 @@ +/* + Copyright (c) 2007, iUI Project Members + See LICENSE.txt for licensing terms + */ + + +(function() { + +var slideSpeed = 40; +var slideInterval = 0; + +var currentPage = null; +var currentDialog = null; +var currentWidth = 0; +var currentHash = location.hash; +var hashPrefix = "#_"; +var pageHistory = []; +var newPageCount = 0; +var checkTimer; + +// ************************************************************************************************* + +window.iui = +{ + showPage: function(page, backwards) + { + if (page) + { + if (currentDialog) + { + currentDialog.removeAttribute("selected"); + currentDialog = null; + } + + if (hasClass(page, "dialog")) + showDialog(page); + else + { + var fromPage = currentPage; + currentPage = page; + + if (fromPage) + setTimeout(slidePages, 0, fromPage, page, backwards); + else + updatePage(page, fromPage); + } + } + }, + + showPageById: function(pageId) + { + var page = $(pageId); + if (page) + { + var index = pageHistory.indexOf(pageId); + var backwards = index != -1; + if (backwards) + pageHistory.splice(index, pageHistory.length); + + iui.showPage(page, backwards); + } + }, + + showPageByHref: function(href, args, method, replace, cb) + { + var req = new XMLHttpRequest(); + req.onerror = function() + { + if (cb) + cb(false); + }; + + req.onreadystatechange = function() + { + if (req.readyState == 4) + { + if (replace) + replaceElementWithSource(replace, req.responseText); + else + { + var frag = document.createElement("div"); + frag.innerHTML = req.responseText; + iui.insertPages(frag.childNodes); + } + if (cb) + setTimeout(cb, 1000, true); + } + }; + + if (args) + { + req.open(method || "GET", href, true); + req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + req.setRequestHeader("Content-Length", args.length); + req.send(args.join("&")); + } + else + { + req.open(method || "GET", href, true); + req.send(null); + } + }, + + insertPages: function(nodes) + { + var targetPage; + for (var i = 0; i < nodes.length; ++i) + { + var child = nodes[i]; + if (child.nodeType == 1) + { + if (!child.id) + child.id = "__" + (++newPageCount) + "__"; + + var clone = $(child.id); + if (clone) + clone.parentNode.replaceChild(child, clone); + else + document.body.appendChild(child); + + if (child.getAttribute("selected") == "true" || !targetPage) + targetPage = child; + + --i; + } + } + + if (targetPage) + iui.showPage(targetPage); + }, + + getSelectedPage: function() + { + for (var child = document.body.firstChild; child; child = child.nextSibling) + { + if (child.nodeType == 1 && child.getAttribute("selected") == "true") + return child; + } + } +}; + +// ************************************************************************************************* + +addEventListener("load", function(event) +{ + var page = iui.getSelectedPage(); + if (page) + iui.showPage(page); + + setTimeout(preloadImages, 0); + setTimeout(checkOrientAndLocation, 0); + checkTimer = setInterval(checkOrientAndLocation, 300); +}, false); + +addEventListener("click", function(event) +{ + var link = findParent(event.target, "a"); + if (link) + { + function unselect() { link.removeAttribute("selected"); } + + if (link.href && link.hash && link.hash != "#") + { + link.setAttribute("selected", "true"); + iui.showPage($(link.hash.substr(1))); + setTimeout(unselect, 500); + } + else if (link == $("backButton")) + history.back(); + else if (link.getAttribute("type") == "submit") + submitForm(findParent(link, "form")); + else if (link.getAttribute("type") == "cancel") + cancelDialog(findParent(link, "form")); + else if (link.target == "_replace") + { + link.setAttribute("selected", "progress"); + iui.showPageByHref(link.href, null, null, link, unselect); + } + else if (!link.target) + { + link.setAttribute("selected", "progress"); + iui.showPageByHref(link.href, null, null, null, unselect); + } + else + return; + + event.preventDefault(); + } +}, true); + +addEventListener("click", function(event) +{ + var div = findParent(event.target, "div"); + if (div && hasClass(div, "toggle")) + { + div.setAttribute("toggled", div.getAttribute("toggled") != "true"); + event.preventDefault(); + } +}, true); + +function checkOrientAndLocation() +{ + if (window.innerWidth != currentWidth) + { + currentWidth = window.innerWidth; + var orient = currentWidth == 320 ? "profile" : "landscape"; + document.body.setAttribute("orient", orient); + setTimeout(scrollTo, 100, 0, 1); + } + + if (location.hash != currentHash) + { + var pageId = location.hash.substr(hashPrefix.length) + iui.showPageById(pageId); + } +} + +function showDialog(page) +{ + currentDialog = page; + page.setAttribute("selected", "true"); + + if (hasClass(page, "dialog") && !page.target) + showForm(page); +} + +function showForm(form) +{ + form.onsubmit = function(event) + { + event.preventDefault(); + submitForm(form); + }; + + form.onclick = function(event) + { + if (event.target == form && hasClass(form, "dialog")) + cancelDialog(form); + }; +} + +function cancelDialog(form) +{ + form.removeAttribute("selected"); +} + +function updatePage(page, fromPage) +{ + if (!page.id) + page.id = "__" + (++newPageCount) + "__"; + + location.href = currentHash = hashPrefix + page.id; + pageHistory.push(page.id); + + var pageTitle = $("pageTitle"); + if (page.title) + pageTitle.innerHTML = page.title; + + if (page.localName.toLowerCase() == "form" && !page.target) + showForm(page); + + var backButton = $("backButton"); + if (backButton) + { + var prevPage = $(pageHistory[pageHistory.length-2]); + if (prevPage && !page.getAttribute("hideBackButton")) + { + backButton.style.display = "inline"; + backButton.innerHTML = prevPage.title ? prevPage.title : "Back"; + } + else + backButton.style.display = "none"; + } +} + +function slidePages(fromPage, toPage, backwards) +{ + var axis = (backwards ? fromPage : toPage).getAttribute("axis"); + if (axis == "y") + (backwards ? fromPage : toPage).style.top = "100%"; + else + toPage.style.left = "100%"; + + toPage.setAttribute("selected", "true"); + scrollTo(0, 1); + clearInterval(checkTimer); + + var percent = 100; + slide(); + var timer = setInterval(slide, slideInterval); + + function slide() + { + percent -= slideSpeed; + if (percent <= 0) + { + percent = 0; + if (!hasClass(toPage, "dialog")) + fromPage.removeAttribute("selected"); + clearInterval(timer); + checkTimer = setInterval(checkOrientAndLocation, 300); + setTimeout(updatePage, 0, toPage, fromPage); + } + + if (axis == "y") + { + backwards + ? fromPage.style.top = (100-percent) + "%" + : toPage.style.top = percent + "%"; + } + else + { + fromPage.style.left = (backwards ? (100-percent) : (percent-100)) + "%"; + toPage.style.left = (backwards ? -percent : percent) + "%"; + } + } +} + +function preloadImages() +{ + var preloader = document.createElement("div"); + preloader.id = "preloader"; + document.body.appendChild(preloader); +} + +function submitForm(form) +{ + iui.showPageByHref(form.action || "POST", encodeForm(form), form.method); +} + +function encodeForm(form) +{ + function encode(inputs) + { + for (var i = 0; i < inputs.length; ++i) + { + if (inputs[i].name) + args.push(inputs[i].name + "=" + escape(inputs[i].value)); + } + } + + var args = []; + encode(form.getElementsByTagName("input")); + encode(form.getElementsByTagName("select")); + return args; +} + +function findParent(node, localName) +{ + while (node && (node.nodeType != 1 || node.localName.toLowerCase() != localName)) + node = node.parentNode; + return node; +} + +function hasClass(self, name) +{ + var re = new RegExp("(^|\\s)"+name+"($|\\s)"); + return re.exec(self.getAttribute("class")) != null; +} + +function replaceElementWithSource(replace, source) +{ + var page = replace.parentNode; + var parent = replace; + while (page.parentNode != document.body) + { + page = page.parentNode; + parent = parent.parentNode; + } + + var frag = document.createElement(parent.localName); + frag.innerHTML = source; + + page.removeChild(parent); + + while (frag.firstChild) + page.appendChild(frag.firstChild); +} + +function $(id) { return document.getElementById(id); } +function ddd() { console.log.apply(console, arguments); } + +})(); diff --git a/addons/smartphone/iui/iuix.css b/addons/smartphone/iui/iuix.css new file mode 100644 index 000000000..1a1969058 --- /dev/null +++ b/addons/smartphone/iui/iuix.css @@ -0,0 +1 @@ +body{margin:0;font-family:Helvetica;background:#FFF;color:#000;overflow-x:hidden;-webkit-user-select:none;-webkit-text-size-adjust:none;}body>*:not(.toolbar){display:none;position:absolute;margin:0;padding:0;left:0;top:45px;width:100%;min-height:372px;}body[orient="landscape"]>*:not(.toolbar){min-height:268px;}body>*[selected="true"]{display:block;}a[selected],a:active{background-color:#194fdb!important;background-image:url(listArrowSel.png),url(selection.png)!important;background-repeat:no-repeat,repeat-x;background-position:right center,left top;color:#FFF!important;}a[selected="progress"]{background-image:url(loading.gif),url(selection.png)!important;}body>.toolbar{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border-bottom:1px solid #2d3642;border-top:1px solid #6d84a2;padding:10px;height:45px;background:url(toolbar.png) #6d84a2 repeat-x;}.toolbar>h1{position:absolute;overflow:hidden;left:50%;margin:1px 0 0 -75px;height:45px;font-size:20px;width:150px;font-weight:bold;text-shadow:rgba(0,0,0,0.4) 0 -1px 0;text-align:center;text-overflow:ellipsis;white-space:nowrap;color:#FFF;}body[orient="landscape"]>.toolbar>h1{margin-left:-125px;width:250px;}.button{position:absolute;overflow:hidden;top:8px;right:6px;margin:0;border-width:0 5px;padding:0 3px;width:auto;height:30px;line-height:30px;font-family:inherit;font-size:12px;font-weight:bold;color:#FFF;text-shadow:rgba(0,0,0,0.6) 0 -1px 0;text-overflow:ellipsis;text-decoration:none;white-space:nowrap;background:none;-webkit-border-image:url(toolButton.png) 0 5 0 5;}.blueButton{-webkit-border-image:url(blueButton.png) 0 5 0 5;border-width:0 5px;}.leftButton{left:6px;right:auto;}#backButton{display:none;left:6px;right:auto;padding:0;max-width:55px;border-width:0 8px 0 14px;-webkit-border-image:url(backButton.png) 0 8 0 14;}.whiteButton,.grayButton{display:block;border-width:0 12px;padding:10px;text-align:center;font-size:20px;font-weight:bold;text-decoration:inherit;color:inherit;}.whiteButton{-webkit-border-image:url(whiteButton.png) 0 12 0 12;text-shadow:rgba(255,255,255,0.7) 0 1px 0;}.grayButton{-webkit-border-image:url(grayButton.png) 0 12 0 12;color:#FFF;}body>ul>li{position:relative;margin:0;border-bottom:1px solid #E0E0E0;padding:8px 0 8px 10px;font-size:20px;font-weight:bold;list-style:none;}body>ul>li.group{position:relative;top:-1px;margin-bottom:-2px;border-top:1px solid #7d7d7d;border-bottom:1px solid #999;padding:1px 10px;background:url(listGroup.png) repeat-x;font-size:17px;font-weight:bold;text-shadow:rgba(0,0,0,0.4) 0 1px 0;color:#FFF;}body>ul>li.group:first-child{top:0;border-top:none;}body>ul>li>a{display:block;margin:-8px 0 -8px -10px;padding:8px 32px 8px 10px;text-decoration:none;color:inherit;background:url(listArrow.png) no-repeat right center;}a[target="_replace"]{box-sizing:border-box;-webkit-box-sizing:border-box;padding-top:25px;padding-bottom:25px;font-size:18px;color:cornflowerblue;background-color:#FFF;background-image:none;}body>.dialog{top:0;width:100%;min-height:417px;z-index:2;background:rgba(0,0,0,0.8);padding:0;text-align:right;}.dialog>fieldset{box-sizing:border-box;-webkit-box-sizing:border-box;width:100%;margin:0;border:none;border-top:1px solid #6d84a2;padding:10px 6px;background:url(toolbar.png) #7388a5 repeat-x;}.dialog>fieldset>h1{margin:0 10px 0 10px;padding:0;font-size:20px;font-weight:bold;color:#FFF;text-shadow:rgba(0,0,0,0.4) 0 -1px 0;text-align:center;}.dialog>fieldset>label{position:absolute;margin:16px 0 0 6px;font-size:14px;color:#999;}input{box-sizing:border-box;-webkit-box-sizing:border-box;width:100%;margin:8px 0 0 0;padding:6px 6px 6px 44px;font-size:16px;font-weight:normal;}body>.panel{box-sizing:border-box;-webkit-box-sizing:border-box;padding:10px;background:#c8c8c8 url(pinstripes.png);}.panel>fieldset{position:relative;margin:0 0 20px 0;padding:0;background:#FFF;-webkit-border-radius:10px;border:1px solid #999;text-align:right;font-size:16px;}.row{position:relative;min-height:42px;border-bottom:1px solid #999;-webkit-border-radius:0;text-align:right;}fieldset>.row:last-child{border-bottom:none!important;}.row>input{box-sizing:border-box;-webkit-box-sizing:border-box;margin:0;border:none;padding:12px 10px 0 110px;height:42px;background:none;}.row>label{position:absolute;margin:0 0 0 14px;line-height:42px;font-weight:bold;}.row>.toggle{position:absolute;top:6px;right:6px;width:100px;height:28px;}.toggle{border:1px solid #888;-webkit-border-radius:6px;background:#FFF url(toggle.png) repeat-x;font-size:19px;font-weight:bold;line-height:30px;}.toggle[toggled="true"]{border:1px solid #143fae;background:#194fdb url(toggleOn.png) repeat-x;}.toggleOn{display:none;position:absolute;width:60px;text-align:center;left:0;top:0;color:#FFF;text-shadow:rgba(0,0,0,0.4) 0 -1px 0;}.toggleOff{position:absolute;width:60px;text-align:center;right:0;top:0;color:#666;}.toggle[toggled="true"]>.toggleOn{display:block;}.toggle[toggled="true"]>.toggleOff{display:none;}.thumb{position:absolute;top:-1px;left:-1px;width:40px;height:28px;border:1px solid #888;-webkit-border-radius:6px;background:#fff url(thumb.png) repeat-x;}.toggle[toggled="true"]>.thumb{left:auto;right:-1px;}.panel>h2{margin:0 0 8px 14px;font-size:inherit;font-weight:bold;color:#4d4d70;text-shadow:rgba(255,255,255,0.75) 2px 2px 0;}#preloader{display:none;background-image:url(loading.gif),url(selection.png),url(blueButton.png),url(listArrowSel.png),url(listGroup.png);} \ No newline at end of file diff --git a/addons/smartphone/iui/iuix.js b/addons/smartphone/iui/iuix.js new file mode 100644 index 000000000..3b2b37f9d --- /dev/null +++ b/addons/smartphone/iui/iuix.js @@ -0,0 +1 @@ +(function(){var _1=20;var _2=0;var _3=null;var _4=null;var _5=0;var _6=location.hash;var _7="#_";var _8=[];var _9=0;var _a;window.iui={showPage:function(_b,_c){if(_b){if(_4){_4.removeAttribute("selected");_4=null;}if(hasClass(_b,"dialog")){showDialog(_b);}else{var _d=_3;_3=_b;if(_d){setTimeout(slidePages,0,_d,_b,_c);}else{updatePage(_b,_d);}}}},showPageById:function(_e){var _f=$(_e);if(_f){var _10=_8.indexOf(_e);var _11=_10!=-1;if(_11){_8.splice(_10,_8.length);}iui.showPage(_f,_11);}},showPageByHref:function(_12,_13,_14,_15,cb){var req=new XMLHttpRequest();req.onerror=function(){if(cb){cb(false);}};req.onreadystatechange=function(){if(req.readyState==4){if(_15){replaceElementWithSource(_15,req.responseText);}else{var _18=document.createElement("div");_18.innerHTML=req.responseText;iui.insertPages(_18.childNodes);}if(cb){setTimeout(cb,1000,true);}}};if(_13){req.open(_14||"GET",_12,true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");req.setRequestHeader("Content-Length",_13.length);req.send(_13.join("&"));}else{req.open(_14||"GET",_12,true);req.send(null);}},insertPages:function(_19){var _1a;for(var i=0;i<_19.length;++i){var _1c=_19[i];if(_1c.nodeType==1){if(!_1c.id){_1c.id="__"+(++_9)+"__";}var _1d=$(_1c.id);if(_1d){_1d.parentNode.replaceChild(_1c,_1d);}else{document.body.appendChild(_1c);}if(_1c.getAttribute("selected")=="true"||!_1a){_1a=_1c;}--i;}}if(_1a){iui.showPage(_1a);}},getSelectedPage:function(){for(var _1e=document.body.firstChild;_1e;_1e=_1e.nextSibling){if(_1e.nodeType==1&&_1e.getAttribute("selected")=="true"){return _1e;}}}};addEventListener("load",function(_1f){var _20=iui.getSelectedPage();if(_20){iui.showPage(_20);}setTimeout(preloadImages,0);setTimeout(checkOrientAndLocation,0);_a=setInterval(checkOrientAndLocation,300);},false);addEventListener("click",function(_21){var _22=findParent(_21.target,"a");if(_22){function unselect(){_22.removeAttribute("selected");}if(_22.href&&_22.hash&&_22.hash!="#"){_22.setAttribute("selected","true");iui.showPage($(_22.hash.substr(1)));setTimeout(unselect,500);}else{if(_22==$("backButton")){history.back();}else{if(_22.getAttribute("type")=="submit"){submitForm(findParent(_22,"form"));}else{if(_22.getAttribute("type")=="cancel"){cancelDialog(findParent(_22,"form"));}else{if(_22.target=="_replace"){_22.setAttribute("selected","progress");iui.showPageByHref(_22.href,null,null,_22,unselect);}else{if(!_22.target){_22.setAttribute("selected","progress");iui.showPageByHref(_22.href,null,null,null,unselect);}else{return;}}}}}}_21.preventDefault();}},true);addEventListener("click",function(_23){var div=findParent(_23.target,"div");if(div&&hasClass(div,"toggle")){div.setAttribute("toggled",div.getAttribute("toggled")!="true");_23.preventDefault();}},true);function checkOrientAndLocation(){if(window.innerWidth!=_5){_5=window.innerWidth;var _25=_5==320?"profile":"landscape";document.body.setAttribute("orient",_25);setTimeout(scrollTo,100,0,1);}if(location.hash!=_6){var _26=location.hash.substr(_7.length);iui.showPageById(_26);}}function showDialog(_27){_4=_27;_27.setAttribute("selected","true");if(hasClass(_27,"dialog")&&!_27.target){showForm(_27);}}function showForm(_28){_28.onsubmit=function(_29){_29.preventDefault();submitForm(_28);};_28.onclick=function(_2a){if(_2a.target==_28&&hasClass(_28,"dialog")){cancelDialog(_28);}};}function cancelDialog(_2b){_2b.removeAttribute("selected");}function updatePage(_2c,_2d){if(!_2c.id){_2c.id="__"+(++_9)+"__";}location.href=_6=_7+_2c.id;_8.push(_2c.id);var _2e=$("pageTitle");if(_2c.title){_2e.innerHTML=_2c.title;}if(_2c.localName.toLowerCase()=="form"&&!_2c.target){showForm(_2c);}var _2f=$("backButton");if(_2f){var _30=$(_8[_8.length-2]);if(_30&&!_2c.getAttribute("hideBackButton")){_2f.style.display="inline";_2f.innerHTML=_30.title?_30.title:"Back";}else{_2f.style.display="none";}}}function slidePages(_31,_32,_33){var _34=(_33?_31:_32).getAttribute("axis");if(_34=="y"){(_33?_31:_32).style.top="100%";}else{_32.style.left="100%";}_32.setAttribute("selected","true");scrollTo(0,1);clearInterval(_a);var _35=100;slide();var _36=setInterval(slide,_2);function slide(){_35-=_1;if(_35<=0){_35=0;if(!hasClass(_32,"dialog")){_31.removeAttribute("selected");}clearInterval(_36);_a=setInterval(checkOrientAndLocation,300);setTimeout(updatePage,0,_32,_31);}if(_34=="y"){_33?_31.style.top=(100-_35)+"%":_32.style.top=_35+"%";}else{_31.style.left=(_33?(100-_35):(_35-100))+"%";_32.style.left=(_33?-_35:_35)+"%";}}}function preloadImages(){var _37=document.createElement("div");_37.id="preloader";document.body.appendChild(_37);}function submitForm(_38){iui.showPageByHref(_38.action||"POST",encodeForm(_38),_38.method);}function encodeForm(_39){function encode(_3a){for(var i=0;i<_3a.length;++i){if(_3a[i].name){args.push(_3a[i].name+"="+escape(_3a[i].value));}}}var _3c=[];encode(_39.getElementsByTagName("input"));encode(_39.getElementsByTagName("select"));return _3c;}function findParent(_3d,_3e){while(_3d&&(_3d.nodeType!=1||_3d.localName.toLowerCase()!=_3e)){_3d=_3d.parentNode;}return _3d;}function hasClass(_3f,_40){var re=new RegExp("(^|\\s)"+_40+"($|\\s)");return re.exec(_3f.getAttribute("class"))!=null;}function replaceElementWithSource(_42,_43){var _44=_42.parentNode;var _45=_42;while(_44.parentNode!=document.body){_44=_44.parentNode;_45=_45.parentNode;}var _46=document.createElement(_45.localName);_46.innerHTML=_43;_44.removeChild(_45);while(_46.firstChild){_44.appendChild(_46.firstChild);}}function $(id){return document.getElementById(id);}function ddd(){console.log.apply(console,arguments);}})(); \ No newline at end of file diff --git a/addons/smartphone/iui/listArrow.png b/addons/smartphone/iui/listArrow.png new file mode 100644 index 000000000..6421a1676 Binary files /dev/null and b/addons/smartphone/iui/listArrow.png differ diff --git a/addons/smartphone/iui/listArrowSel.png b/addons/smartphone/iui/listArrowSel.png new file mode 100644 index 000000000..86832ebc7 Binary files /dev/null and b/addons/smartphone/iui/listArrowSel.png differ diff --git a/addons/smartphone/iui/listGroup.png b/addons/smartphone/iui/listGroup.png new file mode 100644 index 000000000..221553ae9 Binary files /dev/null and b/addons/smartphone/iui/listGroup.png differ diff --git a/addons/smartphone/iui/loading.gif b/addons/smartphone/iui/loading.gif new file mode 100644 index 000000000..8522ddf1a Binary files /dev/null and b/addons/smartphone/iui/loading.gif differ diff --git a/addons/smartphone/iui/pinstripes.png b/addons/smartphone/iui/pinstripes.png new file mode 100644 index 000000000..c99777512 Binary files /dev/null and b/addons/smartphone/iui/pinstripes.png differ diff --git a/addons/smartphone/iui/selection.png b/addons/smartphone/iui/selection.png new file mode 100644 index 000000000..537e3f0b1 Binary files /dev/null and b/addons/smartphone/iui/selection.png differ diff --git a/addons/smartphone/iui/thumb.png b/addons/smartphone/iui/thumb.png new file mode 100644 index 000000000..cefa8fc5e Binary files /dev/null and b/addons/smartphone/iui/thumb.png differ diff --git a/addons/smartphone/iui/toggle.png b/addons/smartphone/iui/toggle.png new file mode 100644 index 000000000..3b62ebf26 Binary files /dev/null and b/addons/smartphone/iui/toggle.png differ diff --git a/addons/smartphone/iui/toggleOn.png b/addons/smartphone/iui/toggleOn.png new file mode 100644 index 000000000..b016814de Binary files /dev/null and b/addons/smartphone/iui/toggleOn.png differ diff --git a/addons/smartphone/iui/toolButton.png b/addons/smartphone/iui/toolButton.png new file mode 100644 index 000000000..afe4d7a3e Binary files /dev/null and b/addons/smartphone/iui/toolButton.png differ diff --git a/addons/smartphone/iui/toolbar.png b/addons/smartphone/iui/toolbar.png new file mode 100644 index 000000000..3dde94c07 Binary files /dev/null and b/addons/smartphone/iui/toolbar.png differ diff --git a/addons/smartphone/iui/whiteButton.png b/addons/smartphone/iui/whiteButton.png new file mode 100644 index 000000000..5514b2700 Binary files /dev/null and b/addons/smartphone/iui/whiteButton.png differ diff --git a/addons/smartphone/smartphone.addon.php b/addons/smartphone/smartphone.addon.php new file mode 100644 index 000000000..4974d9460 --- /dev/null +++ b/addons/smartphone/smartphone.addon.php @@ -0,0 +1,22 @@ +setModuleInfo($this->module_info); + $oSmartphoneXE->setModuleInstance($this); + $oSmartphoneXE->display(); +?> diff --git a/addons/smartphone/tpl/layout.html b/addons/smartphone/tpl/layout.html new file mode 100644 index 000000000..41193bc91 --- /dev/null +++ b/addons/smartphone/tpl/layout.html @@ -0,0 +1,55 @@ + + + + + + + + {Context::getBrowserTitle()} + + + + + + + +
+

+ + Search +
+ + + + + + + + diff --git a/addons/wiki_link/wiki_link.addon.php b/addons/wiki_link/wiki_link.addon.php index 99687c200..501a36711 100644 --- a/addons/wiki_link/wiki_link.addon.php +++ b/addons/wiki_link/wiki_link.addon.php @@ -6,9 +6,7 @@ if(!$module_info->module) return; if($module_info->module != 'wiki') return; Context::loadJavascriptPlugin('hotkeys'); - Context::addJsFile('./addons/wiki_link/wikilink.js'); - Context::addCssFile('./addons/wiki_link/wikilink.css'); - $footer = ""; - Context::addHtmlFooter($footer); + Context::addJsFile('./addons/wiki_link/wikilink.js',false); + Context::addCssFile('./addons/wiki_link/wikilink.css',false); } ?> diff --git a/addons/wiki_link/wikilink.css b/addons/wiki_link/wikilink.css index 6738acecd..c473c440d 100644 --- a/addons/wiki_link/wikilink.css +++ b/addons/wiki_link/wikilink.css @@ -1,4 +1,5 @@ -#link { display: none; } -#link .linkForm { margin-left: 10px; margin-top: 10px; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 5px; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } - +.ui-dialog { background-color:#fff; z-index:999; padding:10px;} +.ui-dialog-title { font-weight:bold; margin-bottom:3px; } +.ui-dialog-titlebar-close { display:none; } +.ui-dialog-buttonpane { text-align:right; bottom:5px !important; } +.ui-dialog-buttonpane button { font-size:11px; font-family:tahoma; } diff --git a/addons/wiki_link/wikilink.js b/addons/wiki_link/wikilink.js index d962a287c..09d4fd435 100644 --- a/addons/wiki_link/wikilink.js +++ b/addons/wiki_link/wikilink.js @@ -1,15 +1,20 @@ function openWikiLinkDialog() { - var link = jQuery("#link"); - link.css('display', 'block'); - var target = xGetElementById('linktarget'); - target.value = ""; - try{ - link.dialog({height:100}); - } - catch(e) - { - link.dialog("open"); + var wikiLink = jQuery('#wikiLink'); + if ( wikiLink.length < 1 ) { + try{ + jQuery('') + .appendTo('body') + .dialog({ + title:'wiki Link', width:300, height:60, resizable:false, + modal: false, overlay: { opacity: 1, background: "#fff" }, + buttons: { "add link": function() { setText(); jQuery(this).dialog("close"); }, "cancel": function() { jQuery(this).dialog("close"); } }, + show: 'drop' /* , hide: 'explode' */ + }); + } catch(e){ + } + } else { + wikiLink.dialog('open'); } } @@ -19,6 +24,7 @@ function setText() { var text = target.value; text.replace(/&/ig,'&').replace(//ig,'>'); var url = request_uri.setQuery('mid',current_mid).setQuery('entry',text); + if(typeof(xeVid)!='undefined') url = url.setQuery('vid', xeVid); var link = ""; @@ -31,16 +37,13 @@ function addShortCutForWiki() { var iframe_obj = editorGetIFrame(1); jQuery(iframe_obj.contentWindow.document).bind('keydown', "CTRL+SHIFT+SPACE", function(evt) { openWikiLinkDialog(); }); - if(jQuery.os.Mac) - { + if(jQuery.os.Mac) { jQuery(iframe_obj.contentWindow.document).bind('keydown', "ALT+SPACE", function(evt) { openWikiLinkDialog(); }); - } - else - { + } else { jQuery(iframe_obj.contentWindow.document).bind('keydown', "CTRL+SPACE", function(evt) { openWikiLinkDialog(); }); } jQuery(document).bind('keydown',"CTRL+SHIFT+SPACE", function(evt) {} ); } -xAddEventListener(window, 'load', addShortCutForWiki); +jQuery(window).load( function() { addShortCutForWiki() } ); diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index bf343451b..170641063 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -13,6 +13,8 @@ class Context { + var $allow_rewrite = false; ///< @brief rewrite mod 사용에 대한 변수 + var $request_method = 'GET'; ///< @brief GET/POST/XMLRPC 중 어떤 방식으로 요청이 왔는지에 대한 값이 세팅. GET/POST/XML 3가지가 있음 var $response_method = ''; ///< @brief HTML/XMLRPC 중 어떤 방식으로 결과를 출력할지 결정. (강제 지정전까지는 request_method를 따름) @@ -26,6 +28,7 @@ var $css_files = array(); ///< @brief display시에 사용하게 되는 css files의 목록 var $html_header = NULL; ///< @brief display시에 사용하게 되는 ..내의 스크립트코드 + var $body_class = array(); ///< @brief display시에 사용하게 되는 안에 출력될 class var $body_header = NULL; ///< @brief display시에 사용하게 되는 바로 다음에 출력될 스크립트 코드 var $html_footer = NULL; ///< @brief display시에 사용하게 되는 바로 앞에 추가될 코드 @@ -45,8 +48,6 @@ var $is_uploaded = false; ///< @brief 첨부파일이 업로드 된 요청이였는지에 대한 체크 플래그 - var $widget_include_info_flag = false; // 위젯 정보 코드 출력 - /** * @brief 유일한 Context 객체를 반환 (Singleton) * Context는 어디서든 객체 선언없이 사용하기 위해서 static 하게 사용 @@ -87,6 +88,8 @@ Context::set('site_module_info', $site_module_info); if($site_module_info->site_srl && isSiteID($site_module_info->vid)) Context::set('vid', $site_module_info->vid); + $this->db_info->lang_type = $site_module_info->default_language; + if(!$this->db_info->lang_type) $this->db_info->lang_type = 'en'; } // 언어 파일 불러오기 @@ -96,14 +99,9 @@ if($_COOKIE['lang_type']) $this->lang_type = $_COOKIE['lang_type']; // 사용자 설정 언어 타입이 없으면 기본 언어타입으로 지정 - if(!$this->lang_type) { - // 가상 사이트라면 가상사이트의 언어타입으로 지정 - if($site_module_info && $site_module_info->default_language) $this->lang_type = $site_module_info->default_language; - else $this->lang_type = $this->db_info->lang_type; - } + if(!$this->lang_type) $this->lang_type = $this->db_info->lang_type; // 관리자 설정 언어값에 등록된 것이 아니라면 기본 언어로 변경 - if(!in_array($this->lang_type, array_keys($lang_supported))) $this->lang_type = $this->db_info->lang_type; if(!$this->lang_type) $this->lang_type = "en"; Context::set('lang_supported', $lang_supported); @@ -113,16 +111,18 @@ $this->loadLang(_XE_PATH_.'modules/module/lang'); // 세션 핸들러 지정 - $oSessionModel = &getModel('session'); - $oSessionController = &getController('session'); - session_set_save_handler( - array(&$oSessionController,"open"), - array(&$oSessionController,"close"), - array(&$oSessionModel,"read"), - array(&$oSessionController,"write"), - array(&$oSessionController,"destroy"), - array(&$oSessionController,"gc") - ); + if($this->db_info->use_db_session != 'N') { + $oSessionModel = &getModel('session'); + $oSessionController = &getController('session'); + session_set_save_handler( + array(&$oSessionController,"open"), + array(&$oSessionController,"close"), + array(&$oSessionModel,"read"), + array(&$oSessionController,"write"), + array(&$oSessionController,"destroy"), + array(&$oSessionController,"gc") + ); + } session_start(); @@ -816,6 +816,8 @@ $get_vars[$key] = $val; } unset($get_vars['vid']); + unset($get_vars['rnd']); + if(isset($get_vars['page'])&&$get_vars['page']<2) unset($get_vars['page']); /* member module중의 쪽지함/친구 관리 기능이 communication 모듈로 이전하여 하위 호환성을 위한 act값 변경 */ if($get_vars['act'] == 'dispMemberFriend') $get_vars['act'] = 'dispCommunicationFriend'; @@ -1248,6 +1250,39 @@ return $this->html_header; } + /** + * @brief Html Body에 css class 추가 + **/ + function addBodyClass($class_name) { + $oContext = &Context::getInstance(); + return $oContext->_addBodyClass($class_name); + } + + /** + * @brief Html Body에 css class 추가 + **/ + function _addBodyClass($class_name) { + $this->body_class[] = $class_name; + } + + /** + * @brief Html Body에 css class return + **/ + function getBodyClass() { + $oContext = &Context::getInstance(); + return $oContext->_getBodyClass(); + } + + /** + * @brief Html Body에 css class return + **/ + function _getBodyClass() { + $this->body_class = array_unique($this->body_class); + if(count($this->body_class)>0) return sprintf(' class="%s"', join(' ',$this->body_class)); + else return ''; + } + + /** * @brief BodyHeader 추가 **/ @@ -1331,117 +1366,19 @@ return file_exists(Context::getConfigFile()) && filesize(Context::getConfigFile()); } - - /** - * @brief 내용의 위젯이나 기타 기능에 대한 code를 실제 code로 변경을 위한 flag set - **/ - function setTransWidgetCodeIncludeInfo($flag=false){ - $oContext = &Context::getInstance(); - $oContext->widget_include_info_flag = $flag ? true : false; - } - /** * @brief 내용의 위젯이나 기타 기능에 대한 code를 실제 code로 변경 **/ function transContent($content) { - - // 사용자 정의 언어로 변경 - $oModuleController = &getController('module'); - $oModuleController->replaceDefinedLangCode($content); - - // 위젯 코드 변경 - $oWidgetController = &getController('widget'); - $content = $oWidgetController->transWidgetCode($content,$this->widget_include_info_flag); - - // 메타 파일 변경 - $content = preg_replace_callback('!<\!\-\-Meta:([^\-]*?)\-\->!is', array($this,'transMeta'), $content); - - // 에디터 컴포넌트를 찾아서 결과 코드로 변환 - $content = preg_replace_callback('!]*)editor_component=([^\>]*)>(.*?)\<\/div\>!is', array($this,'transEditorComponent'), $content); - $content = preg_replace_callback('!]*)editor_component=([^\>]*?)\>!is', array($this,'transEditorComponent'), $content); - - // style의 url 경로를 재정의 한다. - $content = preg_replace('/url\(http:\/\/([^ ]+)http:\/\//is','url(http://', $content); - // body 내의 를 header로 이동 - $content = preg_replace_callback('!!is', array($this,'moveStyleToHeader'), $content); - - // templateHandler의 이미지 경로로 인하여 생기는 절대경로 이미지등의 경로 중복 처리 - //$content = preg_replace('/<(img|input)([^>]*)src=(["|\']?)http:\/\/([^ ]+)http:\/\//is','<$1$2src=$3http://', $content); - $content = preg_replace('/src=(["|\']?)http:\/\/([^ ]+)http:\/\//is','src=$1http://', $content); - return $content; } /** - * @brief IE위지윅에디터에서 태그가 대문자로 사용되기에 이를 소문자로 치환 + * @brief rewrite mod 사용에 대한 변수 return **/ - function transTagToLowerCase($matches) { - return sprintf('<%s%s%s>', $matches[1], strtolower($matches[2]), $matches[3]); + function isAllowRewrite() { + $oContext = &Context::getInstance(); + return $oContext->allow_rewrite; } - - /** - * @brief 를 변경 - **/ - function transMeta($matches) { - if(substr($matches[1],'-4')=='.css') $this->addCSSFile($matches[1]); - elseif(substr($matches[1],'-3')=='.js') $this->addJSFile($matches[1]); - } - - /** - * @brief 내의 addHtmlHeader($matches[0]); - return ''; - } - - /** - * @brief 내용의 에디터 컴포넌트 코드를 변환 - **/ - function transEditorComponent($matches) { - // IE에서는 태그의 특성중에서 " 를 빼어 버리는 경우가 있기에 정규표현식으로 추가해줌 - $buff = $matches[0]; - $buff = preg_replace_callback('/([^=^"^ ]*)=([^ ^>]*)/i', fixQuotation, $buff); - $buff = str_replace("&","&",$buff); - - // 에디터 컴포넌트에서 생성된 코드 - $oXmlParser = new XmlParser(); - $xml_doc = $oXmlParser->parse($buff); - if($xml_doc->div) $xml_doc = $xml_doc->div; - else if($xml_doc->img) $xml_doc = $xml_doc->img; - - $xml_doc->body = $matches[3]; - - // attribute가 없으면 return - $editor_component = $xml_doc->attrs->editor_component; - if(!$editor_component) return $matches[0]; - - // component::transHTML() 을 이용하여 변환된 코드를 받음 - $oEditorModel = &getModel('editor'); - $oComponent = &$oEditorModel->getComponentObject($editor_component, 0); - if(!is_object($oComponent)||!method_exists($oComponent, 'transHTML')) return $matches[0]; - - return $oComponent->transHTML($xml_doc); - } - - /** - * @brief gzip encoding 여부 체크 - **/ - function isGzEnabled() { - if( - (defined('__OB_GZHANDLER_ENABLE__') && __OB_GZHANDLER_ENABLE__ == 1) && - strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')!==false && - function_exists('ob_gzhandler') && - extension_loaded('zlib') - ) return true; - return false; - } - - function getFixUrl($url){ - if(eregi("(http|https):\/\/",$url)) return $url; - if(ereg("^/",$url)) return $url; - return dirname($_SERVER['PHP_SELF']) . "/" . $url; - } - } ?> diff --git a/classes/db/DBCubrid.class.php b/classes/db/DBCubrid.class.php index ccf7fd7fe..b79312ed7 100644 --- a/classes/db/DBCubrid.class.php +++ b/classes/db/DBCubrid.class.php @@ -713,6 +713,23 @@ function _getNavigationData($table_list, $columns, $left_join, $condition, $output) { require_once(_XE_PATH_.'classes/page/PageHandler.class.php'); + /* + // group by 절이 포함된 SELECT 쿼리의 전체 갯수를 구하기 위한 수정 + // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다. + // + $count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition; + $total_count = $this->getCountCache($output->tables, $count_condition); + if($total_count === false) { + $count_query = sprintf('select count(*) as "count" from %s %s %s', implode(', ', $table_list), implode(' ', $left_join), $count_condition); + if (count($output->groups)) + $count_query = sprintf('select count(*) as "count" from (%s) xet', $count_query); + $result = $this->_query($count_query); + $count_output = $this->_fetch($result); + $total_count = (int)$count_output->count; + $this->putCountCache($output->tables, $count_condition, $total_count); + } + */ + // 전체 개수를 구함 $count_query = sprintf("select count(*) as \"count\" from %s %s %s", implode(',',$table_list),implode(' ',$left_join), $condition); $total_count = $this->getCountCache($output->tables, $condition); diff --git a/classes/db/DBFirebird.class.php b/classes/db/DBFirebird.class.php index 0de2caac7..b9de8d553 100644 --- a/classes/db/DBFirebird.class.php +++ b/classes/db/DBFirebird.class.php @@ -338,6 +338,9 @@ $tmp->{$key} = ibase_blob_get($blob_hndl, $blob_data[0]); ibase_blob_close($blob_hndl); } + else if($type == "char") { + $tmp->{$key} = trim($tmp->{$key}); // DB의 character set이 UTF8일때 생기는 빈칸을 제거 + } } $return[] = $tmp; @@ -875,6 +878,30 @@ function _getNavigationData($table_list, $columns, $left_join, $condition, $output) { require_once(_XE_PATH_.'classes/page/PageHandler.class.php'); + $query_groupby = ''; + if ($output->groups) { + foreach ($output->groups as $key => $val) + $group_list[] = $this->autoQuotes($val); + if (count($group_list)) $query_groupby = sprintf(" GROUP BY %s", implode(", ", $group_list)); + } + + /* + // group by 절이 포함된 SELECT 쿼리의 전체 갯수를 구하기 위한 수정 + // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다. + // + $count_condition = strlen($query_groupby) ? sprintf('%s group by %s', $condition, $query_groupby) : $condition; + $total_count = $this->getCountCache($output->tables, $count_condition); + if($total_count === false) { + $count_query = sprintf('select count(*) as "count" from %s %s %s', implode(', ', $table_list), implode(' ', $left_join), $count_condition); + if (count($output->groups)) + $count_query = sprintf('select count(*) as "count" from (%s) xet', $count_query); + $result = $this->_query($count_query); + $count_output = $this->_fetch($result); + $total_count = (int)$count_output->count; + $this->putCountCache($output->tables, $count_condition, $total_count); + } + */ + // 전체 개수를 구함 $count_query = sprintf("select count(*) as \"count\" from %s %s %s", implode(',',$table_list),implode(' ',$left_join), $condition); $total_count = $this->getCountCache($output->tables, $condition); @@ -918,12 +945,7 @@ $limit = sprintf('FIRST %d SKIP %d ', $list_count, $start_count); $query = sprintf('SELECT %s %s FROM %s %s %s', $limit, $columns, implode(',',$table_list), implode(' ',$left_join), $condition); - if($output->groups) { - foreach($output->groups as $key => $val) { - $group_list[] = $this->autoQuotes($val); - } - if(count($group_list)) $query .= sprintf(" GROUP BY %s", implode(",",$group_list)); - } + if (strlen($query_groupby)) $query .= $query_groupby; if($output->order) { foreach($output->order as $key => $val) { diff --git a/classes/db/DBMysql.class.php b/classes/db/DBMysql.class.php index 0269257ad..621ae4d30 100644 --- a/classes/db/DBMysql.class.php +++ b/classes/db/DBMysql.class.php @@ -588,13 +588,16 @@ require_once(_XE_PATH_.'classes/page/PageHandler.class.php'); // 전체 개수를 구함 - $count_query = sprintf("select count(*) as count from %s %s %s", implode(',',$table_list),implode(' ',$left_join), $condition); - $total_count = $this->getCountCache($output->tables, $condition); + $count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition; + $total_count = $this->getCountCache($output->tables, $count_condition); if($total_count === false) { + $count_query = sprintf("select count(*) as count from %s %s %s", implode(', ', $table_list), implode(' ', $left_join), $count_condition); + if (count($output->groups)) + $count_query = sprintf('select count(*) as count from (%s) xet', $count_query); $result = $this->_query($count_query); $count_output = $this->_fetch($result); $total_count = (int)$count_output->count; - $this->putCountCache($output->tables, $condition, $total_count); + $this->putCountCache($output->tables, $count_condition, $total_count); } $list_count = $output->list_count['value']; diff --git a/classes/db/DBMysql_innodb.class.php b/classes/db/DBMysql_innodb.class.php index 7abf4f409..d0c53fe60 100644 --- a/classes/db/DBMysql_innodb.class.php +++ b/classes/db/DBMysql_innodb.class.php @@ -600,13 +600,16 @@ require_once(_XE_PATH_.'classes/page/PageHandler.class.php'); // 전체 개수를 구함 - $count_query = sprintf("select count(*) as count from %s %s %s", implode(',',$table_list),implode(' ',$left_join), $condition); - $total_count = $this->getCountCache($output->tables, $condition); + $count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition; + $total_count = $this->getCountCache($output->tables, $count_condition); if($total_count === false) { + $count_query = sprintf("select count(*) as count from %s %s %s", implode(', ', $table_list), implode(' ', $left_join), $count_condition); + if (count($output->groups)) + $count_query = sprintf('select count(*) as count from (%s) xet', $count_query); $result = $this->_query($count_query); $count_output = $this->_fetch($result); $total_count = (int)$count_output->count; - $this->putCountCache($output->tables, $condition, $total_count); + $this->putCountCache($output->tables, $count_condition, $total_count); } $list_count = $output->list_count['value']; diff --git a/classes/db/DBPostgresql.class.php b/classes/db/DBPostgresql.class.php index 129c1259c..2a96e9f3d 100644 --- a/classes/db/DBPostgresql.class.php +++ b/classes/db/DBPostgresql.class.php @@ -774,6 +774,23 @@ class DBPostgresql extends DB { require_once (_XE_PATH_ . 'classes/page/PageHandler.class.php'); + /* + // group by 절이 포함된 SELECT 쿼리의 전체 갯수를 구하기 위한 수정 + // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다. + // + $count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition; + $total_count = $this->getCountCache($output->tables, $count_condition); + if ($total_count === false) { + $count_query = sprintf('select count(*) as count from %s %s %s', implode(', ', $table_list), implode(' ', $left_join), $count_condition); + if (count($output->groups)) + $count_query = sprintf('select count(*) as count from (%s) xet', $count_query); + $result = $this->_query($count_query); + $count_output = $this->_fetch($result); + $total_count = (int)$count_output->count; + $this->putCountCache($output->tables, $count_condition, $total_count); + } + */ + // 전체 개수를 구함 $count_query = sprintf("select count(*) as count from %s %s %s", implode(',', $table_list), implode(' ', $left_join), $condition); diff --git a/classes/db/DBSqlite2.class.php b/classes/db/DBSqlite2.class.php index 5faf0246e..c84647254 100644 --- a/classes/db/DBSqlite2.class.php +++ b/classes/db/DBSqlite2.class.php @@ -605,6 +605,23 @@ function _getNavigationData($table_list, $columns, $left_join, $condition, $output) { require_once(_XE_PATH_.'classes/page/PageHandler.class.php'); + /* + // group by 절이 포함된 SELECT 쿼리의 전체 갯수를 구하기 위한 수정 + // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다. + // + $count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition; + $total_count = $this->getCountCache($output->tables, $count_condition); + if($total_count === false) { + $count_query = sprintf("select count(*) as count from %s %s %s", implode(', ', $table_list), implode(' ', $left_join), $count_condition); + if (count($output->groups)) + $count_query = sprintf('select count(*) as count from (%s) xet', $count_query); + $result = $this->_query($count_query); + $count_output = $this->_fetch($result); + $total_count = (int)$count_output->count; + $this->putCountCache($output->tables, $count_condition, $total_count); + } + */ + // 전체 개수를 구함 $count_query = sprintf("select count(*) as count from %s %s %s", implode(',',$table_list),implode(' ',$left_join), $condition); diff --git a/classes/db/DBSqlite3_pdo.class.php b/classes/db/DBSqlite3_pdo.class.php index 81fa0bad6..bf7caf22e 100644 --- a/classes/db/DBSqlite3_pdo.class.php +++ b/classes/db/DBSqlite3_pdo.class.php @@ -648,6 +648,23 @@ function _getNavigationData($table_list, $columns, $left_join, $condition, $output) { require_once(_XE_PATH_.'classes/page/PageHandler.class.php'); + /* + // group by 절이 포함된 SELECT 쿼리의 전체 갯수를 구하기 위한 수정 + // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다. + // + $count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition; + $total_count = $this->getCountCache($output->tables, $count_condition); + if($total_count === false) { + $count_query = sprintf("select count(*) as count from %s %s %s", implode(', ', $table_list), implode(' ', $left_join), $count_condition); + if (count($output->groups)) + $count_query = sprintf('select count(*) as count from (%s) xet', $count_query); + $result = $this->_query($count_query); + $count_output = $this->_fetch($result); + $total_count = (int)$count_output->count; + $this->putCountCache($output->tables, $count_condition, $total_count); + } + */ + // 전체 개수를 구함 $count_query = sprintf("select count(*) as count from %s %s %s", implode(',',$table_list),implode(' ',$left_join), $condition); $total_count = $this->getCountCache($output->tables, $condition); diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php index 51e2bdc86..277865b25 100644 --- a/classes/display/DisplayHandler.class.php +++ b/classes/display/DisplayHandler.class.php @@ -7,7 +7,6 @@ * Response Method에 따라서 html or xml 출력방법을 결정한다 * xml : oModule의 variables를 simple xml 로 출력 * html : oModule의 template/variables로 html을 만들고 contents_html로 처리 - * widget이나 layout의 html과 연동하여 출력 **/ class DisplayHandler extends Handler { @@ -22,108 +21,142 @@ function printContent(&$oModule) { // gzip encoding 지원 여부 체크 - $this->gz_enabled = Context::isGzEnabled(); + if( + (defined('__OB_GZHANDLER_ENABLE__') && __OB_GZHANDLER_ENABLE__ == 1) && + strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')!==false && + function_exists('ob_gzhandler') && + extension_loaded('zlib') + ) $this->gz_enabled = true; - // header 출력 - $this->_printHeader(); - // request method에 따른 처리 - if(Context::getRequestMethod() == 'XMLRPC') $content = $this->_toXmlDoc($oModule); - else if(Context::getRequestMethod() == 'JSON') $content = $this->_toJSON($oModule); - else $content = $this->_toHTMLDoc($oModule); + // request method에 따른 컨텐츠 결과물 추출 + if(Context::getRequestMethod() == 'XMLRPC') $output = $this->_toXmlDoc($oModule); + else if(Context::getRequestMethod() == 'JSON') $output = $this->_toJSON($oModule); + else $output = $this->_toHTMLDoc($oModule); - // 요청방식에 따라 출력을 별도로 + // HTML 출력 요청일 경우 레이아웃 컴파일과 더블어 완성된 코드를 제공 if(Context::getResponseMethod()=="HTML") { // 관리자 모드일 경우 #xeAdmin id를 가지는 div 추가 - if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')>0) $content = '
'.$content.'
'; + if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')>0) $output = '
'.$output.'
'; - // 내용을 content라는 변수로 설정 (layout에서 {$content}에서 대체됨) - Context::set('content', $content); + // 내용을 content라는 변수로 설정 (layout에서 {$output}에서 대체됨) + Context::set('content', $output); // 레이아웃을 컴파일 - if(__DEBUG__==3) $start = getMicroTime(); $oTemplate = &TemplateHandler::getInstance(); // layout이라는 변수가 none으로 설정되면 기본 레이아웃으로 변경 if(Context::get('layout') != 'none') { + if(__DEBUG__==3) $start = getMicroTime(); + $layout_path = $oModule->getLayoutPath(); + $layout_file = $oModule->getLayoutFile(); $edited_layout_file = $oModule->getEditedLayoutFile(); - } - if(!$layout_path) $layout_path = './common/tpl/'; - if(!$layout_file) $layout_file = 'default_layout.html'; - // 현재 요청된 레이아웃 정보를 구함 - $oLayoutModel = &getModel('layout'); - $current_module_info = Context::get('current_module_info'); - $layout_srl = $current_module_info->layout_srl; + // 현재 요청된 레이아웃 정보를 구함 + $oLayoutModel = &getModel('layout'); + $current_module_info = Context::get('current_module_info'); + $layout_srl = $current_module_info->layout_srl; - // 생성된 레이아웃과 연결되어 있으면 처리 - if($layout_srl > 0){ - $layout_info = Context::get('layout_info'); + // 레이아웃과 연결되어 있으면 레이아웃 컴파일 + if($layout_srl > 0){ + $layout_info = Context::get('layout_info'); - // faceoff 레이아웃일 경우 별도 처리 - if($layout_info && $layout_info->type == 'faceoff') { - $oLayoutModel->doActivateFaceOff($layout_info); + // faceoff 레이아웃일 경우 별도 처리 + if($layout_info && $layout_info->type == 'faceoff') { + $oLayoutModel->doActivateFaceOff($layout_info); + Context::set('layout_info', $layout_info); + } + + // 관리자 레이아웃 수정화면에서 변경된 CSS가 있는지 조사 + $edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl); + + if(file_exists($edited_layout_css)) Context::addCSSFile($edited_layout_css,true,'all','',100); } + if(!$layout_path) $layout_path = "./common/tpl"; + if(!$layout_file) $layout_file = "default_layout"; - // 관리자 레이아웃 수정화면에서 변경된 CSS가 있는지 조사 - $edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl); + $output = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file); - - if(file_exists($edited_layout_css)) Context::addCSSFile($edited_layout_css,true,'all','',100); + if(__DEBUG__==3) $GLOBALS['__layout_compile_elapsed__'] = getMicroTime()-$start; } - Context::set('layout_info', $layout_info); - $zbxe_final_content = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file); - if(__DEBUG__==3) $GLOBALS['__layout_compile_elapsed__'] = getMicroTime()-$start; - - - // 각 위젯, 에디터 컴포넌트의 코드 변경 - if(__DEBUG__==3) $start = getMicroTime(); - - $oContext = &Context::getInstance(); - $zbxe_final_content= $oContext->transContent($zbxe_final_content); - - if(__DEBUG__==3) $GLOBALS['__trans_widget_editor_elapsed__'] = getMicroTime()-$start; - - // 최종 결과를 common_layout에 넣어버림 - Context::set('zbxe_final_content', $zbxe_final_content); - - $output = $oTemplate->compile('./common/tpl', 'common_layout'); - - // 사용자 정의 언어 변경 - $oModuleController = &getController('module'); - $oModuleController->replaceDefinedLangCode($output); - - - } else { - $output = $content; } + // 출력하기 전에 trigger 호출 (before) + ModuleHandler::triggerCall('display', 'before', $output); + // 애드온 실행 $called_position = 'before_display_content'; $oAddonController = &getController('addon'); $addon_file = $oAddonController->getCacheFilePath(); if(file_exists($addon_file)) @include($addon_file); - $this->content_size = strlen($output); + // HTML 출력일 경우 최종적으로 common layout을 씌워서 출력 + if(Context::getResponseMethod()=="HTML") { + if(__DEBUG__==3) $start = getMicroTime(); - // 컨텐츠 출력 - $this->display($output); + // body 내의 를 header로 이동 + $output = preg_replace_callback('!!is', array($this,'moveStyleToHeader'), $output); + + // 메타 파일 변경 (캐싱기능등으로 인해 위젯등에서 태그를 content에 넣는 경우가 있음 + $output = preg_replace_callback('//is', array($this,'transMeta'), $output); + + // rewrite module 사용시 생기는 상대경로에 대한 처리를 함 + if(Context::isAllowRewrite()) { + $url = parse_url(Context::getRequestUri()); + $real_path = $url['path']; + + $pattern = '/src=("|\'){1}(\.\/)?(files\/attach|files\/cache|files\/faceOff|files\/member_extra_info|modules|common|widgets|widgetstyle|layouts|addons)\/([^"\']+)\.(jpg|jpeg|png|gif)("|\'){1}/s'; + $output = preg_replace($pattern, 'src=$1'.$real_path.'$3/$4.$5$6', $output); + } + + // 간혹 background-image에 url(none) 때문에 request가 한번 더 일어나는 경우가 생기는 것을 방지 + $output = preg_replace('/url\((["\']?)none(["\']?)\)/is', 'none', $output); + + if(__DEBUG__==3) $GLOBALS['__trans_content_elapsed__'] = getMicroTime()-$start; + + // 최종 레이아웃 변환 + Context::set('content', $output); + $output = $oTemplate->compile('./common/tpl', 'common_layout'); + + // 사용자 정의 언어 변환 + $oModuleController = &getController('module'); + $oModuleController->replaceDefinedLangCode($output); + } + + // header 출력 + if($this->gz_enabled) header("Content-Encoding: gzip"); + if(Context::getResponseMethod() == 'JSON') $this->_printJSONHeader(); + else if(Context::getResponseMethod() != 'HTML') $this->_printXMLHeader(); + else $this->_printHTMLHeader(); + + // debugOutput 출력 + $this->content_size = strlen($output); + $output .= $this->_debugOutput(); + + // 결과물 직접 출력 + if($this->gz_enabled) print ob_gzhandler($output, 5); + else print $output; + + // 출력 후 trigger 호출 (after) + ModuleHandler::triggerCall('display', 'after', $content); } /** - * @brief 최종 결과물의 출력 + * @brief 를 변경 **/ - function display($content) { - $content .= $this->_debugOutput(); + function transMeta($matches) { + if(substr($matches[1],'-4')=='.css') Context::addCSSFile($matches[1]); + elseif(substr($matches[1],'-3')=='.js') Context::addJSFile($matches[1]); + } - // 출력하기 전에 trigger 호출 (after) - ModuleHandler::triggerCall('display', 'after', $content); - - if($this->gz_enabled) print ob_gzhandler($content, 5); - else print $content; + /** + * @brief 내의 compile($template_path, $tpl_file); } - /** - * @brief content size return - **/ - function getContentSize() { - return $this->content_size; - } - /** * @brief 디버그 모드일 경우 디버깅 메시지 출력 * @@ -225,7 +251,7 @@ sprintf("%s:%s%s%s%s", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING']?'?':'', $_SERVER['QUERY_STRING']), $_SERVER['REQUEST_METHOD'], Context::getResponseMethod(), - $this->getContentSize().' byte' + $this->content_size.' byte' ) ) ), @@ -233,7 +259,7 @@ ); $firephp->fb( array('Elapsed time >>> Total : '.sprintf('%0.5f sec', $end - __StartTime__), - array(array('DB queries', 'class file load', 'Template compile', 'XmlParse compile', 'PHP', 'Widgets', 'Trans widget&editor'), + array(array('DB queries', 'class file load', 'Template compile', 'XmlParse compile', 'PHP', 'Widgets', 'Trans Content'), array( sprintf('%0.5f sec', $GLOBALS['__db_elapsed_time__']), sprintf('%0.5f sec', $GLOBALS['__elapsed_class_load__']), @@ -241,7 +267,7 @@ sprintf('%0.5f sec', $GLOBALS['__xmlparse_elapsed__']), sprintf('%0.5f sec', $end-__StartTime__-$GLOBALS['__template_elapsed__']-$GLOBALS['__xmlparse_elapsed__']-$GLOBALS['__db_elapsed_time__']-$GLOBALS['__elapsed_class_load__']), sprintf('%0.5f sec', $GLOBALS['__widget_excute_elapsed__']), - sprintf('%0.5f sec', $GLOBALS['__trans_widget_editor_elapsed__']) + sprintf('%0.5f sec', $GLOBALS['__trans_content_elapsed__']) ) ) ), @@ -275,7 +301,7 @@ $buff .= sprintf("\tRequest URI \t\t\t: %s:%s%s%s%s\n", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING']?'?':'', $_SERVER['QUERY_STRING']); $buff .= sprintf("\tRequest method \t\t\t: %s\n", $_SERVER['REQUEST_METHOD']); $buff .= sprintf("\tResponse method \t\t: %s\n", Context::getResponseMethod()); - $buff .= sprintf("\tResponse contents size\t\t: %d byte\n", $this->getContentSize()); + $buff .= sprintf("\tResponse contents size\t\t: %d byte\n", $this->content_size); // 전체 실행 시간 $buff .= sprintf("\n- Total elapsed time : %0.5f sec\n", $end-__StartTime__); @@ -292,7 +318,7 @@ $buff .= sprintf("\n\tLayout compile elapsed time \t: %0.5f sec", $GLOBALS['__layout_compile_elapsed__']); // 위젯, 에디터 컴포넌트 치환 시간 - $buff .= sprintf("\n\tTrans widget&editor elapsed time: %0.5f sec\n", $GLOBALS['__trans_widget_editor_elapsed__']); + $buff .= sprintf("\n\tTrans Content \t\t\t: %0.5f sec\n", $GLOBALS['__trans_content_elapsed__']); } // DB 로그 작성 @@ -338,17 +364,6 @@ } } - - /** - * @brief RequestMethod에 맞춰 헤더 출력 - ***/ - function _printHeader() { - if($this->gz_enabled) header("Content-Encoding: gzip"); - if(Context::getResponseMethod() == 'JSON') return $this->_printJSONHeader(); - else if(Context::getResponseMethod() != 'HTML') return $this->_printXMLHeader(); - else return $this->_printHTMLHeader(); - } - /** * @brief xml header 출력 (utf8 고정) **/ diff --git a/classes/file/FileHandler.class.php b/classes/file/FileHandler.class.php index 148e0d951..9d633014d 100644 --- a/classes/file/FileHandler.class.php +++ b/classes/file/FileHandler.class.php @@ -295,13 +295,12 @@ } $oResponse = $oRequest->sendRequest(); - if(PEAR::isError($oResponse)) return; $code = $oRequest->getResponseCode(); $header = $oRequest->getResponseHeader(); $body = $oRequest->getResponseBody(); - if($code == 301) { + if($code == 301 || $code == 302) { $url = $header['location']; if($url) return FileHandler::getRemoteResource($url, $body, $timeout, $method, $content_type, $headers); else return; diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index cdd2650e6..0d659e73e 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -368,6 +368,10 @@ $instance_name = sprintf("%s%s",$module,"WAP"); $class_file = sprintf('%s%s%s.wap.php', _XE_PATH_, $class_path, $module); break; + case 'smartphone' : + $instance_name = sprintf("%s%s",$module,"SPhone"); + $class_file = sprintf('%s%s%s.smartphone.php', _XE_PATH_, $class_path, $module); + break; case 'class' : $instance_name = $module; $class_file = sprintf('%s%s%s.class.php', _XE_PATH_, $class_path, $module); @@ -437,7 +441,7 @@ if(!$oModule || !method_exists($oModule, $called_method)) continue; $output = $oModule->{$called_method}($obj); - if(!$output->toBool()) return $output; + if(is_object($output) && method_exists($output, 'toBool') && !$output->toBool()) return $output; unset($oModule); } diff --git a/classes/optimizer/Optimizer.class.php b/classes/optimizer/Optimizer.class.php index 8b462c1ee..3a6f94afd 100644 --- a/classes/optimizer/Optimizer.class.php +++ b/classes/optimizer/Optimizer.class.php @@ -71,8 +71,19 @@ $files = $this->_getOptimizedRemoved($files); if(!count($files)) return $files; + $url_info = parse_url(Context::getRequestUri()); + $abpath = $url_info['path']; + foreach($files as $key => $val) { - if(substr($val['file'],0,2)=='./') $files[$key]['file'] = Context::getRequestUri().substr($val['file'],2); + $file = $val['file']; + + if(substr($file,0,1)=='/' || strpos($file,'://')!==false) continue; + if(substr($file,0,2)=='./') $file = substr($file,2); + $file = $abpath.$file; + while(strpos($file,'/../')!==false) { + $file = preg_replace('/\/([^\/]+)\/\.\.\//','/',$file); + } + $files[$key]['file'] = $file; } return $files; } @@ -222,9 +233,14 @@ if(!$cached) { $abpath = $url_info['path']; } $path = str_replace(array('"',"'"),'',$matches[1]); - if(preg_match('/^http|^\//i', $path) || preg_match('/\.htc$/i',$path) ) return $matches[0]; + if(substr($path,0,1)=='/' || strpos($path,'://')!==false || strpos($path,'.htc')!==false) return 'url("'.$path.'")'; + if(substr($path,0,2)=='./') $path = substr($path,2); + $target = $abpath.$this->tmp_css_path.$path; + while(strpos($target,'/../')!==false) { + $target = preg_replace('/\/([^\/]+)\/\.\.\//','/',$target); + } - return 'url("'.$abpath.$this->tmp_css_path.$path.'")'; + return 'url("'.$target.'")'; } } diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index b52da352b..ed75fc545 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -100,8 +100,8 @@ // include 변경 $buff = preg_replace_callback('!<\!--#include\(([^\)]*?)\)-->!is', array($this, '_compileIncludeToCode'), $buff); - // 이미지 태그 img의 src의 값이 http:// 나 / 로 시작하지 않으면 root경로부터 시작하도록 변경 - $buff = preg_replace_callback('/<(img|input)([^>]*)src=[\'"]{1}(?!http)(.*?)[\'"]{1}/is', array($this, '_compileImgPath'), $buff); + // 이미지 태그 img의 src의 값이 ./ 또는 파일이름으로 바로 시작하면 경로 변경 + $buff = preg_replace_callback('/<(img|input)([^>]*)src=[\'"]{1}(.*?)[\'"]{1}/is', array($this, '_compileImgPath'), $buff); // 변수를 변경 $buff = preg_replace_callback('/\{[^@^ ]([^\{\}\n]+)\}/i', array($this, '_compileVarToContext'), $buff); @@ -124,13 +124,9 @@ // javascript plugin import $buff = preg_replace_callback('!<\!--%load_js_plugin\(\"([^\"]*?)\"\)-->!is', array($this, '_compileLoadJavascriptPlugin'), $buff); - // 파일에 쓰기 전에 직접 호출되는 것을 방지 $buff = sprintf('%s%s%s','',"\n",$buff); - // strip white spaces.. - // $buff = preg_replace('/ +/', ' ', $buff); - // 컴파일된 코드를 파일에 저장 if($compiled_tpl_file) FileHandler::writeFile($compiled_tpl_file, $buff); @@ -149,14 +145,23 @@ * @brief {$와 } 안의 $... 변수를 Context::get(...) 으로 변경 **/ function _compileImgPath($matches) { + static $real_path = null; $str1 = $matches[0]; - $str2 = $path = $matches[3]; - - if(substr($path,0,1)=='/') return $str1; + $str2 = $path = trim($matches[3]); + if(substr($path,0,1)=='/' || substr($path,0,1)=='{' || strpos($path,'://')!==false) return $str1; if(substr($path,0,2)=='./') $path = substr($path,2); - $path = 'tpl_path; ?>'.$path; - return str_replace($str2, $path, $str1); + + if(is_null($real_path)) { + $url = parse_url(Context::getRequestUri()); + $real_path = $url['path']; + } + + $target = $real_path.$this->tpl_path.$path; + while(strpos($target,'/../')!==false) { + $target = preg_replace('/\/([^\/]+)\/\.\.\//','/',$target); + } + return str_replace($str2, $target, $str1); } /** diff --git a/classes/widget/WidgetHandler.class.php b/classes/widget/WidgetHandler.class.php index 199e71ea1..38fadc6fd 100644 --- a/classes/widget/WidgetHandler.class.php +++ b/classes/widget/WidgetHandler.class.php @@ -9,337 +9,5 @@ var $widget_path = ''; - /** - * @brief 위젯 캐시 처리 - **/ - function getCache($widget, $args, $lang_type = null, $ignore_cache = false) { - // 지정된 언어가 없으면 현재 언어 지정 - if(!$lang_type) $lang_type = Context::getLangType(); - - // widget, 캐시 번호와 캐시값이 설정되어 있는지 확인 - $widget_sequence = $args->widget_sequence; - $widget_cache = $args->widget_cache; - - // args값에서 urldecode를 해줌 - $object_vars = get_object_vars($args); - if(count($object_vars)) { - foreach($object_vars as $key => $val) { - if(in_array($key, array('body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right','document_srl'))) continue; - $args->{$key} = utf8RawUrlDecode($val); - } - } - - /** - * 캐시 번호와 캐시 값이 아예 없으면 바로 데이터를 추출해서 리턴 - **/ - if(!$ignore_cache && (!$widget_cache || !$widget_sequence)) { - $oWidget = WidgetHandler::getObject($widget); - if(!$oWidget) return; - - return $oWidget->proc($args); - } - - /** - * 캐시 번호와 캐시값이 설정되어 있으면 캐시 파일을 불러오도록 함 - **/ - - // 캐시 디렉토리가 없으면 생성 - $cache_path = './files/cache/widget_cache/'; - if(!is_dir($cache_path)) FileHandler::makeDir($cache_path); - - // 캐시파일명을 구함 - $cache_file = sprintf('%s%d.%s.cache', $cache_path, $widget_sequence, $lang_type); - - // 캐시 Lock 파일을 구함 - $lock_file = sprintf('%s%d.%s.lock', $cache_path, $widget_sequence, $lang_type); - - // 캐시 파일이 존재하면 해당 파일의 유효성 검사 (lock파일이 있을 경우 유효성 검사하지 않음) - if(!$ignore_cache && file_exists($cache_file)) { - $filemtime = filemtime($cache_file); - - // 수정 시간을 비교해서 캐싱중이어야 하거나 WidgetHandler.class.php 파일보다 나중에 만들어 졌다면 캐시값을 return - if(file_exists($lock_file) || ($filemtime + $widget_cache*60 > time() && $filemtime > filemtime('./classes/widget/WidgetHandler.class.php'))) { - return FileHandler::readFile($cache_file); - } - } - - // lock 파일 생성 - FileHandler::writeFile($lock_file, ''); - - // 캐시 파일을 갱신하여야 할 경우 lock파일을 만들고 캐시 생성 - $oWidget = WidgetHandler::getObject($widget); - if(!$oWidget || !method_exists($oWidget,'proc')) return; - - $widget_content = $oWidget->proc($args); - FileHandler::writeFile($cache_file, $widget_content); - - // lock 파일 제거 - FileHandler::removeFile($lock_file); - - return $widget_content; - } - - /** - * @brief 위젯이름과 인자를 받아서 결과를 생성하고 결과 리턴 - * 태그 사용 templateHandler에서 WidgetHandler::execute()를 실행하는 코드로 대체하게 된다 - * - * $include_info가 true일 경우 페이지 수정시 위젯 핸들링을 위한 코드까지 포함함 - **/ - function execute($widget, $args, $include_info = false) { - // 디버그를 위한 위젯 실행 시간 저장 - if(__DEBUG__==3) $start = getMicroTime(); - - // args값에서 urldecode를 해줌 - $object_vars = get_object_vars($args); - if(count($object_vars)) { - foreach($object_vars as $key => $val) { - if(in_array($key, array('widgetbox_content','body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right','widgetstyle','document_srl'))) continue; - $args->{$key} = utf8RawUrlDecode($val); - } - } - - - /** - * 위젯이 widgetContent/ widgetBox가 아니라면 내용을 구함 - **/ - $widget_content = ''; - if($widget != 'widgetContent' && $widget != 'widgetBox') { - if(!is_dir(sprintf('./widgets/%s/',$widget))) return; - - // 위젯의 내용을 담을 변수 - $widget_content = WidgetHandler::getCache($widget, $args); - } - if($widget == 'widgetBox'){ - $widgetbox_content = $args->widgetbox_content; - } - - /** - * 관리자가 지정한 위젯의 style을 구함 - **/ - // 가끔 잘못된 코드인 background-image:url(none)이 들어 있을 수가 있는데 이럴 경우 none에 대한 url을 요청하므로 무조건 제거함 - $style = preg_replace('/background\-image: url\((.+)(\/?)none\)/is','', $args->style); - - // 내부 여백을 둔 것을 구해서 style문으로 미리 변경해 놓음 - $widget_padding_left = $args->widget_padding_left; - $widget_padding_right = $args->widget_padding_right; - $widget_padding_top = $args->widget_padding_top; - $widget_padding_bottom = $args->widget_padding_bottom; - $inner_style = sprintf("padding:%dpx %dpx %dpx %dpx !important; padding:none !important;", $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left); - - $oDocumentModel = &getModel('document'); - - - /** - * 위젯 출력물을 구함 - **/ - - $widget_content_header = ''; - $widget_content_body = ''; - $widget_content_footer = ''; - - // 일반 페이지 호출일 경우 지정된 스타일만 꾸면서 바로 return 함 - if(!$include_info) { - if($args->id) $args->id = ' id="'.$args->id.'" '; - switch($widget) { - // 내용 직접 추가일 경우 - case 'widgetContent' : - if($args->document_srl) { - $oDocument = $oDocumentModel->getDocument($args->document_srl); - $body = $oDocument->getContent(false,false,false, false); - } else { - $body = base64_decode($args->body); - } - - $widget_content_header = sprintf('
', $args->id, $style, $inner_style); - $widget_content_body = $body; - $widget_content_footer = '
'; - - break; - - // 위젯 박스일 경우 - case 'widgetBox' : - $widget_content_header = sprintf('
', $args->id, $style, $inner_style); - $widget_content_body = $widgetbox_content; - - break; - - // 일반 위젯일 경우 - default : - $widget_content_header = sprintf('
',$args->id,$style); - $widget_content_body = sprintf('
%s
', $inner_style,$widget_content); - $widget_content_footer = '
'; - break; - } - - // 페이지 수정시에 호출되었을 경우 위젯 핸들링을 위한 코드 추가 - } else { - switch($widget) { - // 내용 직접 추가일 경우 - case 'widgetContent' : - if($args->document_srl) { - $oDocument = $oDocumentModel->getDocument($args->document_srl); - $body = $oDocument->getContent(false,false,false); - } else { - $body = base64_decode($args->body); - } - - // args 정리 - $attribute = array(); - if($args) { - foreach($args as $key => $val) { - if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) continue; - if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val); - $attribute[] = sprintf('%s="%s"', $key, str_replace('"','\"',$val)); - } - } - - $oWidgetController = &getController('widget'); - - $widget_content_header = sprintf( - '
'. - '
'. - '
'. - '
'. - '
',$args->widgetstyle, - $style, - $args->widget_padding_left, $args->widget_padding_right, $args->widget_padding_top, $args->widget_padding_bottom, - $args->document_srl, - implode(' ',$attribute), - $inner_style); - - $widget_content_body = $body; - $widget_content_footer = sprintf('
'. - '
'. - ''. - '
',base64_encode($body)); - - break; - - // 위젯 박스일 경우 - case 'widgetBox' : - - // args 정리 - $attribute = array(); - if($args) { - foreach($args as $key => $val) { - if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) continue; - if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val); - $attribute[] = sprintf('%s="%s"', $key, str_replace('"','\"',$val)); - } - } - - $widget_content_header = sprintf( - '
'. - '
'. - '
'. - '
',$args->widgetstyle,$style, $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left,implode(' ',$attribute),$inner_style); - - $widget_content_body = $widgetbox_content; - - break; - - // 일반 위젯일 경우 - default : - // args 정리 - $attribute = array(); - if($args) { - foreach($args as $key => $val) { - if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget'))) continue; - if(strlen($val)==0) continue; - if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val); - $attribute[] = sprintf('%s="%s"', $key, str_replace('"','\"',$val)); - } - } - - $widget_content_header = sprintf('
'. - '
'. - '
'. - '
',$args->widgetstyle,$style, - $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left, - $widget, implode(' ',$attribute)); - - $widget_content_body = sprintf('
%s
',$inner_style, $widget_content); - - $widget_content_footer = '
'; - - break; - } - } - - - // 위젯 스타일을 컴파일 한다. - if($args->widgetstyle){ - $widget_content_body = WidgetHandler::complieWidgetStyle($args->widgetstyle,$widget, $widget_content_body, $args, $include_info); - } - - $output = $widget_content_header . $widget_content_body . $widget_content_footer; - - // 위젯 결과물 생성 시간을 debug 정보에 추가 - if(__DEBUG__==3) $GLOBALS['__widget_excute_elapsed__'] += getMicroTime() - $start; - // 결과 return - return $output; - } - - /** - * @brief 위젯 객체를 return - **/ - function getObject($widget) { - if(!$GLOBALS['_xe_loaded_widgets_'][$widget]) { - // 일단 위젯의 위치를 찾음 - $oWidgetModel = &getModel('widget'); - $path = $oWidgetModel->getWidgetPath($widget); - - // 위젯 클래스 파일을 찾고 없으면 에러 출력 (html output) - $class_file = sprintf('%s%s.class.php', $path, $widget); - if(!file_exists($class_file)) return sprintf(Context::getLang('msg_widget_is_not_exists'), $widget); - - // 위젯 클래스를 include - require_once($class_file); - - // 객체 생성 - $eval_str = sprintf('$oWidget = new %s();', $widget); - @eval($eval_str); - if(!is_object($oWidget)) return sprintf(Context::getLang('msg_widget_object_is_null'), $widget); - - if(!method_exists($oWidget, 'proc')) return sprintf(Context::getLang('msg_widget_proc_is_null'), $widget); - - $oWidget->widget_path = $path; - - $GLOBALS['_xe_loaded_widgets_'][$widget] = $oWidget; - } - return $GLOBALS['_xe_loaded_widgets_'][$widget]; - } - - - function complieWidgetStyle($widgetStyle,$widget,$widget_content_body, $args, $include_info){ - if(!$widgetStyle) return $widget_content_body; - - $oWidgetModel = &getModel('widget'); - - // 위젯 스타일의 extra_var를 가져와 묶는다 - $widgetstyle_info = $oWidgetModel->getWidgetStyleInfo($widgetStyle); - if(!$widgetstyle_info) return $widget_content_body; - - $widgetstyle_extar_var_key = get_object_vars($widgetstyle_info); - if(count($widgetstyle_extar_var_key['extra_var'])){ - foreach($widgetstyle_extar_var_key['extra_var'] as $key => $val){ - $widgetstyle_extar_var->{$key} = $args->{$key}; - } - } - Context::set('widgetstyle_extar_var', $widgetstyle_extar_var); - - if($include_info && $widget=='widgetBox'){ - Context::set('widget_content', '
'.$widget_content_body.'
'); - }else{ - Context::set('widget_content', $widget_content_body); - } - - // 컴파일 - $widgetstyle_path = $oWidgetModel->getWidgetStylePath($widgetStyle); - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile($widgetstyle_path, 'widgetstyle'); - - return $tpl; - } } ?> diff --git a/classes/xml/XmlQueryParser.class.php b/classes/xml/XmlQueryParser.class.php index be30f05d7..edf56fb82 100644 --- a/classes/xml/XmlQueryParser.class.php +++ b/classes/xml/XmlQueryParser.class.php @@ -451,6 +451,10 @@ case 'minus' : $args = abs($args); $val = sprintf('"%s-%d"', $name, $args); + break; + case 'multiply' : + $args = intval($args); + $val = sprintf('"%s*%d"', $name, $args); break; } diff --git a/common/css/button.css b/common/css/button.css index 2f0872ce1..25336fc1c 100644 --- a/common/css/button.css +++ b/common/css/button.css @@ -32,7 +32,7 @@ span.button { padding:0; background-position:left top;} span.button, x:-moz-any-link{ font:0/23px Sans-serif; padding:11px 0;} /* Firefox 2 Fix */ span.button, x:-moz-any-link, x:default{ padding:0;} /* Firefox 2 Fix */ span.button button, -span.button input { height:23px; left:2px; /**top:-1px;*/ _top:0; padding:0 10px 0 8px; *padding:0 5px 0 3px; line-height:24px; background-position:right top; cursor:pointer;} +span.button input { height:23px; left:2px; *top:-1px; _top:0; padding:0 10px 0 8px; *padding:0 5px 0 3px; line-height:24px; background-position:right top; cursor:pointer;} /* Large Size */ span.button.large { background-position:left -30px;} span.button.large, x:-moz-any-link{ font:0/29px Sans-serif; padding:14px 0;} /* Firefox 2 Fix */ diff --git a/common/js/common.js b/common/js/common.js index 7bc0cf275..2fc9a0100 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -193,11 +193,12 @@ jQuery(function($) { // 서버에 메뉴를 요청 var params = new Array(); params["target_srl"] = target_srl; - params["cur_mid"] = current_mid; + 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"); @@ -374,6 +375,7 @@ function isDef() { **/ 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(); @@ -395,6 +397,7 @@ function winopen(url, target, attribute) { **/ 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"); } @@ -502,6 +505,7 @@ function zbxe_folder_close(id) { **/ var _popupHeight = 0; function setFixedPopupSize() { + var headerObj = jQuery('#popHeader'); var bodyObj = jQuery('#popBody'); if(bodyObj.length) { @@ -510,6 +514,8 @@ function setFixedPopupSize() { } } + bodyObj.css({paddingRight:30}); + var w = jQuery("#popup_content").width(); w = w< 400 ? 400 : w; var h = jQuery("#popup_content").height(); diff --git a/common/js/jquery.js b/common/js/jquery.js index c327fae81..926357433 100644 --- a/common/js/jquery.js +++ b/common/js/jquery.js @@ -1,19 +1,4376 @@ -/* - * jQuery JavaScript Library v1.3.1 +/*! + * jQuery JavaScript Library v1.3.2 * http://jquery.com/ * * Copyright (c) 2009 John Resig * Dual licensed under the MIT and GPL licenses. * http://docs.jquery.com/License * - * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009) - * Revision: 6158 + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.makeArray(E))},selector:"",jquery:"1.3.1",size:function(){return this.length},get:function(E){return E===g?o.makeArray(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,find:function(E){if(this.length===1&&!/,/.test(E)){var G=this.pushStack([],"find",E);G.length=0;o.find(E,this[0],G);return G}else{var F=o.map(this,function(H){return o.find(E,H)});return this.pushStack(/[^+>] [^+>]/.test(E)?o.unique(F):F,"find",E)}},clone:function(F){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.cloneNode(true),H=document.createElement("div");H.appendChild(I);return o.clean([H.innerHTML])[0]}else{return this.cloneNode(true)}});var G=E.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(F===true){this.find("*").andSelf().each(function(I){if(this.nodeType==3){return}var H=o.data(this,"events");for(var K in H){for(var J in H[K]){o.event.add(G[I],K,H[K][J],H[K][J].data)}}})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var F=o.expr.match.POS.test(E)?o(E):null;return this.map(function(){var G=this;while(G&&G.ownerDocument){if(F?F.index(G)>-1:o(G).is(E)){return G}G=G.parentNode}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML:null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(K,N,M){if(this[0]){var J=(this[0].ownerDocument||this[0]).createDocumentFragment(),G=o.clean(K,(this[0].ownerDocument||this[0]),J),I=J.firstChild,E=this.length>1?J.cloneNode(true):J;if(I){for(var H=0,F=this.length;H0?E.cloneNode(true):J)}}if(G){o.each(G,z)}}return this;function L(O,P){return N&&o.nodeName(O,"table")&&o.nodeName(P,"tr")?(O.getElementsByTagName("tbody")[0]||O.appendChild(O.ownerDocument.createElement("tbody"))):O}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(G,E,I){if(E=="width"||E=="height"){var K,F={position:"absolute",visibility:"hidden",display:"block"},J=E=="width"?["Left","Right"]:["Top","Bottom"];function H(){K=E=="width"?G.offsetWidth:G.offsetHeight;var M=0,L=0;o.each(J,function(){M+=parseFloat(o.curCSS(G,"padding"+this,true))||0;L+=parseFloat(o.curCSS(G,"border"+this+"Width",true))||0});K-=Math.round(M+L)}if(o(G).is(":visible")){H()}else{o.swap(G,F,H)}return Math.max(0,K)}return o.curCSS(G,E,I)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,R){if(typeof R==="number"){R+=""}if(!R){return}if(typeof R==="string"){R=R.replace(/(<(\w+)[^>]*?)\/>/g,function(T,U,S){return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?T:U+">"});var O=o.trim(R).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+R+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var N=!O.indexOf(""&&O.indexOf("=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(R)){L.insertBefore(K.createTextNode(R.match(/^\s*/)[0]),L.firstChild)}R=o.makeArray(L.childNodes)}if(R.nodeType){G.push(R)}else{G=o.merge(G,R)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* +(function(){ + +var + // Will speed up references to window, and allows munging its name. + window = this, + // Will speed up references to undefined, and allows munging its name. + undefined, + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + // Map over the $ in case of overwrite + _$ = window.$, + + jQuery = window.jQuery = window.$ = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + // Make sure that a selection was provided + selector = selector || document; + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this[0] = selector; + this.length = 1; + this.context = selector; + return this; + } + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + var match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) + selector = jQuery.clean( [ match[1] ], context ); + + // HANDLE: $("#id") + else { + var elem = document.getElementById( match[3] ); + + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem && elem.id != match[3] ) + return jQuery().find( selector ); + + // Otherwise, we inject the element directly into the jQuery object + var ret = jQuery( elem || [] ); + ret.context = document; + ret.selector = selector; + return ret; + } + + // HANDLE: $(expr, [context]) + // (which is just equivalent to: $(content).find(expr) + } else + return jQuery( context ).find( selector ); + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) + return jQuery( document ).ready( selector ); + + // Make sure that old selector state is passed along + if ( selector.selector && selector.context ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return this.setArray(jQuery.isArray( selector ) ? + selector : + jQuery.makeArray(selector)); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.3.2", + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num === undefined ? + + // Return a 'clean' array + Array.prototype.slice.call( this ) : + + // Return just the object + this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = jQuery( elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) + ret.selector = this.selector + (this.selector ? " " : "") + selector; + else if ( name ) + ret.selector = this.selector + "." + name + "(" + selector + ")"; + + // Return the newly-formed element set + return ret; + }, + + // Force the current matched set of elements to become + // the specified array of elements (destroying the stack in the process) + // You should use pushStack() in order to do this, but maintain the stack + setArray: function( elems ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + this.length = 0; + Array.prototype.push.apply( this, elems ); + + return this; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem && elem.jquery ? elem[0] : elem + , this ); + }, + + attr: function( name, value, type ) { + var options = name; + + // Look for the case where we're accessing a style value + if ( typeof name === "string" ) + if ( value === undefined ) + return this[0] && jQuery[ type || "attr" ]( this[0], name ); + + else { + options = {}; + options[ name ] = value; + } + + // Check to see if we're setting style values + return this.each(function(i){ + // Set all the styles + for ( name in options ) + jQuery.attr( + type ? + this.style : + this, + name, jQuery.prop( this, options[ name ], type, i, name ) + ); + }); + }, + + css: function( key, value ) { + // ignore negative width and height values + if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) + value = undefined; + return this.attr( key, value, "curCSS" ); + }, + + text: function( text ) { + if ( typeof text !== "object" && text != null ) + return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); + + var ret = ""; + + jQuery.each( text || this, function(){ + jQuery.each( this.childNodes, function(){ + if ( this.nodeType != 8 ) + ret += this.nodeType != 1 ? + this.nodeValue : + jQuery.fn.text( [ this ] ); + }); + }); + + return ret; + }, + + wrapAll: function( html ) { + if ( this[0] ) { + // The elements to wrap the target around + var wrap = jQuery( html, this[0].ownerDocument ).clone(); + + if ( this[0].parentNode ) + wrap.insertBefore( this[0] ); + + wrap.map(function(){ + var elem = this; + + while ( elem.firstChild ) + elem = elem.firstChild; + + return elem; + }).append(this); + } + + return this; + }, + + wrapInner: function( html ) { + return this.each(function(){ + jQuery( this ).contents().wrapAll( html ); + }); + }, + + wrap: function( html ) { + return this.each(function(){ + jQuery( this ).wrapAll( html ); + }); + }, + + append: function() { + return this.domManip(arguments, true, function(elem){ + if (this.nodeType == 1) + this.appendChild( elem ); + }); + }, + + prepend: function() { + return this.domManip(arguments, true, function(elem){ + if (this.nodeType == 1) + this.insertBefore( elem, this.firstChild ); + }); + }, + + before: function() { + return this.domManip(arguments, false, function(elem){ + this.parentNode.insertBefore( elem, this ); + }); + }, + + after: function() { + return this.domManip(arguments, false, function(elem){ + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + }, + + end: function() { + return this.prevObject || jQuery( [] ); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: [].push, + sort: [].sort, + splice: [].splice, + + find: function( selector ) { + if ( this.length === 1 ) { + var ret = this.pushStack( [], "find", selector ); + ret.length = 0; + jQuery.find( selector, this[0], ret ); + return ret; + } else { + return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){ + return jQuery.find( selector, elem ); + })), "find", selector ); + } + }, + + clone: function( events ) { + // Do the clone + var ret = this.map(function(){ + if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { + // IE copies events bound via attachEvent when + // using cloneNode. Calling detachEvent on the + // clone will also remove the events from the orignal + // In order to get around this, we use innerHTML. + // Unfortunately, this means some modifications to + // attributes in IE that are actually only stored + // as properties will not be copied (such as the + // the name attribute on an input). + var html = this.outerHTML; + if ( !html ) { + var div = this.ownerDocument.createElement("div"); + div.appendChild( this.cloneNode(true) ); + html = div.innerHTML; + } + + return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0]; + } else + return this.cloneNode(true); + }); + + // Copy the events from the original to the clone + if ( events === true ) { + var orig = this.find("*").andSelf(), i = 0; + + ret.find("*").andSelf().each(function(){ + if ( this.nodeName !== orig[i].nodeName ) + return; + + var events = jQuery.data( orig[i], "events" ); + + for ( var type in events ) { + for ( var handler in events[ type ] ) { + jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); + } + } + + i++; + }); + } + + // Return the cloned set + return ret; + }, + + filter: function( selector ) { + return this.pushStack( + jQuery.isFunction( selector ) && + jQuery.grep(this, function(elem, i){ + return selector.call( elem, i ); + }) || + + jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ + return elem.nodeType === 1; + }) ), "filter", selector ); + }, + + closest: function( selector ) { + var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null, + closer = 0; + + return this.map(function(){ + var cur = this; + while ( cur && cur.ownerDocument ) { + if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) { + jQuery.data(cur, "closest", closer); + return cur; + } + cur = cur.parentNode; + closer++; + } + }); + }, + + not: function( selector ) { + if ( typeof selector === "string" ) + // test special case where just one selector is passed in + if ( isSimple.test( selector ) ) + return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); + else + selector = jQuery.multiFilter( selector, this ); + + var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; + return this.filter(function() { + return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; + }); + }, + + add: function( selector ) { + return this.pushStack( jQuery.unique( jQuery.merge( + this.get(), + typeof selector === "string" ? + jQuery( selector ) : + jQuery.makeArray( selector ) + ))); + }, + + is: function( selector ) { + return !!selector && jQuery.multiFilter( selector, this ).length > 0; + }, + + hasClass: function( selector ) { + return !!selector && this.is( "." + selector ); + }, + + val: function( value ) { + if ( value === undefined ) { + var elem = this[0]; + + if ( elem ) { + if( jQuery.nodeName( elem, 'option' ) ) + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type == "select-one"; + + // Nothing was selected + if ( index < 0 ) + return null; + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) + return value; + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Everything else, we just grab the value + return (elem.value || "").replace(/\r/g, ""); + + } + + return undefined; + } + + if ( typeof value === "number" ) + value += ''; + + return this.each(function(){ + if ( this.nodeType != 1 ) + return; + + if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) + this.checked = (jQuery.inArray(this.value, value) >= 0 || + jQuery.inArray(this.name, value) >= 0); + + else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(value); + + jQuery( "option", this ).each(function(){ + this.selected = (jQuery.inArray( this.value, values ) >= 0 || + jQuery.inArray( this.text, values ) >= 0); + }); + + if ( !values.length ) + this.selectedIndex = -1; + + } else + this.value = value; + }); + }, + + html: function( value ) { + return value === undefined ? + (this[0] ? + this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : + null) : + this.empty().append( value ); + }, + + replaceWith: function( value ) { + return this.after( value ).remove(); + }, + + eq: function( i ) { + return this.slice( i, +i + 1 ); + }, + + slice: function() { + return this.pushStack( Array.prototype.slice.apply( this, arguments ), + "slice", Array.prototype.slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function(elem, i){ + return callback.call( elem, i, elem ); + })); + }, + + andSelf: function() { + return this.add( this.prevObject ); + }, + + domManip: function( args, table, callback ) { + if ( this[0] ) { + var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), + scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), + first = fragment.firstChild; + + if ( first ) + for ( var i = 0, l = this.length; i < l; i++ ) + callback.call( root(this[i], first), this.length > 1 || i > 0 ? + fragment.cloneNode(true) : fragment ); + + if ( scripts ) + jQuery.each( scripts, evalScript ); + } + + return this; + + function root( elem, cur ) { + return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? + (elem.getElementsByTagName("tbody")[0] || + elem.appendChild(elem.ownerDocument.createElement("tbody"))) : + elem; + } + } +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +function evalScript( i, elem ) { + if ( elem.src ) + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + + else + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + + if ( elem.parentNode ) + elem.parentNode.removeChild( elem ); +} + +function now(){ + return +new Date; +} + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) + target = {}; + + // extend jQuery itself if only one argument is passed + if ( length == i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) + // Extend the base object + for ( var name in options ) { + var src = target[ name ], copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) + continue; + + // Recurse if we're merging object values + if ( deep && copy && typeof copy === "object" && !copy.nodeType ) + target[ name ] = jQuery.extend( deep, + // Never move original objects, clone them + src || ( copy.length != null ? [ ] : { } ) + , copy ); + + // Don't bring in undefined values + else if ( copy !== undefined ) + target[ name ] = copy; + + } + + // Return the modified object + return target; +}; + +// exclude the following css properties to add px +var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, + // cache defaultView + defaultView = document.defaultView || {}, + toString = Object.prototype.toString; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) + window.jQuery = _jQuery; + + return jQuery; + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return toString.call(obj) === "[object Function]"; + }, + + isArray: function( obj ) { + return toString.call(obj) === "[object Array]"; + }, + + // check if an element is in a (or is an) XML document + isXMLDoc: function( elem ) { + return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || + !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument ); + }, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && /\S/.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + if ( jQuery.support.scriptEval ) + script.appendChild( document.createTextNode( data ) ); + else + script.text = data; + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, length = object.length; + + if ( args ) { + if ( length === undefined ) { + for ( name in object ) + if ( callback.apply( object[ name ], args ) === false ) + break; + } else + for ( ; i < length; ) + if ( callback.apply( object[ i++ ], args ) === false ) + break; + + // A special, fast, case for the most common use of each + } else { + if ( length === undefined ) { + for ( name in object ) + if ( callback.call( object[ name ], name, object[ name ] ) === false ) + break; + } else + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} + } + + return object; + }, + + prop: function( elem, value, type, i, name ) { + // Handle executable functions + if ( jQuery.isFunction( value ) ) + value = value.call( elem, i ); + + // Handle passing in a number to a CSS property + return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? + value + "px" : + value; + }, + + className: { + // internal only, use addClass("class") + add: function( elem, classNames ) { + jQuery.each((classNames || "").split(/\s+/), function(i, className){ + if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) + elem.className += (elem.className ? " " : "") + className; + }); + }, + + // internal only, use removeClass("class") + remove: function( elem, classNames ) { + if (elem.nodeType == 1) + elem.className = classNames !== undefined ? + jQuery.grep(elem.className.split(/\s+/), function(className){ + return !jQuery.className.has( classNames, className ); + }).join(" ") : + ""; + }, + + // internal only, use hasClass("class") + has: function( elem, className ) { + return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; + } + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var old = {}; + // Remember the old values, and insert the new ones + for ( var name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + callback.call( elem ); + + // Revert the old values + for ( var name in options ) + elem.style[ name ] = old[ name ]; + }, + + css: function( elem, name, force, extra ) { + if ( name == "width" || name == "height" ) { + var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; + + function getWH() { + val = name == "width" ? elem.offsetWidth : elem.offsetHeight; + + if ( extra === "border" ) + return; + + jQuery.each( which, function() { + if ( !extra ) + val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; + if ( extra === "margin" ) + val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0; + else + val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; + }); + } + + if ( elem.offsetWidth !== 0 ) + getWH(); + else + jQuery.swap( elem, props, getWH ); + + return Math.max(0, Math.round(val)); + } + + return jQuery.curCSS( elem, name, force ); + }, + + curCSS: function( elem, name, force ) { + var ret, style = elem.style; + + // We need to handle opacity special in IE + if ( name == "opacity" && !jQuery.support.opacity ) { + ret = jQuery.attr( style, "opacity" ); + + return ret == "" ? + "1" : + ret; + } + + // Make sure we're using the right name for getting the float value + if ( name.match( /float/i ) ) + name = styleFloat; + + if ( !force && style && style[ name ] ) + ret = style[ name ]; + + else if ( defaultView.getComputedStyle ) { + + // Only "float" is needed here + if ( name.match( /float/i ) ) + name = "float"; + + name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); + + var computedStyle = defaultView.getComputedStyle( elem, null ); + + if ( computedStyle ) + ret = computedStyle.getPropertyValue( name ); + + // We should always get a number back from opacity + if ( name == "opacity" && ret == "" ) + ret = "1"; + + } else if ( elem.currentStyle ) { + var camelCase = name.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + + ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { + // Remember the original values + var left = style.left, rsLeft = elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + elem.runtimeStyle.left = elem.currentStyle.left; + style.left = ret || 0; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + elem.runtimeStyle.left = rsLeft; + } + } + + return ret; + }, + + clean: function( elems, context, fragment ) { + context = context || document; + + // !context.createElement fails in IE with an error but returns typeof 'object' + if ( typeof context.createElement === "undefined" ) + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { + var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); + if ( match ) + return [ context.createElement( match[1] ) ]; + } + + var ret = [], scripts = [], div = context.createElement("div"); + + jQuery.each(elems, function(i, elem){ + if ( typeof elem === "number" ) + elem += ''; + + if ( !elem ) + return; + + // Convert html string into DOM nodes + if ( typeof elem === "string" ) { + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? + all : + front + ">"; + }); + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); + + var wrap = + // option or optgroup + !tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && + [ 1, "", "
" ] || + + !tags.indexOf("", "" ] || + + // matched above + (!tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + // IE can't serialize and -
-
-
-
    -
  • blank
  • -
  • #
  • -
  • -
-
-
diff --git a/modules/editor/components/colorpicker_bg/tpl/popup.js b/modules/editor/components/colorpicker_bg/tpl/popup.js deleted file mode 100644 index 2c7ee722d..000000000 --- a/modules/editor/components/colorpicker_bg/tpl/popup.js +++ /dev/null @@ -1,49 +0,0 @@ -/* 부모창의 위지윅 에디터의 선택된 영역의 글자색을 변경 */ -function applyColor() { - var code = xGetElementById("color_input").value; - - if(opener.xIE4Up) opener.editorDo("BackColor","#"+code, opener.editorPrevSrl); - else opener.editorDo("hilitecolor","#"+code, opener.editorPrevSrl); - - opener.editorFocus(opener.editorPrevSrl); - - window.close(); -} - -/* 색상 클릭시 */ -function select_color(code) { - xGetElementById("color_input").value = code; - xGetElementById("preview_color").style.backgroundColor = "#"+code; -} - -/* 색상표를 출력 */ -function printColor(blank_img_src) { - var colorTable = new Array('22','44','66','88','AA','CC','EE'); - var html = ""; - - for(var i=0;i<8;i+=1) html += printColorBlock(i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16), blank_img_src); - - for(var i=0; i\"color\"<\/div>"; -} - -/* 수동 색상 변경시 */ -function manual_select_color(obj) { - if(obj.value.length!=6) return; - xGetElementById("preview_color").style.backgroundColor = "#"+obj.value; -} diff --git a/modules/editor/components/colorpicker_text/colorpicker_text.class.php b/modules/editor/components/colorpicker_text/colorpicker_text.class.php deleted file mode 100644 index 8e2ebf911..000000000 --- a/modules/editor/components/colorpicker_text/colorpicker_text.class.php +++ /dev/null @@ -1,37 +0,0 @@ -editor_sequence = $editor_sequence; - $this->component_path = $component_path; - } - - /** - * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 - **/ - function getPopupContent() { - // 템플릿을 미리 컴파일해서 컴파일된 소스를 return - $tpl_path = $this->component_path.'tpl'; - $tpl_file = 'popup.html'; - - Context::set("tpl_path", $tpl_path); - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - } -?> diff --git a/modules/editor/components/colorpicker_text/icon.gif b/modules/editor/components/colorpicker_text/icon.gif deleted file mode 100644 index 92e6ca4f7..000000000 Binary files a/modules/editor/components/colorpicker_text/icon.gif and /dev/null differ diff --git a/modules/editor/components/colorpicker_text/info.xml b/modules/editor/components/colorpicker_text/info.xml deleted file mode 100644 index accb343f0..000000000 --- a/modules/editor/components/colorpicker_text/info.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - 글자색 변경 - 文字色変更 - 字体颜色 - Change the color of text - Cambiar el color de texto - Изменение цвета текста - 文字顏色 - 글자색을 변경합니다. - 文字色を変更します。 - 可修改字体颜色。 - It will change the color of text. - Se va a cambiar el color del texto. - Позволяет изменение цвета текста. - 可改變文字顏色。 - 0.1 - 2007-02-28 - - - zero - zero - zero - zero - zero - zero - zero - - diff --git a/modules/editor/components/colorpicker_text/tpl/blank.gif b/modules/editor/components/colorpicker_text/tpl/blank.gif deleted file mode 100644 index 35d42e808..000000000 Binary files a/modules/editor/components/colorpicker_text/tpl/blank.gif and /dev/null differ diff --git a/modules/editor/components/colorpicker_text/tpl/popup.css b/modules/editor/components/colorpicker_text/tpl/popup.css deleted file mode 100644 index cf9181ae4..000000000 --- a/modules/editor/components/colorpicker_text/tpl/popup.css +++ /dev/null @@ -1,51 +0,0 @@ -@charset "utf-8"; - -.colorpicker { - width:275px; - height:100px; - padding:5px; - clear:both; -} - -li { list-style:none; float:left; margin-right:5px; } - -img.preview_color { - width:30px; - height:16px; - border:1px solid #000000; - background-color:#000000; -} - -img.color_icon { - width:14px; - height:14px; - border:1px solid #FFFFFF; -} - -img.color_icon_over { - width:14px; - height:14px; - border:1px solid #000000; - cursor:pointer; -} - -.input_area { - text-align:center; - height:25px; - padding:5px; - font-family:tahoma; - font-size:8pt; - clear:both; - text-align:center; - background-color:#EEEEEE; -} - -.popup_input { - border:1px solid #AAAAAA; - height:14px; -} - -.popup_submit { - border:1px solid #AAAAAA; - height:18px; -} diff --git a/modules/editor/components/colorpicker_text/tpl/popup.html b/modules/editor/components/colorpicker_text/tpl/popup.html deleted file mode 100644 index 1a8dbe3d5..000000000 --- a/modules/editor/components/colorpicker_text/tpl/popup.html +++ /dev/null @@ -1,16 +0,0 @@ - - -
- -
-
-
-
    -
  • blank
  • -
  • #
  • -
  • -
-
-
diff --git a/modules/editor/components/colorpicker_text/tpl/popup.js b/modules/editor/components/colorpicker_text/tpl/popup.js deleted file mode 100644 index 521280cea..000000000 --- a/modules/editor/components/colorpicker_text/tpl/popup.js +++ /dev/null @@ -1,50 +0,0 @@ -/* 부모창의 위지윅 에디터의 선택된 영역의 글자색을 변경 */ -function applyColor() { - var code = xGetElementById("color_input").value; - - opener.editorFocus(opener.editorPrevSrl); - - opener.editorDo("ForeColor", "#"+code, opener.editorPrevSrl); - - opener.editorFocus(opener.editorPrevSrl); - - self.close(); -} - -/* 색상 클릭시 */ -function select_color(code) { - xGetElementById("color_input").value = code; - xGetElementById("preview_color").style.backgroundColor = "#"+code; -} - -/* 색상표를 출력 */ -function printColor(blank_img_src) { - var colorTable = new Array('22','44','66','88','AA','CC','EE'); - var html = ""; - - for(var i=0;i<8;i+=1) html += printColorBlock(i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16), blank_img_src); - - for(var i=0; i\"color\"<\/div>"; -} - -/* 수동 색상 변경시 */ -function manual_select_color(obj) { - if(obj.value.length!=6) return; - xGetElementById("preview_color").style.backgroundColor = "#"+obj.value; -} diff --git a/modules/editor/components/emoticon/component_icon.gif b/modules/editor/components/emoticon/component_icon.gif new file mode 100755 index 000000000..98596a04a Binary files /dev/null and b/modules/editor/components/emoticon/component_icon.gif differ diff --git a/modules/editor/components/emoticon/tpl/popup.js b/modules/editor/components/emoticon/tpl/popup.js index 9708dafdd..0f52bd44d 100644 --- a/modules/editor/components/emoticon/tpl/popup.js +++ b/modules/editor/components/emoticon/tpl/popup.js @@ -9,7 +9,7 @@ function insertEmoticon(obj) { var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl) opener.editorReplaceHTML(iframe_obj, text); - opener.editorFocus(opener.editorPrevSrl); + self.focus(); } /* 선택된 이모티콘 목록을 가져옴 */ diff --git a/modules/editor/components/image_link/component_icon.gif b/modules/editor/components/image_link/component_icon.gif new file mode 100755 index 000000000..0814b167b Binary files /dev/null and b/modules/editor/components/image_link/component_icon.gif differ diff --git a/modules/editor/components/multimedia_link/component_icon.gif b/modules/editor/components/multimedia_link/component_icon.gif new file mode 100755 index 000000000..f11bf8924 Binary files /dev/null and b/modules/editor/components/multimedia_link/component_icon.gif differ diff --git a/modules/editor/components/quotation/component_icon.gif b/modules/editor/components/quotation/component_icon.gif new file mode 100755 index 000000000..c64cacd9d Binary files /dev/null and b/modules/editor/components/quotation/component_icon.gif differ diff --git a/modules/editor/components/table_maker/icon.gif b/modules/editor/components/table_maker/icon.gif deleted file mode 100644 index f32174284..000000000 Binary files a/modules/editor/components/table_maker/icon.gif and /dev/null differ diff --git a/modules/editor/components/table_maker/info.xml b/modules/editor/components/table_maker/info.xml deleted file mode 100644 index c251ef836..000000000 --- a/modules/editor/components/table_maker/info.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - 표(table) 생성 - テーブル作成 - 表格 - Create Table - Crear Tabla - Создание таблиц - 表格 - 에디터에 표(table)을 생성하거나 표(table) 또는 칸(td)의 속성을 변경할 수 있습니다. - エディターでテーブル(table)の作成、テーブル(table)またはセル(td)の属性の変更が出来ます。 - 插入表格(table)或编辑表格属性。 - It can create a table on editor or modify the attribution of table or td. - Se puede crear una tabla en editor o modificar la atribución de la mesa o td. - Это может создать таблицу в редакторе или изменить ее параметры или ячейки. - 插入表格(table)或编辑表格属性。 - 0.1 - 2007-02-28 - - - zero - zero - zero - zero - zero - zero - zero - - diff --git a/modules/editor/components/table_maker/lang/en.lang.php b/modules/editor/components/table_maker/lang/en.lang.php deleted file mode 100644 index 9f6e7c853..000000000 --- a/modules/editor/components/table_maker/lang/en.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @brief editor module > language pack of table_maker component - **/ - - $lang->table_attribute = "Change Table Attibution"; - $lang->cell_attribute = "Change Cell Attribution"; - - $lang->table_width = "Width"; - $lang->table_cols_count = "Number of Columns"; - $lang->table_rows_count = "Number of Rows"; - $lang->table_cellspacing = "Cellspacing"; - $lang->table_cellpadding = "Cellpadding"; - $lang->table_border = "Border Thicknes"; - $lang->table_inner_border = "Inner Line Thickness"; - - $lang->cell_width = "Width"; - $lang->cell_height = "Height"; - - $lang->table_border_color = "Border Color"; - $lang->table_bg_color = "Background Color"; -?> diff --git a/modules/editor/components/table_maker/lang/es.lang.php b/modules/editor/components/table_maker/lang/es.lang.php deleted file mode 100644 index c8657f632..000000000 --- a/modules/editor/components/table_maker/lang/es.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @brief editor module > language pack of table_maker component - **/ - - $lang->table_attribute = "Cambiar el cuadro Attibution"; - $lang->cell_attribute = "Cambio de celda Atribucion"; - - $lang->table_width = "Ancho"; - $lang->table_cols_count = "Numero de columnas"; - $lang->table_rows_count = "Numero de filas"; - $lang->table_cellspacing = "Cellspacing"; - $lang->table_cellpadding = "Cellpadding"; - $lang->table_border = "Thicknes Frontera"; - $lang->table_inner_border = "Inner Grosor de linea"; - - $lang->cell_width = "Ancho"; - $lang->cell_height = "Altura"; - - $lang->table_border_color = "Color del borde"; - $lang->table_bg_color = "Color de fondo"; -?> diff --git a/modules/editor/components/table_maker/lang/jp.lang.php b/modules/editor/components/table_maker/lang/jp.lang.php deleted file mode 100644 index bd3026495..000000000 --- a/modules/editor/components/table_maker/lang/jp.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - 翻訳:RisaPapa、ミニミ - * @brief ウィジウィグエディター(editor) > テーブル生成(table_maker)コンポーネントの言語パッケージ - **/ - - $lang->table_attribute = "テーブル属性変更"; - $lang->cell_attribute = "セル属性変更"; - - $lang->table_width = "横幅サイズ"; - $lang->table_cols_count = "縦幅サイズ"; - $lang->table_rows_count = "列(Rows)数"; - $lang->table_cellspacing = "セルの間隔"; - $lang->table_cellpadding = "セル内余白"; - $lang->table_border = "ボーダー"; - $lang->table_inner_border = "ボーダー境界線の太さ"; - - $lang->cell_width = "セル横幅"; - $lang->cell_height = "セル縦幅"; - - $lang->table_border_color = "ボーダーカラー"; - $lang->table_bg_color = "背景色"; -?> diff --git a/modules/editor/components/table_maker/lang/ko.lang.php b/modules/editor/components/table_maker/lang/ko.lang.php deleted file mode 100644 index 8de490f10..000000000 --- a/modules/editor/components/table_maker/lang/ko.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @brief 위지윅에디터(editor) 모듈 > 테이블 생성(table_maker) 컴포넌트의 언어팩 - **/ - - $lang->table_attribute = "테이블 속성 변경"; - $lang->cell_attribute = "셀 속성 변경"; - - $lang->table_width = "가로크기"; - $lang->table_cols_count = "가로열 갯수"; - $lang->table_rows_count = "세로열 갯수"; - $lang->table_cellspacing = "셀간 간격"; - $lang->table_cellpadding = "셀내 여백"; - $lang->table_border = "외곽선 굵기"; - $lang->table_inner_border = "구분선 굵기"; - - $lang->cell_width = "가로크기 "; - $lang->cell_height = "세로 크기 "; - - $lang->table_border_color = "외곽선 색"; - $lang->table_bg_color = "배경 색"; -?> diff --git a/modules/editor/components/table_maker/lang/ru.lang.php b/modules/editor/components/table_maker/lang/ru.lang.php deleted file mode 100644 index 2599d54de..000000000 --- a/modules/editor/components/table_maker/lang/ru.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - | translation by Maslennikov Evgeny aka X-[Vr]bL1s5 | e-mail: x-bliss[a]tut.by; ICQ: 225035467; - * @brief editor module > language pack of table_maker component - **/ - - $lang->table_attribute = "Изменить параметры таблицы"; - $lang->cell_attribute = "Изменить параметры ячейки"; - - $lang->table_width = "Ширина"; - $lang->table_cols_count = "Число колонок"; - $lang->table_rows_count = "Число рядков"; - $lang->table_cellspacing = "Пространство ячеек (Cellspacing)"; - $lang->table_cellpadding = "Отступ ячеек (Cellpadding)"; - $lang->table_border = "Толщина рамки"; - $lang->table_inner_border = "Толщина внутренней линии"; - - $lang->cell_width = "Ширина"; - $lang->cell_height = "Высота"; - - $lang->table_border_color = "Цвет рамки"; - $lang->table_bg_color = "Цвет фона"; -?> diff --git a/modules/editor/components/table_maker/lang/zh-CN.lang.php b/modules/editor/components/table_maker/lang/zh-CN.lang.php deleted file mode 100644 index 8027bf68c..000000000 --- a/modules/editor/components/table_maker/lang/zh-CN.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @brief 网页编辑器(editor) 模块 > 表格生成(table_maker) 组件的语言包 - **/ - - $lang->table_attribute = "修改表格属性"; - $lang->cell_attribute = "修改单元格属性"; - - $lang->table_width = "宽度"; - $lang->table_cols_count = "行数"; - $lang->table_rows_count = "列数"; - $lang->table_cellspacing = "单元格间距"; - $lang->table_cellpadding = "单元格边距"; - $lang->table_border = "边框粗细"; - $lang->table_inner_border = "区分线粗细"; - - $lang->cell_width = "宽度 "; - $lang->cell_height = "高度 "; - - $lang->table_border_color = "边框颜色"; - $lang->table_bg_color = "背景颜色"; -?> diff --git a/modules/editor/components/table_maker/lang/zh-TW.lang.php b/modules/editor/components/table_maker/lang/zh-TW.lang.php deleted file mode 100644 index b14414b00..000000000 --- a/modules/editor/components/table_maker/lang/zh-TW.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - 翻譯:royallin - * @brief 網頁編輯器(editor) 模組 > 表格(table_maker) 組件的語言 - **/ - - $lang->table_attribute = "修改表格屬性"; - $lang->cell_attribute = "修改儲存格屬性"; - - $lang->table_width = "寬度"; - $lang->table_cols_count = "行數"; - $lang->table_rows_count = "列數"; - $lang->table_cellspacing = "儲存格間距"; - $lang->table_cellpadding = "儲存格邊距"; - $lang->table_border = "邊框粗細"; - $lang->table_inner_border = "區分線粗細"; - - $lang->cell_width = "寬度 "; - $lang->cell_height = "高度 "; - - $lang->table_border_color = "邊框顏色"; - $lang->table_bg_color = "背景顏色"; -?> diff --git a/modules/editor/components/table_maker/table_maker.class.php b/modules/editor/components/table_maker/table_maker.class.php deleted file mode 100644 index 3eddb7878..000000000 --- a/modules/editor/components/table_maker/table_maker.class.php +++ /dev/null @@ -1,37 +0,0 @@ -editor_sequence = $editor_sequence; - $this->component_path = $component_path; - } - - /** - * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 - **/ - function getPopupContent() { - // 템플릿을 미리 컴파일해서 컴파일된 소스를 return - $tpl_path = $this->component_path.'tpl'; - $tpl_file = 'popup.html'; - - Context::set("tpl_path", $tpl_path); - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - } -?> diff --git a/modules/editor/components/table_maker/tpl/images/blank.gif b/modules/editor/components/table_maker/tpl/images/blank.gif deleted file mode 100644 index 35d42e808..000000000 Binary files a/modules/editor/components/table_maker/tpl/images/blank.gif and /dev/null differ diff --git a/modules/editor/components/table_maker/tpl/images/border_dotted.gif b/modules/editor/components/table_maker/tpl/images/border_dotted.gif deleted file mode 100644 index eaf1ae738..000000000 Binary files a/modules/editor/components/table_maker/tpl/images/border_dotted.gif and /dev/null differ diff --git a/modules/editor/components/table_maker/tpl/images/border_left_dotted.gif b/modules/editor/components/table_maker/tpl/images/border_left_dotted.gif deleted file mode 100644 index 101259cb7..000000000 Binary files a/modules/editor/components/table_maker/tpl/images/border_left_dotted.gif and /dev/null differ diff --git a/modules/editor/components/table_maker/tpl/images/border_left_solid.gif b/modules/editor/components/table_maker/tpl/images/border_left_solid.gif deleted file mode 100644 index 10b7e789f..000000000 Binary files a/modules/editor/components/table_maker/tpl/images/border_left_solid.gif and /dev/null differ diff --git a/modules/editor/components/table_maker/tpl/images/border_solid.gif b/modules/editor/components/table_maker/tpl/images/border_solid.gif deleted file mode 100644 index 9fbf79f57..000000000 Binary files a/modules/editor/components/table_maker/tpl/images/border_solid.gif and /dev/null differ diff --git a/modules/editor/components/table_maker/tpl/popup.css b/modules/editor/components/table_maker/tpl/popup.css deleted file mode 100644 index d488d7274..000000000 --- a/modules/editor/components/table_maker/tpl/popup.css +++ /dev/null @@ -1,51 +0,0 @@ -@charset "utf-8"; -@import url(../../../../../modules/admin/tpl/css/admin.css); - -#table_option { border:1px solid #EEEEEE; padding:.5em; color:#555555; font-weight:bold; } -#table_option input { vertical-align:middle; } -#table_option label { margin-left:.3em; margin-right:2em; } - -li { list-style:none; float:left; margin-right:5px; } - -img.color_icon { - width:14px; - height:14px; - border:1px solid #FFFFFF; -} - -img.color_icon_over { - width:14px; - height:14px; - border:1px solid #000000; - cursor:pointer; -} - -img.border_preview_color { - width:30px; - height:16px; - border:1px solid #EEEEEE; - background-color:#000000; -} - -img.border_preview_none_color { - width:30px; - height:12px; - border:1px solid #EEEEEE; - background-color:#FFFFFF; -} - -img.bg_preview_color { - width:30px; - height:16px; - border:1px solid #000000; - background-color:#FFFFFF; -} - -.editor_color_box { - clear:both; - height:65px; - width:400px; - border:1px solid #DDDDDD; - padding:2px; - margin-bottom:3px; -} diff --git a/modules/editor/components/table_maker/tpl/popup.html b/modules/editor/components/table_maker/tpl/popup.html deleted file mode 100644 index 75a8c8987..000000000 --- a/modules/editor/components/table_maker/tpl/popup.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - -
-

{$component_info->title} ver. {$component_info->version}

-
- -
- -
- - -
- - - - - - - - - - - - - - - - - - - - -
{$lang->table_cellspacing}
px
{$lang->table_cellpadding}
px
{$lang->table_border}
px
{$lang->table_inner_border}
px
- - - - - - -
- -
-
diff --git a/modules/editor/components/table_maker/tpl/popup.js b/modules/editor/components/table_maker/tpl/popup.js deleted file mode 100644 index caed7459b..000000000 --- a/modules/editor/components/table_maker/tpl/popup.js +++ /dev/null @@ -1,257 +0,0 @@ -/** - * popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 멀티미디어 컴포넌트 코드를 체크하여 - * 있으면 가져와서 원하는 곳에 삽입 - **/ -var selected_node = null; -function getTable() { - // 부모 위지윅 에디터에서 선택된 영역이 있는지 확인 - if(typeof(opener)=="undefined") return; - - var node = opener.editorPrevNode; - selected_node = node; - - // 선택된 객체가 없으면 테이블 새로 추가 - if(!selected_node) { - doSelectOption('table'); - } else { - doSelectOption('cell'); - } - - setFixedPopupSize(); -} - -/* 테이블, 셀 선택 옵션의 처리 */ -function doSelectOption(type) { - - // 셀 변경 - if(selected_node && type == "cell") { - xGetElementById("table_option").style.display = "block"; - xGetElementById("cell_attribute").style.display = "block"; - - var cell_width = selected_node.style.width.replace(/(px|\%)$/,''); - var cell_width_unit = selected_node.style.width.replace(/^([0-9]+)/,''); - var cell_height = selected_node.style.height.replace(/px$/,''); - - var border_color = selected_node.style.borderColor.replace(/^#/,''); - if(border_color.indexOf('rgb')>-1) { - var tmp_color = border_color.replace(/([a-z\(\) ]*)/ig,'').split(','); - border_color = xHex(tmp_color[0], 2, '')+xHex(tmp_color[1], 2, '')+xHex(tmp_color[2], 2, ''); - } - - var bg_color = selected_node.style.backgroundColor.replace(/^#/,''); - if(bg_color.indexOf('rgb')>-1) { - var tmp_color = bg_color.replace(/([a-z\(\) ]*)/ig,'').split(','); - bg_color = xHex(tmp_color[0], 2, '')+xHex(tmp_color[1], 2, '')+xHex(tmp_color[2], 2, ''); - } - if(!bg_color) bg_color = "FFFFFF"; - - xGetElementById("cell_width").value = cell_width?cell_width:0; - if(cell_width_unit=="px") xGetElementById("cell_width_unit_pixel").checked = "true"; - else xGetElementById("cell_width_unit_percent").value = "true"; - xGetElementById("cell_height").value = cell_height?cell_height:0; - - xGetElementById("border_color_input").value = border_color; - manual_select_color("border", xGetElementById("border_color_input")) - xGetElementById("bg_color_input").value = bg_color; - manual_select_color("bg", xGetElementById("bg_color_input")) - - xGetElementById("table_attribute").style.display = "none"; - xGetElementById("cell_attribute").style.display = "block"; - xGetElementById("cell_attribute_select").checked = true; - xGetElementById("border_color_area").style.display = "none"; - xGetElementById("bg_color_area").style.display = "block"; - - // 테이블 변경 - } else { - var table_obj = xParent(selected_node); - while(table_obj && table_obj.nodeName != "TABLE") { table_obj = xParent(table_obj); } - if(!table_obj) xGetElementById("col_row_area").style.display = "block"; - else { - xGetElementById("col_row_area").style.display = "none"; - - var width = table_obj.width.replace(/\%/,''); - var width_unit = table_obj.width.replace(/^([0-9]+)/,''); - if(!width_unit) xGetElementById("width_unit_pixel").checked = "true"; - else xGetElementById("width_unit_percent").value = "true"; - - var border = table_obj.style.borderLeftWidth.replace(/px$/,''); - if(!border) border = 0; - var inner_border = table_obj.getAttribute("border"); - if(!inner_border) inner_border = 0; - var cellspacing = table_obj.getAttribute("cellspacing"); - if(!cellspacing) cellspacing = 0; - var cellpadding = table_obj.getAttribute("cellpadding"); - if(!cellpadding) cellpadding = 1; - - var border_color = table_obj.style.borderColor.replace(/^#/,''); - if(border_color.indexOf('rgb')>-1) { - var tmp_color = border_color.replace(/([a-z\(\) ]*)/ig,'').split(','); - border_color = xHex(tmp_color[0], 2, '')+xHex(tmp_color[1], 2, '')+xHex(tmp_color[2], 2, ''); - } - - var bg_color = table_obj.style.backgroundColor.replace(/^#/,''); - if(bg_color.indexOf('rgb')>-1) { - var tmp_color = bg_color.replace(/([a-z\(\) ]*)/ig,'').split(','); - bg_color = xHex(tmp_color[0], 2, '')+xHex(tmp_color[1], 2, '')+xHex(tmp_color[2], 2, ''); - } - - xGetElementById("border_color_input").value = border_color; - manual_select_color("border", xGetElementById("border_color_input")) - xGetElementById("bg_color_input").value = bg_color; - manual_select_color("bg", xGetElementById("bg_color_input")) - - xGetElementById("width").value = width; - xGetElementById("border").value = border; - xGetElementById("inner_border").value = inner_border; - xGetElementById("cellspacing").value = cellspacing; - xGetElementById("cellpadding").value = cellpadding - } - xGetElementById("table_attribute").style.display = "block"; - xGetElementById("cell_attribute").style.display = "none"; - xGetElementById("table_attribute_select").checked = true; - xGetElementById("border_color_area").style.display = "block"; - xGetElementById("bg_color_area").style.display = "block"; - } - - setFixedPopupSize(); -} - -/* 추가 버튼 클릭시 부모창의 위지윅 에디터에 인용구 추가 */ -function insertTable() { - if(typeof(opener)=="undefined") return; - - var table_obj = null; - - if(selected_node) { - table_obj = xParent(selected_node); - while(table_obj && table_obj.nodeName != "TABLE") { table_obj = xParent(table_obj); } - } - - // 테이블 생성일 경우 - if(xGetElementById("table_attribute_select").checked && !table_obj) { - var cols_count = parseInt(xGetElementById("cols_count").value,10); - if(!cols_count) cols_count = 1; - - var rows_count = parseInt(xGetElementById("rows_count").value,10); - if(!rows_count) rows_count = 1; - - var width = parseInt(xGetElementById("width").value,10); - var width_unit = "%"; - if(xGetElementById("width_unit_pixel").checked) width_unit = ""; - - var border = parseInt(xGetElementById("border").value,10); - var inner_border = parseInt(xGetElementById("inner_border").value,10); - var cellspacing = parseInt(xGetElementById("cellspacing").value,10); - var cellpadding = parseInt(xGetElementById("cellpadding").value,10); - var border_color = xGetElementById("border_color_input").value; - if(border_color.length!=6) border_color = "000000"; - - var bg_color = xGetElementById("bg_color_input").value; - if(bg_color.length!=6) bg_color = "FFFFFF"; - - var text = ""; - text += "0) text += " style=\"border:"+border+"px solid #"+border_color+";background-color:#"+bg_color+"\" "; - text +=">"; - - for(var row=0; row"; - for(var col=0; col\"color\"<\/div>"; - } else { - return "
\"color\"<\/div>"; - } -} - -xAddEventListener(window, "load", getTable); - diff --git a/modules/editor/components/url_link/icon.gif b/modules/editor/components/url_link/icon.gif deleted file mode 100644 index 3f8c276c9..000000000 Binary files a/modules/editor/components/url_link/icon.gif and /dev/null differ diff --git a/modules/editor/components/url_link/info.xml b/modules/editor/components/url_link/info.xml deleted file mode 100644 index afa581017..000000000 --- a/modules/editor/components/url_link/info.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - 링크 생성 - リンク生成 - 链接 - Create Link - Crear Link - Создание ссылок - 連結 - 에디터에 링크를 추가하거나 링크의 속성을 변경할 수 있습니다. - エディターでリンクの追加、属性の変更が出来ます。 - 插入链接或编辑链接属性。 - It can add a link to editor or modify the attribution of link. - Puede añadir un enlace al editor o modificar la atribución de enlace. - Это может добавить ссылку в редактор или изменить ее параметры. - 插入連結或編輯連結屬性。 - 0.1 - 2007-02-28 - - - zero - zero - zero - zero - zero - zero - zero - - diff --git a/modules/editor/components/url_link/lang/en.lang.php b/modules/editor/components/url_link/lang/en.lang.php deleted file mode 100644 index baecc4ba9..000000000 --- a/modules/editor/components/url_link/lang/en.lang.php +++ /dev/null @@ -1,21 +0,0 @@ - - * @brief editor module > language pack of url_link component - **/ - - $lang->urllink_title = "Title"; - $lang->urllink_url = "URL"; - $lang->urllink_open_window = "Open New Window"; - $lang->urllink_bold = "Bold Text"; - - $lang->urllink_color = "Link Color"; - $lang->urllink_color_blue = "Blue"; - $lang->urllink_color_red = "Red"; - $lang->urllink_color_yellow = "Yellow"; - $lang->urllink_color_green = "Green"; - - $lang->about_url_link_open_window = "Make the link to open as a new window"; - $lang->about_url_link_bold = "Make the link text bold"; -?> diff --git a/modules/editor/components/url_link/lang/es.lang.php b/modules/editor/components/url_link/lang/es.lang.php deleted file mode 100644 index 24946b0e1..000000000 --- a/modules/editor/components/url_link/lang/es.lang.php +++ /dev/null @@ -1,21 +0,0 @@ - - * @brief editor module > language pack of url_link component - **/ - - $lang->urllink_title = "Titulo"; - $lang->urllink_url = "URL"; - $lang->urllink_open_window = "Abrir Nueva Ventana"; - $lang->urllink_bold = "Texto en negrita"; - - $lang->urllink_color = "Color de los vinculos"; - $lang->urllink_color_blue = "Azul"; - $lang->urllink_color_red = "Rojo"; - $lang->urllink_color_yellow = "Amarillo"; - $lang->urllink_color_green = "Verde"; - - $lang->about_url_link_open_window = "Hacer el vinculo para abrir una nueva ventana"; - $lang->about_url_link_bold = "Hacer el link de texto en negrita"; -?> diff --git a/modules/editor/components/url_link/lang/jp.lang.php b/modules/editor/components/url_link/lang/jp.lang.php deleted file mode 100644 index 8fa35c5c0..000000000 --- a/modules/editor/components/url_link/lang/jp.lang.php +++ /dev/null @@ -1,21 +0,0 @@ - 翻訳:RisaPapa、ミニミ - * @brief ウィジウィグエディターモジュール > urllink コンポネント言語パッケージ - **/ - - $lang->urllink_title = "タイトル"; - $lang->urllink_url = "URL"; - $lang->urllink_open_window = "新しいウィンドウで開く"; - $lang->urllink_bold = "太字にする"; - - $lang->urllink_color = "リンクカラー "; - $lang->urllink_color_blue = "青"; - $lang->urllink_color_red = "赤"; - $lang->urllink_color_yellow = "黄"; - $lang->urllink_color_green = "緑"; - - $lang->about_url_link_open_window = "チェックするとリンクをクリックした時に、新しいウィンドウで開きます。"; - $lang->about_url_link_bold = "チェックするとリンクの文字列が太字で表示されます。"; -?> diff --git a/modules/editor/components/url_link/lang/ko.lang.php b/modules/editor/components/url_link/lang/ko.lang.php deleted file mode 100644 index be1b1b390..000000000 --- a/modules/editor/components/url_link/lang/ko.lang.php +++ /dev/null @@ -1,21 +0,0 @@ - - * @brief 위지윅에디터(editor) 모듈 > urllink 컴포넌트의 언어팩 - **/ - - $lang->urllink_title = "제목"; - $lang->urllink_url = "URL"; - $lang->urllink_open_window = "새창열기"; - $lang->urllink_bold = "글자 굵게"; - - $lang->urllink_color = "링크 색상 "; - $lang->urllink_color_blue = "파란색"; - $lang->urllink_color_red = "붉은색"; - $lang->urllink_color_yellow = "노란색"; - $lang->urllink_color_green = "녹색"; - - $lang->about_url_link_open_window = "선택하시면 링크 선택시 새창으로 열립니다"; - $lang->about_url_link_bold = "선택하시면 링크의 글자가 굵게 표시됩니다"; -?> diff --git a/modules/editor/components/url_link/lang/ru.lang.php b/modules/editor/components/url_link/lang/ru.lang.php deleted file mode 100644 index 0459d6635..000000000 --- a/modules/editor/components/url_link/lang/ru.lang.php +++ /dev/null @@ -1,21 +0,0 @@ - | translation by Maslennikov Evgeny aka X-[Vr]bL1s5 | e-mail: x-bliss[a]tut.by; ICQ: 225035467; - * @brief editor module > language pack of url_link component - **/ - - $lang->urllink_title = ""; - $lang->urllink_url = "URL"; - $lang->urllink_open_window = " "; - $lang->urllink_bold = " "; - - $lang->urllink_color = " "; - $lang->urllink_color_blue = ""; - $lang->urllink_color_red = ""; - $lang->urllink_color_yellow = ""; - $lang->urllink_color_green = ""; - - $lang->about_url_link_open_window = " "; - $lang->about_url_link_bold = " "; -?> diff --git a/modules/editor/components/url_link/lang/zh-CN.lang.php b/modules/editor/components/url_link/lang/zh-CN.lang.php deleted file mode 100644 index f3c72f135..000000000 --- a/modules/editor/components/url_link/lang/zh-CN.lang.php +++ /dev/null @@ -1,21 +0,0 @@ - - * @brief 网页编辑器(editor) 模块 > urllink组建语言包 - **/ - - $lang->urllink_title = "文本"; - $lang->urllink_url = "URL"; - $lang->urllink_open_window = "新窗口"; - $lang->urllink_bold = "粗体"; - - $lang->urllink_color = "链接颜色 "; - $lang->urllink_color_blue = "蓝色"; - $lang->urllink_color_red = "红色"; - $lang->urllink_color_yellow = "黄色"; - $lang->urllink_color_green = "绿色"; - - $lang->about_url_link_open_window = "将在新窗口中打开链接。"; - $lang->about_url_link_bold = "用粗体显示文本。"; -?> diff --git a/modules/editor/components/url_link/lang/zh-TW.lang.php b/modules/editor/components/url_link/lang/zh-TW.lang.php deleted file mode 100644 index 83bfc642a..000000000 --- a/modules/editor/components/url_link/lang/zh-TW.lang.php +++ /dev/null @@ -1,21 +0,0 @@ - 翻譯:royallin - * @brief 網頁編輯器(editor) 模組 > urllink組件 - **/ - - $lang->urllink_title = "文字"; - $lang->urllink_url = "網址"; - $lang->urllink_open_window = "新視窗"; - $lang->urllink_bold = "粗體"; - - $lang->urllink_color = "連結顏色 "; - $lang->urllink_color_blue = "藍色"; - $lang->urllink_color_red = "紅色"; - $lang->urllink_color_yellow = "黃色"; - $lang->urllink_color_green = "綠色"; - - $lang->about_url_link_open_window = "以新視窗開啟連結。"; - $lang->about_url_link_bold = "文字以粗體顯示。"; -?> diff --git a/modules/editor/components/url_link/tpl/popup.css b/modules/editor/components/url_link/tpl/popup.css deleted file mode 100644 index b13d6170f..000000000 --- a/modules/editor/components/url_link/tpl/popup.css +++ /dev/null @@ -1,4 +0,0 @@ -@charset "utf-8"; -@import url(../../../../../modules/admin/tpl/css/admin.css); - -.link_color { float:left; margin-right:2em; } diff --git a/modules/editor/components/url_link/tpl/popup.html b/modules/editor/components/url_link/tpl/popup.html deleted file mode 100644 index 6f0edb8bd..000000000 --- a/modules/editor/components/url_link/tpl/popup.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - -
-

{$component_info->title} ver. {$component_info->version}

-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - -
{$lang->urllink_title}
{$lang->urllink_url}
{$lang->urllink_open_window}
{$lang->urllink_bold}
{$lang->urllink_color}
- - - - - -
-
- - - diff --git a/modules/editor/components/url_link/tpl/popup.js b/modules/editor/components/url_link/tpl/popup.js deleted file mode 100644 index 220315f3b..000000000 --- a/modules/editor/components/url_link/tpl/popup.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 block이 있는지 체크하여 - * 있으면 가져와서 원하는 곳에 삽입 - **/ -function getText() { - var node = opener.editorPrevNode; - if(!node) { - var fo_obj = xGetElementById("fo_component"); - var text = opener.editorGetSelectedHtml(opener.editorPrevSrl); - if(text==undefined) text = ""; - text = text.replace(/<([^>]*)>/ig,'').replace(/</ig,'<').replace(/>/ig,'>').replace(/&/ig,'&'); - fo_obj.text.value = text; - return; - } - - if(node.nodeName == "A") { - var url = node.getAttribute("HREF"); - var text = node.innerHTML.replace(/</ig,'<').replace(/>/ig,'>').replace(/&/ig,'&'); - - var open_window = false; - var bold = false; - var color = ""; - var className = node.className; - - var selectedHtml = opener.editorGetSelectedHtml(opener.editorPrevSrl); - if(selectedHtml.indexOf("window.open")>0) open_window = true; - - if(className) { - if(className.indexOf("bold")>-1) bold = true; - - if(className.indexOf("blue")>0) color = "color_blue"; - else if(className.indexOf("red")>0) color = "color_red"; - else if(className.indexOf("yellow")>0) color = "color_yellow"; - else if(className.indexOf("green")>0) color = "color_green"; - } - - var fo_obj = xGetElementById("fo_component"); - - fo_obj.text.value = text; - fo_obj.url.value = url.replace('&','&'); - if(open_window) fo_obj.open_window.checked = true; - if(bold) fo_obj.bold.checked = true; - if(color) xGetElementById(color).checked = true; - - return; - } else if(node.nodeName == "IMG") { - } else { - var fo_obj = xGetElementById("fo_component"); - var text = opener.editorGetSelectedHtml(opener.editorPrevSrl); - fo_obj.text.value = text.replace(/<([^>]*)>/ig,'').replace(/</ig,'<').replace(/>/ig,'>').replace(/&/ig,'&'); - } -} - -/** - * 부모창의 위지윅에디터에 데이터를 삽입 - **/ -function setText() { - if(typeof(opener)=="undefined") return; - - var fo_obj = xGetElementById("fo_component"); - - var text = fo_obj.text.value; - text.replace(/&/ig,'&').replace(//ig,'>'); - var url = fo_obj.url.value; - url = url.replace(/&/ig,'&'); - var open_window = false; - var bold = false; - var link_class = ""; - var link = ""; - - if(!text) { - window.close(); - return; - } - - if(url) { - - if(fo_obj.open_window.checked) open_window = true; - if(fo_obj.bold.checked) bold= true; - if(xGetElementById("color_blue").checked) link_class = "editor_blue_text"; - else if(xGetElementById("color_red").checked) link_class = "editor_red_text"; - else if(xGetElementById("color_yellow").checked) link_class = "editor_yellow_text"; - else if(xGetElementById("color_green").checked) link_class = "editor_green_text"; - else link_class = ""; - - link = ""; - } else { - link = text; - } - - var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl) - opener.editorReplaceHTML(iframe_obj, link); - - opener.focus(); - window.close(); -} - -xAddEventListener(window, "load", getText); diff --git a/modules/editor/components/url_link/url_link.class.php b/modules/editor/components/url_link/url_link.class.php deleted file mode 100644 index 3f8ae3429..000000000 --- a/modules/editor/components/url_link/url_link.class.php +++ /dev/null @@ -1,35 +0,0 @@ -editor_sequence = $editor_sequence; - $this->component_path = $component_path; - } - - /** - * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 - **/ - function getPopupContent() { - // 템플릿을 미리 컴파일해서 컴파일된 소스를 return - $tpl_path = $this->component_path.'tpl'; - $tpl_file = 'popup.html'; - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - } -?> diff --git a/modules/editor/editor.class.php b/modules/editor/editor.class.php index a631b47ed..e262f4894 100644 --- a/modules/editor/editor.class.php +++ b/modules/editor/editor.class.php @@ -37,6 +37,9 @@ // 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가 $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'); + // 2009. 04. 14 editor component 변환 코드를 trigger로 독립 + $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'); + return new Object(); } @@ -53,6 +56,9 @@ // 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가 if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true; + // 2009. 04. 14 editor component 변환 코드를 trigger로 독립 + if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true; + return false; } @@ -73,6 +79,10 @@ if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'); + // 2009. 04. 14 editor component 변환 코드를 trigger로 독립 + if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) + $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'); + return new Object(0, 'success_updated'); } diff --git a/modules/editor/editor.controller.php b/modules/editor/editor.controller.php index 16928ec26..2c08a58b1 100644 --- a/modules/editor/editor.controller.php +++ b/modules/editor/editor.controller.php @@ -28,19 +28,6 @@ $this->setMessage('msg_auto_saved'); } - function doSaveDoc($args) { - - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - } else { - $args->ipaddress = $_SERVER['REMOTE_ADDR']; - } - - // 저장 - return executeQuery('editor.insertSavedDoc', $args); - } - /** * @brief 자동저장된 문서 삭제 **/ @@ -79,30 +66,6 @@ } } - /** - * @brief 게시글의 입력/수정이 일어났을 경우 자동 저장문서를 제거하는 trigger - **/ - function triggerDeleteSavedDoc(&$obj) { - $this->deleteSavedDoc(); - return new Object(); - } - - /** - * @brief 자동 저장된 글을 삭제 - * 현재 접속한 사용자를 기준 - **/ - function deleteSavedDoc() { - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - } else { - $args->ipaddress = $_SERVER['REMOTE_ADDR']; - } - - // 일단 이전 저장본 삭제 - return executeQuery('editor.deleteSavedDoc', $args); - } - /** * @brief 에디터의 모듈별 추가 확장 폼을 저장 **/ @@ -117,6 +80,18 @@ $editor_config->editor_skin = Context::get('editor_skin'); $editor_config->comment_editor_skin = Context::get('comment_editor_skin'); + $editor_config->content_style = Context::get('content_style'); + $editor_config->content_font = Context::get('content_font'); + if($editor_config->content_font) { + $font_list = array(); + $fonts = explode(',',$editor_config->content_font); + for($i=0,$c=count($fonts);$i<$c;$i++) { + $font = trim(str_replace(array('"','\''),'',$fonts[$i])); + if(!$font) continue; + $font_list[] = $font; + } + if(count($font_list)) $editor_config->content_font = '"'.implode('","',$font_list).'"'; + } $editor_config->sel_editor_colorset = Context::get('sel_editor_colorset'); $editor_config->sel_comment_editor_colorset = Context::get('sel_comment_editor_colorset'); @@ -171,6 +146,115 @@ $this->setMessage('success_updated'); } + /** + * @brief 에디터컴포넌트의 코드를 결과물로 변환 + 문서서식 style 지정 + **/ + function triggerEditorComponentCompile(&$content) { + if(Context::getResponseMethod()!='HTML') return new Object(); + + $module_info = Context::get('module_info'); + $module_srl = $module_info->module_srl; + if($module_srl) { + $oEditorModel = &getModel('editor'); + $editor_config = $oEditorModel->getEditorConfig($module_srl); + $content_style = $editor_config->content_style; + $path = _XE_PATH_.'modules/editor/styles/'.$content_style.'/'; + if(is_dir($path) && file_exists($path.'style.ini')) { + $ini = file($path.'style.ini'); + for($i=0,$c=count($ini);$i<$c;$i++) { + $file = trim($ini[$i]); + if(!$file) continue; + if(preg_match('/\.css$/i',$file)) Context::addCSSFile('./modules/editor/styles/'.$content_style.'/'.$file, false); + elseif(preg_match('/\.js/i',$file)) Context::addJsFile('./modules/editor/styles/'.$content_style.'/'.$file, false); + } + } + $content_font = $editor_config->content_font; + if($content_font) Context::addHtmlHeader(''); + } + + $content = $this->transComponent($content); + } + + /** + * @brief 에디터 컴포넌트코드를 결과물로 변환 + **/ + function transComponent($content) { + $content = preg_replace_callback('!]*)editor_component=([^\>]*)>(.*?)\<\/div\>!is', array($this,'transEditorComponent'), $content); + $content = preg_replace_callback('!]*)editor_component=([^\>]*?)\>!is', array($this,'transEditorComponent'), $content); + return $content; + } + + /** + * @brief 내용의 에디터 컴포넌트 코드를 변환 + **/ + function transEditorComponent($matches) { + // IE에서는 태그의 특성중에서 " 를 빼어 버리는 경우가 있기에 정규표현식으로 추가해줌 + $buff = $matches[0]; + $buff = preg_replace_callback('/([^=^"^ ]*)=([^ ^>]*)/i', fixQuotation, $buff); + $buff = str_replace("&","&",$buff); + + // 에디터 컴포넌트에서 생성된 코드 + $oXmlParser = new XmlParser(); + $xml_doc = $oXmlParser->parse($buff); + if($xml_doc->div) $xml_doc = $xml_doc->div; + else if($xml_doc->img) $xml_doc = $xml_doc->img; + + $xml_doc->body = $matches[3]; + + // attribute가 없으면 return + $editor_component = $xml_doc->attrs->editor_component; + if(!$editor_component) return $matches[0]; + + // component::transHTML() 을 이용하여 변환된 코드를 받음 + $oEditorModel = &getModel('editor'); + $oComponent = &$oEditorModel->getComponentObject($editor_component, 0); + if(!is_object($oComponent)||!method_exists($oComponent, 'transHTML')) return $matches[0]; + + return $oComponent->transHTML($xml_doc); + } + + + /** + * @brief 자동 저장 + **/ + function doSaveDoc($args) { + + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + } else { + $args->ipaddress = $_SERVER['REMOTE_ADDR']; + } + + // 저장 + return executeQuery('editor.insertSavedDoc', $args); + } + + + /** + * @brief 게시글의 입력/수정이 일어났을 경우 자동 저장문서를 제거하는 trigger + **/ + function triggerDeleteSavedDoc(&$obj) { + $this->deleteSavedDoc(); + return new Object(); + } + + /** + * @brief 자동 저장된 글을 삭제 + * 현재 접속한 사용자를 기준 + **/ + function deleteSavedDoc() { + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + } else { + $args->ipaddress = $_SERVER['REMOTE_ADDR']; + } + + // 일단 이전 저장본 삭제 + return executeQuery('editor.deleteSavedDoc', $args); + } + /** * @brief 가상 사이트에서 사용된 에디터 컴포넌트 정보를 제거 **/ @@ -256,6 +340,12 @@ } $component_list->{$component_name} = $xml_info; + + // 버튼, 아이콘 이미지 구함 + $icon_file = _XE_PATH_.'modules/editor/components/'.$component_name.'/icon.gif'; + $component_icon_file = _XE_PATH_.'modules/editor/components/'.$component_name.'/component_icon.gif'; + if(file_exists($icon_file)) $component_list->{$component_name}->icon = true; + if(file_exists($component_icon_file)) $component_list->{$component_name}->component_icon = true; } // enabled만 체크하도록 하였으면 그냥 return diff --git a/modules/editor/editor.model.php b/modules/editor/editor.model.php index 8d5134875..f212c6b8d 100644 --- a/modules/editor/editor.model.php +++ b/modules/editor/editor.model.php @@ -46,8 +46,9 @@ if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 120; if($editor_config->enable_autosave!='N') $editor_config->enable_autosave = "Y"; - if(!$editor_config->editor_skin) $editor_config->editor_skin = 'default'; - if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'default'; + if(!$editor_config->editor_skin) $editor_config->editor_skin = 'xpresseditor'; + if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'xpresseditor'; + if(!$editor_config->content_style) $editor_config->content_style = 'xeStyle'; return $editor_config; } @@ -65,6 +66,13 @@ if(!$option->allow_fileupload) $allow_fileupload = false; else $allow_fileupload = true; + // content_style 세팅 + if(!$option->content_style) $option->content_style = 'xeStyle'; + Context::set('content_style', $option->content_style); + + // 기본 글꼴 지정 + Context::set('content_font', $option->content_font); + // 자동 저장 유무 옵션 설정 if(!$option->enable_autosave) $enable_autosave = false; else $enable_autosave = true; @@ -89,9 +97,6 @@ $skin = $option->skin; if(!$skin) $skin = 'xpresseditor'; - // xpresseditor룰 위한 셋팅 -// if($skin=='default') $skin = 'xpresseditor'; - $colorset = $option->colorset; Context::set('colorset', $colorset); Context::set('skin', $skin); @@ -125,7 +130,7 @@ // SWFUploader에 세팅할 업로드 설정 구함 $file_config = $oFileModel->getUploadConfig(); - $file_config->attached_size = $file_config->allowed_attach_size*1024*1024; + $file_config->allowed_attach_size = $file_config->allowed_attach_size*1024*1024; $file_config->allowed_filesize = $file_config->allowed_filesize*1024*1024; Context::set('file_config',$file_config); @@ -192,10 +197,8 @@ $tpl_path = sprintf('%sskins/%s/', $this->module_path, $skin); $tpl_file = 'editor.html'; - - if(!file_exists($tpl_path.$tpl_file)) { - $skin = 'default'; + $skin = 'xpresseditor'; $tpl_path = sprintf('%sskins/%s/', $this->module_path, $skin); } Context::set('editor_path', $tpl_path); @@ -219,6 +222,8 @@ // type에 따른 설정 정리 if($type == 'document') { $config->editor_skin = $editor_config->editor_skin; + $config->content_style = $editor_config->content_style; + $config->content_font = $editor_config->content_font; $config->sel_editor_colorset = $editor_config->sel_editor_colorset; $config->upload_file_grant = $editor_config->upload_file_grant; $config->enable_default_component_grant = $editor_config->enable_default_component_grant; @@ -228,6 +233,8 @@ $config->enable_autosave = $editor_config->enable_autosave; } else { $config->editor_skin = $editor_config->comment_editor_skin; + $config->content_style = $editor_config->content_style; + $config->content_font = $editor_config->content_font; $config->sel_editor_colorset = $editor_config->sel_comment_editor_colorset; $config->upload_file_grant = $editor_config->comment_upload_file_grant; $config->enable_default_component_grant = $editor_config->enable_comment_default_component_grant; @@ -247,6 +254,8 @@ // 에디터 옵션 변수를 미리 설정 $option->skin = $config->editor_skin; + $option->content_style = $config->content_style; + $option->content_font = $config->content_font; $option->colorset = $config->sel_editor_colorset; // 파일 업로드 권한 체크 @@ -407,8 +416,18 @@ } if(!file_exists($cache_file)) return; - @include($cache_file); + + if(count($component_list)) { + foreach($component_list as $key => $val) { + if(!trim($key)) continue; + if(!is_dir(_XE_PATH_.'modules/editor/components/'.$key)) { + FileHandler::removeFile($cache_file); + return $this->getComponentList($filter_enabled, $site_srl); + } + } + + } return $component_list; } diff --git a/modules/editor/editor.view.php b/modules/editor/editor.view.php index 37826cf99..29e5f89b8 100644 --- a/modules/editor/editor.view.php +++ b/modules/editor/editor.view.php @@ -87,17 +87,25 @@ Context::set('editor_config', $editor_config); - // 에디터 스킨 목록을 구함 - $editor_skin_list = FileHandler::readDir('./modules/editor/skins'); - Context::set('editor_skin_list', $editor_skin_list); - $oModuleModel = &getModel('module'); + // 에디터 스킨 목록을 구함 + $editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins'); + Context::set('editor_skin_list', $editor_skin_list); + $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin); Context::set('editor_colorset_list', $skin_info->colorset); $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->comment_editor_skin); Context::set('editor_comment_colorset_list', $skin_info->colorset); - + + $contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles'); + for($i=0,$c=count($contents);$i<$c;$i++) { + $style = $contents[$i]; + $info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles'); + $content_style_list[$style]->title = $info->title; + } + Context::set('content_style_list', $content_style_list); + // 그룹 목록을 구함 $oMemberModel = &getModel('member'); diff --git a/modules/editor/lang/en.lang.php b/modules/editor/lang/en.lang.php index a62e41234..578e8c1c6 100644 --- a/modules/editor/lang/en.lang.php +++ b/modules/editor/lang/en.lang.php @@ -16,6 +16,8 @@ $lang->component_description = 'Description'; $lang->component_extra_vars = 'Option Variable'; $lang->component_grant = 'Permission Setting'; + $lang->content_style = 'Content Style'; + $lang->content_font = 'Content Font'; $lang->about_component = 'About component'; $lang->about_component_grant = 'Selected group(s) will be able to use expanded components of editor.
(Leave them blank if you want all groups to have permission)'; @@ -41,6 +43,8 @@ $lang->editor_height = 'Height of Editor'; $lang->about_editor_skin = 'You may select the skin of editor.'; + $lang->about_content_style = '문서 편집 및 내용 출력시 원하는 서식을 지정할 수 있습니다'; + $lang->about_content_font = '문서 편집 및 내용 출력시 원하는 폰트를 지정할 수 있습니다.
지정하지 않으면 사용자 설정에 따르게 됩니다
,(콤마)로 여러 폰트를 지정할 수 있습니다.'; $lang->about_upload_file_grant = 'Selected group(s) will be able to upload files. (Leave them blank if you want all groups to have permission)'; $lang->about_default_component_grant = 'Selected group(s) will be able to use default components of editor. (Leave them blank if you want all groups to have permission)'; $lang->about_editor_height = 'You may set the height of editor.'; @@ -182,19 +186,21 @@ $lang->edit->symbol = '일반기호'; $lang->edit->number_unit = '숫자와 단위'; $lang->edit->circle_bracket = '원,괄호'; - $lang->edit->korean = '한글'; - $lang->edit->greece = '그리스'; - $lang->edit->Latin = '라틴어'; - $lang->edit->japan = '일본어'; + $lang->edit->korean = 'Korean'; + $lang->edit->greece = 'Greek'; + $lang->edit->Latin = 'Latin'; + $lang->edit->japan = 'Japanese'; $lang->edit->selected_symbol = '선택한 기호'; - $lang->edit->search_replace = '찾기/바꾸기'; + $lang->edit->search_replace = 'Find/Replace'; $lang->edit->close_search_replace = '찾기/바꾸기 레이어 닫기'; - $lang->edit->replace_all = '모두바꾸기'; + $lang->edit->replace_all = 'Replace All'; $lang->edit->search_words = '찾을단어'; $lang->edit->replace_words = '바꿀단어'; $lang->edit->next_search_words = '다음찾기'; $lang->edit->edit_height_control = '입력창 크기 조절'; - + $lang->edit->merge_cells = 'Merge Table Cells'; + $lang->edit->split_row = '행 분할'; + $lang->edit->split_col = '열 분할'; ?> diff --git a/modules/editor/lang/es.lang.php b/modules/editor/lang/es.lang.php index edb980ba6..a35dfde77 100644 --- a/modules/editor/lang/es.lang.php +++ b/modules/editor/lang/es.lang.php @@ -16,6 +16,8 @@ $lang->component_description = 'Descripción'; $lang->component_extra_vars = 'Varibles Extras'; $lang->component_grant = 'Ajuste de las atribuciones'; + $lang->content_style = 'Content Style'; + $lang->content_font = 'Content Font'; $lang->about_component = 'Presentación del componente'; $lang->about_component_grant = 'Usted puede configurar el permiso de utilizar la ampliación de los componentes de editor.
(Todo el mundo tendría permiso si no comprobado)'; @@ -41,6 +43,8 @@ $lang->editor_height = 'Altura de Editor'; $lang->about_editor_skin = 'Usted puede seleccionar la piel del editor.'; + $lang->about_content_style = '문서 편집 및 내용 출력시 원하는 서식을 지정할 수 있습니다'; + $lang->about_content_font = '문서 편집 및 내용 출력시 원하는 폰트를 지정할 수 있습니다.
지정하지 않으면 사용자 설정에 따르게 됩니다
,(콤마)로 여러 폰트를 지정할 수 있습니다.'; $lang->about_upload_file_grant = 'Usted puede configurar el permiso de archivo adjunto. (Todo el mundo tendría permiso si no comprobado)'; $lang->about_default_component_grant = 'Usted puede configurar el permiso de uso de los componentes de editor por defecto. (Todo el mundo tendría permiso si no comprobado)'; $lang->about_editor_height = 'Usted puede configurar la altura del editor.'; @@ -192,5 +196,7 @@ $lang->edit->next_search_words = '다음찾기'; $lang->edit->edit_height_control = '입력창 크기 조절'; - + $lang->edit->merge_cells = '셀 병합'; + $lang->edit->split_row = '행 분할'; + $lang->edit->split_col = '열 분할'; ?> diff --git a/modules/editor/lang/fr.lang.php b/modules/editor/lang/fr.lang.php index eb5961e60..2069957ac 100644 --- a/modules/editor/lang/fr.lang.php +++ b/modules/editor/lang/fr.lang.php @@ -16,6 +16,8 @@ $lang->component_description = 'Description'; $lang->component_extra_vars = 'Variables d\'Option'; $lang->component_grant = 'Configuration de la Permission'; + $lang->content_style = 'Content Style'; + $lang->content_font = 'Content Font'; $lang->about_component = 'Sur le Composant'; $lang->about_component_grant = 'Vous pouvez configurer la Permission d\'utiliser des composants additionnels de l\'Editeur.
(Tout le monde aura la Permission si vous ne cochez rien)'; @@ -41,6 +43,8 @@ $lang->editor_height = 'Hauteur de l\'Editeur'; $lang->about_editor_skin = 'Vous pouvez choisir l\'habillage de l\'Editeur.'; + $lang->about_content_style = '문서 편집 및 내용 출력시 원하는 서식을 지정할 수 있습니다'; + $lang->about_content_font = '문서 편집 및 내용 출력시 원하는 폰트를 지정할 수 있습니다.
지정하지 않으면 사용자 설정에 따르게 됩니다
,(콤마)로 여러 폰트를 지정할 수 있습니다.'; $lang->about_upload_file_grant = 'Vous pouvez configurer la permission d\'attacher les fichiers. (Tout le monde aura la permission si vous ne cochez rien)'; $lang->about_default_component_grant = 'Vous pouvez configurer la permission d\'utiliser les Composants Par Défaut de l\'Editeur. (Tout le monde aura la permission si vous ne cochez rien)'; $lang->about_editor_height = 'Vous pouvez configurer l\'hauteur de l\'Editeur.'; @@ -196,5 +200,7 @@ $lang->edit->next_search_words = '다음찾기'; $lang->edit->edit_height_control = '입력창 크기 조절'; - + $lang->edit->merge_cells = '셀 병합'; + $lang->edit->split_row = '행 분할'; + $lang->edit->split_col = '열 분할'; ?> diff --git a/modules/editor/lang/jp.lang.php b/modules/editor/lang/jp.lang.php index f50d56b2e..27af053ae 100644 --- a/modules/editor/lang/jp.lang.php +++ b/modules/editor/lang/jp.lang.php @@ -16,6 +16,8 @@ $lang->component_description = '説明'; $lang->component_extra_vars = '設定変数'; $lang->component_grant = '権限設定'; + $lang->content_style = 'Content Style'; + $lang->content_font = 'Content Font'; $lang->about_component = 'コンポーネント情報'; $lang->about_component_grant = '基本コンポーネント以外の拡張コンポーネント機能が利用可能な権限の設定が出来ます。
(選択なしの場合、誰でも利用可能)'; @@ -41,6 +43,8 @@ $lang->editor_height = 'エディターの高さ'; $lang->about_editor_skin = 'エディターのスキンの選択が出来ます。'; + $lang->about_content_style = '문서 편집 및 내용 출력시 원하는 서식을 지정할 수 있습니다'; + $lang->about_content_font = '문서 편집 및 내용 출력시 원하는 폰트를 지정할 수 있습니다.
지정하지 않으면 사용자 설정에 따르게 됩니다
,(콤마)로 여러 폰트를 지정할 수 있습니다.'; $lang->about_upload_file_grant = 'ファイル添付可能な権限の設定が出来ます。(選択なしの場合、誰でも添付が可能)'; $lang->about_default_component_grant = 'エディターでの基本コンポーネントを使用可能な権限の設定が出来ます。(選択なしの場合、誰でも利用可能)'; $lang->about_editor_height = 'エディターの基本高さを設定します。'; @@ -198,4 +202,7 @@ $lang->edit->next_search_words = '次を検索'; $lang->edit->edit_height_control = '入力サイズ調整'; -?> \ No newline at end of file + $lang->edit->merge_cells = '셀 병합'; + $lang->edit->split_row = '행 분할'; + $lang->edit->split_col = '열 분할'; +?> diff --git a/modules/editor/lang/ko.lang.php b/modules/editor/lang/ko.lang.php index 2b5d40dba..aa1d66665 100644 --- a/modules/editor/lang/ko.lang.php +++ b/modules/editor/lang/ko.lang.php @@ -16,6 +16,8 @@ $lang->component_description = '설명'; $lang->component_extra_vars = '설정 변수'; $lang->component_grant = '권한설정'; + $lang->content_style = '문서 서식'; + $lang->content_font = '문서 폰트'; $lang->about_component = '컴포넌트 소개'; $lang->about_component_grant = '기본 컴포넌트외의 확장 컴포넌트 기능을 사용할 수 있는 권한을 지정할 수 있습니다.
(모두 해제시 아무나 사용 가능합니다)'; @@ -41,6 +43,8 @@ $lang->editor_height = '에디터 높이'; $lang->about_editor_skin = '에디터 스킨을 선택하실 수 있습니다'; + $lang->about_content_style = '문서 편집 및 내용 출력시 원하는 서식을 지정할 수 있습니다'; + $lang->about_content_font = '문서 편집 및 내용 출력시 원하는 폰트를 지정할 수 있습니다.
지정하지 않으면 사용자 설정에 따르게 됩니다
,(콤마)로 여러 폰트를 지정할 수 있습니다.'; $lang->about_upload_file_grant = '파일을 첨부할 수 있는 권한을 지정하실 수 있습니다. (모두 해제 시 아무나 첨부 가능합니다)'; $lang->about_default_component_grant = '에디터에서 사용되는 기본 컴포넌트를 사용할 수 있는 권한을 지정할 수 있습니다. (모두 해제 시 아무나 사용 가능합니다)'; $lang->about_editor_height = '에디터의 기본 높이를 지정하실 수 있습니다.'; @@ -197,5 +201,9 @@ $lang->edit->replace_words = '바꿀단어'; $lang->edit->next_search_words = '다음찾기'; $lang->edit->edit_height_control = '입력창 크기 조절'; + + $lang->edit->merge_cells = '셀 병합'; + $lang->edit->split_row = '행 분할'; + $lang->edit->split_col = '열 분할'; -?> \ No newline at end of file +?> diff --git a/modules/editor/lang/ru.lang.php b/modules/editor/lang/ru.lang.php index ab217e620..f8621e7b7 100644 --- a/modules/editor/lang/ru.lang.php +++ b/modules/editor/lang/ru.lang.php @@ -16,6 +16,8 @@ $lang->component_description = 'Описание'; $lang->component_extra_vars = 'Экстра перем.'; $lang->component_grant = 'Настройки прав доступа'; + $lang->content_style = 'Content Style'; + $lang->content_font = 'Content Font'; $lang->about_component = 'О компоненте'; $lang->about_component_grant = 'Только выбранным группам позволено использование.
(Каждый может использовать его, если режим выключен)'; @@ -41,6 +43,8 @@ $lang->editor_height = '에디터 높이'; $lang->about_editor_skin = '에디터 스킨을 선택하실 수 있습니다'; + $lang->about_content_style = '문서 편집 및 내용 출력시 원하는 서식을 지정할 수 있습니다'; + $lang->about_content_font = '문서 편집 및 내용 출력시 원하는 폰트를 지정할 수 있습니다.
지정하지 않으면 사용자 설정에 따르게 됩니다
,(콤마)로 여러 폰트를 지정할 수 있습니다.'; $lang->about_upload_file_grant = '파일을 첨부할 수 있는 권한을 지정하실 수 있습니다 (모두 해제시 아무나 첨부 가능합니다)'; $lang->about_default_component_grant = '에디터에서 사용되는 기본 컴포넌트를 사용할 수 있는 권한을 지정할 수 있습니다. (모두 해제시 아무나 사용 가능합니다)'; $lang->about_editor_height = '에디터의 기본 높이를 지정하실 수 있습니다'; @@ -192,4 +196,7 @@ $lang->edit->next_search_words = '다음찾기'; $lang->edit->edit_height_control = '입력창 크기 조절'; -?> \ No newline at end of file + $lang->edit->merge_cells = '셀 병합'; + $lang->edit->split_row = '행 분할'; + $lang->edit->split_col = '열 분할'; +?> diff --git a/modules/editor/lang/zh-CN.lang.php b/modules/editor/lang/zh-CN.lang.php index 12f82c2ed..0b4f31c9e 100644 --- a/modules/editor/lang/zh-CN.lang.php +++ b/modules/editor/lang/zh-CN.lang.php @@ -16,6 +16,8 @@ $lang->component_description = '说明'; $lang->component_extra_vars = '变数设置'; $lang->component_grant = '权限设置'; + $lang->content_style = 'Content Style'; + $lang->content_font = 'Content Font'; $lang->about_component = '组件简介'; $lang->about_component_grant = '可以设置除默认组件外的扩展组件使用权限
(全部解除时任何用户都可以使用)。'; @@ -41,6 +43,8 @@ $lang->editor_height = '编辑器高度'; $lang->about_editor_skin = '可以选择编辑器皮肤。'; + $lang->about_content_style = '문서 편집 및 내용 출력시 원하는 서식을 지정할 수 있습니다'; + $lang->about_content_font = '문서 편집 및 내용 출력시 원하는 폰트를 지정할 수 있습니다.
지정하지 않으면 사용자 설정에 따르게 됩니다
,(콤마)로 여러 폰트를 지정할 수 있습니다.'; $lang->about_upload_file_grant = '可以设置上传文件的权限(全部解除为无限制)。'; $lang->about_default_component_grant = '可以设置编辑器默认组件的使用权限(全部解除为无限制)。'; $lang->about_editor_height = '可以指定编辑器的默认高度。'; @@ -198,5 +202,7 @@ $lang->edit->next_search_words = '다음찾기'; $lang->edit->edit_height_control = '입력창 크기 조절'; - + $lang->edit->merge_cells = '셀 병합'; + $lang->edit->split_row = '행 분할'; + $lang->edit->split_col = '열 분할'; ?> diff --git a/modules/editor/lang/zh-TW.lang.php b/modules/editor/lang/zh-TW.lang.php index cb5e9364b..e6af9cdbc 100644 --- a/modules/editor/lang/zh-TW.lang.php +++ b/modules/editor/lang/zh-TW.lang.php @@ -16,6 +16,8 @@ $lang->component_description = '說明'; $lang->component_extra_vars = '變數設置'; $lang->component_grant = '權限設置'; + $lang->content_style = '內容樣式'; + $lang->content_font = 'Content Font'; $lang->about_component = '組件簡介'; $lang->about_component_grant = '除預設組件外,可設置延伸組件的使用權限
(全部解除時,任何用戶都可使用)。'; @@ -41,6 +43,8 @@ $lang->editor_height = '編輯器高度'; $lang->about_editor_skin = '選擇編輯器面板。'; + $lang->about_content_style = '문서 편집 및 내용 출력시 원하는 서식을 지정할 수 있습니다'; + $lang->about_content_font = '문서 편집 및 내용 출력시 원하는 폰트를 지정할 수 있습니다.
지정하지 않으면 사용자 설정에 따르게 됩니다
,(콤마)로 여러 폰트를 지정할 수 있습니다.'; $lang->about_upload_file_grant = '設置上傳檔案的權限(全部解除為無限制)。'; $lang->about_default_component_grant = '設置編輯器預設組件的使用權限(全部解除為無限制)。'; $lang->about_editor_height = '指定編輯器的預設高度。'; @@ -130,7 +134,7 @@ $lang->edit->upload = '上傳'; $lang->edit->upload_file = '上傳附檔'; - $lang->edit->link_file = '插入圖片'; + $lang->edit->link_file = '插入檔案'; $lang->edit->delete_selected = '刪除所選'; $lang->edit->icon_align_article = '段落'; @@ -145,59 +149,61 @@ $lang->edit->html_editor = 'HTML'; $lang->edit->extension ='延伸組件'; $lang->edit->help = '使用說明'; - $lang->edit->help_command = '快速鍵指引'; + $lang->edit->help_command = '熱鍵指引'; - $lang->edit->lineheight = '줄간격'; - $lang->edit->fontbgsampletext = '가나다'; + $lang->edit->lineheight = '行距'; + $lang->edit->fontbgsampletext = 'ㄅㄆㄇ'; - $lang->edit->hyperlink = '하이퍼링크'; - $lang->edit->target_blank = '새창으로'; + $lang->edit->hyperlink = '超連結'; + $lang->edit->target_blank = '新視窗'; - $lang->edit->quotestyle1 = '왼쪽 실선'; - $lang->edit->quotestyle2 = '인용 부호'; - $lang->edit->quotestyle3 = '실선'; - $lang->edit->quotestyle4 = '실선 + 배경'; - $lang->edit->quotestyle5 = '굵은 실선'; - $lang->edit->quotestyle6 = '점선'; - $lang->edit->quotestyle7 = '점선 + 배경'; - $lang->edit->quotestyle8 = '적용 취소'; + $lang->edit->quotestyle1 = '左側實線'; + $lang->edit->quotestyle2 = '引用符號'; + $lang->edit->quotestyle3 = '實線'; + $lang->edit->quotestyle4 = '實線 + 背景'; + $lang->edit->quotestyle5 = '粗框'; + $lang->edit->quotestyle6 = '虛線'; + $lang->edit->quotestyle7 = '虛線 + 背景'; + $lang->edit->quotestyle8 = '取消'; - $lang->edit->jumptoedit = '편집 도구모음 건너뛰기'; - $lang->edit->set_sel = '칸 수 지정'; - $lang->edit->row = '행'; - $lang->edit->col = '열'; - $lang->edit->add_one_row = '1행추가'; - $lang->edit->del_one_row = '1행삭제'; - $lang->edit->add_one_col = '1열추가'; - $lang->edit->del_one_col = '1열삭제'; + $lang->edit->jumptoedit = '跳過編輯工具列'; + $lang->edit->set_sel = '表格'; + $lang->edit->row = '行'; + $lang->edit->col = '列'; + $lang->edit->add_one_row = '新增一行'; + $lang->edit->del_one_row = '刪除一行'; + $lang->edit->add_one_col = '新增一列'; + $lang->edit->del_one_col = '刪除一列'; - $lang->edit->table_config = '표 속성 지정'; - $lang->edit->border_width = '테두리 굵기'; - $lang->edit->border_color = '테두리 색'; - $lang->edit->add = '더하기'; - $lang->edit->del = '빼기'; - $lang->edit->search_color = '색상찾기'; - $lang->edit->table_backgroundcolor = '표 배경색'; - $lang->edit->special_character = '특수문자'; - $lang->edit->insert_special_character = '특수문자 삽입'; - $lang->edit->close_special_character = '특수문자 레이어 닫기'; - $lang->edit->symbol = '일반기호'; - $lang->edit->number_unit = '숫자와 단위'; - $lang->edit->circle_bracket = '원,괄호'; - $lang->edit->korean = '한글'; - $lang->edit->greece = '그리스'; - $lang->edit->Latin = '라틴어'; - $lang->edit->japan = '일본어'; - $lang->edit->selected_symbol = '선택한 기호'; + $lang->edit->table_config = '設置'; + $lang->edit->border_width = '邊框寬度'; + $lang->edit->border_color = '邊框顏色'; + $lang->edit->add = '新增'; + $lang->edit->del = '刪除'; + $lang->edit->search_color = '其他顏色'; + $lang->edit->table_backgroundcolor = '背景顏色'; + $lang->edit->special_character = '特殊符號'; + $lang->edit->insert_special_character = '插入特殊符號'; + $lang->edit->close_special_character = '關閉特殊符號圖層'; + $lang->edit->symbol = '一般符號'; + $lang->edit->number_unit = '數字、單位'; + $lang->edit->circle_bracket = '圓、括弧'; + $lang->edit->korean = '韓國語'; + $lang->edit->greece = '希臘語'; + $lang->edit->Latin = '拉丁語'; + $lang->edit->japan = '日本語'; + $lang->edit->selected_symbol = '選擇符號'; - $lang->edit->search_replace = '찾기/바꾸기'; - $lang->edit->close_search_replace = '찾기/바꾸기 레이어 닫기'; - $lang->edit->replace_all = '모두바꾸기'; - $lang->edit->search_words = '찾을단어'; - $lang->edit->replace_words = '바꿀단어'; - $lang->edit->next_search_words = '다음찾기'; - $lang->edit->edit_height_control = '입력창 크기 조절'; + $lang->edit->search_replace = '搜尋/置換'; + $lang->edit->close_search_replace = '關閉搜尋/置換圖層'; + $lang->edit->replace_all = '全部置換'; + $lang->edit->search_words = '搜尋文字'; + $lang->edit->replace_words = '置換文字'; + $lang->edit->next_search_words = '搜尋下一個'; + $lang->edit->edit_height_control = '設定大小'; - -?> \ No newline at end of file + $lang->edit->merge_cells = '分割儲存格'; + $lang->edit->split_row = '插入行'; + $lang->edit->split_col = '插入列'; +?> diff --git a/modules/editor/skins/default/css/black.css b/modules/editor/skins/default/css/black.css deleted file mode 100644 index d4584ed53..000000000 --- a/modules/editor/skins/default/css/black.css +++ /dev/null @@ -1,47 +0,0 @@ -@charset "utf-8"; -/* NHN > UIT Center > Open UI Platform Team > Jeong Chan Myeong(dece24@nhncorp.com) */ - -/* Editor XE White Theme */ - -/* Editor Type Selector */ -.editorTypeSelector a, -.editorTypeSelector a span{ background-image:url(../images/buttonBlack.gif); color:#fff;} - -/* Editor Container */ -.xeEditor{ border-color:#666;} - - /* Tool Box */ -.toolBox{ background-color:#666; background-image:url(../images/black/buttonSetBg.gif);} -.toolBox .item li button{ background-color:transparent; background-image:url(../images/black/buttonSet.gif); opacity:.7; filter:alpha(opacity=70);} - -.toolBox .extension2 .exButton{ background-color:transparent; background-image:url(../images/black/buttonSet.gif); opacity:.7; filter:alpha(opacity=70);} -.toolBox .extension2 ul { background:#fafafa; border-color:#9f9f9f;} -.toolBox .extension2 li button span{ color:#333;} - -.toolBox .editorHelp .helpButton{ background-color:transparent; background-image:url(../images/black/buttonSet.gif); opacity:.7; filter:alpha(opacity=70);} -.toolBox ul.helpList{ background:#333; border-color:#666;} - -/* ToolBox Button Default */ - -/* Auto Save */ -.xeEditor .editor_autosaved_message{ background:#000; color:#aaa; } - -/* Edit Area */ -.xeEditor .editorBox{ border-color:#000; background:#000;} - -/* Editor */ -.xeEditor .richEditor, -.xeEditor .htmlEditor{ background:#000; color:#fff;} - -/* Editor Resize Bar */ -.xeEditor .textAreaDragIndicator{ border-color:#666;} -.xeEditor .textAreaDragIndicator button{ background-color:#444; background-image:url(../images/common/buttonTextAreaDrag.gif);} - -/* File Uploader */ -.commentEditor .xeEditor .fileUploader{ border-color:#666;} -.xeEditor .fileUploader .preview{ border-color:#ddd; background:#fff;} - -/* TextEditor */ -.xeTextEditor {padding:10px; overflow:hidden; margin:0 0 10px 0;} -.xeTextEditor textarea { display:block; margin:0; padding:2px; } -.xeTextEditor.black textarea { color:#fff; background-color:#000;} diff --git a/modules/editor/skins/default/css/editor.css b/modules/editor/skins/default/css/editor.css deleted file mode 100644 index 8a167c1f1..000000000 --- a/modules/editor/skins/default/css/editor.css +++ /dev/null @@ -1,241 +0,0 @@ -@charset "utf-8"; -/* NHN > UIT Center > Open UI Platform Team > Jeong Chan Myeong(dece24@nhncorp.com) */ - -/* Editor XE */ - -/* Editor Temporary */ -.editorTemporary{ float:left; clear:left;} - -/* Editor Type Selector */ -.editorTypeSelector{ float:right; clear:right; position:relative; right:3px; margin:0; padding:0; line-height:normal; *zoom:1;} -.editorTypeSelector:after{ content:""; display:block; clear:both;} -.editorTypeSelector *{ margin:0; padding:0; list-style:none;} -.editorTypeSelector li{ float:left; margin-right:5px; top:0;} -.editorTypeSelector a, -.editorTypeSelector a span{ position:relative; display:block; float:left; background-repeat:no-repeat; cursor:pointer; _cursor /**/:hand; white-space:nowrap;} -.editorTypeSelector a{ background-position:left -65px; text-decoration:none !important;} -.editorTypeSelector a span{ padding:3px 15px; left:3px; background-position:right -65px;} - -/* Editor Type Selector - Hover */ -.editorTypeSelector a:hover span, -.editorTypeSelector a:active span, -.editorTypeSelector a:focus span{ font-weight:bold; letter-spacing:-1px;} - -/* Editor Type Selector - Active */ -.editorTypeSelector li a{ top:0; margin-bottom:-4px;} -.editorTypeSelector li.active a{ top:-2px; margin-bottom:-4px;} -.editorTypeSelector li.active a span{ padding:5px 15px; font-weight:bold; letter-spacing:-1px;} - -/* Skip Tool Box */ -a.skipToolBox, -a.skipToolBox span{ width:0; height:0; overflow:hidden;} - -a.skipToolBox:hover, -a.skipToolBox:focus, -a.skipToolBox:active{ width:auto; height:auto;} - -a.skipToolBox:hover span, -a.skipToolBox:focus span, -a.skipToolBox:active span{ width:auto; height:auto; padding:3px 15px; font-weight:bold; letter-spacing:-1px;} - -/* Editor Container */ -.xeEditor{ clear:both; position:relative; z-index:1; border-top:1px solid; *zoom:1} - - /* Tool Box */ -.toolBox{ position:relative; z-index:100; padding:5px 10px 3px 10px !important; *padding-bottom:8px !important; background-repeat:repeat-x; background-position:left bottom; *zoom:1;} -.toolBox:after{ content:""; display:block; clear:both;} -.toolBox .item{ float:left; margin:0 5px 5px 0;} -.toolBox .item li{ float:left;} -.toolBox .item li button{ display:block; border:0; width:21px; height:21px; background-position:no-repeat; cursor:pointer; overflow:hidden; } -.toolBox .item li button span {position:relative !important; z-index:-1 !important; font-size:0 !important; line-height:0 !important;} - -.toolBox .extension2{ float:left; position:relative; margin:0 5px 5px 0;} -.toolBox .extension2 .exButton{ float:left; border:0; width:68px; height:21px; background-repeat:no-repeat; background-position:-579px 0; cursor:pointer;} -.toolBox .extension2 .exButton span{ position:relative; z-index:-1; font-size:0; line-height:0;} -.toolBox .extension2 .exButton:hover, -.toolBox .extension2 .exButton:focus{ background-position:-579px -21px;} -.toolBox .extension2 .exButton:active{ background-position:-579px -42px;} -.toolBox .extension2 ul { display:none; position:absolute; padding:5px 0; top:10px; *top:25px; right:0; border:1px solid; } -.toolBox .extension2.open ul { display:block; } -.toolBox .extension2 li{ text-align:left; padding:2px 3px !important; list-style:none; margin:0 !important; display:block; white-space:nowrap;} -.toolBox .extension2 li a { color:#000000; text-decoration:none; } - -.toolBox .editorHelp{ float:left; position:relative; margin:0 5px 5px 0;} -.toolBox .editorHelp .helpButton{ float:left; border:0; width:22px; height:21px; background-repeat:no-repeat; background-position:right top; cursor:pointer;} -.toolBox .editorHelp .helpButton span{ position:relative; z-index:-1; font-size:0; line-height:0;} -.toolBox .editorHelp .helpButton:hover, -.toolBox .editorHelp .helpButton:focus{ background-position:right -21px;} -.toolBox .editorHelp .helpButton:active{ background-position:right -42px;} - -.toolBox ul.helpList{ display:none; float:none !important; position:absolute; padding:5px 0; top:100%; right:0; margin-top:-3px; border:1px solid;} -.toolBox ul.helpList.open{ display:block;} -.toolBox ul.helpList li{ list-style:disc; float:none; text-align:left; white-space:nowrap; padding:0 10px 0 0; margin-left:25px; font-size:12px;} -.toolBox ul.helpList li li{ list-style:circle; margin-left:20px;} - -/* ToolBox Button Default */ -.toolBox .item { list-style:none; padding:0; } -.toolBox .item.do{ width:43px;} -.toolBox .item .undo button{ width:22px;} -.toolBox .item .redo button{ background-position:-22px 0;} - -.toolBox .item.type *{ font-size:12px; line-height:100%;} -.toolBox .item.type select{ height:21px;} -.toolBox .item.type .hx{} -.toolBox .item.type .size .px10{ font-size:10px;} -.toolBox .item.type .size .px13{ font-size:13px;} -.toolBox .item.type .size .px16{ font-size:16px;} -.toolBox .item.type .size .px18{ font-size:18px;} -.toolBox .item.type .size .px24{ font-size:24px;} -.toolBox .item.type .size .px32{ font-size:32px;} -.toolBox .item.type .size .px48{ font-size:48px;} -.toolBox .item.type .family{} - -.toolBox .item.style{ width:214px;} -.toolBox .item .bold button{ width:22px; background-position:-43px 0;} -.toolBox .item .underline button{ background-position:-65px 0;} -.toolBox .item .italic button{ background-position:-86px 0;} -.toolBox .item .strike button{ background-position:-107px 0;} -.toolBox .item .sup button{ background-position:-128px 0;} -.toolBox .item .sub button{ background-position:-149px 0;} -.toolBox .item .txColor button{ background-position:-170px 0;} -.toolBox .item .bgColor button{ background-position:-191px 0;} -.toolBox .item .styleRemover button{ width:45px; background-position:-212px 0;} - -.toolBox .item.paragraph{ width:169px;} -.toolBox .item .alignLeft button{ width:22px; background-position:-257px 0;} -.toolBox .item .alignCenter button{ background-position:-279px 0;} -.toolBox .item .alignRight button{ background-position:-300px 0;} -.toolBox .item .alignJustify button{ background-position:-321px 0;} -.toolBox .item .orderedList button{background-position:-342px 0;} -.toolBox .item .unorderedList button{ background-position:-363px 0;} -.toolBox .item .outdent button{ background-position:-384px 0;} -.toolBox .item .indent button{ background-position:-405px 0;} - -.toolBox .item.extension1{ width:153px;} -.toolBox .item .url button{ width:27px; background-position:-426px 0;} -.toolBox .item .blockquote button{ background-position:-453px 0;} -.toolBox .item .table button{ background-position:-474px 0;} -.toolBox .item .image button{ background-position:-495px 0;} -.toolBox .item .movie button{ background-position:-516px 0;} -.toolBox .item .file button{ background-position:-537px 0;} -.toolBox .item .emoticon button{ background-position:-558px 0;} - -/* ToolBox Button Hover & Focus & Active */ -.toolBox .item .undo button:hover, -.toolBox .item .undo button:focus{ background-position:0 -21px;} -.toolBox .item .undo button:active{ background-position:0 -42px;} -.toolBox .item .redo button:hover, -.toolBox .item .redo button:focus{ background-position:-22px -21px;} -.toolBox .item .redo button:active{ background-position:-22px -42px;} - -.toolBox .item .bold button:hover, -.toolBox .item .bold button:focus{ background-position:-43px -21px;} -.toolBox .item .bold button:active{ background-position:-43px -42px;} -.toolBox .item .underline button:hover, -.toolBox .item .underline button:focus{ background-position:-65px -21px;} -.toolBox .item .underline button:active{ background-position:-65px -42px;} -.toolBox .item .italic button:hover, -.toolBox .item .italic button:focus{ background-position:-86px -21px;} -.toolBox .item .italic button:active{ background-position:-86px -42px;} -.toolBox .item .strike button:hover, -.toolBox .item .strike button:focus{ background-position:-107px -21px;} -.toolBox .item .strike button:active{ background-position:-107px -42px;} -.toolBox .item .sup button:hover, -.toolBox .item .sup button:focus{ background-position:-128px -21px;} -.toolBox .item .sup button:active{ background-position:-128px -42px;} -.toolBox .item .sub button:hover, -.toolBox .item .sub button:focus{ background-position:-149px -21px;} -.toolBox .item .sub button:active{ background-position:-149px -42px;} -.toolBox .item .txColor button:hover, -.toolBox .item .txColor button:focus{ background-position:-170px -21px;} -.toolBox .item .txColor button:active{ background-position:-170px -42px;} -.toolBox .item .bgColor button:hover, -.toolBox .item .bgColor button:focus{ background-position:-191px -21px;} -.toolBox .item .bgColor button:active{ background-position:-191px -42px;} -.toolBox .item .styleRemover button:hover, -.toolBox .item .styleRemover button:focus{ background-position:-212px -21px;} -.toolBox .item .styleRemover button:active{ background-position:-212px -42px;} - -.toolBox .item .alignLeft button:hover, -.toolBox .item .alignLeft button:focus{ background-position:-257px -21px;} -.toolBox .item .alignLeft button:active{ background-position:-257px -42px;} -.toolBox .item .alignCenter button:hover, -.toolBox .item .alignCenter button:focus{ background-position:-279px -21px;} -.toolBox .item .alignCenter button:active{ background-position:-279px -42px;} -.toolBox .item .alignRight button:hover, -.toolBox .item .alignRight button:focus{ background-position:-300px -21px;} -.toolBox .item .alignRight button:active{ background-position:-300px -42px;} -.toolBox .item .alignJustify button:hover, -.toolBox .item .alignJustify button:focus{ background-position:-321px -21px;} -.toolBox .item .alignJustify button:active{ background-position:-321px -42px;} -.toolBox .item .orderedList button:hover, -.toolBox .item .orderedList button:focus{background-position:-342px -21px;} -.toolBox .item .orderedList button:active{background-position:-342px -42px;} -.toolBox .item .unorderedList button:hover, -.toolBox .item .unorderedList button:focus{ background-position:-363px -21px;} -.toolBox .item .unorderedList button:active{ background-position:-363px -42px;} -.toolBox .item .outdent button:hover, -.toolBox .item .outdent button:focus{ background-position:-384px -21px;} -.toolBox .item .outdent button:active{ background-position:-384px -42px;} -.toolBox .item .indent button:hover, -.toolBox .item .indent button:focus{ background-position:-405px -21px;} -.toolBox .item .indent button:active{ background-position:-405px -42px;} - -.toolBox .item .url button:hover, -.toolBox .item .url button:focus{ background-position:-426px -21px;} -.toolBox .item .url button:active{ background-position:-426px -42px;} -.toolBox .item .blockquote button:hover, -.toolBox .item .blockquote button:focus{ background-position:-453px -21px;} -.toolBox .item .blockquote button:active{ background-position:-453px -42px;} -.toolBox .item .table button:hover, -.toolBox .item .table button:focus{ background-position:-474px -21px;} -.toolBox .item .table button:active{ background-position:-474px -42px;} -.toolBox .item .image button:hover, -.toolBox .item .image button:focus{ background-position:-495px -21px;} -.toolBox .item .image button:active{ background-position:-495px -42px;} -.toolBox .item .movie button:hover, -.toolBox .item .movie button:focus{ background-position:-516px -21px;} -.toolBox .item .movie button:active{ background-position:-516px -42px;} -.toolBox .item .file button:hover, -.toolBox .item .file button:focus{ background-position:-537px -21px;} -.toolBox .item .file button:active{ background-position:-537px -42px;} -.toolBox .item .emoticon button:hover, -.toolBox .item .emoticon button:focus{ background-position:-558px -21px;} -.toolBox .item .emoticon button:active{ background-position:-558px -42px;} - -/* Auto Save */ -.xeEditor .editor_autosaved_message{background:none; border:none; text-align:right; clear:both; margin:0; padding:0 5px 0 0; } - -/* Edit Area */ -.xeEditor .editorBox{ border-bottom:5px solid; position:relative; width:100%;} -.xeEditor .editorBox .editorMargin{ margin:0 5px; *zoom:1;} - -/* Editor Display */ -.xeEditor .toolBox, .xeEditor .richEditor, .xeEditor .htmlEditor {display:none;} -.xeEditor.rich .toolBox, .xeEditor.rich .richEditor, .xeEditor.html .htmlEditor{ display:block;} -.xeEditor.preview .toolBox, .xeEditor.rich .xeEditor.html .htmlEditor { display:none;} -.xeEditor.preview .previewEditor { display:block;} -.xeEditor .richEditor, .xeEditor .htmlEditor{ border:0;} -.xeEditor .htmlEditor{ width:100%; padding:10px 0; font-size:12px;} -.xeEditor .previewEditor { display:none; } - -/* Editor Resize Bar */ -.xeEditor .textAreaDragIndicator{ border-top:1px solid; border-bottom:1px solid; clear:both; margin-bottom:5px;} -.xeEditor .textAreaDragIndicator button{ width:100%; height:9px; border:none; cursor:n-resize; background-repeat:no-repeat; background-position:center center; } -.xeEditor .mask{ position:absolute; width:100%;height:500px;margin-top:-500px;bottom:0; display:none; } - -/* File Uploader */ -.xeEditor .fileUploader{ clear:both; position:relative; padding-top:5px; *zoom:1; *margin-bottom:5px;} -.commentEditor .xeEditor .fileUploader{ border-top:1px solid;} -.xeEditor .fileUploader:after{ content:""; display:block; clear:both;} -.xeEditor .fileUploader .preview{ float:left; width:64px; height:64px; border:1px solid; padding:2px; margin:0 10px 5px 10px;} -.xeEditor .fileUploader .preview.black { background-color:#000; border:1px solid #666;} -.xeEditor .fileUploader .preview img{ display:block; width:64px; height:64px;} -.xeEditor .fileUploader .fileListArea{ float:left; width:260px; margin:0 10px 5px 0;} -.xeEditor .fileUploader .fileListArea select{ width:100%; height:70px; overflow:auto;} -.xeEditor .fileUploader .fileListArea select option{ font-size:11px;} -.xeEditor .fileUploader .fileListArea.black select { background-color:#000; border:1px solid #666;} -.xeEditor .fileUploader .fileListArea.black select option { color:#aaa; } -.xeEditor .fileUploader .fileUploadControl{ clear:right;} -.xeEditor .fileUploader .fileUploadControl .button{ margin-bottom:5px;} -.xeEditor .fileUploader .file_attach_info{ clear:right; margin:5px 0;} diff --git a/modules/editor/skins/default/css/white.css b/modules/editor/skins/default/css/white.css deleted file mode 100644 index 00dabe37a..000000000 --- a/modules/editor/skins/default/css/white.css +++ /dev/null @@ -1,46 +0,0 @@ -@charset "utf-8"; -/* NHN > UIT Center > Open UI Platform Team > Jeong Chan Myeong(dece24@nhncorp.com) */ - -/* Editor XE White Theme */ - -/* Editor Type Selector */ -.editorTypeSelector a, -.editorTypeSelector a span{ background-image:url(../images/buttonWhite.gif); color:#000;} - -/* Editor Container */ -.xeEditor{ border-color:#ddd;} - - /* Tool Box */ -.toolBox{ background-color:#fafafa; background-image:url(../images/white/buttonSetBg.gif);} -.toolBox .item li button{ background-color:transparent; background-image:url(../images/white/buttonSet.gif);} - -.toolBox .extension2 .exButton{ background-color:transparent; background-image:url(../images/white/buttonSet.gif);} -.toolBox .extension2 ul { background:#fafafa; border-color:#9f9f9f;} -.toolBox .extension2 li button span{ color:#333;} - -.toolBox .editorHelp .helpButton{ background-color:transparent; background-image:url(../images/white/buttonSet.gif);} -.toolBox ul.helpList{ background:#fafafa; border-color:#9f9f9f;} - -/* ToolBox Button Default */ - -/* Auto Save */ -.xeEditor .editor_autosaved_message{ background:#fff; color:#666; } - -/* Edit Area */ -.xeEditor .editorBox{ border-color:#fff; background:#fff;} - -/* Editor */ -.xeEditor .richEditor, -.xeEditor .htmlEditor{ background:#fff;} - -/* Editor Resize Bar */ -.xeEditor .textAreaDragIndicator{ border-color:#ddd; border-color:#ddd;} -.xeEditor .textAreaDragIndicator button{ background-color:#f4f4f4; background-image:url(../images/common/buttonTextAreaDrag.gif);} - -/* File Uploader */ -.commentEditor .xeEditor .fileUploader{ border-color:#ddd;} -.xeEditor .fileUploader .preview{ border-color:#ddd; background:#fff;} - -/* TextEditor */ -.xeTextEditor {padding:10px; overflow:hidden; margin:0 0 10px 0;} -.xeTextEditor textarea { display:block; margin:0; padding:2px; } diff --git a/modules/editor/skins/default/editor.html b/modules/editor/skins/default/editor.html deleted file mode 100644 index c686d826d..000000000 --- a/modules/editor/skins/default/editor.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - {@ $editor_class = "black" } - - - - -
- nbr" /> - -
- - - - - - - - - - {@ $editor_class = "black" } - - - - - - - - - - - - - - - -
- - -
- - -
- - - -
    -
  • -
  • -
- -
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
- -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
- -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
- -
    -
  • -
  • -
  • -
  • -
  • - -
  • -
- - - - -
- - -
- - - - -
- -
- -
    - - -
  • {$lang->about_dblclick_in_editor}
  • -
  • {$lang->edit->help_use_paragraph}
  • - -
  • {$lang->edit->help_command} -
      -
    • {$lang->edit->undo} : Ctrl+Z
    • -
    • {$lang->edit->redo} : Ctrl+Y
    • -
    • {$lang->edit->bold} : Ctrl+B
    • -
    • {$lang->edit->underline} : Ctrl+U
    • -
    • {$lang->edit->italic} : Ctrl+I
    • -
    • {$lang->edit->remove_format} : Ctrl+D
    • -
    • {$lang->edit->url} : Ctrl+L
    • -
    -
  • -
- -
- - -

 

- - - -
-
- - - -
-
- -
- - -
- - - - - - - -
-
-
- -
-
- - - -
-
{$upload_status}
-
- -
- - - - - diff --git a/modules/editor/skins/default/images/black/buttonSet.gif b/modules/editor/skins/default/images/black/buttonSet.gif deleted file mode 100644 index 1d464c951..000000000 Binary files a/modules/editor/skins/default/images/black/buttonSet.gif and /dev/null differ diff --git a/modules/editor/skins/default/images/black/buttonSetBg.gif b/modules/editor/skins/default/images/black/buttonSetBg.gif deleted file mode 100644 index 9a1bf559c..000000000 Binary files a/modules/editor/skins/default/images/black/buttonSetBg.gif and /dev/null differ diff --git a/modules/editor/skins/default/images/black/tabCorner.gif b/modules/editor/skins/default/images/black/tabCorner.gif deleted file mode 100644 index 8d5413200..000000000 Binary files a/modules/editor/skins/default/images/black/tabCorner.gif and /dev/null differ diff --git a/modules/editor/skins/default/images/buttonBlack.gif b/modules/editor/skins/default/images/buttonBlack.gif deleted file mode 100644 index 8873a99e5..000000000 Binary files a/modules/editor/skins/default/images/buttonBlack.gif and /dev/null differ diff --git a/modules/editor/skins/default/images/buttonWhite.gif b/modules/editor/skins/default/images/buttonWhite.gif deleted file mode 100644 index 4d5e40cef..000000000 Binary files a/modules/editor/skins/default/images/buttonWhite.gif and /dev/null differ diff --git a/modules/editor/skins/default/images/common/buttonTextAreaDrag.gif b/modules/editor/skins/default/images/common/buttonTextAreaDrag.gif deleted file mode 100644 index 2a0bbb580..000000000 Binary files a/modules/editor/skins/default/images/common/buttonTextAreaDrag.gif and /dev/null differ diff --git a/modules/editor/skins/default/images/white/buttonSet.gif b/modules/editor/skins/default/images/white/buttonSet.gif deleted file mode 100644 index 1d464c951..000000000 Binary files a/modules/editor/skins/default/images/white/buttonSet.gif and /dev/null differ diff --git a/modules/editor/skins/default/images/white/buttonSetBg.gif b/modules/editor/skins/default/images/white/buttonSetBg.gif deleted file mode 100644 index 5ee1d693d..000000000 Binary files a/modules/editor/skins/default/images/white/buttonSetBg.gif and /dev/null differ diff --git a/modules/editor/skins/default/images/white/tabCorner.gif b/modules/editor/skins/default/images/white/tabCorner.gif deleted file mode 100644 index 235ab732c..000000000 Binary files a/modules/editor/skins/default/images/white/tabCorner.gif and /dev/null differ diff --git a/modules/editor/skins/default/skin.xml b/modules/editor/skins/default/skin.xml deleted file mode 100644 index 634bbdcce..000000000 --- a/modules/editor/skins/default/skin.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - XE 기본 에디터 - XE básico Editor - XE default Editor - XE编辑器默认皮肤 - XE基本エディター - XE預設編輯器面板 - 개발 : zero (http://blog.nzeo.com) - Developer : zero (http://blog.nzeo.com) - Desarrollo : zero (http://blog.nzeo.com) - 程序 : zero (http://blog.nzeo.com) - 開発 : zero (http://blog.nzeo.com) - 開發 : zero (http://blog.nzeo.com) - 0.1 - 2007-02-28 - - - zero - Zero - zero - zero - zero - zero - - - - 하얀색(기본) - 白(デフォルト) - 白色(基本) - White (default) - Blanco (por defecto) - 白色(預設) - - - 검은색 - - Black - Черного - Negro - 黑色 - 黑色 - - - 하얀색 텍스트편집기(자동 줄 바꿈) - 白色テキストエディター(自動に改行を入れる) - White Text Editor(Auto Line Break) - White Text Editor(Auto Line Break) - Editor de texto en blanco (Auto de línea) - 白色文本编辑器(自动换行) - 白色文字編輯器(Auto Line Break) - - - 검은색 텍스트편집기(자동 줄 바꿈) - 黒色テキストエディター(自動に改行を入れる) - Black Text Editor(Auto Line Break) - Black Text Editor(Auto Line Break) - Editor de texto negro (salto de línea automático) - 黑色文本编辑器(自动换行) - 黑色文字編輯器(Auto Line Break) - - - 하얀색 텍스트편집기(HTML 사용) - 白色テキストエディター(HTMLタグを使う) - White Text Editor(Use HTML) - White Text Editor(Use HTML) - Editor de texto en blanco (Uso de HTML) - 白色文本编辑器(使用HTML) - 白色文字編輯器(Use HTML) - - - 검은색 텍스트편집기(HTML 사용) - 黒色テキストエディター(HTMLタグを使う) - Black Text Editor(Use HTML) - Black Text Editor(Use HTML) - Editor de texto negro (Uso de HTML) - 黑色文本编辑器(使用HTML) - 黑色文字編輯器(Use HTML) - - - 하얀색 텍스트편집기(HTML 사용 안함) - 白色テキストエディター(HTMLタグを使わない) - White Text Editor(No HTML) - White Text Editor(No HTML) - Editor de texto en blanco (no HTML) - 白色文本编辑器(不使用HTML) - 白色文字編輯器(No HTML) - - - 검은색 텍스트편집기(HTML 사용 안함) - 黒色テキストエディター(HTMLタグを使わない) - Black Text Editor(No HTML) - Black Text Editor(No HTML) - Editor de texto negro (no HTML) - 黑色文本编辑器(不使用HTML) - 黑色文字編輯器(No HTML) - - - diff --git a/modules/editor/skins/fckeditor/editor.html b/modules/editor/skins/fckeditor/editor.html index efaf4a4f0..8bf2cfecb 100644 --- a/modules/editor/skins/fckeditor/editor.html +++ b/modules/editor/skins/fckeditor/editor.html @@ -31,9 +31,7 @@ @@ -96,4 +94,4 @@
{$upload_status}
-
\ No newline at end of file +
diff --git a/modules/editor/skins/xpresseditor/css/default.css b/modules/editor/skins/xpresseditor/css/default.css index f2aeb9f03..df73a3cac 100644 --- a/modules/editor/skins/xpresseditor/css/default.css +++ b/modules/editor/skins/xpresseditor/css/default.css @@ -1,372 +1,407 @@ -@charset "utf-8"; - -/* Type Selector */ -.xpress-editor *{margin:0; padding:0; font-style:normal; font-size:12px; } -.xpress-editor img, -.xpress-editor fieldset, -.xpress-editor button{ border:0;} -.xpress-editor button{ background:none; background-repeat:no-repeat; cursor:pointer; _cursor /**/:hand;} -.xpress-editor button *{ visibility:hidden;} -.xpress-editor legend{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden;} -.xpress-editor label{ cursor:pointer; _cursor /**/:hand;} -.xpress-editor hr{ display:none;} -.xpress-editor li{list-style:none;} - -/* Layout Selector */ -.xpress-editor{ position:relative; background:#fff;} -.xpress-editor #smart_content{ position:relative; clear:both; margin:0 0 10px 0; border:1px solid #c2c2c2; *zoom:1;} -.xpress-editor #smart_footer{ position:relative; text-align:center; padding:10px 0;} - -/* Footer */ -.xpress-editor #smart_footer *{ vertical-align:top;} -.xpress-editor #smart_footer button{ position:relative; width:67px; height:25px; margin:0 5px 0 0;} -.xpress-editor #smart_footer button.save_temp{ background:url(../img/btn_save_temp.gif) no-repeat;} -.xpress-editor #smart_footer button.preview{ background:url(../img/btn_preview.gif) no-repeat;} -.xpress-editor #smart_footer input{ margin:0;} -.xpress-editor #smart_footer input.reset{ width:67px; height:25px; border:0; background:url(../img/btn_cancel.gif) no-repeat; cursor:pointer; margin-left:5px;} - -/* Content > Input Area */ -.xpress-editor a.skip{ position:relative; display:block; top:0; right:0; width:0; height:0; overflow:hidden; clear:both; zoom:1} -.xpress-editor a.skip:hover, -.xpress-editor a.skip:active, -.xpress-editor a.skip:focus{ position:relative; display:block; padding:5px; right:0; z-index:60; width:auto; height:auto; text-align:right; white-space:nowrap; color:#000; text-decoration:none; letter-spacing:-1px; _zoom:1;} - -.xpress-editor .input_area{ position:relative; margin:10px; z-index:30; *zoom:1; height:400px;} -.xpress-editor .input_area iframe, -.xpress-editor .input_area textarea{ display:block; width:100%; position:relative; height:100%; border:0; overflow:auto;} -.xpress-editor .input_area iframe{} -.xpress-editor .input_area textarea{ *margin:0 -10px; _margin-bottom:-2px;} -.xpress-editor .input_area textarea.blind{ display:none;} -.xpress-editor .input_control{ position:relative; display:block; width:100%; clear:both; text-align:center; background:#fbfbfb url(../img/btn_expand.gif) no-repeat center center; cursor:n-resize;} -.xpress-editor .input_control span{ display:block; height:10px; border-top:1px solid #dfdfdf; visibility:visible; font-size:0; line-height:200%; white-space:nowrap; color:#fff;} - -.xpress-editor .tool{ position:relative; overflow:visible; padding:5px 10px 6px 10px; *padding:5px 10px 8px 10px; z-index:40; clear:both; background:#f8f8f8 url(../img/bg_tool.gif) repeat-x left bottom; border:0; *zoom:1;} -.xpress-editor .tool:after{ content:""; display:block; clear:both;} -.xpress-editor .tool ul{ position:relative; overflow:visible; float:left; margin:0 5px 2px 0; z-index:2;} -.xpress-editor .tool ul.action{ width:43px;} -.xpress-editor .tool ul.type{ width:auto; white-space:nowrap;} -.xpress-editor .tool ul.style{ width:169px; z-index:5;} -.xpress-editor .tool ul.paragraph{ width:169px; z-index:4;} -.xpress-editor .tool ul.extra1{ width:111px; z-index:3;} -.xpress-editor .tool ul.extra2{ width:auto; z-index:2;} -.xpress-editor .tool ul.extra3{ float:right; width:auto; z-index:1; margin-right:1px;} -.xpress-editor .tool ul.extra3 li{ margin-right:4px;} -.xpress-editor .tool li{ position:relative; float:left;} -.xpress-editor .tool li button{ width:21px; height:21px; background:url(../img/btn_set.gif) no-repeat 0 0; vertical-align:top;} -.xpress-editor .tool li button span{ position:absolute; top:0; left:0; width:0; height:0; overflow:hidden; visibility:hidden;} - -.xpress-editor .tool li.extensions span.exButton, -.xpress-editor .tool li.extensions span.exButton button{ float:left; position:relative; display:inline-block; width:auto; background:url(../img/btn_extension.gif) no-repeat left top;} -.xpress-editor .tool li.extensions span.exButton{ margin-right:18px;} -.xpress-editor .tool li.extensions span.exButton button{ left:18px; height:21px; background-position:right top; padding:0 4px 0 0; font:11px/21px Tahoma, Sans-serif; text-align:left;} - -.xpress-editor .tool li.html span, -.xpress-editor .tool li.html span button, -.xpress-editor .tool li.preview span, -.xpress-editor .tool li.preview span button{ float:left; position:relative; display:inline-block; width:auto; height:auto; visibility:visible; background:url(../img/btn_set_blank.gif) no-repeat 0 0; white-space:nowrap;} - -.xpress-editor .tool li.html span, -.xpress-editor .tool li.preview span{ margin-right:2px; background-position:left top;} -.xpress-editor .tool li.html span button, -.xpress-editor .tool li.preview span button{ left:2px; height:21px; background-position:right top; font:11px/21px Tahoma, Sans-serif; padding:0 4px;} - -.xpress-editor .tool ul.type li{ float:none; display:inline; *top:1px;} -.xpress-editor .tool ul.type li select{ height:21px; width:62px;} - -/* Content > Tool > Button Default */ -.xpress-editor .tool li.undo button{ width:22px; background-position:0 0;} -.xpress-editor .tool li.redo button{ background-position:-22px 0;} -.xpress-editor .tool li.bold button{ width:22px; background-position:-43px 0;} -.xpress-editor .tool li.underline button{ background-position:-65px 0;} -.xpress-editor .tool li.italic button{ background-position:-86px 0;} -.xpress-editor .tool li.del button{ background-position:-107px 0;} -.xpress-editor .tool li.fcolor button{ background-position:-128px 0;} -.xpress-editor .tool li.bcolor button{ background-position:-149px 0;} -.xpress-editor .tool li.sup button{ background-position:-170px 0;} -.xpress-editor .tool li.sub button{ background-position:-191px 0;} -.xpress-editor .tool li.left button{ width:22px; background-position:-212px 0;} -.xpress-editor .tool li.center button{ background-position:-234px 0;} -.xpress-editor .tool li.right button{ background-position:-255px 0;} -.xpress-editor .tool li.justify button{ background-position:-276px 0;} -.xpress-editor .tool li.ol button{ background-position:-297px 0;} -.xpress-editor .tool li.ul button{ background-position:-318px 0;} -.xpress-editor .tool li.outdent button{ background-position:-339px 0;} -.xpress-editor .tool li.indent button{ background-position:-360px 0;} -.xpress-editor .tool li.blockquote button{ width:22px; background-position:-381px 0;} -.xpress-editor .tool li.url button{ width:26px; background-position:-403px 0;} -.xpress-editor .tool li.table button{ background-position:-429px 0;} -.xpress-editor .tool li.character button{ background-position:-450px 0;} -.xpress-editor .tool li.find button{ background-position:-471px 0;} -.xpress-editor .tool li.extensions span{ background-position:0 0;} -.xpress-editor .tool li.extensions span button{ background-position:right 0;} -.xpress-editor .tool li.html span{ background-position:0 0;} -.xpress-editor .tool li.html span button{ background-position:right 0;} -.xpress-editor .tool li.preview span{ background-position:0 0;} -.xpress-editor .tool li.preview span button{ background-position:right 0;} - -/* Content > Tool > Button Hover */ -.xpress-editor .tool li.undo button.hover{ width:22px; background-position:0 -21px;} -.xpress-editor .tool li.redo button.hover{ background-position:-22px -21px;} -.xpress-editor .tool li.bold button.hover{ width:22px; background-position:-43px -21px;} -.xpress-editor .tool li.underline button.hover{ background-position:-65px -21px;} -.xpress-editor .tool li.italic button.hover{ background-position:-86px -21px;} -.xpress-editor .tool li.del button.hover{ background-position:-107px -21px;} -.xpress-editor .tool li.fcolor button.hover{ background-position:-128px -21px;} -.xpress-editor .tool li.bcolor button.hover{ background-position:-149px -21px;} -.xpress-editor .tool li.sup button.hover{ background-position:-170px -21px;} -.xpress-editor .tool li.sub button.hover{ background-position:-191px -21px;} -.xpress-editor .tool li.left button.hover{ width:22px; background-position:-212px -21px;} -.xpress-editor .tool li.center button.hover{ background-position:-234px -21px;} -.xpress-editor .tool li.right button.hover{ background-position:-255px -21px;} -.xpress-editor .tool li.justify button.hover{ background-position:-276px -21px;} -.xpress-editor .tool li.ol button.hover{ background-position:-297px -21px;} -.xpress-editor .tool li.ul button.hover{ background-position:-318px -21px;} -.xpress-editor .tool li.outdent button.hover{ background-position:-339px -21px;} -.xpress-editor .tool li.indent button.hover{ background-position:-360px -21px;} -.xpress-editor .tool li.blockquote button.hover{ width:22px; background-position:-381px -21px;} -.xpress-editor .tool li.url button.hover{ width:26px; background-position:-403px -21px;} -.xpress-editor .tool li.table button.hover{ background-position:-429px -21px;} -.xpress-editor .tool li.character button.hover{ background-position:-450px -21px;} -.xpress-editor .tool li.find button.hover{ background-position:-471px -21px;} -.xpress-editor .tool li.extensions span.hover{ background-position:0 -21px;} -.xpress-editor .tool li.extensions span.hover button{ background-position:right -21px;} -.xpress-editor .tool li.html span.hover{ background-position:0 -21px;} -.xpress-editor .tool li.html span.hover button{ background-position:right -21px;} -.xpress-editor .tool li.preview span.hover{ background-position:0 -21px;} -.xpress-editor .tool li.preview span.hover button{ background-position:right -21px;} - -/* Content > Tool > Button Active */ -.xpress-editor .tool li.undo button.active{ width:22px; background-position:0 -42px;} -.xpress-editor .tool li.redo button.active{ background-position:-22px -42px;} -.xpress-editor .tool li.bold button.active{ width:22px; background-position:-43px -42px;} -.xpress-editor .tool li.underline button.active{ background-position:-65px -42px;} -.xpress-editor .tool li.italic button.active{ background-position:-86px -42px;} -.xpress-editor .tool li.del button.active{ background-position:-107px -42px;} -.xpress-editor .tool li.fcolor button.active{ background-position:-128px -42px;} -.xpress-editor .tool li.bcolor button.active{ background-position:-149px -42px;} -.xpress-editor .tool li.sup button.active{ background-position:-170px -42px;} -.xpress-editor .tool li.sub button.active{ background-position:-191px -42px;} -.xpress-editor .tool li.left button.active{ width:22px; background-position:-212px -42px;} -.xpress-editor .tool li.center button.active{ background-position:-234px -42px;} -.xpress-editor .tool li.right button.active{ background-position:-255px -42px;} -.xpress-editor .tool li.justify button.active{ background-position:-276px -42px;} -.xpress-editor .tool li.ol button.active{ background-position:-297px -42px;} -.xpress-editor .tool li.ul button.active{ background-position:-318px -42px;} -.xpress-editor .tool li.outdent button.active{ background-position:-339px -42px;} -.xpress-editor .tool li.indent button.active{ background-position:-360px -42px;} -.xpress-editor .tool li.blockquote button.active{ width:22px; background-position:-381px -42px;} -.xpress-editor .tool li.url button.active{ width:26px; background-position:-403px -42px;} -.xpress-editor .tool li.table button.active{ background-position:-429px -42px;} -.xpress-editor .tool li.character button.active{ background-position:-450px -42px;} -.xpress-editor .tool li.find button.active{ background-position:-471px -42px;} -.xpress-editor .tool li.extensions span.active{ background-position:0 -42px;} -.xpress-editor .tool li.extensions span.active button{ background-position:right -42px;} -.xpress-editor .tool li.html span.active{ background-position:0 -42px;} -.xpress-editor .tool li.html span.active button{ background-position:right -42px;} -.xpress-editor .tool li.preview span.active{ background-position:0 -42px;} -.xpress-editor .tool li.preview span.active button{ background-position:right -42px;} - -/* Content > Tool > Button Off */ -.xpress-editor .tool.off li.undo button, -.xpress-editor .tool li.undo button.off{ width:22px; background-position:0 -63px;} -.xpress-editor .tool.off li.redo button, -.xpress-editor .tool li.redo button.off{ background-position:-22px -63px;} -.xpress-editor .tool.off li.bold button{ width:22px; background-position:-43px -63px;} -.xpress-editor .tool.off li.underline button{ background-position:-65px -63px;} -.xpress-editor .tool.off li.italic button{ background-position:-86px -63px;} -.xpress-editor .tool.off li.del button{ background-position:-107px -63px;} -.xpress-editor .tool.off li.fcolor button{ background-position:-128px -63px;} -.xpress-editor .tool.off li.bcolor button{ background-position:-149px -63px;} -.xpress-editor .tool.off li.sup button{ background-position:-170px -63px;} -.xpress-editor .tool.off li.sub button{ background-position:-191px -63px;} -.xpress-editor .tool.off li.left button{ width:22px; background-position:-212px -63px;} -.xpress-editor .tool.off li.center button{ background-position:-234px -63px;} -.xpress-editor .tool.off li.right button{ background-position:-255px -63px;} -.xpress-editor .tool.off li.justify button{ background-position:-276px -63px;} -.xpress-editor .tool.off li.ol button{ background-position:-297px -63px;} -.xpress-editor .tool.off li.ul button{ background-position:-318px -63px;} -.xpress-editor .tool.off li.outdent button{ background-position:-339px -63px;} -.xpress-editor .tool.off li.indent button{ background-position:-360px -63px;} -.xpress-editor .tool.off li.blockquote button{ width:22px; background-position:-381px -63px;} -.xpress-editor .tool.off li.url button{ width:26px; background-position:-403px -63px;} -.xpress-editor .tool.off li.table button{ background-position:-429px -63px;} -.xpress-editor .tool.off li.character button{ background-position:-450px -63px;} -.xpress-editor .tool.off li.find button{ background-position:-471px -63px;} -.xpress-editor .tool.off li.extensions span{ background-position:0 -63px;} -.xpress-editor .tool.off li.extensions span button{ background-position:right -63px; color:#bcbcbc;} -.xpress-editor .tool.off li button{ cursor:default;} -.xpress-editor .tool.off ul.extra3 li button{ cursor:pointer;} - -/* Content > Tool > Layer */ -.xpress-editor .tool .layer{ display:none; position:absolute; left:0; top:20px; background-color:#fbfbfb; border:1px solid #c5c5c5; border-right:1px solid #9f9f9f; border-bottom:1px solid #9f9f9f;} -.xpress-editor .tool .layer li{ float:none; left:0;} -.xpress-editor .tool .layer button{ margin:0 !important; width:auto; height:auto; background:none;} -.xpress-editor .tool .layer button span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden;} -.xpress-editor .tool .btn_area{ position:relative; clear:both; text-align:center !important; padding:7px 0 12px 0; width:100%; white-space:nowrap; *zoom:1;} -.xpress-editor .tool .btn_area *{ vertical-align:top;} -.xpress-editor .tool button.close{ position:absolute; top:4px; right:3px; width:21px; height:20px; background:url(../img/btn_layer_close.gif) no-repeat center center !important;} -.xpress-editor .tool button.close span{ position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} -.xpress-editor .tool .layer .btn_area button{ *margin:0 2px !important;} -.xpress-editor .tool .layer .btn_area button.confirm{ width:38px; height:21px; background:url(../img/btn_layer_confirm.gif) no-repeat;} -.xpress-editor .tool .layer .btn_area button.cancel{ width:38px; height:21px; background:url(../img/btn_layer_cancel.gif) no-repeat;} - -.xpress-editor .tool li.fcolor .layer{ width:218px !important; height:auto !important; background-image:none !important; overflow:hidden;} -.xpress-editor .tool .layer .palette{ width:210px; position:relative; left:7px; padding:8px 0 7px 0; margin:0;} -.xpress-editor .tool .layer .palette li{ float:left; margin:0 1px 1px 0; font-size:0; line-height:0;} -.xpress-editor .tool .layer .palette button{ position:relative; overflow:hidden; width:11px; height:11px;} - -.xpress-editor .tool li.bcolor .layer { width:218px; overflow:hidden;} -.xpress-editor .tool .layer .background{ width:210px; position:relative; left:7px; margin:0 0 -2px 0; padding:8px 0 0 0; *padding-bottom:8px; _padding-bottom:4px;} -.xpress-editor .tool .layer .background li{ float:left; margin:0 5px 2px 0;} -.xpress-editor .tool .layer .background button{ position:relative; overflow:hidden; width:65px; height:19px; text-align:left; padding:4px;} -.xpress-editor .tool .layer .background button span{ position:relative; visibility:visible; font-size:12px; line-height:normal; width:auto; height:auto;} - -.xpress-editor .tool li.style .layer{ padding:4px 2px; _overflow:hidden; filter:progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=135,strength=2);} -.xpress-editor .tool li.style .layer li{ position:relative; background:#fbfbfb;} -.xpress-editor .tool li.style .layer li button{ display:block; width:134px; position:relative;} -.xpress-editor .tool li.style .layer li button span{ display:block; width:130px; text-align:left; letter-spacing:normal;} -.xpress-editor .tool li.style .layer li.h3 button span{ padding:3px 0 1px 4px; height:15px; _height /**/:19px; font-size:16px; font-weight:bold;} -.xpress-editor .tool li.style .layer li.h4 button span{ padding:3px 0 2px 4px; height:13px; _height /**/:18px; font-size:14px; font-weight:bold;} -.xpress-editor .tool li.style .layer li.h5 button span{ padding:3px 0 1px 4px; height:11px; _height /**/:15px; font-size:12px; font-weight:bold;} -.xpress-editor .tool li.style .layer li.h6 button span{ padding:3px 0 1px 4px; height:11px; _height /**/:15px; font-size:12px;} -.xpress-editor .tool li.style .layer li.p button span{ padding:3px 0 1px 4px; height:11px; _height /**/:15px; font-size:12px; color:#5d5d5d;} -.xpress-editor .tool li.style .layer li button.hover{ background:#c1f471; *height:1%;} - -.xpress-editor .tool li.blockquote .layer{ padding:6px 5px 6px 7px; left:0; width:288px;} -.xpress-editor .tool li.blockquote .layer ul{ *zoom:1; margin:0;} -.xpress-editor .tool li.blockquote .layer ul:after{ content:""; display:block; clear:both;} -.xpress-editor .tool li.blockquote .layer li{ position:relative; float:left; overflow:hidden; width:32px; height:34px; margin:0 2px 0 0; border:1px solid #cdcecc; background-image:url(../img/btn_qmark.gif); background-repeat:no-repeat;} -.xpress-editor .tool li.blockquote .layer li.q1{ background-position:0 0;} -.xpress-editor .tool li.blockquote .layer li.q2{ background-position:-32px 0;} -.xpress-editor .tool li.blockquote .layer li.q3{ background-position:-64px 0;} -.xpress-editor .tool li.blockquote .layer li.q4{ background-position:-96px 0;} -.xpress-editor .tool li.blockquote .layer li.q5{ background-position:-128px 0;} -.xpress-editor .tool li.blockquote .layer li.q6{ background-position:-160px 0;} -.xpress-editor .tool li.blockquote .layer li.q7{ background-position:-192px 0;} -.xpress-editor .tool li.blockquote .layer li.q8{ background-position:-224px 0;} -.xpress-editor .tool li.blockquote .layer li button{ width:32px; height:34px;} - -.xpress-editor .tool li.url .layer{ width:231px; height:125px; background-image:url(../img/bx_url.gif); background-repeat:no-repeat; background-position:10px 14px;} -.xpress-editor .tool li.url .layer fieldset{ position:absolute; width:212px; left:10px; top:14px;} -.xpress-editor .tool li.url .layer fieldset h3{ position:absolute; top:-4px; left:15px; color:#404040; visibility:visible; font-size:12px; line-height:normal; width:auto; height:auto; background:none; margin:0; padding:0; font-weight:normal;} -.xpress-editor .tool li.url .layer fieldset input.link{ position:absolute; left:12px; top:19px; width:179px; padding:2px 0 1px 6px; *margin:-1px 0; font-size:11px; height:13px; border:1px solid #818181; border-right:1px solid #dadada; border-bottom:1px solid #dadada;} -.xpress-editor .tool li.url .layer fieldset p{ position:absolute; left:12px; top:44px;} -.xpress-editor .tool li.url .layer fieldset p input{ width:13px; height:13px; vertical-align:middle; margin-right:3px;} -.xpress-editor .tool li.url .layer .btn_area{ position:absolute; bottom:12px; padding:0;} - -.xpress-editor .tool li.table .layer{ width:242px; height:239px; background-image:url(../img/bx_table.gif); background-repeat:no-repeat; background-position:10px 14px;} -.xpress-editor .tool li.table .layer fieldset{ position:absolute; width:222px; left:10px;} -.xpress-editor .tool li.table .layer fieldset h3{ position:absolute; top:-4px; left:15px; color:#404040; visibility:visible; font-size:12px; line-height:normal; width:auto; height:auto; background:none; margin:0; padding:0; font-weight:normal;} - -.xpress-editor .tool li.table .layer fieldset dl{ position:absolute; left:10px;} -.xpress-editor .tool li.table .layer fieldset dt{ float:left; padding:3px 0 0 0; height:20px; white-space:nowrap; letter-spacing:-1px;} -.xpress-editor .tool li.table .layer fieldset dd{ float:right; position:relative;} -.xpress-editor .tool li.table .layer fieldset dd button.add, -.xpress-editor .tool li.table .layer fieldset dd button.del{ position:absolute; left:27px; width:15px; height:8px; background:url(../img/btn_layer_cell_adjust.gif) no-repeat;} -.xpress-editor .tool li.table .layer fieldset dd button.add{ top:1px;} -.xpress-editor .tool li.table .layer fieldset dd button.del{ top:9px; background-position:0 -8px;} -.xpress-editor .tool li.table .layer fieldset dd .preview_palette{ display:block; float:left; margin:0 3px 0 0; padding:2px; position:relative; border:1px solid #c8c9c6; width:14px; height:14px; overflow:hidden;} -.xpress-editor .tool li.table .layer fieldset dd .preview_palette button{ width:14px; height:14px; font-size:500px; line-height:0;} -.xpress-editor .tool li.table .layer fieldset dd .find_palette{ width:33px; height:20px; background:url(../img/btn_search.gif) no-repeat;} - -.xpress-editor .tool li.table .layer fieldset.num{ top:14px;} -.xpress-editor .tool li.table .layer fieldset.num dl{ top:18px; width:60px;} -.xpress-editor .tool li.table .layer fieldset.num dt{ height:20px;} -.xpress-editor .tool li.table .layer fieldset.num dd{ height:23px;} -.xpress-editor .tool li.table .layer fieldset.num dt label{ font-size:11px; color:#333;} -.xpress-editor .tool li.table .layer fieldset.num dd input{ padding:3px 0 0 6px; *margin:-1px 0; width:35px; height:13px; font-size:11px; border:1px solid #818181; border-right:1px solid #dadada; border-bottom:1px solid #dadada;} - -.xpress-editor .tool li.table .layer fieldset.color{ top:96px;} -.xpress-editor .tool li.table .layer fieldset.color dl{ top:18px; width:210px;} -.xpress-editor .tool li.table .layer fieldset.color dt{ height:23px;} -.xpress-editor .tool li.table .layer fieldset.color dd{ height:26px; width:146px;} -.xpress-editor .tool li.table .layer fieldset.color dt label{ font-size:11px; color:#333;} -.xpress-editor .tool li.table .layer fieldset.color dd input{ padding:3px 0 0 6px; *margin:-1px 0; font-size:11px; border:1px solid #818181; border-right:1px solid #dadada; border-bottom:1px solid #dadada;} -.xpress-editor .tool li.table .layer fieldset.color dd input#table_border_width{ width:35px; height:13px;} -.xpress-editor .tool li.table .layer fieldset.color dd input#table_border_color, -.xpress-editor .tool li.table .layer fieldset.color dd input#table_bg_color{ width:70px; height:15px; *margin-right:3px;} - -.xpress-editor .tool li.table .layer table{ position:absolute; top:18px; left:75px; width:137px; height:40px; table-layout:fixed;} -.xpress-editor .tool li.table .layer table *{ font-size:0; line-height:0;} -.xpress-editor .tool li.table .layer table th, -.xpress-editor .tool li.table .layer table td{ text-align:center;} -.xpress-editor .tool li.table .layer .btn_area{ position:absolute; bottom:12px; padding:0; z-index:1;} - -.xpress-editor .tool li.table .layer .palette{ display:none; position:absolute; z-index:2; left:11px; width:204px; padding:8px 7px 7px 7px; _padding-right:6px; background-color:#fbfbfb; border:1px solid #c5c5c5; border-right:1px solid #9f9f9f; border-bottom:1px solid #9f9f9f;} -.xpress-editor .tool li.table .layer.p1 .palette{ display:block; top:163px;} -.xpress-editor .tool li.table .layer.p2 .palette{ display:block; top:189px;} - -.xpress-editor .tool li.character .layer{ width:433px; height:242px; overflow:hidden;} -.xpress-editor .tool li.character .layer ul{ margin:0;} -.xpress-editor .tool li.character .layer h3{position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} -.xpress-editor .tool li.character .layer .nav{ position:absolute; top:11px; left:-1px; overflow:hidden; white-space:nowrap;} -.xpress-editor .tool li.character .layer .nav li{ display:inline; margin:0 -4px 0 0; padding:0 8px; background:url(../img/vr_layer_character.gif) no-repeat 0 0;} -.xpress-editor .tool li.character .layer .nav li a{ color:#444; text-decoration:none; letter-spacing:-1px;} -.xpress-editor .tool li.character .layer .nav li a:hover, -.xpress-editor .tool li.character .layer .nav li a:active, -.xpress-editor .tool li.character .layer .nav li a:focus{ text-decoration:underline;} -.xpress-editor .tool li.character .layer .nav li a.on{ font-weight:bold; color:#004790; display:inline;} -.xpress-editor .tool li.character .layer .list{ position:absolute; left:7px; top:30px; width:421px; height:172px; background:url(../img/bx_character.gif) no-repeat;} -.xpress-editor .tool li.character .layer .list li{ position:relative; top:1px; left:1px; float:left; width:20px; height:18px; margin:0 1px 1px 0;} -.xpress-editor .tool li.character .layer .list li button{ width:20px; height:18px;} -.xpress-editor .tool li.character .layer .list li button.hover{ border:2px solid #27c11a;} -.xpress-editor .tool li.character .layer .list li button span{ overflow:visible; font-size:12px; width:auto; height:auto; position:relative; visibility:visible; line-height:normal;} -.xpress-editor .tool li.character .layer p{ position:absolute; top:212px; left:7px;} -.xpress-editor .tool li.character .layer p *{ vertical-align:top;} -.xpress-editor .tool li.character .layer p label{ position:relative; top:4px; margin:0 7px 0 0; color:#333; letter-spacing:-1px;} -.xpress-editor .tool li.character .layer p input{ padding:3px 0 0 4px; margin:0 4px 0 0; width:300px; _width /**/:306px; height:16px; _height /**/:20px; border:1px solid #acacac; border-right:1px solid #dadada; border-bottom:1px solid #dadada;} -.xpress-editor .tool li.character .layer p button{ position:relative; *top:1px; width:38px; height:21px; background:url(../img/btn_layer_confirm.gif) no-repeat;} -.xpress-editor .tool li.character .layer p button span{ position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} - -.xpress-editor .tool li.find .layer{ width:242px;} -.xpress-editor .tool li.find .layer h3{ background:#f2f2f2; color:#333; height:21px; margin:0 0 11px 0; padding:7px 0 0 5px;} -.xpress-editor .tool li.find .layer .menu_tab{ position:relative; z-index:20; width:100%; *zoom:1;} -.xpress-editor .tool li.find .layer .menu_tab:after{ content:""; display:block; clear:both;} -.xpress-editor .tool li.find .layer .layer_tab{ position:relative; left:10px; padding:0; margin:0; clear:both;} -.xpress-editor .tool li.find .layer .layer_tab li{ position:relative; z-index:1; float:left; margin-right:1px; background:url(../img/btn_layer_tab.gif) no-repeat 0 0;} -.xpress-editor .tool li.find .layer .layer_tab li a{ position:relative; display:block; float:left; left:2px; height:15px; padding:4px 9px 0 5px; color:#404040; text-decoration:none; background:url(../img/btn_layer_tab.gif) no-repeat right 0;} -.xpress-editor .tool li.find .layer.find .layer_tab li.tab1, -.xpress-editor .tool li.find .layer.replace .layer_tab li.tab2{ top:-1px; margin-bottom:-1px;} -.xpress-editor .tool li.find .layer.find .layer_tab li.tab1 a, -.xpress-editor .tool li.find .layer.replace .layer_tab li.tab2 a{ height:18px;} -.xpress-editor .tool li.find .layer .container{ position:relative; z-index:1; clear:both; top:-2px;} -.xpress-editor .tool li.find .layer .container .bx{ display:none; position:relative; width:222px; left:10px; clear:both; z-index:1; background:url(../img/bx_find.gif) no-repeat;} -.xpress-editor .tool li.find .layer.find .container #find, -.xpress-editor .tool li.find .layer.replace .container #replace{ display:block;} - -.xpress-editor .tool li.find .layer .bx fieldset{ position:relative; padding:13px 0 17px 11px;} -.xpress-editor .tool li.find .layer .bx fieldset *{ vertical-align:top;} -.xpress-editor .tool li.find .layer .bx label{ position:relative; top:4px; margin:0 7px 0 0; font-size:11px; letter-spacing:-1px; color:#333;} -.xpress-editor .tool li.find .layer .bx input{ padding:3px 0 0 4px; width:144px; _width /**/:150px; height:14px; _height /**/:19px; border:1px solid #acacac; border-right:1px solid #dadada; border-bottom:1px solid #dadada;} -.xpress-editor .tool li.find .layer .bx .cap{ position:absolute; left:0; bottom:0; display:block; width:222px; height:2px; _margin:0 0 -1px 0; overflow:hidden; background:#fff url(../img/bx_find.gif) no-repeat left bottom; font-size:0; line-height:0;} -.xpress-editor .tool li.find .layer .bx#replace fieldset{ height:45px; _height /**/:75px;} -.xpress-editor .tool li.find .layer .bx#replace fieldset #keyword2{ margin-bottom:6px;} -.xpress-editor .tool li.find .layer .btn_area button{ display:none; *margin:0 2px !important;} -.xpress-editor .tool li.find .layer.find .btn_area .find_next{ display:inline; width:62px; height:21px; background:url(../img/btn_layer_find_next_strong.gif) no-repeat;} -.xpress-editor .tool li.find .layer.replace .btn_area .find_next{ display:inline; width:55px; height:21px; background:url(../img/btn_layer_find_next.gif) no-repeat;} -.xpress-editor .tool li.find .layer.replace .btn_area .replace{ display:inline; width:48px; height:21px; background:url(../img/btn_layer_replace.gif) no-repeat;} -.xpress-editor .tool li.find .layer.replace .btn_area .replace_all{ display:inline; width:69px; height:21px; background:url(../img/btn_layer_replace_all.gif) no-repeat;} -.xpress-editor .tool li.find .layer .btn_area .cancel{ display:inline;} - -.xpress-editor .tool li.extensions .layer{ width:auto; white-space:nowrap; padding:5px 10px;} -.xpress-editor .tool li.extensions .layer li{ margin:2px 0;} -.xpress-editor .tool li.extensions .layer li a { color:#000; text-decoration:none; } -.xpress-editor .tool li.extensions .layer li a:hover { text-decoration:underline; } - -/* File Uploader */ -.xpress-editor .fileUploader{ clear:both; padding-top:5px; margin-bottom:20px;} -.xpress-editor .fileUploader:after{ content:""; display:block; clear:both;} -.xpress-editor .fileUploader .preview{ float:left; width:64px; height:64px; border:1px solid #ccc;; padding:2px; margin:0 10px 5px 10px;} -.xpress-editor .fileUploader .preview.black { background-color:#000; border:1px solid #666;} -.xpress-editor .fileUploader .preview img{ display:block; width:64px; height:64px;} -.xpress-editor .fileUploader .fileListArea{ float:left; width:260px; margin:0 10px 5px 0;} -.xpress-editor .fileUploader .fileListArea select{ width:100%; height:70px; overflow:auto;} -.xpress-editor .fileUploader .fileListArea select option{ font-size:11px;} -.xpress-editor .fileUploader .fileListArea.black select { background-color:#000; border:1px solid #666;} -.xpress-editor .fileUploader .fileListArea.black select option { color:#aaa; } -.xpress-editor .fileUploader .fileUploadControl{ clear:right;} -.xpress-editor .fileUploader .fileUploadControl .button{ margin-bottom:5px;} -.xpress-editor .fileUploader .file_attach_info{ clear:right; margin:5px 0;} - -/* Auto Save */ -.xpress-editor .autosave_message { display:none; background: #f6ffdb; padding:6px 10px; margin:0; line-height:1;} +@charset "utf-8"; + +/* TextEditor */ +.xeTextEditor {padding:10px; overflow:hidden; margin:0 0 10px 0;} +.xeTextEditor textarea { display:block; margin:0; padding:2px; } +.xeTextEditor.black textarea { color:#fff; background-color:#000;} + +/* Type Selector */ +.xpress-editor *{margin:0; padding:0; font-style:normal; font-size:12px; } +.xpress-editor img, +.xpress-editor fieldset, +.xpress-editor button{ border:0;} +.xpress-editor button{ background:none; background-repeat:no-repeat; cursor:pointer; _cursor /**/:hand;} +.xpress-editor button *{ visibility:hidden;} +.xpress-editor legend{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden;} +.xpress-editor label{ cursor:pointer; _cursor /**/:hand;} +.xpress-editor hr{ display:none;} +.xpress-editor li{list-style:none;} + +/* Layout Selector */ +.xpress-editor{ position:relative; background:transparent;} +.xpress-editor #smart_content{ position:relative; clear:both; margin:0 0 10px 0; border:1px solid #c2c2c2; *zoom:1; z-index:5} +.xpress-editor #smart_footer{ position:relative; text-align:center; padding:10px 0;} + +/* Footer */ +.xpress-editor #smart_footer *{ vertical-align:top;} +.xpress-editor #smart_footer button{ position:relative; width:67px; height:25px; margin:0 5px 0 0;} +.xpress-editor #smart_footer button.save_temp{ background:url(../img/btn_save_temp.gif) no-repeat;} +.xpress-editor #smart_footer button.preview{ background:url(../img/btn_preview.gif) no-repeat;} +.xpress-editor #smart_footer input{ margin:0;} +.xpress-editor #smart_footer input.reset{ width:67px; height:25px; border:0; background:url(../img/btn_cancel.gif) no-repeat; cursor:pointer; margin-left:5px;} + +/* Content > Input Area */ +.xpress-editor a.skip{ position:relative; display:block; top:0; right:0; width:0; height:0; overflow:hidden; clear:both; zoom:1} +.xpress-editor a.skip:hover, +.xpress-editor a.skip:active, +.xpress-editor a.skip:focus{ position:relative; display:block; padding:5px; right:0; z-index:60; width:auto; height:auto; text-align:right; white-space:nowrap; color:#000; text-decoration:none; letter-spacing:-1px; _zoom:1;} + +.xpress-editor .input_area{ position:relative; margin:10px; z-index:30; *zoom:1; height:400px;} +.xpress-editor .input_area iframe, +.xpress-editor .input_area textarea{ display:block; width:100%; position:relative; height:100%; border:0; overflow:auto;} +.xpress-editor .input_area iframe{} +.xpress-editor .input_area textarea{ *margin:0 -10px; _margin-bottom:-2px;} +.xpress-editor .input_area textarea.blind{ display:none;} +.xpress-editor .input_control{ position:relative; display:block; width:100%; clear:both; text-align:center; background:#fbfbfb url(../img/btn_expand.gif) no-repeat center center; cursor:n-resize;} +.xpress-editor .input_control span{ display:block; height:10px; border-top:1px solid #dfdfdf; visibility:visible; font-size:0; line-height:200%; white-space:nowrap; color:#fff;} +.xpress-editor.black .input_control { background:#111 url(../img/btn_expand.black.gif) no-repeat center center;} +.xpress-editor.black .input_control span{ border-top:1px solid #333; color:#000;} + +.xpress-editor .tool{ position:relative; overflow:visible; padding:5px 10px 6px 10px; *padding:5px 10px 8px 10px; z-index:40; clear:both; background:#f8f8f8 url(../img/bg_tool.gif) repeat-x left bottom; border:0; *zoom:1;} +.xpress-editor.black .tool{ background:#111 url(../img/bg_tool.black.gif) repeat-x left bottom; } + +.xpress-editor .tool:after{ content:""; display:block; clear:both;} +.xpress-editor .tool ul{ position:relative; overflow:visible; float:left; margin:0 5px 2px 0; z-index:2;} +.xpress-editor .tool ul.action{ width:43px;} +.xpress-editor .tool ul.type{ width:auto; white-space:nowrap;} +.xpress-editor .tool ul.style{ width:169px; z-index:6;} +.xpress-editor .tool ul.paragraph{ width:169px; z-index:5;} +.xpress-editor .tool ul.extra1{ width:90px; z-index:4;} +.xpress-editor .tool ul.table{ width:85px; z-index:3;} +.xpress-editor .tool ul.extra2{ width:auto; z-index:2;} +.xpress-editor .tool ul.extra3{ float:right; width:auto; z-index:1; margin-right:1px;} +.xpress-editor .tool ul.extra3 li{ margin-right:4px;} +.xpress-editor .tool li{ position:relative; float:left;} +.xpress-editor .tool li button{ width:21px; height:21px; background:url(../img/btn_set.gif) no-repeat 0 0; vertical-align:top;} +.xpress-editor.black .tool li button{ width:21px; height:21px; background:url(../img/btn_set.black.gif) no-repeat 0 0; vertical-align:top;} +.xpress-editor .tool li button span{ position:absolute; top:0; left:0; width:0; height:0; overflow:hidden; visibility:hidden;} + +.xpress-editor .tool li.extensions span.exButton, +.xpress-editor .tool li.extensions span.exButton button{ float:left; position:relative; display:inline-block; width:auto; background:url(../img/btn_extension.gif) no-repeat left top;} +.xpress-editor .tool li.extensions span.exButton{ margin-right:18px;} +.xpress-editor .tool li.extensions span.exButton button{ left:18px; height:21px; background-position:right top; padding:0 4px 0 0; font:11px/21px Tahoma, Sans-serif; text-align:left;} +.xpress-editor.black .tool li.extensions span.exButton, +.xpress-editor.black .tool li.extensions span.exButton button{ color:#fff; background-image:url(../img/btn_extension.black.gif); } + +.xpress-editor .tool li.html span, +.xpress-editor .tool li.html span button, +.xpress-editor .tool li.preview span, +.xpress-editor .tool li.preview span button{ float:left; position:relative; display:inline-block; width:auto; height:auto; visibility:visible; background:url(../img/btn_set_blank.gif) no-repeat 0 0; white-space:nowrap;} +.xpress-editor.black .tool li.html span, +.xpress-editor.black .tool li.html span button, +.xpress-editor.black .tool li.preview span, +.xpress-editor.black .tool li.preview span button{ color:#fff;background-image:url(../img/btn_set_blank.black.gif); } + +.xpress-editor .tool li.html span, +.xpress-editor .tool li.preview span{ margin-right:2px; background-position:left top;} +.xpress-editor .tool li.html span button, +.xpress-editor .tool li.preview span button{ left:2px; height:21px; background-position:right top; font:11px/21px Tahoma, Sans-serif; padding:0 4px;} + +.xpress-editor .tool ul.type li{ float:none; display:inline; *top:1px;} +.xpress-editor .tool ul.type li select{ height:21px; width:62px;} +.xpress-editor.black .tool ul.type li select{ color:#fff; background-color:#000; } + +/* Content > Tool > Button Default */ +.xpress-editor .tool li.undo button{ width:22px; background-position:0 0;} +.xpress-editor .tool li.redo button{ background-position:-22px 0;} +.xpress-editor .tool li.bold button{ width:22px; background-position:-43px 0;} +.xpress-editor .tool li.underline button{ background-position:-65px 0;} +.xpress-editor .tool li.italic button{ background-position:-86px 0;} +.xpress-editor .tool li.del button{ background-position:-107px 0;} +.xpress-editor .tool li.fcolor button{ background-position:-128px 0;} +.xpress-editor .tool li.bcolor button{ background-position:-149px 0;} +.xpress-editor .tool li.sup button{ background-position:-170px 0;} +.xpress-editor .tool li.sub button{ background-position:-191px 0;} +.xpress-editor .tool li.left button{ width:22px; background-position:-212px 0;} +.xpress-editor .tool li.center button{ background-position:-234px 0;} +.xpress-editor .tool li.right button{ background-position:-255px 0;} +.xpress-editor .tool li.justify button{ background-position:-276px 0;} +.xpress-editor .tool li.ol button{ background-position:-297px 0;} +.xpress-editor .tool li.ul button{ background-position:-318px 0;} +.xpress-editor .tool li.outdent button{ background-position:-339px 0;} +.xpress-editor .tool li.indent button{ background-position:-360px 0;} +.xpress-editor .tool li.blockquote button{ width:22px; background-position:-381px 0;} +.xpress-editor .tool li.url button{ width:26px; background-position:-403px 0;} +.xpress-editor .tool li.character button{ background-position:-429px 0;} +.xpress-editor .tool li.find button{ background-position:-450px 0;} +.xpress-editor .tool li.table button{ width:22px; background-position:-471px 0;} +.xpress-editor .tool li.merge button{ background-position:-493px 0;} +.xpress-editor .tool li.splitCol button{ background-position:-514px 0;} +.xpress-editor .tool li.splitRow button{ background-position:-535px 0;} +.xpress-editor .tool li.extensions span{ background-position:0 0;} +.xpress-editor .tool li.extensions span button{ background-position:right 0;} +.xpress-editor .tool li.html span{ background-position:0 0;} +.xpress-editor .tool li.html span button{ background-position:right 0;} +.xpress-editor .tool li.preview span{ background-position:0 0;} +.xpress-editor .tool li.preview span button{ background-position:right 0;} + +/* Content > Tool > Button Hover */ +.xpress-editor .tool li.undo button.hover{ width:22px; background-position:0 -21px;} +.xpress-editor .tool li.redo button.hover{ background-position:-22px -21px;} +.xpress-editor .tool li.bold button.hover{ width:22px; background-position:-43px -21px;} +.xpress-editor .tool li.underline button.hover{ background-position:-65px -21px;} +.xpress-editor .tool li.italic button.hover{ background-position:-86px -21px;} +.xpress-editor .tool li.del button.hover{ background-position:-107px -21px;} +.xpress-editor .tool li.fcolor button.hover{ background-position:-128px -21px;} +.xpress-editor .tool li.bcolor button.hover{ background-position:-149px -21px;} +.xpress-editor .tool li.sup button.hover{ background-position:-170px -21px;} +.xpress-editor .tool li.sub button.hover{ background-position:-191px -21px;} +.xpress-editor .tool li.left button.hover{ width:22px; background-position:-212px -21px;} +.xpress-editor .tool li.center button.hover{ background-position:-234px -21px;} +.xpress-editor .tool li.right button.hover{ background-position:-255px -21px;} +.xpress-editor .tool li.justify button.hover{ background-position:-276px -21px;} +.xpress-editor .tool li.ol button.hover{ background-position:-297px -21px;} +.xpress-editor .tool li.ul button.hover{ background-position:-318px -21px;} +.xpress-editor .tool li.outdent button.hover{ background-position:-339px -21px;} +.xpress-editor .tool li.indent button.hover{ background-position:-360px -21px;} +.xpress-editor .tool li.blockquote button.hover{ width:22px; background-position:-381px -21px;} +.xpress-editor .tool li.url button.hover{ width:26px; background-position:-403px -21px;} +.xpress-editor .tool li.character button.hover{ background-position:-429px -21px;} +.xpress-editor .tool li.find button.hover{ background-position:-450px -21px;} +.xpress-editor .tool li.table button.hover{ width:22px; background-position:-471px -21px;} +.xpress-editor .tool li.merge button.hover{ background-position:-493px -21px;} +.xpress-editor .tool li.splitCol button.hover{ background-position:-514px -21px;} +.xpress-editor .tool li.splitRow button.hover{ background-position:-535px -21px;} +.xpress-editor .tool li.extensions span.hover{ background-position:0 -21px;} +.xpress-editor .tool li.extensions span.hover button{ background-position:right -21px;} +.xpress-editor .tool li.html span.hover{ background-position:0 -21px;} +.xpress-editor .tool li.html span.hover button{ background-position:right -21px;} +.xpress-editor .tool li.preview span.hover{ background-position:0 -21px;} +.xpress-editor .tool li.preview span.hover button{ background-position:right -21px;} + +/* Content > Tool > Button Active */ +.xpress-editor .tool li.undo button.active{ width:22px; background-position:0 -42px;} +.xpress-editor .tool li.redo button.active{ background-position:-22px -42px;} +.xpress-editor .tool li.bold button.active{ width:22px; background-position:-43px -42px;} +.xpress-editor .tool li.underline button.active{ background-position:-65px -42px;} +.xpress-editor .tool li.italic button.active{ background-position:-86px -42px;} +.xpress-editor .tool li.del button.active{ background-position:-107px -42px;} +.xpress-editor .tool li.fcolor button.active{ background-position:-128px -42px;} +.xpress-editor .tool li.bcolor button.active{ background-position:-149px -42px;} +.xpress-editor .tool li.sup button.active{ background-position:-170px -42px;} +.xpress-editor .tool li.sub button.active{ background-position:-191px -42px;} +.xpress-editor .tool li.left button.active{ width:22px; background-position:-212px -42px;} +.xpress-editor .tool li.center button.active{ background-position:-234px -42px;} +.xpress-editor .tool li.right button.active{ background-position:-255px -42px;} +.xpress-editor .tool li.justify button.active{ background-position:-276px -42px;} +.xpress-editor .tool li.ol button.active{ background-position:-297px -42px;} +.xpress-editor .tool li.ul button.active{ background-position:-318px -42px;} +.xpress-editor .tool li.outdent button.active{ background-position:-339px -42px;} +.xpress-editor .tool li.indent button.active{ background-position:-360px -42px;} +.xpress-editor .tool li.blockquote button.active{ width:22px; background-position:-381px -42px;} +.xpress-editor .tool li.url button.active{ width:26px; background-position:-403px -42px;} +.xpress-editor .tool li.character button.active{ background-position:-429px -42px;} +.xpress-editor .tool li.find button.active{ background-position:-450px -42px;} +.xpress-editor .tool li.table button.active{ width:22px; background-position:-471px -42px;} +.xpress-editor .tool li.merge button.active{ background-position:-493px -42px;} +.xpress-editor .tool li.splitCol button.active{ background-position:-514px -42px;} +.xpress-editor .tool li.splitRow button.active{ background-position:-535px -42px;} +.xpress-editor .tool li.extensions span.active{ background-position:0 -42px;} +.xpress-editor .tool li.extensions span.active button{ background-position:right -42px;} +.xpress-editor .tool li.html span.active{ background-position:0 -42px;} +.xpress-editor .tool li.html span.active button{ background-position:right -42px;} +.xpress-editor .tool li.preview span.active{ background-position:0 -42px;} +.xpress-editor .tool li.preview span.active button{ background-position:right -42px;} + +/* Content > Tool > Button Off */ +.xpress-editor .tool.off li.undo button, +.xpress-editor .tool li.undo button.off{ width:22px; background-position:0 -63px;} +.xpress-editor .tool.off li.redo button, +.xpress-editor .tool li.redo button.off{ background-position:-22px -63px;} +.xpress-editor .tool.off li.bold button{ width:22px; background-position:-43px -63px;} +.xpress-editor .tool.off li.underline button{ background-position:-65px -63px;} +.xpress-editor .tool.off li.italic button{ background-position:-86px -63px;} +.xpress-editor .tool.off li.del button{ background-position:-107px -63px;} +.xpress-editor .tool.off li.fcolor button{ background-position:-128px -63px;} +.xpress-editor .tool.off li.bcolor button{ background-position:-149px -63px;} +.xpress-editor .tool.off li.sup button{ background-position:-170px -63px;} +.xpress-editor .tool.off li.sub button{ background-position:-191px -63px;} +.xpress-editor .tool.off li.left button{ width:22px; background-position:-212px -63px;} +.xpress-editor .tool.off li.center button{ background-position:-234px -63px;} +.xpress-editor .tool.off li.right button{ background-position:-255px -63px;} +.xpress-editor .tool.off li.justify button{ background-position:-276px -63px;} +.xpress-editor .tool.off li.ol button{ background-position:-297px -63px;} +.xpress-editor .tool.off li.ul button{ background-position:-318px -63px;} +.xpress-editor .tool.off li.outdent button{ background-position:-339px -63px;} +.xpress-editor .tool.off li.indent button{ background-position:-360px -63px;} +.xpress-editor .tool.off li.blockquote button{ width:22px; background-position:-381px -63px;} +.xpress-editor .tool.off li.url button{ width:26px; background-position:-403px -63px;} +.xpress-editor .tool.off li.character button{ background-position:-429px -63px;} +.xpress-editor .tool.off li.find button{ background-position:-450px -63px;} +.xpress-editor .tool.off li.table button{ width:22px; background-position:-471px -63px;} +.xpress-editor .tool.off li.merge button, +.xpress-editor .tool li.merge button.off{ background-position:-493px -63px;} +.xpress-editor .tool.off li.splitCol button, +.xpress-editor .tool li.splitCol button.off{ background-position:-514px -63px;} +.xpress-editor .tool.off li.splitRow button, +.xpress-editor .tool li.splitRow button.off{ background-position:-535px -63px;} +.xpress-editor .tool.off li.extensions span{ background-position:0 -63px;} +.xpress-editor .tool.off li.extensions span button{ background-position:right -63px; color:#bcbcbc;} +.xpress-editor .tool.off li button{ cursor:default;} +.xpress-editor .tool.off ul.extra3 li button{ cursor:pointer;} + +/* Content > Tool > Layer */ +.xpress-editor .tool .layer{ display:none; position:absolute; left:0; top:20px; background-color:#fbfbfb; border:1px solid #c5c5c5; border-right:1px solid #9f9f9f; border-bottom:1px solid #9f9f9f;} +.xpress-editor .tool .layer li{ float:none; left:0;} +.xpress-editor .tool .layer button{ margin:0 !important; width:auto; height:auto; background:none;} +.xpress-editor .tool .layer button span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden;} +.xpress-editor .tool .btn_area{ position:relative; clear:both; text-align:center !important; padding:7px 0 12px 0; width:100%; white-space:nowrap; *zoom:1;} +.xpress-editor .tool .btn_area *{ vertical-align:top;} +.xpress-editor .tool button.close{ position:absolute; top:4px; right:3px; width:21px; height:20px; background:url(../img/btn_layer_close.gif) no-repeat center center !important;} +.xpress-editor .tool button.close span{ position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} +.xpress-editor .tool .layer .btn_area button{ *margin:0 2px !important;} +.xpress-editor .tool .layer .btn_area button.confirm{ width:38px; height:21px; background:url(../img/btn_layer_confirm.gif) no-repeat;} +.xpress-editor .tool .layer .btn_area button.cancel{ width:38px; height:21px; background:url(../img/btn_layer_cancel.gif) no-repeat;} + +.xpress-editor .tool li.fcolor .layer{ width:218px !important; height:auto !important; background-image:none !important; overflow:hidden;} +.xpress-editor .tool .layer .palette{ width:210px; position:relative; left:7px; padding:8px 0 7px 0; margin:0;} +.xpress-editor .tool .layer .palette li{ float:left; margin:0 1px 1px 0; font-size:0; line-height:0;} +.xpress-editor .tool .layer .palette button{ position:relative; overflow:hidden; width:11px; height:11px;} + +.xpress-editor .tool li.bcolor .layer { width:218px; overflow:hidden;} +.xpress-editor .tool .layer .background{ width:210px; position:relative; left:7px; margin:0 0 -2px 0; padding:8px 0 0 0; *padding-bottom:8px; _padding-bottom:4px;} +.xpress-editor .tool .layer .background li{ float:left; margin:0 5px 2px 0;} +.xpress-editor .tool .layer .background button{ position:relative; overflow:hidden; width:65px; height:19px; text-align:left; padding:4px;} +.xpress-editor .tool .layer .background button span{ position:relative; visibility:visible; font-size:12px; line-height:normal; width:auto; height:auto;} + +.xpress-editor .tool li.style .layer{ padding:4px 2px; _overflow:hidden; filter:progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=135,strength=2);} +.xpress-editor .tool li.style .layer li{ position:relative; background:#fbfbfb;} +.xpress-editor .tool li.style .layer li button{ display:block; width:134px; position:relative;} +.xpress-editor .tool li.style .layer li button span{ display:block; width:130px; text-align:left; letter-spacing:normal;} +.xpress-editor .tool li.style .layer li.h3 button span{ padding:3px 0 1px 4px; height:15px; _height /**/:19px; font-size:16px; font-weight:bold;} +.xpress-editor .tool li.style .layer li.h4 button span{ padding:3px 0 2px 4px; height:13px; _height /**/:18px; font-size:14px; font-weight:bold;} +.xpress-editor .tool li.style .layer li.h5 button span{ padding:3px 0 1px 4px; height:11px; _height /**/:15px; font-size:12px; font-weight:bold;} +.xpress-editor .tool li.style .layer li.h6 button span{ padding:3px 0 1px 4px; height:11px; _height /**/:15px; font-size:12px;} +.xpress-editor .tool li.style .layer li.p button span{ padding:3px 0 1px 4px; height:11px; _height /**/:15px; font-size:12px; color:#5d5d5d;} +.xpress-editor .tool li.style .layer li button.hover{ background:#c1f471; *height:1%;} + +.xpress-editor .tool li.blockquote .layer{ padding:6px 5px 6px 7px; left:0; width:288px;} +.xpress-editor .tool li.blockquote .layer ul{ *zoom:1; margin:0;} +.xpress-editor .tool li.blockquote .layer ul:after{ content:""; display:block; clear:both;} +.xpress-editor .tool li.blockquote .layer li{ position:relative; float:left; overflow:hidden; width:32px; height:34px; margin:0 2px 0 0; border:1px solid #cdcecc; background-image:url(../img/btn_qmark.gif); background-repeat:no-repeat;} +.xpress-editor .tool li.blockquote .layer li.q1{ background-position:0 0;} +.xpress-editor .tool li.blockquote .layer li.q2{ background-position:-32px 0;} +.xpress-editor .tool li.blockquote .layer li.q3{ background-position:-64px 0;} +.xpress-editor .tool li.blockquote .layer li.q4{ background-position:-96px 0;} +.xpress-editor .tool li.blockquote .layer li.q5{ background-position:-128px 0;} +.xpress-editor .tool li.blockquote .layer li.q6{ background-position:-160px 0;} +.xpress-editor .tool li.blockquote .layer li.q7{ background-position:-192px 0;} +.xpress-editor .tool li.blockquote .layer li.q8{ background-position:-224px 0;} +.xpress-editor .tool li.blockquote .layer li button{ width:32px; height:34px;} + +.xpress-editor .tool li.url .layer{ width:231px; height:125px; background-image:url(../img/bx_url.gif); background-repeat:no-repeat; background-position:10px 14px;} +.xpress-editor .tool li.url .layer fieldset{ position:absolute; width:212px; left:10px; top:14px;} +.xpress-editor .tool li.url .layer fieldset h3{ position:absolute; top:-4px; left:15px; color:#404040; visibility:visible; font-size:12px; line-height:normal; width:auto; height:auto; background:none; margin:0; padding:0; font-weight:normal;} +.xpress-editor .tool li.url .layer fieldset input.link{ position:absolute; left:12px; top:19px; width:179px; padding:2px 0 1px 6px; *margin:-1px 0; font-size:11px; height:13px; border:1px solid #818181; border-right:1px solid #dadada; border-bottom:1px solid #dadada;} +.xpress-editor .tool li.url .layer fieldset p{ position:absolute; left:12px; top:44px;} +.xpress-editor .tool li.url .layer fieldset p input{ width:13px; height:13px; vertical-align:middle; margin-right:3px;} +.xpress-editor .tool li.url .layer .btn_area{ position:absolute; bottom:12px; padding:0;} + +.xpress-editor .tool li.table .layer{ width:242px; height:239px; background-image:url(../img/bx_table.gif); background-repeat:no-repeat; background-position:10px 14px;} +.xpress-editor .tool li.table .layer fieldset{ position:absolute; width:222px; left:10px;} +.xpress-editor .tool li.table .layer fieldset h3{ position:absolute; top:-4px; left:15px; color:#404040; visibility:visible; font-size:12px; line-height:normal; width:auto; height:auto; background:none; margin:0; padding:0; font-weight:normal;} + +.xpress-editor .tool li.table .layer fieldset dl{ position:absolute; left:10px;} +.xpress-editor .tool li.table .layer fieldset dt{ float:left; padding:3px 0 0 0; height:20px; white-space:nowrap; letter-spacing:-1px;} +.xpress-editor .tool li.table .layer fieldset dd{ float:right; position:relative;} +.xpress-editor .tool li.table .layer fieldset dd button.add, +.xpress-editor .tool li.table .layer fieldset dd button.del{ position:absolute; left:27px; width:15px; height:8px; background:url(../img/btn_layer_cell_adjust.gif) no-repeat;} +.xpress-editor .tool li.table .layer fieldset dd button.add{ top:1px;} +.xpress-editor .tool li.table .layer fieldset dd button.del{ top:9px; background-position:0 -8px;} +.xpress-editor .tool li.table .layer fieldset dd .preview_palette{ display:block; float:left; margin:0 3px 0 0; padding:2px; position:relative; border:1px solid #c8c9c6; width:14px; height:14px; overflow:hidden;} +.xpress-editor .tool li.table .layer fieldset dd .preview_palette button{ width:14px; height:14px; font-size:500px; line-height:0;} +.xpress-editor .tool li.table .layer fieldset dd .find_palette{ width:33px; height:20px; background:url(../img/btn_search.gif) no-repeat;} + +.xpress-editor .tool li.table .layer fieldset.num{ top:14px;} +.xpress-editor .tool li.table .layer fieldset.num dl{ top:18px; width:60px;} +.xpress-editor .tool li.table .layer fieldset.num dt{ height:20px;} +.xpress-editor .tool li.table .layer fieldset.num dd{ height:23px;} +.xpress-editor .tool li.table .layer fieldset.num dt label{ font-size:11px; color:#333;} +.xpress-editor .tool li.table .layer fieldset.num dd input{ padding:3px 0 0 6px; *margin:-1px 0; width:35px; height:13px; font-size:11px; border:1px solid #818181; border-right:1px solid #dadada; border-bottom:1px solid #dadada;} + +.xpress-editor .tool li.table .layer fieldset.color{ top:96px;} +.xpress-editor .tool li.table .layer fieldset.color dl{ top:18px; width:210px;} +.xpress-editor .tool li.table .layer fieldset.color dt{ height:23px;} +.xpress-editor .tool li.table .layer fieldset.color dd{ height:26px; width:146px;} +.xpress-editor .tool li.table .layer fieldset.color dt label{ font-size:11px; color:#333;} +.xpress-editor .tool li.table .layer fieldset.color dd input{ padding:3px 0 0 6px; *margin:-1px 0; font-size:11px; border:1px solid #818181; border-right:1px solid #dadada; border-bottom:1px solid #dadada;} +.xpress-editor .tool li.table .layer fieldset.color dd input#table_border_width{ width:35px; height:13px;} +.xpress-editor .tool li.table .layer fieldset.color dd input#table_border_color, +.xpress-editor .tool li.table .layer fieldset.color dd input#table_bg_color{ width:70px; height:15px; *margin-right:3px;} + +.xpress-editor .tool li.table .layer table{ position:absolute; top:18px; left:75px; width:137px; height:40px; table-layout:fixed;} +.xpress-editor .tool li.table .layer table *{ font-size:0; line-height:0;} +.xpress-editor .tool li.table .layer table th, +.xpress-editor .tool li.table .layer table td{ text-align:center;} +.xpress-editor .tool li.table .layer .btn_area{ position:absolute; bottom:12px; padding:0; z-index:1;} + +.xpress-editor .tool li.table .layer .palette{ display:none; position:absolute; z-index:2; left:11px; width:204px; padding:8px 7px 7px 7px; _padding-right:6px; background-color:#fbfbfb; border:1px solid #c5c5c5; border-right:1px solid #9f9f9f; border-bottom:1px solid #9f9f9f;} +.xpress-editor .tool li.table .layer.p1 .palette{ display:block; top:163px;} +.xpress-editor .tool li.table .layer.p2 .palette{ display:block; top:189px;} + +.xpress-editor .tool li.character .layer{ width:433px; height:242px; overflow:hidden;} +.xpress-editor .tool li.character .layer ul{ margin:0;} +.xpress-editor .tool li.character .layer h3{position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} +.xpress-editor .tool li.character .layer .nav{ position:absolute; top:11px; left:-1px; overflow:hidden; white-space:nowrap;} +.xpress-editor .tool li.character .layer .nav li{ display:inline; margin:0 -4px 0 0; padding:0 8px; background:url(../img/vr_layer_character.gif) no-repeat 0 0;} +.xpress-editor .tool li.character .layer .nav li a{ color:#444; text-decoration:none; letter-spacing:-1px;} +.xpress-editor .tool li.character .layer .nav li a:hover, +.xpress-editor .tool li.character .layer .nav li a:active, +.xpress-editor .tool li.character .layer .nav li a:focus{ text-decoration:underline;} +.xpress-editor .tool li.character .layer .nav li a.on{ font-weight:bold; color:#004790; display:inline;} +.xpress-editor .tool li.character .layer .list{ position:absolute; left:7px; top:30px; width:421px; height:172px; background:url(../img/bx_character.gif) no-repeat;} +.xpress-editor .tool li.character .layer .list li{ position:relative; top:1px; left:1px; float:left; width:20px; height:18px; margin:0 1px 1px 0;} +.xpress-editor .tool li.character .layer .list li button{ width:20px; height:18px;} +.xpress-editor .tool li.character .layer .list li button.hover{ border:2px solid #27c11a;} +.xpress-editor .tool li.character .layer .list li button span{ overflow:visible; font-size:12px; width:auto; height:auto; position:relative; visibility:visible; line-height:normal;} +.xpress-editor .tool li.character .layer p{ position:absolute; top:212px; left:7px;} +.xpress-editor .tool li.character .layer p *{ vertical-align:top;} +.xpress-editor .tool li.character .layer p label{ position:relative; top:4px; margin:0 7px 0 0; color:#333; letter-spacing:-1px;} +.xpress-editor .tool li.character .layer p input{ padding:3px 0 0 4px; margin:0 4px 0 0; width:300px; _width /**/:306px; height:16px; _height /**/:20px; border:1px solid #acacac; border-right:1px solid #dadada; border-bottom:1px solid #dadada;} +.xpress-editor .tool li.character .layer p button{ position:relative; *top:1px; width:38px; height:21px; background:url(../img/btn_layer_confirm.gif) no-repeat;} +.xpress-editor .tool li.character .layer p button span{ position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} + +.xpress-editor .tool li.find .layer{ width:242px;} +.xpress-editor .tool li.find .layer h3{ background:#f2f2f2; color:#333; height:21px; margin:0 0 11px 0; padding:7px 0 0 5px;} +.xpress-editor .tool li.find .layer .menu_tab{ position:relative; z-index:20; width:100%; *zoom:1;} +.xpress-editor .tool li.find .layer .menu_tab:after{ content:""; display:block; clear:both;} +.xpress-editor .tool li.find .layer .layer_tab{ position:relative; left:10px; padding:0; margin:0; clear:both;} +.xpress-editor .tool li.find .layer .layer_tab li{ position:relative; z-index:1; float:left; margin-right:1px; background:url(../img/btn_layer_tab.gif) no-repeat 0 0;} +.xpress-editor .tool li.find .layer .layer_tab li a{ position:relative; display:block; float:left; left:2px; height:15px; padding:4px 9px 0 5px; color:#404040; text-decoration:none; background:url(../img/btn_layer_tab.gif) no-repeat right 0;} +.xpress-editor .tool li.find .layer.find .layer_tab li.tab1, +.xpress-editor .tool li.find .layer.replace .layer_tab li.tab2{ top:-1px; margin-bottom:-1px;} +.xpress-editor .tool li.find .layer.find .layer_tab li.tab1 a, +.xpress-editor .tool li.find .layer.replace .layer_tab li.tab2 a{ height:18px;} +.xpress-editor .tool li.find .layer .container{ position:relative; z-index:1; clear:both; top:-2px;} +.xpress-editor .tool li.find .layer .container .bx{ display:none; position:relative; width:222px; left:10px; clear:both; z-index:1; background:url(../img/bx_find.gif) no-repeat;} +.xpress-editor .tool li.find .layer.find .container #find, +.xpress-editor .tool li.find .layer.replace .container #replace{ display:block;} + +.xpress-editor .tool li.find .layer .bx fieldset{ position:relative; padding:13px 0 17px 11px;} +.xpress-editor .tool li.find .layer .bx fieldset *{ vertical-align:top;} +.xpress-editor .tool li.find .layer .bx label{ position:relative; top:4px; margin:0 7px 0 0; font-size:11px; letter-spacing:-1px; color:#333;} +.xpress-editor .tool li.find .layer .bx input{ padding:3px 0 0 4px; width:144px; _width /**/:150px; height:14px; _height /**/:19px; border:1px solid #acacac; border-right:1px solid #dadada; border-bottom:1px solid #dadada;} +.xpress-editor .tool li.find .layer .bx .cap{ position:absolute; left:0; bottom:0; display:block; width:222px; height:2px; _margin:0 0 -1px 0; overflow:hidden; background:#fff url(../img/bx_find.gif) no-repeat left bottom; font-size:0; line-height:0;} +.xpress-editor .tool li.find .layer .bx#replace fieldset{ height:45px; _height /**/:75px;} +.xpress-editor .tool li.find .layer .bx#replace fieldset #keyword2{ margin-bottom:6px;} +.xpress-editor .tool li.find .layer .btn_area button{ display:none; *margin:0 2px !important;} +.xpress-editor .tool li.find .layer.find .btn_area .find_next{ display:inline; width:62px; height:21px; background:url(../img/btn_layer_find_next_strong.gif) no-repeat;} +.xpress-editor .tool li.find .layer.replace .btn_area .find_next{ display:inline; width:55px; height:21px; background:url(../img/btn_layer_find_next.gif) no-repeat;} +.xpress-editor .tool li.find .layer.replace .btn_area .replace{ display:inline; width:48px; height:21px; background:url(../img/btn_layer_replace.gif) no-repeat;} +.xpress-editor .tool li.find .layer.replace .btn_area .replace_all{ display:inline; width:69px; height:21px; background:url(../img/btn_layer_replace_all.gif) no-repeat;} +.xpress-editor .tool li.find .layer .btn_area .cancel{ display:inline;} + +.xpress-editor .tool li.extensions .layer{ width:auto; white-space:nowrap; padding:5px 10px;} +.xpress-editor .tool li.extensions .layer li{ margin:2px 0;} +.xpress-editor .tool li.extensions .layer li a { color:#000; text-decoration:none; } +.xpress-editor .tool li.extensions .layer li a:hover { text-decoration:underline; } + +/* File Uploader */ +.xpress-editor .fileUploader{ clear:both; padding-top:5px; margin-bottom:20px;} +.xpress-editor .fileUploader:after{ content:""; display:block; clear:both;} +.xpress-editor .fileUploader .preview{ float:left; width:64px; height:64px; border:1px solid #ccc;; padding:2px; margin:0 10px 5px 10px;} +.xpress-editor .fileUploader .preview.black { background-color:#000; border:1px solid #666;} +.xpress-editor .fileUploader .preview img{ display:block; width:64px; height:64px;} +.xpress-editor .fileUploader .fileListArea{ float:left; width:260px; margin:0 10px 5px 0;} +.xpress-editor .fileUploader .fileListArea select{ width:100%; height:70px; overflow:auto;} +.xpress-editor .fileUploader .fileListArea select option{ font-size:11px;} +.xpress-editor .fileUploader .fileListArea.black select { background-color:#000; border:1px solid #666;} +.xpress-editor .fileUploader .fileListArea.black select option { color:#aaa; } +.xpress-editor .fileUploader .fileUploadControl{ clear:right;} +.xpress-editor .fileUploader .fileUploadControl .button{ margin-bottom:5px;} +.xpress-editor .fileUploader .file_attach_info{ clear:right; margin:5px 0;} + +/* Auto Save */ +.xpress-editor .autosave_message { display:none; background: #f6ffdb; padding:6px 10px; margin:0; line-height:1;} +.xpress-editor.black .autosave_message { display:none; background:#222; padding:6px 10px; margin:0; line-height:1; color:#fff; } +.xpress-editor .input_syntax.black { background:transparent; color:#fff; } diff --git a/modules/editor/skins/xpresseditor/css/style.css b/modules/editor/skins/xpresseditor/css/style.css deleted file mode 100644 index 522bac462..000000000 --- a/modules/editor/skins/xpresseditor/css/style.css +++ /dev/null @@ -1,30 +0,0 @@ -@charset "utf-8"; -/* NHN > UIT Center > Open UI Technology Team > Jeong Chan Myeong(dece24@nhncorp.com) 200812 */ - -html, -body{ height:100%; } - -#xpressInput{ margin:0 10px 0 0;} -.xpressOutput{ font-size:12px; line-height:1.6; font-family:Dotum, AppleGothic, Sans-serif;} - -.xpressOutput p{ margin-top:7px; margin-bottom:7px;} - -.xpressOutput blockquote.q1, -.xpressOutput blockquote.q2, -.xpressOutput blockquote.q3, -.xpressOutput blockquote.q4, -.xpressOutput blockquote.q5, -.xpressOutput blockquote.q6, -.xpressOutput blockquote.q7{ padding:10px; margin-left:15px; margin-right:15px;} - -.xpressOutput blockquote.q1{ padding:0 10px; border-left:2px solid #ccc;} -.xpressOutput blockquote.q2{ padding:0 10px; background:url(../img/bg_qmark.gif) no-repeat;} -.xpressOutput blockquote.q3{ border:1px solid #d9d9d9;} -.xpressOutput blockquote.q4{ border:1px solid #d9d9d9; background:#fbfbfb;} -.xpressOutput blockquote.q5{ border:2px solid #707070;} -.xpressOutput blockquote.q6{ border:1px dashed #707070;} -.xpressOutput blockquote.q7{ border:1px dashed #707070; background:#fbfbfb;} - -.xpressOutput sup{ font:10px Tahoma;} -.xpressOutput sub{ font:10px Tahoma;} -.xpressOutput table td{ padding:4px;} diff --git a/modules/editor/skins/xpresseditor/editor.html b/modules/editor/skins/xpresseditor/editor.html index b6b133e5a..e43fb0c0a 100644 --- a/modules/editor/skins/xpresseditor/editor.html +++ b/modules/editor/skins/xpresseditor/editor.html @@ -1,494 +1,519 @@ - + - - - - - - - - - - -
-
- - -
- - -
    -
  • -
  • -
-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - - - - -
  • -
  • - - - - -
  • -
  • - -
  • -
  • - -
  • -
-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
    -
  • - - - - -
  • - -
  • - - - - -
  • -
  • - - - - -
  • -
  • - - - - -
  • -
- - - - - - - -
    - -
  • - -
- - -
- - -
- -
- - -

 

+ + + + + {@ $editor_class = "black" } - - - +
+ nbr" /> +
- - - - - - -
-
-
- -
-
- - - -
-
{$upload_status}
-
- -
- - + + + + + + + + + + + + + + +
+
+ + +
+ + +
    +
  • +
  • +
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + + + + +
  • +
  • + + + + +
  • +
  • + +
  • +
  • + +
  • +
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
    +
  • + + + + +
  • + +
  • + + + + +
  • +
  • + + + + +
  • +
+ +
    +
  • + + + + +
  • +
  • +
  • +
  • +
+ + + + + + + +
    + +
  • + +
+ + +
+ + +
+ +
+ + +

 

+ + + + + +
+ + + + + + +
+
+
+ +
+
+ + + +
+
{$upload_status}
+
+ +
+ + + + diff --git a/modules/editor/skins/xpresseditor/img/bg_tool.black.gif b/modules/editor/skins/xpresseditor/img/bg_tool.black.gif new file mode 100755 index 000000000..4cb5c84d9 Binary files /dev/null and b/modules/editor/skins/xpresseditor/img/bg_tool.black.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_confirm.gif b/modules/editor/skins/xpresseditor/img/btn_confirm.gif deleted file mode 100644 index fd78c5fdd..000000000 Binary files a/modules/editor/skins/xpresseditor/img/btn_confirm.gif and /dev/null differ diff --git a/modules/editor/skins/xpresseditor/img/btn_expand.black.gif b/modules/editor/skins/xpresseditor/img/btn_expand.black.gif new file mode 100755 index 000000000..203a82eaa Binary files /dev/null and b/modules/editor/skins/xpresseditor/img/btn_expand.black.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_extension.black.gif b/modules/editor/skins/xpresseditor/img/btn_extension.black.gif new file mode 100755 index 000000000..06e028d09 Binary files /dev/null and b/modules/editor/skins/xpresseditor/img/btn_extension.black.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_layer_cancel.gif b/modules/editor/skins/xpresseditor/img/btn_layer_cancel.gif index 789f82ae5..6c38d9fd0 100644 Binary files a/modules/editor/skins/xpresseditor/img/btn_layer_cancel.gif and b/modules/editor/skins/xpresseditor/img/btn_layer_cancel.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_layer_confirm.gif b/modules/editor/skins/xpresseditor/img/btn_layer_confirm.gif index 519fb734d..39217dea4 100644 Binary files a/modules/editor/skins/xpresseditor/img/btn_layer_confirm.gif and b/modules/editor/skins/xpresseditor/img/btn_layer_confirm.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_layer_find_next.gif b/modules/editor/skins/xpresseditor/img/btn_layer_find_next.gif index 986902051..35487470b 100644 Binary files a/modules/editor/skins/xpresseditor/img/btn_layer_find_next.gif and b/modules/editor/skins/xpresseditor/img/btn_layer_find_next.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_layer_find_next_strong.gif b/modules/editor/skins/xpresseditor/img/btn_layer_find_next_strong.gif index f1f183ec1..99611c267 100644 Binary files a/modules/editor/skins/xpresseditor/img/btn_layer_find_next_strong.gif and b/modules/editor/skins/xpresseditor/img/btn_layer_find_next_strong.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_layer_replace.gif b/modules/editor/skins/xpresseditor/img/btn_layer_replace.gif index 10051f3df..37b885ceb 100644 Binary files a/modules/editor/skins/xpresseditor/img/btn_layer_replace.gif and b/modules/editor/skins/xpresseditor/img/btn_layer_replace.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_layer_replace_all.gif b/modules/editor/skins/xpresseditor/img/btn_layer_replace_all.gif index 7264bb1ad..2b8390a8a 100644 Binary files a/modules/editor/skins/xpresseditor/img/btn_layer_replace_all.gif and b/modules/editor/skins/xpresseditor/img/btn_layer_replace_all.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_qmark.gif b/modules/editor/skins/xpresseditor/img/btn_qmark.gif index b1fef0a5b..a1efa1926 100644 Binary files a/modules/editor/skins/xpresseditor/img/btn_qmark.gif and b/modules/editor/skins/xpresseditor/img/btn_qmark.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_search.gif b/modules/editor/skins/xpresseditor/img/btn_search.gif index 3f69bd4ec..e7fa10974 100644 Binary files a/modules/editor/skins/xpresseditor/img/btn_search.gif and b/modules/editor/skins/xpresseditor/img/btn_search.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_set.black.gif b/modules/editor/skins/xpresseditor/img/btn_set.black.gif new file mode 100755 index 000000000..0940eca96 Binary files /dev/null and b/modules/editor/skins/xpresseditor/img/btn_set.black.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_set.gif b/modules/editor/skins/xpresseditor/img/btn_set.gif index c4cca3da5..1a0391905 100644 Binary files a/modules/editor/skins/xpresseditor/img/btn_set.gif and b/modules/editor/skins/xpresseditor/img/btn_set.gif differ diff --git a/modules/editor/skins/xpresseditor/img/btn_set_blank.black.gif b/modules/editor/skins/xpresseditor/img/btn_set_blank.black.gif new file mode 100755 index 000000000..4ee61a458 Binary files /dev/null and b/modules/editor/skins/xpresseditor/img/btn_set_blank.black.gif differ diff --git a/modules/editor/skins/xpresseditor/js/Xpress_Editor.js b/modules/editor/skins/xpresseditor/js/Xpress_Editor.js index e38e3b38b..7a7a83e25 100644 --- a/modules/editor/skins/xpresseditor/js/Xpress_Editor.js +++ b/modules/editor/skins/xpresseditor/js/Xpress_Editor.js @@ -1,249 +1,6178 @@ +// extends jQuery object +(function($){ -(function($){$.extend({Class:function(def){function c(){if(typeof this.$super!='undefined')this.$super.$this=this;if($.isFunction(this.$init))this.$init.apply(this,arguments);} -c.prototype=def;c.constructor=c;c.extend=Class_extend;return c;},$:function(id){if(typeof id=='string'){if(id.substring(0,1)=='<')return $(id).get(0);return $('#'+id).get(0);}else{return id;}},fnBind:function(fn,th){var args=$.makeArray(arguments);args.shift();args.shift();return function(){var a=args.concat($.makeArray(arguments));return fn.apply(th,a);};}});$.browser.nVersion=parseFloat($.browser.version);function Class_extend(superDef){var Super=superDef.prototype;this.prototype.$super={};function bind(fn){return function(){return fn.apply(this.$this,arguments);};} -for(var x in Super){if(!Super.propertyIsEnumerable(x))continue;if(typeof this.prototype[x]=='undefined')this.prototype[x]=Super[x];this.prototype.$super[x]=$.isFunction(Super[x])?bind(Super[x]):Super[x];} -return this;}})(jQuery);if(typeof window.xe=='undefined')window.xe={};xe.XpressCore=jQuery.Class({name:"XpressCore",$init:function(htOptions){htOptions=!htOptions?{}:jQuery.Class({}).extend({oDebugger:null}).extend(htOptions);if(htOptions.oDebugger){this.oDebugger=htOptions.oDebugger;this.oDebugger.oApp=this;} -this.commandQueue=[];this.oCommandMap={};this.oDisabledCommand={};this.aPlugins=[];this.appStatus=xe.APP_STATUS["NOT_READY"];this.registerPlugin(this);},exec:function(msg,args,oEvent){if(this.appStatus==xe.APP_STATUS["NOT_READY"]){this.commandQueue[this.commandQueue.length]={'msg':msg,'args':args,'event':oEvent};return true;} -this.exec=this._exec;this.exec(msg,args,oEvent);},delayedExec:function(msg,args,nDelay,oEvent){var fExec=jQuery.fnBind(this.exec,this,msg,args,oEvent);setTimeout(fExec,nDelay);},_exec:function(msg,args,oEvent){return(this._exec=this.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this,msg,args,oEvent);},_execWithDebugger:function(msg,args,oEvent){this.oDebugger.log_MessageStart(msg,args);var bResult=this._doExec(msg,args,oEvent);this.oDebugger.log_MessageEnd(msg,args);return bResult;},_execWithoutDebugger:function(msg,args,oEvent){return this._doExec(msg,args,oEvent);},_doExec:function(msg,args,oEvent){var bContinue=false;if(!this.oDisabledCommand[msg]){var allArgs=[];if(args&&args.length){var iLen=args.length;for(var i=0;i=0&&xe.DOMFix.parentNode(aAllNodes[iChildIdx])==aAllNodes[iCurIdx]){iChildIdx=this._recurConstructClonedTree(aAllNodes,iChildIdx,aAllNodes[iCurIdx],oCurNodeCloneWithChildren,oClonedStartContainer,oClonedEndContainer);} -oClonedParentNode.insertBefore(oCurNodeCloneWithChildren,oClonedParentNode.firstChild);return iChildIdx;};aNodes[aNodes.length]=xe.DOMFix.parentNode(aNodes[aNodes.length-1]);_recurConstructClonedTree(aNodes,aNodes.length-1,aNodes[aNodes.length-1],oClonedParentNode);return{oStartContainer:oClonedStartContainer,oEndContainer:oClonedEndContainer};},cloneRange:function(){return this._copyRange(new xe.W3CDOMRange(this._document));},_copyRange:function(oClonedRange){oClonedRange.collapsed=this.collapsed;oClonedRange.commonAncestorContainer=this.commonAncestorContainer;oClonedRange.endContainer=this.endContainer;oClonedRange.endOffset=this.endOffset;oClonedRange.startContainer=this.startContainer;oClonedRange.startOffset=this.startOffset;oClonedRange._document=this._document;return oClonedRange;},collapse:function(toStart){if(toStart){this.endContainer=this.startContainer;this.endOffset=this.startOffset;}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset;} -this._updateRangeInfo();},compareBoundaryPoints:function(how,sourceRange){switch(how){case xe.W3CDOMRange.START_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,sourceRange.startContainer,sourceRange.startOffset);case xe.W3CDOMRange.START_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,sourceRange.startContainer,sourceRange.startOffset);case xe.W3CDOMRange.END_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,sourceRange.endContainer,sourceRange.endOffset);case xe.W3CDOMRange.END_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,sourceRange.endContainer,sourceRange.endOffset);}},_findBody:function(oNode){if(!oNode)return null;while(oNode){if(oNode.tagName=="BODY")return oNode;oNode=xe.DOMFix.parentNode(oNode);} -return null;},_compareEndPoint:function(oContainerA,iOffsetA,oContainerB,iOffsetB){var iIdxA,iIdxB;if(!oContainerA||this._findBody(oContainerA)!=this._document.body){oContainerA=this._document.body;iOffsetA=0;} -if(!oContainerB||this._findBody(oContainerB)!=this._document.body){oContainerB=this._document.body;iOffsetB=0;} -var compareIdx=function(iIdxA,iIdxB){if(iIdxB==-1)iIdxB=iIdxA+1;if(iIdxAoNode.nodeValue.length)iOffset=oNode.nodeValue.length;}else{if(iOffset>xe.DOMFix.childNodes(oNode).length)iOffset=xe.DOMFix.childNodes(oNode).length;} -return iOffset;},setEnd:function(refNode,offset){offset=this._endsNodeValidation(refNode,offset);this.endContainer=refNode;this.endOffset=offset;if(!this.startContainer||this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)!=-1)this.collapse(false);this._updateRangeInfo();},setEndAfter:function(refNode){if(!refNode)throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter");if(refNode.tagName=="BODY"){this.setEnd(refNode,xe.DOMFix.childNodes(refNode).length);return;} -this.setEnd(xe.DOMFix.parentNode(refNode),this._getPosIdx(refNode)+1);},setEndBefore:function(refNode){if(!refNode)throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore");if(refNode.tagName=="BODY"){this.setEnd(refNode,0);return;} -this.setEnd(xe.DOMFix.parentNode(refNode),this._getPosIdx(refNode));},setStart:function(refNode,offset){offset=this._endsNodeValidation(refNode,offset);this.startContainer=refNode;this.startOffset=offset;if(!this.endContainer||this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)!=-1)this.collapse(true);this._updateRangeInfo();},setStartAfter:function(refNode){if(!refNode)throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter");if(refNode.tagName=="BODY"){this.setStart(refNode,xe.DOMFix.childNodes(refNode).length);return;} -this.setStart(xe.DOMFix.parentNode(refNode),this._getPosIdx(refNode)+1);},setStartBefore:function(refNode){if(!refNode)throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore");if(refNode.tagName=="BODY"){this.setStart(refNode,0);return;} -this.setStart(xe.DOMFix.parentNode(refNode),this._getPosIdx(refNode));},surroundContents:function(newParent){newParent.appendChild(this.extractContents());this.insertNode(newParent);this.selectNode(newParent);},toString:function(){var oTmpContainer=this._document.createElement("DIV");oTmpContainer.appendChild(this.cloneContents());return oTmpContainer.textContent||oTmpContainer.innerText||"";},_isBlankTextNode:function(oNode){if(oNode.nodeType==3&&oNode.nodeValue=="")return true;return false;},_getPosIdx:function(refNode){var idx=0;for(var node=refNode.previousSibling;node;node=node.previousSibling)idx++;return idx;},_updateRangeInfo:function(){if(!this.startContainer){this.init(this._document);return;} -this.collapsed=this._isCollapsed(this.startContainer,this.startOffset,this.endContainer,this.endOffset);this.commonAncestorContainer=this._getCommonAncestorContainer(this.startContainer,this.endContainer);},_isCollapsed:function(oStartContainer,iStartOffset,oEndContainer,iEndOffset){var bCollapsed=false;if(oStartContainer==oEndContainer&&iStartOffset==iEndOffset){bCollapsed=true;}else{var oActualStartNode=this._getActualStartNode(oStartContainer,iStartOffset);var oActualEndNode=this._getActualEndNode(oEndContainer,iEndOffset);oActualStartNode=this._getNextNode(this._getPrevNode(oActualStartNode));oActualEndNode=this._getPrevNode(this._getNextNode(oActualEndNode));if(oActualStartNode&&oActualEndNode&&oActualEndNode.tagName!="BODY"&&(this._getNextNode(oActualEndNode)==oActualStartNode||(oActualEndNode==oActualStartNode&&this._isBlankTextNode(oActualEndNode)))) -bCollapsed=true;} -return bCollapsed;},_splitTextEndNodesOfTheRange:function(){var oEndPoints=this._splitTextEndNodes({oStartContainer:this.startContainer,iStartOffset:this.startOffset,oEndContainer:this.endContainer,iEndOffset:this.endOffset});this.startContainer=oEndPoints.oStartContainer;this.startOffset=oEndPoints.iStartOffset;this.endContainer=oEndPoints.oEndContainer;this.endOffset=oEndPoints.iEndOffset;},_splitTextEndNodes:function(oEndPoints){oEndPoints=this._splitStartTextNode(oEndPoints);oEndPoints=this._splitEndTextNode(oEndPoints);return oEndPoints;},_splitStartTextNode:function(oEndPoints){var oStartContainer=oEndPoints.oStartContainer;var iStartOffset=oEndPoints.iStartOffset;var oEndContainer=oEndPoints.oEndContainer;var iEndOffset=oEndPoints.iEndOffset;if(!oStartContainer)return oEndPoints;if(oStartContainer.nodeType!=3)return oEndPoints;if(iStartOffset==0)return oEndPoints;if(oStartContainer.nodeValue.length<=iStartOffset)return oEndPoints;var oLastPart=oStartContainer.splitText(iStartOffset);if(oStartContainer==oEndContainer){iEndOffset-=iStartOffset;oEndContainer=oLastPart;} -oStartContainer=oLastPart;iStartOffset=0;return{oStartContainer:oStartContainer,iStartOffset:iStartOffset,oEndContainer:oEndContainer,iEndOffset:iEndOffset};},_splitEndTextNode:function(oEndPoints){var oStartContainer=oEndPoints.oStartContainer;var iStartOffset=oEndPoints.iStartOffset;var oEndContainer=oEndPoints.oEndContainer;var iEndOffset=oEndPoints.iEndOffset;if(!oEndContainer)return oEndPoints;if(oEndContainer.nodeType!=3)return oEndPoints;if(iEndOffset>=oEndContainer.nodeValue.length)return oEndPoints;if(iEndOffset==0)return oEndPoints;oEndContainer.splitText(iEndOffset);return{oStartContainer:oStartContainer,iStartOffset:iStartOffset,oEndContainer:oEndContainer,iEndOffset:iEndOffset};},_getNodesInRange:function(){if(this.collapsed)return[];var oStartNode=this._getActualStartNode(this.startContainer,this.startOffset);var oEndNode=this._getActualEndNode(this.endContainer,this.endOffset);return this._getNodesBetween(oStartNode,oEndNode);},_getActualStartNode:function(oStartContainer,iStartOffset){var oStartNode=oStartContainer;;if(oStartContainer.nodeType==3){if(iStartOffset>=oStartContainer.nodeValue.length){oStartNode=this._getNextNode(oStartContainer);if(oStartNode.tagName=="BODY")oStartNode=null;}else{oStartNode=oStartContainer;}}else{if(iStartOffset=this.startContainer.nodeValue.length)return this._getNextNode(this.startContainer);return this.startContainer;}else{if(this.startOffset>=xe.DOMFix.childNodes(this.startContainer).length)return this._getNextNode(this.startContainer);return xe.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 xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1];}},getNodeAroundRange:function(bBefore,bStrict){if(this.collapsed&&this.startContainer&&this.startContainer.nodeType==3)return this.startContainer;if(!this.collapsed||(this.startContainer&&this.startContainer.nodeType==3))return this.getStartNode();var oBeforeRange,oAfterRange,oResult;if(this.startOffset>=xe.DOMFix.childNodes(this.startContainer).length) -oAfterRange=this._getNextNode(this.startContainer);else -oAfterRange=xe.DOMFix.childNodes(this.startContainer)[this.startOffset];if(this.endOffset==0) -oBeforeRange=this._getPrevNode(this.endContainer);else -oBeforeRange=xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1];if(bBefore){oResult=oBeforeRange;if(!oResult&&!bStrict)oResult=oAfterRange;}else{oResult=oAfterRange;if(!oResult&&!bStrict)oResult=oBeforeRange;} -return oResult;},_getXPath:function(elNode){var sXPath="";while(elNode&&elNode.nodeType==1){sXPath="/"+elNode.tagName+"["+this._getPosIdx4XPath(elNode)+"]"+sXPath;elNode=xe.DOMFix.parentNode(elNode);} -return sXPath;},_getPosIdx4XPath:function(refNode){var idx=0;for(var node=refNode.previousSibling;node;node=node.previousSibling) -if(node.tagName==refNode.tagName)idx++;return idx;},_evaluateXPath:function(sXPath,oDoc){sXPath=sXPath.substring(1,sXPath.length-1);var aXPath=sXPath.split(/\//);var elNode=oDoc.body;for(var i=2;i-1&&elContainer){var aChildNodes=xe.DOMFix.childNodes(elContainer);var elNode=null;var nIdx=nTextNodeIdx;var nOffsetLeft=nOffset;while((elNode=aChildNodes[nIdx])&&elNode.nodeType==3&&elNode.nodeValue.length=0)return true;if(bIncludePartlyIncluded){if(startToEnd==1)return false;if(endToStart==-1)return false;return true;} -return false;},isNodeInRange:function(oNode,bIncludePartlySelected,bContentOnly){var oTmpRange=new xe.XpressRange(this._window);if(bContentOnly&&oNode.firstChild){oTmpRange.setStartBefore(oNode.firstChild);oTmpRange.setEndAfter(oNode.lastChild);}else{oTmpRange.selectNode(oNode);} -return isRangeInRange(oTmpRange,bIncludePartlySelected);},pasteHTML:function(sHTML){if(sHTML==""){this.deleteContents();return;} -var oTmpDiv=this._document.createElement("DIV");oTmpDiv.innerHTML=sHTML;var oFirstNode=oTmpDiv.firstChild;var oLastNode=oTmpDiv.lastChild;var clone=this.cloneRange();var sBM=clone.placeStringBookmark();while(oTmpDiv.lastChild)this.insertNode(oTmpDiv.lastChild);this.setEndNodes(oFirstNode,oLastNode);clone.moveToBookmark(sBM);clone.deleteContents();clone.removeStringBookmark(sBM);},toString:function(){this.toString=xe.W3CDOMRange.prototype.toString;return this.toString();},toHTMLString:function(){var oTmpContainer=this._document.createElement("DIV");oTmpContainer.appendChild(this.cloneContents());return oTmpContainer.innerHTML;},findAncestorByTagName:function(sTagName){var oNode=this.commonAncestorContainer;while(oNode&&oNode.tagName!=sTagName)oNode=xe.DOMFix.parentNode(oNode);return oNode;},selectNodeContents:function(oNode){if(!oNode)return;var oFirstNode=oNode.firstChild?oNode.firstChild:oNode;var oLastNode=oNode.lastChild?oNode.lastChild:oNode;if(oFirstNode.nodeType==3) -this.setStart(oFirstNode,0);else -this.setStartBefore(oFirstNode);if(oLastNode.nodeType==3) -this.setEnd(oLastNode,oLastNode.nodeValue.length);else -this.setEndAfter(oLastNode);},styleRange:function(oStyle,oAttribute,sNewSpanMarker){var aStyleParents=this._getStyleParentNodes(sNewSpanMarker);if(aStyleParents.length<1)return;var sName,sValue;for(var i=0;i=0)){oSNode=this.getNodeAroundRange(false,true);oENode=this.getNodeAroundRange(false,true);oStart=this._getLineStartInfo(oSNode);oEnd=this._getLineEndInfo(oENode);} -return{oStart:oStart,oEnd:oEnd};}}).extend(xe.W3CDOMRange);xe.SimpleSelection=function(win){this.init=function(win){this._window=win||window;this._document=this._window.document;};this.init(win);if(jQuery.browser.msie) -xe.SimpleSelectionImpl_IE.apply(this);else -xe.SimpleSelectionImpl_FF.apply(this);this.selectRange=function(oRng){this.selectNone();this.addRange(oRng);};this.selectionLoaded=true;if(!this._oSelection)this.selectionLoaded=false;};xe.SimpleSelectionImpl_FF=function(){this._oSelection=this._window.getSelection();this.getRangeAt=function(iNum){iNum=iNum||0;try{var oFFRange=this._oSelection.getRangeAt(iNum);}catch(e){return new xe.W3CDOMRange(this._document);} -return this._FFRange2W3CRange(oFFRange);};this.addRange=function(oW3CRange){var oFFRange=this._W3CRange2FFRange(oW3CRange);this._oSelection.addRange(oFFRange);};this.selectNone=function(){this._oSelection.removeAllRanges();};this._FFRange2W3CRange=function(oFFRange){var oW3CRange=new xe.W3CDOMRange(this._document);oW3CRange.setStart(oFFRange.startContainer,oFFRange.startOffset);oW3CRange.setEnd(oFFRange.endContainer,oFFRange.endOffset);return oW3CRange;};this._W3CRange2FFRange=function(oW3CRange){var oFFRange=this._document.createRange();oFFRange.setStart(oW3CRange.startContainer,oW3CRange.startOffset);oFFRange.setEnd(oW3CRange.endContainer,oW3CRange.endOffset);return oFFRange;};};xe.SimpleSelectionImpl_IE=function(){this._oSelection=this._document.selection;this.getRangeAt=function(iNum){iNum=iNum||0;if(this._oSelection.type=="Control"){var oW3CRange=new xe.W3CDOMRange(this._document);var oSelectedNode=this._oSelection.createRange().item(iNum);if(!oSelectedNode||oSelectedNode.ownerDocument!=this._document)return oW3CRange;oW3CRange.selectNode(oSelectedNode);return oW3CRange;}else{var oSelectedNode=this._oSelection.createRangeCollection().item(iNum).parentElement();if(!oSelectedNode||oSelectedNode.ownerDocument!=this._document){var oW3CRange=new xe.W3CDOMRange(this._document);return oW3CRange;} -return this._IERange2W3CRange(this._oSelection.createRangeCollection().item(iNum));}};this.addRange=function(oW3CRange){var oIERange=this._W3CRange2IERange(oW3CRange);oIERange.select();};this.selectNone=function(){this._oSelection.empty();};this._W3CRange2IERange=function(oW3CRange){var oStartIERange=this._getIERangeAt(oW3CRange.startContainer,oW3CRange.startOffset);var oEndIERange=this._getIERangeAt(oW3CRange.endContainer,oW3CRange.endOffset);oStartIERange.setEndPoint("EndToEnd",oEndIERange);return oStartIERange;};this._getIERangeAt=function(oW3CContainer,iW3COffset){var oIERange=this._document.body.createTextRange();var oEndPointInfoForIERange=this._getSelectableNodeAndOffsetForIE(oW3CContainer,iW3COffset);var oSelectableNode=oEndPointInfoForIERange.oSelectableNodeForIE;var iIEOffset=oEndPointInfoForIERange.iOffsetForIE;oIERange.moveToElementText(oSelectableNode);oIERange.collapse(oEndPointInfoForIERange.bCollapseToStart);oIERange.moveStart("character",iIEOffset);return oIERange;};this._getSelectableNodeAndOffsetForIE=function(oW3CContainer,iW3COffset){var oIERange=this._document.body.createTextRange();var oNonTextNode=null;var aChildNodes=null;var iNumOfLeftNodesToCount=0;if(oW3CContainer.nodeType==3){oNonTextNode=xe.DOMFix.parentNode(oW3CContainer);aChildNodes=xe.DOMFix.childNodes(oNonTextNode);iNumOfLeftNodesToCount=aChildNodes.length;}else{oNonTextNode=oW3CContainer;aChildNodes=xe.DOMFix.childNodes(oNonTextNode);iNumOfLeftNodesToCount=iW3COffset;} -var oNodeTester=null;var iResultOffset=0;var bCollapseToStart=true;for(var i=0;i=0)break;oPrevNonTextNode=aChildNodes[i];} -var pointRangeIdx=i;if(pointRangeIdx!=0&&aChildNodes[pointRangeIdx-1].nodeType==3){var oRgTextStart=this._document.body.createTextRange();var oCurTextNode=null;if(oPrevNonTextNode){oRgTextStart.moveToElementText(oPrevNonTextNode);oRgTextStart.collapse(false);oCurTextNode=oPrevNonTextNode.nextSibling;}else{oRgTextStart.moveToElementText(oContainer);oRgTextStart.collapse(true);oCurTextNode=oContainer.firstChild;} -var oRgTextsUpToThePoint=oRgOrigPoint.duplicate();oRgTextsUpToThePoint.setEndPoint("StartToStart",oRgTextStart);var textCount=oRgTextsUpToThePoint.text.length -while(textCount>oCurTextNode.nodeValue.length&&oCurTextNode.nextSibling){textCount-=oCurTextNode.nodeValue.length;oCurTextNode=oCurTextNode.nextSibling;} -var oTmp=oCurTextNode.nodeValue;if(bStartPt&&oCurTextNode.nextSibling&&oCurTextNode.nextSibling.nodeType==3&&textCount==oCurTextNode.nodeValue.length){textCount-=oCurTextNode.nodeValue.length;oCurTextNode=oCurTextNode.nextSibling;} -oContainer=oCurTextNode;offset=textCount;}else{oContainer=oRgOrigPoint.parentElement();offset=pointRangeIdx;} -return{"oContainer":oContainer,"iOffset":offset};};} -xe.DOMFix=new(jQuery.Class({$init:function(){if(jQuery.browser.msie||jQuery.browser.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(elNode){return elNode.parentNode;},_parentNode_Fix:function(elNode){if(!elNode)return elNode;while(elNode.previousSibling){elNode=elNode.previousSibling;} -return elNode.parentNode;},_childNodes_Native:function(elNode){return elNode.childNodes;},_childNodes_Fix:function(elNode){var aResult=null;var nCount=0;if(elNode){var aResult=[];elNode=elNode.firstChild;while(elNode){aResult[nCount++]=elNode;elNode=elNode.nextSibling;}} -return aResult;}}))();xe.FindReplace=jQuery.Class({sKeyword:"",window:null,document:null,bBrowserSupported:false,bEOC:false,$init:function(win){this.window=win;this.document=this.window.document;if(this.document.domain!=this.document.location.hostname){if(jQuery.browser.mozilla&&jQuery.browser.nVersion<3){this.bBrowserSupported=false;this.find=function(){return 3};return;}} -this.bBrowserSupported=true;},find:function(sKeyword,bCaseMatch,bBackwards,bWholeWord){var bSearchResult,bFreshSearch;this.window.focus();if(!sKeyword)return 2;this.bEOC=false;bSearchResult=this.findNext(sKeyword,bCaseMatch,bBackwards,bWholeWord);if(bSearchResult)return 0;this.bEOC=true;bSearchResult=this.findNew(sKeyword,bCaseMatch,bBackwards,bWholeWord);if(bSearchResult)return 0;return 1;},findNew:function(sKeyword,bCaseMatch,bBackwards,bWholeWord){this.findReset();return this.findNext(sKeyword,bCaseMatch,bBackwards,bWholeWord);},findNext:function(sKeyword,bCaseMatch,bBackwards,bWholeWord){var bSearchResult;bCaseMatch=bCaseMatch||false;bWholeWord=bWholeWord||false;bBackwards=bBackwards||false;if(this.window.find){var bWrapAround=false;return this.window.find(sKeyword,bCaseMatch,bBackwards,bWrapAround,bWholeWord);} -if(this.document.body.createTextRange){var iOption=0;if(bBackwards)iOption+=1;if(bWholeWord)iOption+=2;if(bCaseMatch)iOption+=4;this.window.focus();this._range=this.document.selection.createRangeCollection().item(0);this._range.collapse(false);bSearchResult=this._range.findText(sKeyword,1,iOption);this._range.select();return bSearchResult;} -return false;},findReset:function(){if(this.window.find){this.window.getSelection().removeAllRanges();return;} -if(this.document.body.createTextRange){this._range=this.document.body.createTextRange();this._range.collapse(true);this._range.select();}},replace:function(sOriginalWord,Replacement,bCaseMatch,bBackwards,bWholeWord){if(!sOriginalWord)return 4;var oSelection=new xe.XpressRange(this.window);oSelection.setFromSelection();bCaseMatch=bCaseMatch||false;var bMatch,selectedText=oSelection.toString();if(bCaseMatch) -bMatch=(selectedText==sOriginalWord);else -bMatch=(selectedText.toLowerCase()==sOriginalWord.toLowerCase());if(!bMatch) -return this.find(sOriginalWord,bCaseMatch,bBackwards,bWholeWord)+2;if(typeof Replacement=="function"){oSelection=Replacement(oSelection);}else{oSelection.pasteHTML(Replacement);} -oSelection.select();return this.find(sOriginalWord,bCaseMatch,bBackwards,bWholeWord);},replaceAll:function(sOriginalWord,Replacement,bCaseMatch,bWholeWord){if(!sOriginalWord)return-1;var bBackwards=false;var iReplaceResult;var iResult=0;var win=this.window;var oSelection=new xe.XpressRange(this.window);oSelection.setFromSelection();var sBookmark=oSelection.placeStringBookmark();this.bEOC=false;while(!this.bEOC){iReplaceResult=this.replace(sOriginalWord,Replacement,bCaseMatch,bBackwards,bWholeWord);if(iReplaceResult==0||iReplaceResult==1)iResult++;} -var startingPointReached=function(){var oCurSelection=new xe.XpressRange(win);oCurSelection.setFromSelection();oSelection.moveToBookmark(sBookmark);var pos=oSelection.compareBoundaryPoints(xe.W3CDOMRange.START_TO_END,oCurSelection);if(pos==1)return false;return true;} -iReplaceResult=0;this.bEOC=false;while(!startingPointReached()&&iReplaceResult==0&&!this.bEOC){iReplaceResult=this.replace(sOriginalWord,Replacement,bCaseMatch,bBackwards,bWholeWord);if(iReplaceResult==0||iReplaceResult==1)iResult++;} -oSelection.moveToBookmark(sBookmark);oSelection.select();oSelection.removeStringBookmark(sBookmark);return iResult;}});xe.DraggableLayer=jQuery.Class({$init:function(oLayer,oOptions){this.oOptions=jQuery.extend({bModal:"false",oHandle:oLayer,iMinX:-999999,iMinY:-999999,iMaxX:999999,iMaxY:999999},oOptions);this.oHandle=this.oOptions.oHandle;oLayer.style.display="block";oLayer.style.position="absolute";oLayer.style.zIndex="9999";this.aBasePosition=this.getBaseOffset(oLayer);oLayer.style.top=(this.toInt(jQuery(oLayer).offset().top)-this.aBasePosition.top)+"px";oLayer.style.left=(this.toInt(jQuery(oLayer).offset().left)-this.aBasePosition.left)+"px";this.$FnMouseDown=jQuery.fnBind(this._mousedown,this,oLayer);this.$FnMouseMove=jQuery.fnBind(this._mousemove,this,oLayer);this.$FnMouseUp=jQuery.fnBind(this._mouseup,this,oLayer);jQuery(this.oHandle).bind("mousedown",this.$FnMouseDown);},_mousedown:function(oLayer,oEvent){if(oEvent.target.tagName=="INPUT")return;this.MouseOffsetY=(oEvent.pageY-this.toInt(oLayer.style.top)-this.aBasePosition['top']);this.MouseOffsetX=(oEvent.pageX-this.toInt(oLayer.style.left)-this.aBasePosition['left']);jQuery(oLayer).bind("mousemove",this.$FnMouseMove);jQuery(oLayer).bind("mouseup",this.$FnMouseUp);},_mousemove:function(oLayer,oEvent){var iTop=(oEvent.pageY-this.MouseOffsetY-this.aBasePosition['top']);var iLeft=(oEvent.pageX-this.MouseOffsetX-this.aBasePosition['left']);if(iTopthis.oOptions.iMaxY)iTop=this.oOptions.iMaxY;if(iLeftthis.oOptions.iMaxX)iLeft=this.oOptions.iMaxX;oLayer.style.top=iTop+"px";oLayer.style.left=iLeft+"px";},_mouseup:function(oLayer,oEvent){jQuery(oLayer).unbind("mousemove",this.$FnMouseMove);jQuery(oLayer).unbind("mouseup",this.$FnMouseUp);},toInt:function(num){var result=parseInt(num);return result||0;},findNonStatic:function(oEl){if(!oEl)return null;if(oEl.tagName=="BODY")return oEl;if(jQuery(oEl).css("position").match(/absolute|relative/i))return oEl;return this.findNonStatic(oEl.offsetParent);},getBaseOffset:function(oEl){var oBase=this.findNonStatic(oEl.offsetParent);var tmp=jQuery(oBase).offset();return{top:tmp.top,left:tmp.left};}});xe.CorePlugin=jQuery.Class({name:"CorePlugin",$init:function(funcOnReady){this.funcOnReady=funcOnReady;},$AFTER_MSG_APP_READY:function(){this.oApp.exec("EXEC_ON_READY_FUNCTION",[]);},$ON_ADD_APP_PROPERTY:function(sPropertyName,oProperty){this.oApp[sPropertyName]=oProperty;},$ON_REGISTER_BROWSER_EVENT:function(obj,sEvent,sCMD,aParams,nDelay){this.oApp.registerBrowserEvent(obj,sEvent,sCMD,aParams,nDelay);},$ON_DISABLE_COMMAND:function(sCommand){this.oApp.disableCommand(sCommand,true);},$ON_ENABLE_COMMAND:function(sCommand){this.oApp.disableCommand(sCommand,false);},$ON_EXEC_ON_READY_FUNCTION:function(){if(typeof this.funcOnReady=="function")this.funcOnReady();}});xe.Utils=jQuery.Class({name:"Utils",$init:function(){if(jQuery.browser.msie&&jQuery.browser.nVersion==6){try{document.execCommand('BackgroundImageCache',false,true);}catch(e){}}},$ON_ATTACH_HOVER_EVENTS:function(aElms,sHoverClass){sHoverClass=sHoverClass||"hover";if(!aElms)return;jQuery(aElms).hover(function(){jQuery(this).addClass(sHoverClass)},function(){jQuery(this).removeClass(sHoverClass)});}});xe.XpressRangeManager=jQuery.Class({name:"XpressRangeManager",oWindow:null,$init:function(win){this.oWindow=win||window;},$BEFORE_MSG_APP_READY:function(){if(this.oWindow&&this.oWindow.tagName=="IFRAME") -this.oWindow=this.oWindow.contentWindow;this.oApp.exec("ADD_APP_PROPERTY",["getSelection",jQuery.fnBind(this.getSelection,this)]);this.oApp.exec("ADD_APP_PROPERTY",["getEmptySelection",jQuery.fnBind(this.getEmptySelection,this)]);},$ON_SET_EDITING_WINDOW:function(oWindow){this.oWindow=oWindow;},getEmptySelection:function(){var oXpressRange=new xe.XpressRange(this.oWindow);return oXpressRange;},getSelection:function(){this.oApp.exec("RESTORE_IE_SELECTION",[]);var oXpressRange=this.getEmptySelection();try{oXpressRange.setFromSelection();}catch(e){} -return oXpressRange;}});xe.Hotkey=jQuery.Class({name:"Hotkey",storage:{},keyhash:{},$init:function(){this.storage={};this.keyhash={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,meta:224,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:46,comma:188,period:190,slash:191,hyphen:109,equal:61};if(jQuery.browser.msie||jQuery.browser.safari){this.keyhash.hyphen=189;this.keyhash.equal=187;this.keyhash.meta=91;}},$ON_MSG_APP_READY:function(){jQuery(this.oApp.getWYSIWYGDocument()||document).keydown(jQuery.fnBind(this.keydown,this));},$ON_REGISTER_HOTKEY:function(sHotkey,sCMD,sArgs){if(!sArgs)sArgs=[];var func=jQuery.fnBind(this.oApp.exec,this.oApp,sCMD,sArgs);sHotkey=this.normalize(sHotkey);if(!sHotkey)return false;this.add(sHotkey,func);},add:function(sHotkey,func){if(typeof this.storage[sHotkey]=='undefined'){this.storage[sHotkey]=[func];}else{this.storage[sHotkey].push(func);}},keydown:function(event){var key=[],kh=this.keyhash;if(jQuery.inArray(event.keyCode,[kh.shift,kh.ctrl,kh.alt,kh.meta])>=0)return;if(event.shiftKey)key.push('shift');if(event.altKey)key.push('alt');if(event.ctrlKey)key.push('ctrl');if(event.metaKey)key.push('meta');if(!key.length)return;if(key.length==1&&event.metaKey)key=['ctrl','meta'];key.push(event.keyCode);key=key.join('+');if(!this.storage[key])return;jQuery.each(this.storage[key],function(){this();});return false;},normalize:function(sHotkey){var shift,ctrl,alt,meta,key,keys=(sHotkey||"").toLowerCase().split('+');shift=ctrl=alt=meta=key=false;jQuery.each(keys,function(){var s=""+this;switch(s){case'shift':shift=true;case'alt':alt=true;case'ctrl':ctrl=true;case'meta':meta=true;default:key=s;}});if(!key)return'';keys=[];if(shift)keys.push('shift');if(alt)keys.push('alt');if(ctrl)keys.push('ctrl');if(meta||(ctrl&&!shift&&!alt))keys.push('meta');keys.push(this.keyhash[key]||key.toUpperCase().charCodeAt(0));return keys.join('+');}});xe.DialogLayerManager=jQuery.Class({name:"DialogLayerManager",aMadeDraggable:null,aOpenedLayers:null,$init:function(){this.aMadeDraggable=[];this.aOpenedLayers=[];},$ON_SHOW_DIALOG_LAYER:function(oLayer,bModal){oLayer=jQuery.$(oLayer);bModal=jQuery.$(bModal)||false;if(!oLayer)return;if(jQuery.inArray(oLayer,this.aOpenedLayers))return;this.oApp.exec("POSITION_DIALOG_LAYER",[oLayer]);this.aOpenedLayers[this.aOpenedLayers.length]=oLayer;if(!jQuery.inArray(oLayer,this.aMadeDraggable)){new xe.DraggableLayer(oLayer,{bModal:bModal,iMinY:0});this.aMadeDraggable[this.aMadeDraggable.length]=oLayer;}else{oLayer.style.display="block";}},$ON_HIDE_LAST_DIALOG_LAYER:function(){this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[this.aOpenedLayers.length-1]]);},$ON_HIDE_ALL_DIALOG_LAYER:function(){for(var i=this.aOpenedLayers.length-1;i>=0;i--) -this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[i]]);},$ON_HIDE_DIALOG_LAYER:function(oLayer){oLayer=jQuery.$(oLayer);if(oLayer)oLayer.style.display="none";this.aOpenedLayers=jQuery.grep(this.aOpenedLayers,function(a){return a!=oLayer});},$ON_SET_DIALOG_LAYER_POSITION:function(oLayer,iTop,iLeft){oLayer.style.top=iTop;oLayer.style.left=iLeft;}});xe.ActiveLayerManager=jQuery.Class({name:"ActiveLayerManager",oCurrentLayer:null,$ON_TOGGLE_ACTIVE_LAYER:function(oLayer,sOnOpenCmd,aOnOpenParam,sOnCloseCmd,aOnCloseParam){if(oLayer==this.oCurrentLayer){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);}else{this.oApp.exec("SHOW_ACTIVE_LAYER",[oLayer,sOnCloseCmd,aOnCloseParam]);if(sOnOpenCmd)this.oApp.exec(sOnOpenCmd,aOnOpenParam);}},$ON_SHOW_ACTIVE_LAYER:function(oLayer,sOnCloseCmd,aOnCloseParam){oLayer=jQuery.$(oLayer);this.sOnCloseCmd=sOnCloseCmd;this.aOnCloseParam=aOnCloseParam;var oPrevLayer=this.oCurrentLayer;if(oLayer==oPrevLayer)return;this.oApp.exec("HIDE_ACTIVE_LAYER",[]);oLayer.style.display="block";this.oCurrentLayer=oLayer;},$ON_HIDE_ACTIVE_LAYER:function(){var oLayer=this.oCurrentLayer;if(!oLayer)return;oLayer.style.display="none";this.oCurrentLayer=null;if(this.sOnCloseCmd) -this.oApp.exec(this.sOnCloseCmd,this.aOnCloseParam);},$ON_HIDE_CURRENT_ACTIVE_LAYER:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);},$ON_EVENT_EDITING_AREA_KEYDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);},$ON_EVENT_EDITING_AREA_MOUSEDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);}});xe.StringConverterManager=jQuery.Class({name:"StringConverterManager",oConverters:null,$init:function(){this.oConverters={};},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["applyConverter",jQuery.fnBind(this.applyConverter,this)]);this.oApp.exec("ADD_APP_PROPERTY",["addConverter",jQuery.fnBind(this.addConverter,this)]);},applyConverter:function(sRuleName,sContent){var aConverters=this.oConverters[sRuleName];if(!aConverters)return sContent;for(var i=0;i*:first-child",aAllLi[i]).get(0);}}},$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.exec("ADD_APP_PROPERTY",["getToolbarButtonByUIName",jQuery.fnBind(this.getToolbarButtonByUIName,this)]);},$ON_EVENT_TOOLBAR_MOUSEOVER:function(weEvent){if(weEvent.target.tagName=="BUTTON")jQuery(weEvent.target).addClass("hover").parent("span").addClass("hover");},$ON_EVENT_TOOLBAR_MOUSEOUT:function(weEvent){if(weEvent.target.tagName=="BUTTON")jQuery(weEvent.target).removeClass("hover").parent("span").removeClass("hover");},$ON_TOGGLE_TOOLBAR_ACTIVE_LAYER:function(oLayer,oBtn,sOpenCmd,aOpenArgs,sCloseCmd,aCloseArgs){this.oApp.exec("TOGGLE_ACTIVE_LAYER",[oLayer,"MSG_TOOLBAR_LAYER_SHOWN",[oLayer,oBtn,sOpenCmd,aOpenArgs],sCloseCmd,aCloseArgs]);},$ON_MSG_TOOLBAR_LAYER_SHOWN:function(oLayer,oBtn,aOpenCmd,aOpenArgs){this.oApp.exec("POSITION_TOOLBAR_LAYER",[oLayer,oBtn]);if(aOpenCmd)this.oApp.exec(aOpenCmd,aOpenArgs);},$ON_SHOW_TOOLBAR_ACTIVE_LAYER:function(oLayer,sCmd,aArgs,oBtn){this.oApp.exec("SHOW_ACTIVE_LAYER",[oLayer,sCmd,aArgs]);this.oApp.exec("POSITION_TOOLBAR_LAYER",[oLayer,oBtn]);},$ON_ENABLE_UI:function(sUIName){var elUI=this.htUIList[sUIName];if(!elUI)return;jQuery(elUI).removeClass("off");elUI.disabled=false;var sCmd="";if(this.aUICmdMap[sUIName]){for(var i=0;inToolbarLeft)oLayer.style.left=(nToolbarLeft-nLayerLeft-5)+"px";},getToolbarButtonByUIName:function(sUIName){return this.htUIList[sUIName];}});xe.XE_EditingAreaManager=jQuery.Class({name:"XE_EditingAreaManager",oActivePlugin:null,oIRField:null,bIsDirty:false,$init:function(sInitialMode,oIRField,oDimension,fOnBeforeUnload,oAppContainer){this.sInitialMode=sInitialMode;this.oIRField=jQuery.$(oIRField);this._assignHTMLObjects(oAppContainer);this.fOnBeforeUnload=fOnBeforeUnload;this.oEditingMode={};this.elEditingAreaContainer.style.height=parseInt(oDimension.nHeight||this.elEditingAreaContainer.offsetHeight)+"px";this.nMinHeight=oDimension.nMinHeight||10;this.niMinWidth=oDimension.nMinWidth||10;},_assignHTMLObjects:function(oAppContainer){oAppContainer=jQuery.$(oAppContainer)||document;this.elEditingAreaContainer=jQuery("DIV.xpress_xeditor_editing_area_container",oAppContainer).get(0);this.elEditingAreaSkipUI=jQuery("A.skip",oAppContainer).get(0);},$BEFORE_MSG_APP_READY:function(msg){this.oApp.exec("ADD_APP_PROPERTY",["elEditingAreaContainer",this.elEditingAreaContainer]);this.oApp.exec("ADD_APP_PROPERTY",["getIR",jQuery.fnBind(this.getIR,this)]);this.oApp.exec("ADD_APP_PROPERTY",["setIR",this.setIR]);this.oApp.exec("ADD_APP_PROPERTY",["getEditingMode",jQuery.fnBind(this.getEditingMode,this)]);},$ON_MSG_APP_READY:function(){this.oApp.exec("CHANGE_EDITING_MODE",[this.sInitialMode,true]);this.oApp.exec("LOAD_IR_FIELD",[false]);this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"focus","MSG_EDITING_AREA_SIZE_CHANGED",[],50);this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"blur","MSG_EDITING_AREA_SIZE_CHANGED",[],50);var fOnBeforeUnload=this.fOnBeforeUnload||function(){if(this.getIR()!=this.oIRField.value||this.bIsDirty)return this.oApp.$MSG("XE_EditingAreaManager.onExit")};jQuery(window).bind("beforeunload",jQuery.fnBind(fOnBeforeUnload,this));},$AFTER_MSG_APP_READY:function(){this.oApp.exec("UPDATE_IR_FIELD",[]);},$ON_LOAD_IR_FIELD:function(bDontAddUndo){this.oApp.setIR(this.oIRField.value,bDontAddUndo);},$ON_UPDATE_IR_FIELD:function(){this.oIRField.value=this.oApp.getIR();},$BEFORE_CHANGE_EDITING_MODE:function(sMode){this._oPrevActivePlugin=this.oActivePlugin;this.oActivePlugin=this.oEditingMode[sMode];},$AFTER_CHANGE_EDITING_MODE:function(sMode,bNoFocus){if(this._oPrevActivePlugin){var sIR=this._oPrevActivePlugin.getIR();this.oApp.exec("SET_IR",[sIR]);this.oApp.exec("ENABLE_UI",[this._oPrevActivePlugin.sMode]);this._setEditingAreaDimension();} -this.oApp.exec("DISABLE_UI",[this.oActivePlugin.sMode]);if(!bNoFocus){this.oApp.exec("FOCUS",[]);}},$ON_SET_IS_DIRTY:function(bIsDirty){this.bIsDirty=bIsDirty;},$ON_FOCUS:function(){if(!this.oActivePlugin||typeof this.oActivePlugin.setIR!="function")return -this.oActivePlugin.focus();},$BEFORE_SET_IR:function(sIR,bDontAddUndoHistory){bDontAddUndoHistory=bDontAddUndoHistory||false;if(!bDontAddUndoHistory)this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"]);},$ON_SET_IR:function(sIR){if(!this.oActivePlugin||typeof this.oActivePlugin.setIR!="function")return -this.oActivePlugin.setIR(sIR);},$AFTER_SET_IR:function(sIR,bDontAddUndoHistory){bDontAddUndoHistory=bDontAddUndoHistory||false;if(!bDontAddUndoHistory)this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"]);},$ON_REGISTER_EDITING_AREA:function(oEditingAreaPlugin){this.oEditingMode[oEditingAreaPlugin.sMode]=oEditingAreaPlugin;this.attachDocumentEvents(oEditingAreaPlugin.oEditingArea);},$ON_MSG_EDITING_AREA_RESIZE_STARTED:function(){this.oActivePlugin.elEditingArea.style.display="none";this.iStartingHeight=parseInt(this.elEditingAreaContainer.style.height);},$ON_RESIZE_EDITING_AREA:function(ipNewWidth,ipNewHeight){var iNewWidth=parseInt(ipNewWidth);var iNewHeight=parseInt(ipNewHeight);if(iNewWidth=33&&oEvent.keyCode<=40)||oEvent.keyCode==16)return;this._recordUndo(oEvent);},$ON_PASTE_HTML:function(sHTML,oPSelection){if(this.oApp.getEditingMode()!=this.sMode)return;var oSelection=oPSelection||this.oApp.getSelection();oSelection.pasteHTML(sHTML);if(!jQuery.browser.msie){var sTmpBookmark=oSelection.placeStringBookmark();this.oApp.getWYSIWYGDocument().body.innerHTML=this.oApp.getWYSIWYGDocument().body.innerHTML;oSelection.moveToBookmark(sTmpBookmark);oSelection.collapseToEnd();oSelection.select();oSelection.removeStringBookmark(sTmpBookmark);} -this.oApp.exec("RECORD_UNDO_ACTION",["INSERT HTML"]);},$AFTER_MSG_EDITING_AREA_RESIZE_ENDED:function(FnMouseDown,FnMouseMove,FnMouseUp){this.oApp.exec("REFRESH_WYSIWYG",[]);},$ON_RESTORE_IE_SELECTION:function(){if(this._oIERange){this._oIERange.select();this._oPrevIERange=this._oIERange;this._oIERange=null;}},initIframe:function(){try{this.doc=this.iframe.contentWindow.document;if(this.doc==null||this.doc.location.href=='about:blank'){throw new Error('Access denied');} -this._enableWYSIWYG();this.status=xe.PLUGIN_STATUS["READY"];}catch(e){if(this._nIFrameReadyCount-->0){setTimeout(jQuery.fnBind(this.initIframe,this),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 sContent=this.doc.body.innerHTML;var sIR;if(this.oApp.applyConverter) -sIR=this.oApp.applyConverter(this.sMode+"_TO_IR",sContent);else -sIR=sContent;return sIR;},setIR:function(sIR){var sContent;if(this.oApp.applyConverter) -sContent=this.oApp.applyConverter("IR_TO_"+this.sMode,sIR);else -sContent=sIR;this.doc.body.innerHTML=sContent;if(jQuery.browser.mozilla){if(this.doc.body.innerHTML=="")this.doc.body.innerHTML="
";}},getWindow:function(){return this.iframe.contentWindow;},getDocument:function(){return this.iframe.contentWindow.document;},focus:function(){this.getWindow().focus();this.oApp.exec("RESTORE_IE_SELECTION",[]);},_recordUndo:function(oKeyInfo){var curTime=new Date();if(curTime-this.iLastUndoRecorded";if(oEWrapper.innerHTML=="")oEWrapper.innerHTML="
";if(oEWrapper.nextSibling&&oEWrapper.nextSibling.tagName=="BR")oEWrapper.parentNode.removeChild(oEWrapper.nextSibling);oSelection.selectNodeContents(oEWrapper);oSelection.collapseToStart();oSelection.select();this.oApp.exec("CHECK_STYLE_CHANGE",[]);}else{oSelection.removeStringBookmark(sBM);}}}});xe.XE_WYSIWYGStyler=jQuery.Class({name:"XE_WYSIWYGStyler",$PRECONDITION:function(sFullCommand,aArgs){return(this.oApp.getEditingMode()=="WYSIWYG");},$ON_SET_WYSIWYG_STYLE:function(oStyles){var oSelection=this.oApp.getSelection();if(oSelection.collapsed){var oSpan=this.oApp.getWYSIWYGDocument().createElement("SPAN");oSelection.insertNode(oSpan);oSpan.innerHTML=unescape("%uFEFF");var sValue;for(var sName in oStyles){sValue=oStyles[sName];if(typeof sValue!="string")continue;oSpan.style[sName]=sValue;} -oSelection.selectNodeContents(oSpan);oSelection.collapseToEnd();oSelection._window.focus();oSelection._window.document.body.focus();oSelection.select();if(jQuery.browser.mozilla&&jQuery.browser.nVersion==3) -oSpan.innerHTML="";return;} -this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["FONT STYLE"]);oSelection.styleRange(oStyles);oSelection._window.focus();oSelection.select();this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["FONT STYLE"]);}});xe.XE_WYSIWYGStyleGetter=jQuery.Class({name:"XE_WYSIWYGStyleGetter",hKeyUp:null,getStyleInterval:200,oStyleMap:{fontFamily:{type:"Value",css:"fontFamily"},fontSize:{type:"Value",css:"fontSize"},lineHeight:{type:"Value",css:"lineHeight",converter:function(sValue,oStyle){if(!sValue.match(/px$/))return sValue;return Math.ceil((parseInt(sValue)/parseInt(oStyle.fontSize))*10)/10;}},bold:{command:"bold"},underline:{command:"underline"},italic:{command:"italic"},lineThrough:{command:"strikethrough"},superscript:{command:"superscript"},subscript:{command:"subscript"},justifyleft:{command:"justifyleft"},justifycenter:{command:"justifycenter"},justifyright:{command:"justifyright"},justifyfull:{command:"justifyfull"},orderedlist:{command:"insertorderedlist"},unorderedlist:{command:"insertunorderedlist"}},$init:function(){this.oStyle=this._getBlankStyle();},$PRECONDITION:function(){if(this.oApp.getEditingMode()!="WYSIWYG")return false;return true;},$ON_MSG_APP_READY:function(){this.oDocument=this.oApp.getWYSIWYGDocument();this.oApp.exec("ADD_APP_PROPERTY",["getCurrentStyle",jQuery.fnBind(this.getCurrentStyle,this)]);},$ON_EVENT_EDITING_AREA_MOUSEUP:function(oEvnet){if(this.hKeyUp)clearTimeout(this.hKeyUp);this.oApp.exec("CHECK_STYLE_CHANGE",[]);},$ON_EVENT_EDITING_AREA_KEYUP:function(oEvent){if(!(oEvent.keyCode==8||(oEvent.keyCode>=33&&oEvent.keyCode<=40)||oEvent.keyCode==45||oEvent.keyCode==46))return;if(this.hKeyUp)clearTimeout(this.hKeyUp);this.hKeyUp=setTimeout(jQuery.fnBind(this.oApp.exec,this.oApp,"CHECK_STYLE_CHANGE",[]),this.getStyleInterval);},$ON_CHECK_STYLE_CHANGE:function(){this._getStyle();},$ON_RESET_STYLE_STATUS:function(){var oBlankStyle=this._getBlankStyle();for(var sAttributeName in oBlankStyle) -this.oApp.exec("SET_STYLE_STATUS",[sAttributeName,oBlankStyle[sAttributeName]]);},getCurrentStyle:function(){return this.oStyle;},_check_style_change:function(){this.oApp.exec("CHECK_STYLE_CHANGE",[]);},_getBlankStyle:function(){var oBlankStyle={};for(var attributeName in this.oStyleMap){if(this.oStyleMap[attributeName].type=="Value") -oBlankStyle[attributeName]="";else -oBlankStyle[attributeName]=0;} -return oBlankStyle;},_getStyle:function(){var oSelection=this.oApp.getSelection();var funcFilter=function(oNode){if(!oNode.childNodes||oNode.childNodes.length==0) -return true;else -return false;} -var aBottomNodes=oSelection.getNodes(false,funcFilter);var oStyle,oBaseStyle,oTmpStyle,attributeName;if(aBottomNodes.length==0){oStyle=this._getStyleOf(oSelection.commonAncestorContainer);}else{oStyle=this._getStyleOf(aBottomNodes[0]);} -for(attributeName in oStyle){if(this.oStyleMap[attributeName].converter){oStyle[attributeName]=this.oStyleMap[attributeName].converter(oStyle[attributeName],oStyle);} -if(this.oStyle[attributeName]!=oStyle[attributeName]) -this.oApp.exec("MSG_STYLE_CHANGED",[attributeName,oStyle[attributeName]]);} -this.oStyle=oStyle;},_getStyleOf:function(oNode){var oStyle=this._getBlankStyle();if(!oNode)return oStyle;if(oNode.nodeType==3)oNode=oNode.parentNode;var welNode=jQuery(oNode);var attribute,cssName;for(var styleName in this.oStyle){attribute=this.oStyleMap[styleName];if(attribute.type&&attribute.type=="Value"){if(attribute.css){var sValue=welNode.css(attribute.css);if(styleName=="fontFamily"){sValue=sValue.split(/,/)[0];} -oStyle[styleName]=sValue;}else{if(attribute.command){try{oStyle[styleName]=this.oDocument.queryCommandState(attribute.command);}catch(e){}}else{}}}else{if(attribute.command){try{if(this.oDocument.queryCommandState(attribute.command)){oStyle[styleName]=1;}else{oStyle[styleName]=0;}}catch(e){}}else{}}} -return oStyle;}});xe.XE_FontSizeWithSelectUI=jQuery.Class({name:"XE_FontSizeWithSelectUI",$init:function(elAppContainer){this._assignHTMLObjects(elAppContainer);},_assignHTMLObjects:function(elAppContainer){this.elFontSizeSelect=jQuery("SELECT.xpress_xeditor_ui_fontSize_select",elAppContainer).get(0);},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFontSizeSelect,"change","SET_FONTSIZE_FROM_SELECT_UI");this.elFontSizeSelect.selectedIndex=0;},$ON_MSG_STYLE_CHANGED:function(sAttributeName,sAttributeValue){if(sAttributeName=="fontSize"){this.elFontSizeSelect.value=sAttributeValue;if(this.elFontSizeSelect.selectedIndex<0)this.elFontSizeSelect.selectedIndex=0;}},$ON_SET_FONTSIZE_FROM_SELECT_UI:function(){var sFontSize=this.elFontSizeSelect.value;if(!sFontSize)return;this.oApp.exec("SET_WYSIWYG_STYLE",[{"fontSize":sFontSize}]);this.oApp.exec("CHECK_STYLE_CHANGE",[]);}});xe.XE_FontNameWithSelectUI=jQuery.Class({name:"XE_FontNameWithSelectUI",$init:function(elAppContainer){this._assignHTMLObjects(elAppContainer);},_assignHTMLObjects:function(elAppContainer){this.elFontNameSelect=jQuery("SELECT.xpress_xeditor_ui_fontName_select",elAppContainer).get(0);},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFontNameSelect,"change","SET_FONTNAME_FROM_SELECT_UI");this.elFontNameSelect.selectedIndex=0;},$ON_MSG_STYLE_CHANGED:function(sAttributeName,sAttributeValue){if(sAttributeName=="fontFamily"){this.elFontNameSelect.value=sAttributeValue.toLowerCase();if(this.elFontNameSelect.selectedIndex<0)this.elFontNameSelect.selectedIndex=0;}},$ON_SET_FONTNAME_FROM_SELECT_UI:function(){var sFontName=this.elFontNameSelect.value;if(!sFontName)return;this.oApp.exec("SET_WYSIWYG_STYLE",[{"fontFamily":sFontName}]);this.oApp.exec("CHECK_STYLE_CHANGE",[]);}});xe.XE_LineHeight=jQuery.Class({name:"XE_LineHeight",$init:function(oAppContainer){this._assignHTMLObjects(oAppContainer);},_assignHTMLObjects:function(oAppContainer){},$ON_SET_LINEHEIGHT:function(nLineHeight){this.setLineHeight(nLineHeight);},getLineHeight:function(){var nodes=this._getSelectedNodes(false);var curWrapper,prevWrapper;var iCurHeight,iHeight;if(nodes.length==0)return-1;var iLength=nodes.length;if(iLength==0){iHeight=-1;}else{prevWrapper=this._getLineWrapper(nodes[0]);iHeight=this._getWrapperLineheight(prevWrapper);} -var firstNode=this.oSelection.getStartNode();if(iHeight>0){for(var i=1;i=0;i--){if(aNodes[i].nodeType==3||aNodes[i].tagName=="BR"){var oP=oSelection._document.createElement("P");oInsertionPoint=aNodes[i].nextSibling;while(i>=0&&aNodes[i]&&(aNodes[i].nodeType==3||aNodes[i].tagName=="BR")){oP.insertBefore(aNodes[i--],oP.firstChild);} -oFormattingNode.insertBefore(oP,oInsertionPoint);i++;}} -if(oFormattingNode&&oFormattingNode.parentNode){var oP=oSelection._document.createElement("P");oP.innerHTML=unescape("
");oFormattingNode.parentNode.insertBefore(oP,oFormattingNode.nextSibling);} -this.oApp.exec("RECORD_UNDO_ACTION",["Block Quote"]);return oFormattingNode;},_expandToTableStart:function(oSelection,oNode){var oC=oSelection.commonAncestorContainer;var oResultNode=null;var bLastIteration=false;while(oNode&&!bLastIteration){if(oNode==oC)bLastIteration=true;if(/TBODY|TFOOT|THEAD|TR/i.test(oNode.tagName)){oResultNode=this._getTableRoot(oNode);break;} -oNode=oNode.parentNode;} -return oResultNode;},_getTableRoot:function(oNode){while(oNode&&oNode.tagName!="TABLE")oNode=oNode.parentNode;return oNode;}});xe.XE_SCharacter=jQuery.Class({name:"XE_SCharacter",$init:function(oAppContainer){this.bIE=jQuery.browser.msie;this._assignHTMLObjects(oAppContainer);this.charSet=[];this.charSet[0]=unescape('FF5B FF5D 3014 3015 3008 3009 300A 300B 300C 300D 300E 300F 3010 3011 2018 2019 201C 201D 3001 3002 %B7 2025 2026 %A7 203B 2606 2605 25CB 25CF 25CE 25C7 25C6 25A1 25A0 25B3 25B2 25BD 25BC 25C1 25C0 25B7 25B6 2664 2660 2661 2665 2667 2663 2299 25C8 25A3 25D0 25D1 2592 25A4 25A5 25A8 25A7 25A6 25A9 %B1 %D7 %F7 2260 2264 2265 221E 2234 %B0 2032 2033 2220 22A5 2312 2202 2261 2252 226A 226B 221A 223D 221D 2235 222B 222C 2208 220B 2286 2287 2282 2283 222A 2229 2227 2228 FFE2 21D2 21D4 2200 2203 %B4 FF5E 02C7 02D8 02DD 02DA 02D9 %B8 02DB %A1 %BF 02D0 222E 2211 220F 266D 2669 266A 266C 327F 2192 2190 2191 2193 2194 2195 2197 2199 2196 2198 321C 2116 33C7 2122 33C2 33D8 2121 2668 260F 260E 261C 261E %B6 2020 2021 %AE %AA %BA 2642 2640').replace(/(\S{4})/g,function(a){return"%u"+a}).split(' ');this.charSet[1]=unescape('%BD 2153 2154 %BC %BE 215B 215C 215D 215E %B9 %B2 %B3 2074 207F 2081 2082 2083 2084 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 FFE6 %24 FFE5 FFE1 20AC 2103 212B 2109 FFE0 %A4 2030 3395 3396 3397 2113 3398 33C4 33A3 33A4 33A5 33A6 3399 339A 339B 339C 339D 339E 339F 33A0 33A1 33A2 33CA 338D 338E 338F 33CF 3388 3389 33C8 33A7 33A8 33B0 33B1 33B2 33B3 33B4 33B5 33B6 33B7 33B8 33B9 3380 3381 3382 3383 3384 33BA 33BB 33BC 33BD 33BE 33BF 3390 3391 3392 3393 3394 2126 33C0 33C1 338A 338B 338C 33D6 33C5 33AD 33AE 33AF 33DB 33A9 33AA 33AB 33AC 33DD 33D0 33D3 33C3 33C9 33DC 33C6').replace(/(\S{4})/g,function(a){return"%u"+a}).split(' ');this.charSet[2]=unescape('3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 326A 326B 326C 326D 326E 326F 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 327A 327B 24D0 24D1 24D2 24D3 24D4 24D5 24D6 24D7 24D8 24D9 24DA 24DB 24DC 24DD 24DE 24DF 24E0 24E1 24E2 24E3 24E4 24E5 24E6 24E7 24E8 24E9 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 246A 246B 246C 246D 246E 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 320A 320B 320C 320D 320E 320F 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 321A 321B 249C 249D 249E 249F 24A0 24A1 24A2 24A3 24A4 24A5 24A6 24A7 24A8 24A9 24AA 24AB 24AC 24AD 24AE 24AF 24B0 24B1 24B2 24B3 24B4 24B5 2474 2475 2476 2477 2478 2479 247A 247B 247C 247D 247E 247F 2480 2481 2482').replace(/(\S{4})/g,function(a){return"%u"+a}).split(' ');this.charSet[3]=unescape('3131 3132 3133 3134 3135 3136 3137 3138 3139 313A 313B 313C 313D 313E 313F 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 314A 314B 314C 314D 314E 314F 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 315A 315B 315C 315D 315E 315F 3160 3161 3162 3163 3165 3166 3167 3168 3169 316A 316B 316C 316D 316E 316F 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 317A 317B 317C 317D 317E 317F 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 318A 318B 318C 318D 318E').replace(/(\S{4})/g,function(a){return"%u"+a}).split(' ');this.charSet[4]=unescape('0391 0392 0393 0394 0395 0396 0397 0398 0399 039A 039B 039C 039D 039E 039F 03A0 03A1 03A3 03A4 03A5 03A6 03A7 03A8 03A9 03B1 03B2 03B3 03B4 03B5 03B6 03B7 03B8 03B9 03BA 03BB 03BC 03BD 03BE 03BF 03C0 03C1 03C3 03C4 03C5 03C6 03C7 03C8 03C9 %C6 %D0 0126 0132 013F 0141 %D8 0152 %DE 0166 014A %E6 0111 %F0 0127 I 0133 0138 0140 0142 0142 0153 %DF %FE 0167 014B 0149 0411 0413 0414 0401 0416 0417 0418 0419 041B 041F 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F 0431 0432 0433 0434 0451 0436 0437 0438 0439 043B 043F 0444 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F').replace(/(\S{4})/g,function(a){return"%u"+a}).split(' ');this.charSet[5]=unescape('3041 3042 3043 3044 3045 3046 3047 3048 3049 304A 304B 304C 304D 304E 304F 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 305A 305B 305C 305D 305E 305F 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 306A 306B 306C 306D 306E 306F 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 307A 307B 307C 307D 307E 307F 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 308A 308B 308C 308D 308E 308F 3090 3091 3092 3093 30A1 30A2 30A3 30A4 30A5 30A6 30A7 30A8 30A9 30AA 30AB 30AC 30AD 30AE 30AF 30B0 30B1 30B2 30B3 30B4 30B5 30B6 30B7 30B8 30B9 30BA 30BB 30BC 30BD 30BE 30BF 30C0 30C1 30C2 30C3 30C4 30C5 30C6 30C7 30C8 30C9 30CA 30CB 30CC 30CD 30CE 30CF 30D0 30D1 30D2 30D3 30D4 30D5 30D6 30D7 30D8 30D9 30DA 30DB 30DC 30DD 30DE 30DF 30E0 30E1 30E2 30E3 30E4 30E5 30E6 30E7 30E8 30E9 30EA 30EB 30EC 30ED 30EE 30EF 30F0 30F1 30F2 30F3 30F4 30F5 30F6').replace(/(\S{4})/g,function(a){return"%u"+a}).split(' ');},_assignHTMLObjects:function(oAppContainer){oAppContainer=jQuery.$(oAppContainer)||document;this.elDropdownLayer=jQuery("DIV.xpress_xeditor_sCharacter_layer",oAppContainer).get(0);this.oTextField=jQuery("INPUT",this.elDropdownLayer).get(0);this.oInsertButton=jQuery("+ BUTTON",this.oTextField).get(0);this.aCloseButton=jQuery("BUTTON.close",this.elDropdownLayer).get();this.aSCharList=jQuery(".list",this.elDropdownLayer).get();var oLabelUL=jQuery(">UL",this.elDropdownLayer).get(0);this.aLabelA=jQuery("A",oLabelUL).get();},$ON_MSG_APP_READY:function(){var funcInsert=jQuery.fnBind(this.oApp.exec,this.oApp,"INSERT_SCHARACTERS",[this.oTextField.value]);jQuery(this.oInsertButton).click(funcInsert,this);this.oApp.exec("SET_SCHARACTER_LIST",[this.charSet]);for(var i=0;i");}else{button=document.createElement("BUTTON");button.type="button";} -span=document.createElement("SPAN");span.innerHTML=unescape(this.charSet[i][ii]);button.appendChild(span);aLI[ii].appendChild(button);this.aSCharList[i].appendChild(aLI[ii]);}},_stopBrowserEvent:function(obj,sEvent){jQuery(obj).bind(sEvent,function(e){e.stopPropagation();e.preventDefault();})}});xe.XE_UndoRedo=jQuery.Class({name:"XE_UndoRedo",actionHistory:null,oCurStateIdx:null,iMinimumSizeChange:10,sBlankContentsForFF:"
",$init:function(){this.aUndoHistory=[];this.oCurStateIdx={nIdx:0,nStep:0};},$PRECONDITION:function(sCmd){if(sCmd.match(/_DO_RECORD_UNDO_HISTORY_AT$/))return true;try{if(this.oApp.getEditingMode()!="WYSIWYG")return false;}catch(e){return false;} -return true;},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("DO_RECORD_UNDO_HISTORY_AT",[this.oCurStateIdx,"","",null]);},$ON_MSG_APP_READY:function(){this.bFF=jQuery.browser.mozilla;this.oApp.exec("ADD_APP_PROPERTY",["getUndoHistory",jQuery.fnBind(this.getUndoHistory,this)]);this.oApp.exec("ADD_APP_PROPERTY",["getUndoStateIdx",jQuery.fnBind(this.getUndoStateIdx,this)]);this.oApp.exec("REGISTER_UI_EVENT",["undo","click","UNDO"]);this.oApp.exec("REGISTER_UI_EVENT",["redo","click","REDO"]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+z","UNDO"]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+y","REDO"]);},$ON_UNDO:function(){var oTmpStateIdx={};this.oApp.exec("DO_RECORD_UNDO_HISTORY",["KEYPRESS",false,false,1]);if(this.oCurStateIdx.nIdx==0)return;if(this.oCurStateIdx.nStep>0){this.oCurStateIdx.nStep--;}else{var oTmpHistory=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nIdx--;if(oTmpHistory.nTotalSteps>1){this.oCurStateIdx.nStep=0;}else{oTmpHistory=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nStep=oTmpHistory.nTotalSteps-1;}} -this.oApp.exec("RESTORE_UNDO_HISTORY",[this.oCurStateIdx.nIdx,this.oCurStateIdx.nStep]);this.oApp.exec("CHECK_STYLE_CHANGE",[]);},$ON_REDO:function(){if(this.oCurStateIdx.nIdx>=this.aUndoHistory.length)return;var oCurHistory=this.aUndoHistory[this.oCurStateIdx.nIdx];if(this.oCurStateIdx.nIdx==this.aUndoHistory.length-1&&this.oCurStateIdx.nStep>=oCurHistory.nTotalSteps-1)return;if(this.oCurStateIdx.nStep .bx",this.oUILayer).get();this.oFindInputSet=oTmp[0];this.oReplaceInputSet=oTmp[1];this.oFindInput_Keyword=jQuery("INPUT",this.oFindInputSet).get(0);oTmp=jQuery("INPUT",this.oReplaceInputSet).get();this.oReplaceInput_Original=oTmp[0];this.oReplaceInput_Replacement=oTmp[1];this.oFindNextButton=jQuery("BUTTON.find_next",this.oUILayer).get(0);this.oCancelButton=jQuery("BUTTON.cancel",this.oUILayer).get(0);this.oReplaceButton=jQuery("BUTTON.replace",this.oUILayer).get(0);this.oReplaceAllButton=jQuery("BUTTON.replace_all",this.oUILayer).get(0);this.aCloseButtons=jQuery("BUTTON.close",this.oUILayer).get();this.aCloseButtons[this.aCloseButtons.length]=this.oCancelButton;},$ON_MSG_APP_READY:function(){if(this.oEditingWindow&&this.oEditingWindow.tagName=="IFRAME") -this.oEditingWindow=this.oEditingWindow.contentWindow;this.oFindReplace=new xe.FindReplace(this.oEditingWindow);if(!this.oFindReplace.bBrowserSupported){this.oApp.exec("DISABLE_UI",["find_replace"]);return;} -for(var i=0;i"+sURL+"";this.oSelection.pasteHTML(str);}else{var nSession=Math.ceil(Math.random()*10000);var arg=(sURL==""?["unlink"]:["createLink",false,this.sATagMarker+nSession+sURL]);this.oApp.exec("EXECCOMMAND",arg);this.oSelection.setFromSelection();var oDoc=this.oApp.getWYSIWYGDocument();var aATags=oDoc.body.getElementsByTagName("A");var nLen=aATags.length;var rxMarker=new RegExp(this.sRXATagMarker+nSession,"i");var elATag;for(var i=0;ithis.iMaxRows)iRows=this.iMaxRows;this.oRowInput.value=iRows;this._showNewTable();},$ON_ST_SET_COLUMN_NUM:function(iColumns,iColumnDiff){iColumns=iColumns||parseInt(this.oColumnInput.value);iColumnDiff=iColumnDiff||0;iColumns+=iColumnDiff;if(iColumnsthis.iMaxColumns)iColumns=this.iMaxColumns;this.oColumnInput.value=iColumns;this._showNewTable();},$ON_ST_INSERT_TABLE:function(){var sTable=this._getTableString();this.oApp.exec("PASTE_HTML",[sTable]);this.oApp.exec("ST_CLOSE",[]);},$ON_ST_CLOSE:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[]);},$ON_ST_SET_BORDER_WIDTH:function(iBorderWidth,iBorderWidthDiff){iBorderWidth=iBorderWidth||parseInt(this.oBorderWidthInput.value);iBorderWidthDiff=iBorderWidthDiff||0;iBorderWidth+=iBorderWidthDiff;if(iBorderWidththis.iMaxBorderWidth)iBorderWidth=this.iMaxBorderWidth;this.oBorderWidthInput.value=iBorderWidth;this._showNewTable();},$ON_ST_INC_BORDER_WIDTH:function(){this.oApp.exec("ST_SET_BORDER_WIDTH",[null,1]);},$ON_ST_DEC_BORDER_WIDTH:function(){this.oApp.exec("ST_SET_BORDER_WIDTH",[null,-1]);},$ON_ST_TOGGLE_BORDER_COLOR_LAYER:function(){if(this.welDropdownLayer.hasClass("p1")) -this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER",[]);else -this.oApp.exec("ST_SHOW_BORDER_COLOR_LAYER",[]);},$ON_ST_SHOW_BORDER_COLOR_LAYER:function(){this.welDropdownLayer.addClass("p1");this.welDropdownLayer.removeClass("p2");this.oApp.exec("SHOW_COLOR_PALETTE",["ST_SET_BORDER_COLOR_FROM_PALETTE",this.elDropdownLayer]);},$ON_ST_HIDE_BORDER_COLOR_LAYER:function(){this.welDropdownLayer.removeClass("p1");this.oApp.exec("HIDE_COLOR_PALETTE",[]);},$ON_ST_TOGGLE_BGCOLOR_LAYER:function(){if(this.welDropdownLayer.hasClass("p2")) -this.oApp.exec("ST_HIDE_BGCOLOR_LAYER",[]);else -this.oApp.exec("ST_SHOW_BGCOLOR_LAYER",[]);},$ON_ST_SHOW_BGCOLOR_LAYER:function(){this.welDropdownLayer.removeClass("p1");this.welDropdownLayer.addClass("p2");this.oApp.exec("SHOW_COLOR_PALETTE",["ST_SET_BGCOLOR_FROM_PALETTE",this.elDropdownLayer]);},$ON_ST_HIDE_BGCOLOR_LAYER:function(){this.welDropdownLayer.removeClass("p2");this.oApp.exec("HIDE_COLOR_PALETTE",[]);},$ON_ST_SET_BORDER_COLOR_FROM_PALETTE:function(sColorCode){this.oApp.exec("ST_SET_BORDER_COLOR",[sColorCode]);this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER",[]);},$ON_ST_SET_BORDER_COLOR:function(sColorCode){this.oBorderColorInput.value=sColorCode;this.oButton_BorderColorPreview.style.backgroundColor=sColorCode;this._showNewTable();},$ON_ST_SET_BGCOLOR_FROM_PALETTE:function(sColorCode){this.oApp.exec("ST_SET_BGCOLOR",[sColorCode]);this.oApp.exec("ST_HIDE_BGCOLOR_LAYER",[]);},$ON_ST_SET_BGCOLOR:function(sColorCode){this.oBGColorInput.value=sColorCode;this.oButton_BGColorPreview.style.backgroundColor=sColorCode;this._showNewTable();},_showNewTable:function(){var oTmp=document.createElement("DIV");oTmp.innerHTML=this._getTableString();var oNewTable=oTmp.firstChild;this.oSampleTable.parentNode.insertBefore(oNewTable,this.oSampleTable);this.oSampleTable.parentNode.removeChild(this.oSampleTable);this.oSampleTable=oNewTable;},_getTableString:function(){var sBorderColorCode=this.oBorderColorInput.value;var sBGColorCode=this.oBGColorInput.value;var iBorderWidth=this.oBorderWidthInput.value;var sTD="";if(jQuery.browser.msie){sTD="

";}else{if(jQuery.browser.firefox){sTD="


";}else{sTD="

 

";}} -var sTable='';var sRow='';var iColumns=this.oColumnInput.value;for(var i=0;i";for(var i=0;i/ig,regex_meanless_css2=/(?:(?:margin|padding)\s*:\s*0(?:px)?|\-(?:moz|ms|webkit|opera)\-[\w-]+\s*:\s*.*?|[\w-]+\s*:\s*\-(?:moz|ms|webkit|opera)\-[\w-]+|(?:line-height|font-variant|font-stretch|font-size-adjust|font-size)\s*:\s*[a-z_-]+)\s*;?\s*|font-(?:weight|style)\s*:\s*normal;?/ig,regex_class=/<(.*?)\s+class\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig,regex_handler=/<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig,regex_id=/<(.*?)\s+id\s*=(?:[^\s>]+|\s*".*?"|\s*'.*?')(.*?)>/ig,regex_script=//ig,regex_font_color=/color\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i,regex_font_face=/face\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i,regex_font_size=/size\s*=(?:\s*"(\d+)"|\s*'(\d+)'|(\d+))/i,regex_style=/style\s*=\s*(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i,regex_font_weight=/font-weight\s*:\s*([a-z]+);?/i,regex_font_style=/font-style\s*:\s*italic;?/i,regex_font_decoration=/text-decoration\s*:\s*([a-z -]+);?/i;var -allow_tags='a,abbr,acronym,address,area,blockquote,br,caption,center,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,embed,h1,h2,h3,h4,h5,h6,hr,img,ins,kbd,li,map,object,ol,p,param,pre,q,samp,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,u,ul,var'.split(','),lonely_tags='area,br,col,embed,hr,img,input,param'.split(',');var -replace_tags={'b':'strong','i':'em','s':'del','strike':'del'};xe.XE_XHTMLConverter=$.Class({name:"XE_XHTMLConverter",$ON_MSG_APP_READY:function(){this.oApp.addConverter("WYSIWYG_TO_IR",this.TO_IR);this.oApp.addConverter("HTMLSrc_TO_IR",this.TO_IR);this.oApp.addConverter("IR_TO_HTMLSrc",this.IR_TO);this.oApp.addConverter("IR_TO_WYSIWYG",this.IR_TO);},TO_IR:function(sContent){var stack=[];sContent=sContent.replace(regex_meanless_css1,function(m0,m1,m2,m3){m2=m2.replace(regex_meanless_css2,'');return'<'+m1+(m2?' style="'+m2+'"':'')+m3+'>';});sContent=sContent.replace(regex_class,'<$1$2>');sContent=sContent.replace(regex_handler,'<$1$2>');sContent=sContent.replace(regex_id,'<$1$2>');sContent=sContent.replace(regex_script,'');regex=/<(\/)?([:\w\/-]+)(.*?)>/ig;sContent=sContent.replace(regex,function(m0,m1,m2,m3){var m3s=[];var state='';m1=m1||'';m2=m2.toLowerCase();m3=$.trim(m3||'');if(!m1){if($.inArray(m2,lonely_tags)>=0){var len=m3.length;if(m2=='br')m3='';if(!m3||m3.substring(len-1,len)!='/')m3+=' /';return'<'+m2+' '+m3+'>';} -if(replace_tags[m2]){stack.push({tag:m2,state:'deleted'});m2=replace_tags[m2];state='inserted';}else if(m2=='font'){stack.push({tag:m2,state:'deleted'});m2='span';m3s=[];if(regex_font_color.test(m3))m3s.push('color:'+(RegExp.$1||RegExp.$2||RegExp.$3)+';');if(regex_font_face.test(m3))m3s.push('font-family:'+(RegExp.$1||RegExp.$2||RegExp.$3)+';');m3=m3s.length?'style="'+m3s.join('')+'"':'';state='inserted';}else if(m2=='center'){stack.push({tag:m2,state:'deleted'});m2='div' -m3='style="text-align:center"';state='inserted';}else if(m2=='span'){var style='';if(!m3){stack.push({tag:m3,state:'deleted'});return'';} -if(regex_style.test(m3)){var tmpstack=[];var tmptag='';style=RegExp.$1||RegExp.$2||RegExp.$3;m3=m3.replace(regex_style,'');if(regex_font_weight.test(style)){if(RegExp.$1=='bold'||RegExp.$1=='bolder'){style=style.replace(regex_font_weight,'');tmpstack.push({tag:'strong',state:'inserted'});tmptag+='';}} -if(regex_font_style.test(style)){style=style.replace(regex_font_style,'');tmpstack.push({tag:'em',state:'inserted'});tmptag+='';} -if(regex_font_decoration.test(style)){var deco_css=' '+RegExp.$1.toLowerCase()+' ';if(deco_css.indexOf('underline ')>0){deco_css=deco_css.replace('underline ','');tmpstack.push({tag:'u',state:'inserted'});tmptag+='';} -if(deco_css.indexOf('line-through ')>0){deco_css=deco_css.replace('line-through ','');tmpstack.push({tag:'del',state:'inserted'});tmptag+='';} -deco_css=$.trim(deco_css);style=style.replace(regex_font_decoration,(deco_css?'text-decoration:'+deco_css+';':''));} -style=$.trim(style);stack.push({tag:m2,state:(!m3&&!style?'deleted':'')});stack=stack.concat(tmpstack);return(!m3&&!style?'':'')+tmptag;}}else{state=(jQuery.inArray(m2,allow_tags)<0)?'deleted':'';if(state=='deleted')return'';} -stack.push({tag:m2,state:state});}else{var tags=[],t='';if(!stack.length)return'';do{t=stack.pop();if(t.state!='inserted'&&t.tag!=m2){stack.push(t);return tags.join('');} -if(t.state!='deleted')tags.push('');}while(stack.length&&t.tag!=m2);return tags.join('');} -return'<'+m1+m2+(m3?' '+m3:'')+'>';});if(stack.length){var t='';do{t=stack.pop();if(t.state!='deleted')sContent+='';}while(stack.length);} -return sContent;},IR_TO:function(sContent){return sContent;}});})(jQuery);xe.XE_Extension=jQuery.Class({name:"XE_Extension",seq:'',$init:function(elAppContainer,editor_sequence){this.seq=editor_sequence;this._assignHTMLObjects(elAppContainer);},_assignHTMLObjects:function(elAppContainer){this.elDropdownLayer=jQuery('DIV.xpress_xeditor_extension_layer',elAppContainer).get(0);},_removeAttrs:function(sContent){sContent=sContent.replace(/]*?) xe_handled\s*=\s*".+?"([^>]*?)>/i,'');return sContent;},_addEvent:function(){if(this.oApp.getEditingMode()!='WYSIWYG')return;var doc=this.oApp.getWYSIWYGDocument();var seq=this.seq;var fn=function(){var img=jQuery(this);var comp=img.attr('editor_component');if(comp&&jQuery.isFunction(openComponent)){editorPrevNode=img.get(0);openComponent(comp,seq);}};jQuery('img[editor_component]',doc).each(function(){var img=jQuery(this);if(!img.attr('xe_handled')){img.attr('xe_handled','yes').dblclick(fn);}});},$ON_MSG_APP_READY:function(){this.oApp.exec('REGISTER_UI_EVENT',['extension','click','TOGGLE_EXTENSION_LAYER']);this.oApp.addConverter("WYSIWYG_TO_IR",this._removeAttrs);},$ON_TOGGLE_EXTENSION_LAYER:function(){this.oApp.exec('TOGGLE_TOOLBAR_ACTIVE_LAYER',[this.elDropdownLayer]);},$ON_CHANGE_EDITING_MODE:function(mode){this._addEvent();},$ON_PASTE_HTML:function(){this._addEvent();},$ON_LOAD_IR_FIELD:function(){this._addEvent();},$ON_SET_IR:function(){this._addEvent();}});xe.XE_AutoSave=jQuery.Class({name:"XE_AutoSave",form:null,textarea:null,$init:function(oIRTextarea,elAppContainer){this.form=oIRTextarea.form;this.textarea=oIRTextarea;this._assignHTMLObjects(elAppContainer);},_assignHTMLObjects:function(elAppContainer){this.welMessageBox=jQuery('autosave_message');},$ON_MSG_APP_READY:function(){var elTitle=jQuery(this.form._saved_doc_title);var elContent=jQuery(this.form._saved_doc_content);var title=jQuery.trim(elTitle.val());var content=jQuery.trim(elContent.val());if(title||content){if(confirm(this.form._saved_doc_message.value)){jQuery(this.form.title).val(title);this.oApp.setIR(content);}else{editorRemoveSavedDoc();}} -editorEnableAutoSave(this.form,jQuery(this.form).attr("editor_sequence"));this.oApp.exec('REGISTER_HOTKEY',['ctrl+shift+s','AUTO_SAVE']);},$ON_AUTO_SAVE:function(){_editorAutoSave();}});xe.XE_FormatWithSelectUI=jQuery.Class({name:"XE_FormatWithSelectUI",$init:function(elAppContainer){this._assignHTMLObjects(elAppContainer);},_assignHTMLObjects:function(elAppContainer){this.elFormatSelect=jQuery("SELECT.xpress_xeditor_ui_format_select",elAppContainer).get(0);},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFormatSelect,"change","SET_FORMAT_FROM_SELECT_UI");this.elFormatSelect.selectedIndex=0;},$ON_MSG_STYLE_CHANGED:function(sAttributeName,sAttributeValue){var blockName=this.oApp.getWYSIWYGDocument().queryCommandValue("FormatBlock");this.elFormatSelect.value=blockName.toLowerCase();if(this.elFormatSelect.selectedIndex<0)this.elFormatSelect.selectedIndex=0;},$ON_SET_FORMAT_FROM_SELECT_UI:function(){var sFormat=this.elFormatSelect.value;if(!sFormat)return;this.oApp.exec("EXECCOMMAND",["FormatBlock",false,sFormat]);this.oApp.exec("CHECK_STYLE_CHANGE",[]);}}); \ No newline at end of file +$.extend({ + Class : function(def) { + function c(){ + if (typeof this.$super != 'undefined') this.$super.$this = this; + if ($.isFunction(this.$init)) this.$init.apply(this, arguments); + } + c.prototype = def; + c.constructor = c; + c.extend = Class_extend; + + return c; + }, + $ : function(id) { + if(typeof id == 'string') { + if (id.substring(0,1) == '<') return $(id).get(0); + return $('#'+id).get(0); + } else { + return id; + } + }, + fnBind : function(fn, th/* , args... */) { + var args = $.makeArray(arguments); + args.shift(); args.shift(); + + return function() { + var a = args.concat($.makeArray(arguments)); + + return fn.apply(th, a); + }; + } +}); + +$.browser.nVersion = parseFloat($.browser.version); + +function Class_extend(superDef) { + var Super = superDef.prototype; + + this.prototype.$super = {}; + + function bind(fn) { + return function() { + return fn.apply(this.$this, arguments); + }; + } + + for(var x in Super) { + if (!Super.propertyIsEnumerable(x)) continue; + + if (typeof this.prototype[x] == 'undefined') this.prototype[x] = Super[x]; + this.prototype.$super[x] = $.isFunction(Super[x])?bind(Super[x]):Super[x]; + } + + return this; +} + +})(jQuery); + +if (typeof window.xe == 'undefined') window.xe = {}; + +//{ + /** + * @fileOverview This file contains Xpress framework core + * @name XpressCore.js + */ +xe.XpressCore = jQuery.Class({ + name : "XpressCore", + + $init : function(htOptions){ + htOptions = !htOptions?{}:jQuery.Class({}).extend({ + oDebugger : null + }).extend(htOptions); + if(htOptions.oDebugger){ + this.oDebugger = htOptions.oDebugger; + this.oDebugger.oApp = this; + } + + // To prevent processing a Xpress command before all the plugins are registered and ready, + // Queue up all the commands here until the application's status is changed to READY + this.commandQueue = []; + + this.oCommandMap = {}; + this.oDisabledCommand = {}; + this.aPlugins = []; + + this.appStatus = xe.APP_STATUS["NOT_READY"]; + + // Register the core as a plugin so it can receive messages + this.registerPlugin(this); + }, + + exec : function(msg, args, oEvent){ + // If the application is not yet ready just queue the command + if(this.appStatus == xe.APP_STATUS["NOT_READY"]){ + this.commandQueue[this.commandQueue.length] = {'msg':msg, 'args':args, 'event':oEvent}; + return true; + } + + this.exec = this._exec; + this.exec(msg, args, oEvent); + }, + + delayedExec : function(msg, args, nDelay, oEvent){ + var fExec = jQuery.fnBind(this.exec, this, msg, args, oEvent); + setTimeout(fExec, nDelay); + }, + + _exec : function(msg, args, oEvent){return (this._exec = this.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this, msg, args, oEvent);}, + _execWithDebugger : function(msg, args, oEvent){this.oDebugger.log_MessageStart(msg, args);var bResult = this._doExec(msg, args, oEvent);this.oDebugger.log_MessageEnd(msg, args);return bResult; }, + _execWithoutDebugger : function(msg, args, oEvent){return this._doExec(msg, args, oEvent);}, + _doExec : function(msg, args, oEvent){ + var bContinue = false; + + if(!this.oDisabledCommand[msg]){ + var allArgs = []; + if(args && args.length){ + var iLen = args.length; + for(var i=0; i= 0 && xe.DOMFix.parentNode(aAllNodes[iChildIdx]) == aAllNodes[iCurIdx]){ + iChildIdx = this._recurConstructClonedTree(aAllNodes, iChildIdx, aAllNodes[iCurIdx], oCurNodeCloneWithChildren, oClonedStartContainer, oClonedEndContainer); + } + + // this may trigger an error message in IE when an erroneous script is inserted + oClonedParentNode.insertBefore(oCurNodeCloneWithChildren, oClonedParentNode.firstChild); + + return iChildIdx; + }; + + aNodes[aNodes.length] = xe.DOMFix.parentNode(aNodes[aNodes.length-1]); + _recurConstructClonedTree(aNodes, aNodes.length-1, aNodes[aNodes.length-1], oClonedParentNode); + + return {oStartContainer: oClonedStartContainer, oEndContainer: oClonedEndContainer}; + }, + + cloneRange : function(){ + return this._copyRange(new xe.W3CDOMRange(this._document)); + }, + + _copyRange : function(oClonedRange){ + oClonedRange.collapsed = this.collapsed; + oClonedRange.commonAncestorContainer = this.commonAncestorContainer; + oClonedRange.endContainer = this.endContainer; + oClonedRange.endOffset = this.endOffset; + oClonedRange.startContainer = this.startContainer; + oClonedRange.startOffset = this.startOffset; + oClonedRange._document = this._document; + + return oClonedRange; + }, + + collapse : function(toStart){ + if(toStart){ + this.endContainer = this.startContainer; + this.endOffset = this.startOffset; + }else{ + this.startContainer = this.endContainer; + this.startOffset = this.endOffset; + } + + this._updateRangeInfo(); + }, + + compareBoundaryPoints : function(how, sourceRange){ + switch(how){ + case xe.W3CDOMRange.START_TO_START: + return this._compareEndPoint(this.startContainer, this.startOffset, sourceRange.startContainer, sourceRange.startOffset); + case xe.W3CDOMRange.START_TO_END: + return this._compareEndPoint(this.endContainer, this.endOffset, sourceRange.startContainer, sourceRange.startOffset); + case xe.W3CDOMRange.END_TO_END: + return this._compareEndPoint(this.endContainer, this.endOffset, sourceRange.endContainer, sourceRange.endOffset); + case xe.W3CDOMRange.END_TO_START: + return this._compareEndPoint(this.startContainer, this.startOffset, sourceRange.endContainer, sourceRange.endOffset); + } + }, + + _findBody : function(oNode){ + if(!oNode) return null; + while(oNode){ + if(oNode.tagName == "BODY") return oNode; + oNode = xe.DOMFix.parentNode(oNode); + } + return null; + }, + + _compareEndPoint : function(oContainerA, iOffsetA, oContainerB, iOffsetB){ + var iIdxA, iIdxB; + + if(!oContainerA || this._findBody(oContainerA) != this._document.body){ + oContainerA = this._document.body; + iOffsetA = 0; + } + + if(!oContainerB || this._findBody(oContainerB) != this._document.body){ + oContainerB = this._document.body; + iOffsetB = 0; + } + + var compareIdx = function(iIdxA, iIdxB){ + // iIdxX == -1 when the node is the commonAncestorNode + // if iIdxA == -1 + // -> [[...]]... + // if iIdxB == -1 + // -> ...[[...]] + if(iIdxB == -1) iIdxB = iIdxA+1; + if(iIdxA < iIdxB) return -1; + if(iIdxA == iIdxB) return 0; + return 1; + }; + + var oCommonAncestor = this._getCommonAncestorContainer(oContainerA, oContainerB); + + // ================================================================================================================================================ + // Move up both containers so that both containers are direct child nodes of the common ancestor node. From there, just compare the offset + // Add 0.5 for each contaienrs that has "moved up" since the actual node is wrapped by 1 or more parent nodes and therefore its position is somewhere between idx & idx+1 + // NODE1

NODE2

NODE3
+ // The position of NODE2 in COMMON_ANCESTOR is somewhere between after NODE1(idx1) and before NODE3(idx2), so we let that be 1.5 + + // container node A in common ancestor container + var oNodeA = oContainerA; + if(oNodeA != oCommonAncestor){ + while((oTmpNode = xe.DOMFix.parentNode(oNodeA)) != oCommonAncestor){oNodeA = oTmpNode;} + + iIdxA = this._getPosIdx(oNodeA)+0.5; + }else iIdxA = iOffsetA; + + // container node B in common ancestor container + var oNodeB = oContainerB; + if(oNodeB != oCommonAncestor){ + while((oTmpNode = xe.DOMFix.parentNode(oNodeB)) != oCommonAncestor){oNodeB = oTmpNode;} + + iIdxB = this._getPosIdx(oNodeB)+0.5; + }else iIdxB = iOffsetB; + + return compareIdx(iIdxA, iIdxB); + }, + + _getCommonAncestorContainer : function(oNode1, oNode2){ + var oComparingNode = oNode2; + + while(oNode1){ + while(oComparingNode){ + if(oNode1 == oComparingNode) return oNode1; + oComparingNode = xe.DOMFix.parentNode(oComparingNode); + } + oComparingNode = oNode2; + oNode1 = xe.DOMFix.parentNode(oNode1); + } + + return this._document.body; + }, + + deleteContents : function(){ + if(this.collapsed) return; + + this._splitTextEndNodesOfTheRange(); + + var aNodes = this._getNodesInRange(); + + if(aNodes.length < 1) return; + + var oPrevNode = aNodes[0].previousSibling; + while(oPrevNode && this._isBlankTextNode(oPrevNode)) oPrevNode = oPrevNode.previousSibling; + + var oNewStartContainer, iNewOffset; + if(!oPrevNode){ + oNewStartContainer = xe.DOMFix.parentNode(aNodes[0]); + iNewOffset = 0; + } + + for(var i=0; i oNode.nodeValue.length) iOffset = oNode.nodeValue.length; + }else{ + if(iOffset > xe.DOMFix.childNodes(oNode).length) iOffset = xe.DOMFix.childNodes(oNode).length; + } + + return iOffset; + }, + + + setEnd : function(refNode, offset){ + offset = this._endsNodeValidation(refNode, offset); + + this.endContainer = refNode; + this.endOffset = offset; + if(!this.startContainer || this._compareEndPoint(this.startContainer, this.startOffset, this.endContainer, this.endOffset) != -1) this.collapse(false); + + this._updateRangeInfo(); + }, + + setEndAfter : function(refNode){ + if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter"); + + if(refNode.tagName == "BODY"){ + this.setEnd(refNode, xe.DOMFix.childNodes(refNode).length); + return; + } + this.setEnd(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)+1); + }, + + setEndBefore : function(refNode){ + if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore"); + + if(refNode.tagName == "BODY"){ + this.setEnd(refNode, 0); + return; + } + + this.setEnd(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)); + }, + + setStart : function(refNode, offset){ + offset = this._endsNodeValidation(refNode, offset); + + this.startContainer = refNode; + this.startOffset = offset; + + if(!this.endContainer || this._compareEndPoint(this.startContainer, this.startOffset, this.endContainer, this.endOffset) != -1) this.collapse(true); + this._updateRangeInfo(); + }, + + setStartAfter : function(refNode){ + if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter"); + + if(refNode.tagName == "BODY"){ + this.setStart(refNode, xe.DOMFix.childNodes(refNode).length); + return; + } + + this.setStart(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)+1); + }, + + setStartBefore : function(refNode){ + if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore"); + + if(refNode.tagName == "BODY"){ + this.setStart(refNode, 0); + return; + } + this.setStart(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)); + }, + + surroundContents : function(newParent){ + newParent.appendChild(this.extractContents()); + this.insertNode(newParent); + this.selectNode(newParent); + }, + + toString : function(){ + var oTmpContainer = this._document.createElement("DIV"); + oTmpContainer.appendChild(this.cloneContents()); + + return oTmpContainer.textContent || oTmpContainer.innerText || ""; + }, + + _isBlankTextNode : function(oNode){ + if(oNode.nodeType == 3 && oNode.nodeValue == "") return true; + return false; + }, + + _getPosIdx : function(refNode){ + var idx = 0; + for(var node = refNode.previousSibling; node; node = node.previousSibling) idx++; + + return idx; + }, + + _updateRangeInfo : function(){ + if(!this.startContainer){ + this.init(this._document); + return; + } + + this.collapsed = this._isCollapsed(this.startContainer, this.startOffset, this.endContainer, this.endOffset); + + this.commonAncestorContainer = this._getCommonAncestorContainer(this.startContainer, this.endContainer); + }, + + _isCollapsed : function(oStartContainer, iStartOffset, oEndContainer, iEndOffset){ + var bCollapsed = false; + + if(oStartContainer == oEndContainer && iStartOffset == iEndOffset){ + bCollapsed = true; + }else{ + var oActualStartNode = this._getActualStartNode(oStartContainer, iStartOffset); + var oActualEndNode = this._getActualEndNode(oEndContainer, iEndOffset); + + // Take the parent nodes on the same level for easier comparison when they're next to each other + // eg) From + // + // + // + // + // + // + // + // + // + // + // + // + // , it's easier to compare the position of B and D rather than C and F because they are siblings + // + // If the range were collapsed, oActualEndNode will precede oActualStartNode by doing this + oActualStartNode = this._getNextNode(this._getPrevNode(oActualStartNode)); + oActualEndNode = this._getPrevNode(this._getNextNode(oActualEndNode)); + + if(oActualStartNode && oActualEndNode && oActualEndNode.tagName != "BODY" && + (this._getNextNode(oActualEndNode) == oActualStartNode || (oActualEndNode == oActualStartNode && this._isBlankTextNode(oActualEndNode))) + ) + bCollapsed = true; + } + + return bCollapsed; + }, + + _splitTextEndNodesOfTheRange : function(){ + var oEndPoints = this._splitTextEndNodes({oStartContainer: this.startContainer, iStartOffset: this.startOffset, + oEndContainer: this.endContainer, iEndOffset: this.endOffset}); + + this.startContainer = oEndPoints.oStartContainer; + this.startOffset = oEndPoints.iStartOffset; + + this.endContainer = oEndPoints.oEndContainer; + this.endOffset = oEndPoints.iEndOffset; + }, + + _splitTextEndNodes : function(oEndPoints){ + oEndPoints = this._splitStartTextNode(oEndPoints); + oEndPoints = this._splitEndTextNode(oEndPoints); + + return oEndPoints; + }, + + _splitStartTextNode : function(oEndPoints){ + var oStartContainer = oEndPoints.oStartContainer; + var iStartOffset = oEndPoints.iStartOffset; + + var oEndContainer = oEndPoints.oEndContainer; + var iEndOffset = oEndPoints.iEndOffset; + + if(!oStartContainer) return oEndPoints; + if(oStartContainer.nodeType != 3) return oEndPoints; + if(iStartOffset == 0) return oEndPoints; + + if(oStartContainer.nodeValue.length <= iStartOffset) return oEndPoints; + + var oLastPart = oStartContainer.splitText(iStartOffset); + + if(oStartContainer == oEndContainer){ + iEndOffset -= iStartOffset; + oEndContainer = oLastPart; + } + oStartContainer = oLastPart; + iStartOffset = 0; + + return {oStartContainer: oStartContainer, iStartOffset: iStartOffset, oEndContainer: oEndContainer, iEndOffset: iEndOffset}; + }, + + _splitEndTextNode : function(oEndPoints){ + var oStartContainer = oEndPoints.oStartContainer; + var iStartOffset = oEndPoints.iStartOffset; + + var oEndContainer = oEndPoints.oEndContainer; + var iEndOffset = oEndPoints.iEndOffset; + + if(!oEndContainer) return oEndPoints; + if(oEndContainer.nodeType != 3) return oEndPoints; + + if(iEndOffset >= oEndContainer.nodeValue.length) return oEndPoints; + if(iEndOffset == 0) return oEndPoints; + + oEndContainer.splitText(iEndOffset); + + return {oStartContainer: oStartContainer, iStartOffset: iStartOffset, oEndContainer: oEndContainer, iEndOffset: iEndOffset}; + }, + + _getNodesInRange : function(){ + if(this.collapsed) return []; + + var oStartNode = this._getActualStartNode(this.startContainer, this.startOffset); + var oEndNode = this._getActualEndNode(this.endContainer, this.endOffset); + + return this._getNodesBetween(oStartNode, oEndNode); + }, + + _getActualStartNode : function(oStartContainer, iStartOffset){ + var oStartNode = oStartContainer;; + + if(oStartContainer.nodeType == 3){ + if(iStartOffset >= oStartContainer.nodeValue.length){ + oStartNode = this._getNextNode(oStartContainer); + if(oStartNode.tagName == "BODY") oStartNode = null; + }else{ + oStartNode = oStartContainer; + } + }else{ + if(iStartOffset < xe.DOMFix.childNodes(oStartContainer).length){ + oStartNode = xe.DOMFix.childNodes(oStartContainer)[iStartOffset]; + }else{ + oStartNode = this._getNextNode(oStartContainer); + if(oStartNode.tagName == "BODY") oStartNode = null; + } + } + + return oStartNode; + }, + + _getActualEndNode : function(oEndContainer, iEndOffset){ + var oEndNode = oEndContainer; + + if(iEndOffset == 0){ + oEndNode = this._getPrevNode(oEndContainer); + if(oEndNode.tagName == "BODY") oEndNode = null; + }else if(oEndContainer.nodeType == 3){ + oEndNode = oEndContainer; + }else{ + oEndNode = xe.DOMFix.childNodes(oEndContainer)[iEndOffset-1]; + } + + return oEndNode; + }, + + _getNextNode : function(oNode){ + if(!oNode || oNode.tagName == "BODY") return this._document.body; + + if(oNode.nextSibling) return oNode.nextSibling; + + return this._getNextNode(xe.DOMFix.parentNode(oNode)); + }, + + _getPrevNode : function(oNode){ + if(!oNode || oNode.tagName == "BODY") return this._document.body; + + if(oNode.previousSibling) return oNode.previousSibling; + + return this._getPrevNode(xe.DOMFix.parentNode(oNode)); + }, + + // includes partially selected + // for
, _getNodesBetween(b, c) will yield to b, "a" and c + _getNodesBetween : function(oStartNode, oEndNode){ + var aNodesBetween = []; + + if(!oStartNode || !oEndNode) return aNodesBetween; + + this._recurGetNextNodesUntil(oStartNode, oEndNode, aNodesBetween); + return aNodesBetween; + }, + + _recurGetNextNodesUntil : function(oNode, oEndNode, aNodesBetween){ + if(!oNode) return false; + + if(!this._recurGetChildNodesUntil(oNode, oEndNode, aNodesBetween)) return false; + + var oNextToChk = oNode.nextSibling; + + while(!oNextToChk){ + if(!xe.DOMFix.parentNode(oNode)) return false; + oNode = xe.DOMFix.parentNode(oNode); + + aNodesBetween[aNodesBetween.length] = oNode; + + if(oNode == oEndNode) return false; + + oNextToChk = oNode.nextSibling; + } + + return this._recurGetNextNodesUntil(oNextToChk, oEndNode, aNodesBetween); + }, + + _recurGetChildNodesUntil : function(oNode, oEndNode, aNodesBetween){ + if(!oNode) return false; + + var bEndFound = false; + var oCurNode = oNode; + if(oCurNode.firstChild){ + oCurNode = oCurNode.firstChild; + while(oCurNode){ + if(!this._recurGetChildNodesUntil(oCurNode, oEndNode, aNodesBetween)){ + bEndFound = true; + break; + } + oCurNode = oCurNode.nextSibling; + } + } + + aNodesBetween[aNodesBetween.length] = oNode; + + if(bEndFound) return false; + if(oNode == oEndNode) return false; + + return true; + } +}); + +xe.W3CDOMRange.START_TO_START = 0; +xe.W3CDOMRange.START_TO_END = 1; +xe.W3CDOMRange.END_TO_END = 2; +xe.W3CDOMRange.END_TO_START = 3; + + +/** + * @fileOverview This file contains a cross-browser function that implements all of the W3C's DOM Range specification and some more + * @name XpressRange.js + */ +xe.XpressRange = jQuery.Class({ + setWindow : function(win){ + this._window = win; + this._document = win.document; + }, + + $init : function(win){ + this.HUSKY_BOOMARK_START_ID_PREFIX = "xpress_bookmark_start_"; + this.HUSKY_BOOMARK_END_ID_PREFIX = "xpress_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(win); + + this.oSimpleSelection = new xe.SimpleSelection(this._window); + this.selectionLoaded = this.oSimpleSelection.selectionLoaded; + + this.$super.$init(this._document); + }, + + select : function(){ + this.oSimpleSelection.selectRange(this); + }, + + setFromSelection : function(iNum){ + this.setRange(this.oSimpleSelection.getRangeAt(iNum)); + }, + + setRange : function(oW3CRange){ + this.setStart(oW3CRange.startContainer, oW3CRange.startOffset); + this.setEnd(oW3CRange.endContainer, oW3CRange.endOffset); + }, + + setEndNodes : function(oSNode, oENode){ + this.setEndAfter(oENode); + this.setStartBefore(oSNode); + }, + + 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 >= xe.DOMFix.childNodes(this.startContainer).length) return this._getNextNode(this.startContainer); + return xe.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 xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]; + } + }, + + getNodeAroundRange : function(bBefore, bStrict){ + if(this.collapsed && this.startContainer && this.startContainer.nodeType == 3) return this.startContainer; + if(!this.collapsed || (this.startContainer && this.startContainer.nodeType == 3)) return this.getStartNode(); + + var oBeforeRange, oAfterRange, oResult; + + if(this.startOffset >= xe.DOMFix.childNodes(this.startContainer).length) + oAfterRange = this._getNextNode(this.startContainer); + else + oAfterRange = xe.DOMFix.childNodes(this.startContainer)[this.startOffset]; + + if(this.endOffset == 0) + oBeforeRange = this._getPrevNode(this.endContainer); + else + oBeforeRange = xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]; + + if(bBefore){ + oResult = oBeforeRange; + if(!oResult && !bStrict) oResult = oAfterRange; + }else{ + oResult = oAfterRange; + if(!oResult && !bStrict) oResult = oBeforeRange; + } + + return oResult; + }, + + _getXPath : function(elNode){ + var sXPath = ""; + + while(elNode && elNode.nodeType == 1){ + sXPath = "/" + elNode.tagName+"["+this._getPosIdx4XPath(elNode)+"]" + sXPath; + elNode = xe.DOMFix.parentNode(elNode); + } + + return sXPath; + }, + + _getPosIdx4XPath : function(refNode){ + var idx = 0; + for(var node = refNode.previousSibling; node; node = node.previousSibling) + if(node.tagName == refNode.tagName) idx++; + + return idx; + }, + + // this was written specifically for XPath Bookmark and it may not perform correctly for general purposes + _evaluateXPath : function(sXPath, oDoc){ + sXPath = sXPath.substring(1, sXPath.length-1); + var aXPath = sXPath.split(/\//); + var elNode = oDoc.body; + + for(var i=2; i -1 && elContainer){ + var aChildNodes = xe.DOMFix.childNodes(elContainer); + var elNode = null; + + var nIdx = nTextNodeIdx; + var nOffsetLeft = nOffset; + + while((elNode = aChildNodes[nIdx]) && elNode.nodeType == 3 && elNode.nodeValue.length < nOffsetLeft){ + nOffsetLeft -= elNode.nodeValue.length; + nIdx++; + } + + elContainer = xe.DOMFix.childNodes(elContainer)[nIdx]; + nOffset = nOffsetLeft; + } + + if(!elContainer){ + elContainer = this._document.body; + nOffset = 0; + } + return {elContainer: elContainer, nOffset: nOffset}; + }, + + // this was written specifically for XPath Bookmark and it may not perform correctly for general purposes + getXPathBookmark : function(){ + var nTextNodeIdx1 = -1; + var htEndPt1 = {elContainer: this.startContainer, nOffset: this.startOffset}; + var elNode1 = this.startContainer; + if(elNode1.nodeType == 3){ + htEndPt1 = this._getFixedStartTextNode(); + nTextNodeIdx1 = this._getPosIdx(htEndPt1.elContainer); + elNode1 = xe.DOMFix.parentNode(elNode1); + } + var sXPathNode1 = this._getXPath(elNode1); + var oBookmark1 = {sXPath:sXPathNode1, nTextNodeIdx:nTextNodeIdx1, nOffset: htEndPt1.nOffset}; + + var nTextNodeIdx2 = -1; + var htEndPt2 = {elContainer: this.endContainer, nOffset: this.endOffset}; + var elNode2 = this.endContainer; + if(elNode2.nodeType == 3){ + htEndPt2 = this._getFixedEndTextNode(); + nTextNodeIdx2 = this._getPosIdx(htEndPt2.elContainer); + elNode2 = xe.DOMFix.parentNode(elNode2); + } + var sXPathNode2 = this._getXPath(elNode2); + var oBookmark2 = {sXPath:sXPathNode2, nTextNodeIdx:nTextNodeIdx2, nOffset: htEndPt2.nOffset}; + + return [oBookmark1, oBookmark2]; + }, + + moveToXPathBookmark : function(aBookmark){ + if(!aBookmark) return; + + var oBookmarkInfo1 = this._evaluateXPathBookmark(aBookmark[0]); + var oBookmarkInfo2 = this._evaluateXPathBookmark(aBookmark[1]); + + if(!oBookmarkInfo1["elContainer"] || !oBookmarkInfo2["elContainer"]) return; + + this.startContainer = oBookmarkInfo1["elContainer"]; + this.startOffset = oBookmarkInfo1["nOffset"]; + + this.endContainer = oBookmarkInfo2["elContainer"]; + this.endOffset = oBookmarkInfo2["nOffset"]; + }, + + _getFixedTextContainer : function(elNode, nOffset){ + while(elNode && elNode.nodeType == 3 && elNode.previousSibling && elNode.previousSibling.nodeType == 3){ + nOffset += elNode.previousSibling.nodeValue.length; + elNode = elNode.previousSibling; + } + + return {elContainer:elNode, nOffset:nOffset}; + }, + + _getFixedStartTextNode : function(){ + return this._getFixedTextContainer(this.startContainer, this.startOffset); + }, + + _getFixedEndTextNode : function(){ + return this._getFixedTextContainer(this.endContainer, this.endOffset); + }, + + placeStringBookmark : function(){ + var sTmpId = (new Date()).getTime(); + + var oInsertionPoint = this.cloneRange(); + oInsertionPoint.collapseToEnd(); + var oEndMarker = this._document.createElement("A"); + oEndMarker.id = this.HUSKY_BOOMARK_END_ID_PREFIX+sTmpId; + oInsertionPoint.insertNode(oEndMarker); + + var oInsertionPoint = this.cloneRange(); + oInsertionPoint.collapseToStart(); + var oStartMarker = this._document.createElement("A"); + oStartMarker.id = this.HUSKY_BOOMARK_START_ID_PREFIX+sTmpId; + oInsertionPoint.insertNode(oStartMarker); + + this.moveToBookmark(sTmpId); + + return sTmpId; + }, + + cloneRange : function(){ + return this._copyRange(new xe.XpressRange(this._window)); + }, + + moveToBookmark : function(vBookmark){ + if(typeof(vBookmark) != "object") + this.moveToStringBookmark(vBookmark); + else + this.moveToXPathBookmark(vBookmark); + }, + + moveToStringBookmark : function(sBookmarkID){ + var oStartMarker = this._document.getElementById(this.HUSKY_BOOMARK_START_ID_PREFIX+sBookmarkID); + var oEndMarker = this._document.getElementById(this.HUSKY_BOOMARK_END_ID_PREFIX+sBookmarkID); + + if(!oStartMarker || !oEndMarker) return; + + this.setEndBefore(oEndMarker); + this.setStartAfter(oStartMarker); + }, + + removeStringBookmark : function(sBookmarkID){ + var oStartMarker = this._document.getElementById(this.HUSKY_BOOMARK_START_ID_PREFIX+sBookmarkID); + var oEndMarker = this._document.getElementById(this.HUSKY_BOOMARK_END_ID_PREFIX+sBookmarkID); + + if(oStartMarker) xe.DOMFix.parentNode(oStartMarker).removeChild(oStartMarker); + if(oEndMarker) xe.DOMFix.parentNode(oEndMarker).removeChild(oEndMarker); + }, + + collapseToStart : function(){ + this.collapse(true); + }, + + collapseToEnd : function(){ + this.collapse(false); + }, + + createAndInsertNode : function(sTagName){ + tmpNode = this._document.createElement(tagName); + this.insertNode(tmpNode) + return tmpNode + }, + + getNodes : function(bSplitTextEndNodes, fnFilter){ + if(bSplitTextEndNodes) this._splitTextEndNodesOfTheRange(); + + var aAllNodes = this._getNodesInRange(); + var aFilteredNodes = []; + + if(!fnFilter) return aAllNodes; + + for(var i=0; i= 0) return true; + + if(bIncludePartlyIncluded){ + if(startToEnd == 1) return false; + if(endToStart == -1) return false; + return true; + } + + return false; + }, + + isNodeInRange : function(oNode, bIncludePartlySelected, bContentOnly){ + var oTmpRange = new xe.XpressRange(this._window); + + if(bContentOnly && oNode.firstChild){ + oTmpRange.setStartBefore(oNode.firstChild); + oTmpRange.setEndAfter(oNode.lastChild); + }else{ + oTmpRange.selectNode(oNode); + } + + return isRangeInRange(oTmpRange, bIncludePartlySelected); + }, + + pasteHTML : function(sHTML){ + if(sHTML == ""){ + this.deleteContents(); + return; + } + + var oTmpDiv = this._document.createElement("DIV"); + oTmpDiv.innerHTML = sHTML; + + var oFirstNode = oTmpDiv.firstChild; + var oLastNode = oTmpDiv.lastChild; + + var clone = this.cloneRange(); + var sBM = clone.placeStringBookmark(); + + while(oTmpDiv.lastChild) this.insertNode(oTmpDiv.lastChild); + + this.setEndNodes(oFirstNode, oLastNode); + + // delete the content later as deleting it first may mass up the insertion point + // eg)

[A]BCD

---paste O---> O

BCD

+ clone.moveToBookmark(sBM); + clone.deleteContents(); + clone.removeStringBookmark(sBM); + }, + + toString : function(){ + this.toString = xe.W3CDOMRange.prototype.toString; + return this.toString(); + }, + + toHTMLString : function(){ + var oTmpContainer = this._document.createElement("DIV"); + oTmpContainer.appendChild(this.cloneContents()); + + return oTmpContainer.innerHTML; + }, + + findAncestorByTagName : function(sTagName){ + var oNode = this.commonAncestorContainer; + while(oNode && oNode.tagName != sTagName) oNode = xe.DOMFix.parentNode(oNode); + + return oNode; + }, + + selectNodeContents : function(oNode){ + if(!oNode) return; + + var oFirstNode = oNode.firstChild?oNode.firstChild:oNode; + var oLastNode = oNode.lastChild?oNode.lastChild:oNode; + + if(oFirstNode.nodeType == 3) + this.setStart(oFirstNode, 0); + else + this.setStartBefore(oFirstNode); + + if(oLastNode.nodeType == 3) + this.setEnd(oLastNode, oLastNode.nodeValue.length); + else + this.setEndAfter(oLastNode); + }, + + styleRange : function(oStyle, oAttribute, sNewSpanMarker){ + var aStyleParents = this._getStyleParentNodes(sNewSpanMarker); + if(aStyleParents.length < 1) return; + + var sName, sValue; + + for(var i=0; i= 0)){ + oSNode = this.getNodeAroundRange(false, true); + oENode = this.getNodeAroundRange(false, true); + oStart = this._getLineStartInfo(oSNode); + oEnd = this._getLineEndInfo(oENode); + } + + return {oStart: oStart, oEnd: oEnd}; + } +}).extend(xe.W3CDOMRange); + +/** + * @fileOverview This file contains cross-browser selection function + * @name SimpleSelection.js + */ +xe.SimpleSelection = function(win){ + this.init = function(win){ + this._window = win || window; + this._document = this._window.document; + }; + + this.init(win); + + if(jQuery.browser.msie) + xe.SimpleSelectionImpl_IE.apply(this); + else + xe.SimpleSelectionImpl_FF.apply(this); + + this.selectRange = function(oRng){ + this.selectNone(); + this.addRange(oRng); + }; + + this.selectionLoaded = true; + if(!this._oSelection) this.selectionLoaded = false; +}; + +xe.SimpleSelectionImpl_FF = function(){ + this._oSelection = this._window.getSelection(); + + this.getRangeAt = function(iNum){ + iNum = iNum || 0; + + try{ + var oFFRange = this._oSelection.getRangeAt(iNum); + }catch(e){return new xe.W3CDOMRange(this._document);} + + return this._FFRange2W3CRange(oFFRange); + }; + + this.addRange = function(oW3CRange){ + var oFFRange = this._W3CRange2FFRange(oW3CRange); + this._oSelection.addRange(oFFRange); + }; + + this.selectNone = function(){ + this._oSelection.removeAllRanges(); + }; + + this._FFRange2W3CRange = function(oFFRange){ + var oW3CRange = new xe.W3CDOMRange(this._document); + oW3CRange.setStart(oFFRange.startContainer, oFFRange.startOffset); + oW3CRange.setEnd(oFFRange.endContainer, oFFRange.endOffset); + return oW3CRange; + }; + + this._W3CRange2FFRange = function(oW3CRange){ + var oFFRange = this._document.createRange(); + oFFRange.setStart(oW3CRange.startContainer, oW3CRange.startOffset); + oFFRange.setEnd(oW3CRange.endContainer, oW3CRange.endOffset); + + return oFFRange; + }; +}; + +xe.SimpleSelectionImpl_IE = function(){ + this._oSelection = this._document.selection; + + this.getRangeAt = function(iNum){ + iNum = iNum || 0; + + if(this._oSelection.type == "Control"){ + var oW3CRange = new xe.W3CDOMRange(this._document); + + var oSelectedNode = this._oSelection.createRange().item(iNum); + + // if the selction occurs in a different document, ignore + if(!oSelectedNode || oSelectedNode.ownerDocument != this._document) return oW3CRange; + + oW3CRange.selectNode(oSelectedNode); + + return oW3CRange; + }else{ + var oSelectedNode = this._oSelection.createRangeCollection().item(iNum).parentElement(); + + // if the selction occurs in a different document, ignore + if(!oSelectedNode || oSelectedNode.ownerDocument != this._document){ + var oW3CRange = new xe.W3CDOMRange(this._document); + return oW3CRange; + } + return this._IERange2W3CRange(this._oSelection.createRangeCollection().item(iNum)); + } + }; + + this.addRange = function(oW3CRange){ + var oIERange = this._W3CRange2IERange(oW3CRange); + oIERange.select(); + }; + + this.selectNone = function(){ + this._oSelection.empty(); + }; + + this._W3CRange2IERange = function(oW3CRange){ + var oStartIERange = this._getIERangeAt(oW3CRange.startContainer, oW3CRange.startOffset); + var oEndIERange = this._getIERangeAt(oW3CRange.endContainer, oW3CRange.endOffset); + oStartIERange.setEndPoint("EndToEnd", oEndIERange); + + return oStartIERange; + }; + + this._getIERangeAt = function(oW3CContainer, iW3COffset){ + var oIERange = this._document.body.createTextRange(); + + var oEndPointInfoForIERange = this._getSelectableNodeAndOffsetForIE(oW3CContainer, iW3COffset); + + var oSelectableNode = oEndPointInfoForIERange.oSelectableNodeForIE; + var iIEOffset = oEndPointInfoForIERange.iOffsetForIE; + + oIERange.moveToElementText(oSelectableNode); + oIERange.collapse(oEndPointInfoForIERange.bCollapseToStart); + oIERange.moveStart("character", iIEOffset); + + return oIERange; + }; + + this._getSelectableNodeAndOffsetForIE = function(oW3CContainer, iW3COffset){ + var oIERange = this._document.body.createTextRange(); + + var oNonTextNode = null; + var aChildNodes = null; + var iNumOfLeftNodesToCount = 0; + + if(oW3CContainer.nodeType == 3){ + oNonTextNode = xe.DOMFix.parentNode(oW3CContainer); + aChildNodes = xe.DOMFix.childNodes(oNonTextNode); + iNumOfLeftNodesToCount = aChildNodes.length; + }else{ + oNonTextNode = oW3CContainer; + aChildNodes = xe.DOMFix.childNodes(oNonTextNode); + iNumOfLeftNodesToCount = iW3COffset; + } + + var oNodeTester = null; + + var iResultOffset = 0; + + var bCollapseToStart = true; + + for(var i=0; i=0) break; + + oPrevNonTextNode = aChildNodes[i]; + } + + var pointRangeIdx = i; + + if(pointRangeIdx != 0 && aChildNodes[pointRangeIdx-1].nodeType == 3){ + var oRgTextStart = this._document.body.createTextRange(); + var oCurTextNode = null; + if(oPrevNonTextNode){ + oRgTextStart.moveToElementText(oPrevNonTextNode); + oRgTextStart.collapse(false); + oCurTextNode = oPrevNonTextNode.nextSibling; + }else{ + oRgTextStart.moveToElementText(oContainer); + oRgTextStart.collapse(true); + oCurTextNode = oContainer.firstChild; + } + + var oRgTextsUpToThePoint = oRgOrigPoint.duplicate(); + oRgTextsUpToThePoint.setEndPoint("StartToStart", oRgTextStart); + + var textCount = oRgTextsUpToThePoint.text.length + + while(textCount > oCurTextNode.nodeValue.length && oCurTextNode.nextSibling){ + textCount -= oCurTextNode.nodeValue.length; + oCurTextNode = oCurTextNode.nextSibling; + } + + // this will enforce IE to re-reference oCurTextNode + var oTmp = oCurTextNode.nodeValue; + + if(bStartPt && oCurTextNode.nextSibling && oCurTextNode.nextSibling.nodeType == 3 && textCount == oCurTextNode.nodeValue.length){ + textCount -= oCurTextNode.nodeValue.length; + oCurTextNode = oCurTextNode.nextSibling; + } + + oContainer = oCurTextNode; + offset = textCount; + }else{ + oContainer = oRgOrigPoint.parentElement(); + offset = pointRangeIdx; + } + + return {"oContainer" : oContainer, "iOffset" : offset}; + }; +} + +xe.DOMFix = new (jQuery.Class({ + $init : function(){ + if(jQuery.browser.msie || jQuery.browser.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(elNode){ + return elNode.parentNode; + }, + + _parentNode_Fix : function(elNode){ + if(!elNode) return elNode; + + while(elNode.previousSibling){elNode = elNode.previousSibling;} + + return elNode.parentNode; + }, + + _childNodes_Native : function(elNode){ + return elNode.childNodes; + }, + + _childNodes_Fix : function(elNode){ + var aResult = null; + var nCount = 0; + + if(elNode){ + var aResult = []; + elNode = elNode.firstChild; + while(elNode){ + aResult[nCount++] = elNode; + elNode=elNode.nextSibling; + } + } + + return aResult; + } +}))(); +/** + * @fileOverview This file contains a function that takes care of various operations related to find and replace + * @name N_FindReplace.js + */ +xe.FindReplace = jQuery.Class({ + sKeyword : "", + window : null, + document : null, + bBrowserSupported : false, + + // true if End Of Contents is reached during last execution of find + bEOC : false, + + $init : function(win){ + this.window = win; + this.document = this.window.document; + + if(this.document.domain != this.document.location.hostname){ + if(jQuery.browser.mozilla && jQuery.browser.nVersion < 3){ + this.bBrowserSupported = false; + this.find = function(){return 3}; + return; + } + } + + this.bBrowserSupported = true; + }, + + // 0: found + // 1: not found + // 2: keyword required + // 3: browser not supported + find : function(sKeyword, bCaseMatch, bBackwards, bWholeWord){ + var bSearchResult, bFreshSearch; + + this.window.focus(); + + if(!sKeyword) return 2; + + // try find starting from current cursor position + this.bEOC = false; + bSearchResult = this.findNext(sKeyword, bCaseMatch, bBackwards, bWholeWord); + if(bSearchResult) return 0; + + // end of the contents could have been reached so search again from the beginning + this.bEOC = true; + bSearchResult = this.findNew(sKeyword, bCaseMatch, bBackwards, bWholeWord); + + if(bSearchResult) return 0; + + return 1; + }, + + findNew : function (sKeyword, bCaseMatch, bBackwards, bWholeWord){ + this.findReset(); + return this.findNext(sKeyword, bCaseMatch, bBackwards, bWholeWord); + }, + + findNext : function(sKeyword, bCaseMatch, bBackwards, bWholeWord){ + var bSearchResult; + bCaseMatch = bCaseMatch || false; + bWholeWord = bWholeWord || false; + bBackwards = bBackwards || false; + + if(this.window.find){ + var bWrapAround = false; + return this.window.find(sKeyword, bCaseMatch, bBackwards, bWrapAround, bWholeWord); + } + + // IE solution + if(this.document.body.createTextRange){ + var iOption = 0; + if(bBackwards) iOption += 1; + if(bWholeWord) iOption += 2; + if(bCaseMatch) iOption += 4; + + this.window.focus(); + this._range = this.document.selection.createRangeCollection().item(0); + this._range.collapse(false); + bSearchResult = this._range.findText(sKeyword, 1, iOption); + + this._range.select(); + return bSearchResult; + } + + return false; + }, + + findReset : function() { + if (this.window.find){ + this.window.getSelection().removeAllRanges(); + return; + } + + // IE solution + if(this.document.body.createTextRange){ + this._range = this.document.body.createTextRange(); + this._range.collapse(true); + this._range.select(); + } + }, + + // 0: replaced & next word found + // 1: replaced & next word not found + // 2: not replaced & next word found + // 3: not replaced & next word not found + // 4: sOriginalWord required + replace : function(sOriginalWord, Replacement, bCaseMatch, bBackwards, bWholeWord){ + if(!sOriginalWord) return 4; + + var oSelection = new xe.XpressRange(this.window); + oSelection.setFromSelection(); + + bCaseMatch = bCaseMatch || false; + var bMatch, selectedText = oSelection.toString(); + if(bCaseMatch) + bMatch = (selectedText == sOriginalWord); + else + bMatch = (selectedText.toLowerCase() == sOriginalWord.toLowerCase()); + + if(!bMatch) + return this.find(sOriginalWord, bCaseMatch, bBackwards, bWholeWord)+2; + + if(typeof Replacement == "function"){ + // the returned oSelection must contain the replacement + oSelection = Replacement(oSelection); + }else{ + oSelection.pasteHTML(Replacement); + } + + // force it to find the NEXT occurance of sOriginalWord + oSelection.select(); + + return this.find(sOriginalWord, bCaseMatch, bBackwards, bWholeWord); + }, + + // returns number of replaced words + // -1 : if original word is not given + replaceAll : function(sOriginalWord, Replacement, bCaseMatch, bWholeWord){ + if(!sOriginalWord) return -1; + + var bBackwards = false; + + var iReplaceResult; + var iResult = 0; + var win = this.window; + var oSelection = new xe.XpressRange(this.window); + oSelection.setFromSelection(); + var sBookmark = oSelection.placeStringBookmark(); + + this.bEOC = false; + while(!this.bEOC){ + iReplaceResult = this.replace(sOriginalWord, Replacement, bCaseMatch, bBackwards, bWholeWord); + if(iReplaceResult == 0 || iReplaceResult == 1) iResult++; + } + + var startingPointReached = function(){ + var oCurSelection = new xe.XpressRange(win); + oCurSelection.setFromSelection(); + + oSelection.moveToBookmark(sBookmark); + var pos = oSelection.compareBoundaryPoints(xe.W3CDOMRange.START_TO_END, oCurSelection); + + if(pos == 1) return false; + return true; + } + + iReplaceResult = 0; + this.bEOC = false; + while(!startingPointReached() && iReplaceResult == 0 && !this.bEOC){ + iReplaceResult = this.replace(sOriginalWord, Replacement, bCaseMatch, bBackwards, bWholeWord); + if(iReplaceResult == 0 || iReplaceResult == 1) iResult++; + } + + oSelection.moveToBookmark(sBookmark); + oSelection.select(); + oSelection.removeStringBookmark(sBookmark); + + return iResult; + } +}); + +/** + * @fileOverview This file contains a function that takes care of the draggable layers + * @name N_DraggableLayer.js + */ +xe.DraggableLayer = jQuery.Class({ + $init : function(oLayer, oOptions){ + this.oOptions = jQuery.extend({ + bModal : "false", + oHandle : oLayer, + iMinX : -999999, + iMinY : -999999, + iMaxX : 999999, + iMaxY : 999999 + }, oOptions); + + this.oHandle = this.oOptions.oHandle; + + oLayer.style.display = "block"; + oLayer.style.position = "absolute"; + oLayer.style.zIndex = "9999"; + + this.aBasePosition = this.getBaseOffset(oLayer); + + // "number-ize" the position and set it as inline style. (the position could've been set as "auto" or set by css, not inline style) + oLayer.style.top = (this.toInt(jQuery(oLayer).offset().top) - this.aBasePosition.top)+"px"; + oLayer.style.left = (this.toInt(jQuery(oLayer).offset().left) - this.aBasePosition.left)+"px"; + + this.$FnMouseDown = jQuery.fnBind(this._mousedown, this, oLayer); + this.$FnMouseMove = jQuery.fnBind(this._mousemove, this, oLayer); + this.$FnMouseUp = jQuery.fnBind(this._mouseup, this, oLayer); + + jQuery(this.oHandle).bind("mousedown", this.$FnMouseDown); + }, + + _mousedown : function(oLayer, oEvent){ + if(oEvent.target.tagName == "INPUT") return; + + this.MouseOffsetY = (oEvent.pageY-this.toInt(oLayer.style.top)-this.aBasePosition['top']); + this.MouseOffsetX = (oEvent.pageX-this.toInt(oLayer.style.left)-this.aBasePosition['left']); + + jQuery(oLayer).bind("mousemove", this.$FnMouseMove); + jQuery(oLayer).bind("mouseup", this.$FnMouseUp); + }, + + _mousemove : function(oLayer, oEvent){ + var iTop = (oEvent.pageY-this.MouseOffsetY-this.aBasePosition['top']); + var iLeft = (oEvent.pageX-this.MouseOffsetX-this.aBasePosition['left']); + + if(iTopthis.oOptions.iMaxY) iTop = this.oOptions.iMaxY; + + if(iLeftthis.oOptions.iMaxX) iLeft = this.oOptions.iMaxX; + + oLayer.style.top = iTop + "px"; + oLayer.style.left = iLeft + "px"; + }, + + _mouseup : function(oLayer, oEvent){ + jQuery(oLayer).unbind("mousemove", this.$FnMouseMove); + jQuery(oLayer).unbind("mouseup", this.$FnMouseUp); + }, + + toInt : function(num){ + var result = parseInt(num); + return result || 0; + }, + + findNonStatic : function(oEl){ + if(!oEl) return null; + if(oEl.tagName == "BODY") return oEl; + + if(jQuery(oEl).css("position").match(/absolute|relative/i)) return oEl; + + return this.findNonStatic(oEl.offsetParent); + }, + + getBaseOffset : function(oEl){ + var oBase = this.findNonStatic(oEl.offsetParent); + var tmp = jQuery(oBase).offset(); + + return {top: tmp.top, left: tmp.left}; + } +}); +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the messages related to core operations + * @name hp_CorePlugin.js + */ +xe.CorePlugin = jQuery.Class({ + name : "CorePlugin", + + $init : function(funcOnReady){ + this.funcOnReady = funcOnReady; + }, + + $AFTER_MSG_APP_READY : function(){ + this.oApp.exec("EXEC_ON_READY_FUNCTION", []); + }, + + $ON_ADD_APP_PROPERTY : function(sPropertyName, oProperty){ + this.oApp[sPropertyName] = oProperty; + }, + + $ON_REGISTER_BROWSER_EVENT : function(obj, sEvent, sCMD, aParams, nDelay){ + this.oApp.registerBrowserEvent(obj, sEvent, sCMD, aParams, nDelay); + }, + + $ON_DISABLE_COMMAND : function(sCommand){ + this.oApp.disableCommand(sCommand, true); + }, + + $ON_ENABLE_COMMAND : function(sCommand){ + this.oApp.disableCommand(sCommand, false); + }, + + $ON_EXEC_ON_READY_FUNCTION : function(){ + if(typeof this.funcOnReady == "function") this.funcOnReady(); + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that helps various operations. + * @name hp_Utils.js + */ + xe.Utils = jQuery.Class({ + name : "Utils", + + $init : function(){ + if(jQuery.browser.msie && jQuery.browser.nVersion == 6){ + try{ + document.execCommand('BackgroundImageCache', false, true); + }catch(e){} + } + }, + + $ON_ATTACH_HOVER_EVENTS : function(aElms, sHoverClass){ + sHoverClass = sHoverClass || "hover"; + + if(!aElms) return; + + jQuery(aElms).hover( + function(){jQuery(this).addClass(sHoverClass)}, + function(){jQuery(this).removeClass(sHoverClass)} + ); + } +}); +//} + +//{ +/** + * @fileOverview This file contains Xpress plugin that bridges the XpressRange function + * @name hp_XpressRangeManager.js + */ +xe.XpressRangeManager = jQuery.Class({ + name : "XpressRangeManager", + + oWindow : null, + + $init : function(win){ + this.oWindow = win || window; + }, + + $BEFORE_MSG_APP_READY : function(){ + if(this.oWindow && this.oWindow.tagName == "IFRAME") + this.oWindow = this.oWindow.contentWindow; + + this.oApp.exec("ADD_APP_PROPERTY", ["getSelection", jQuery.fnBind(this.getSelection, this)]); + this.oApp.exec("ADD_APP_PROPERTY", ["getEmptySelection", jQuery.fnBind(this.getEmptySelection, this)]); + }, + + $ON_SET_EDITING_WINDOW : function(oWindow){ + this.oWindow = oWindow; + }, + + getEmptySelection : function(){ + var oXpressRange = new xe.XpressRange(this.oWindow); + return oXpressRange; + }, + + getSelection : function(){ + this.oApp.exec("RESTORE_IE_SELECTION", []); + + var oXpressRange = this.getEmptySelection(); + + // this may throw an exception if the selected is area is not yet shown + try{ + oXpressRange.setFromSelection(); + }catch(e){} + + return oXpressRange; + } +}); +//} +xe.Hotkey = jQuery.Class({ + name : "Hotkey", + + storage : {}, + keyhash : {}, + + $init : function(){ + this.storage = {}; + + this.keyhash = { + backspace : 8, + tab : 9, + enter : 13, + shift : 16, + ctrl : 17, + alt : 18, + meta : 224, + esc : 27, + space : 32, + pageup : 33, + pagedown : 34, + end : 35, + home : 36, + left : 37, + up : 38, + right : 39, + down : 40, + del : 46, + comma : 188,//(,) + period : 190,//(.) + slash : 191,//(/) + hyphen : 109, + equal : 61 + }; + + if (jQuery.browser.msie || jQuery.browser.safari) { + this.keyhash.hyphen = 189; // (-) + this.keyhash.equal = 187; // (=) + this.keyhash.meta = 91; // meta + } + + + }, + + $ON_MSG_APP_READY : function(){ + jQuery(this.oApp.getWYSIWYGDocument() || document).keydown(jQuery.fnBind(this.keydown, this)); + }, + + $ON_REGISTER_HOTKEY : function(sHotkey, sCMD, sArgs){ + if(!sArgs) sArgs = []; + var func = jQuery.fnBind(this.oApp.exec, this.oApp, sCMD, sArgs); + + sHotkey = this.normalize(sHotkey); + if (!sHotkey) return false; + + this.add(sHotkey, func); + }, + + add : function(sHotkey, func) { + if (typeof this.storage[sHotkey] == 'undefined') { + this.storage[sHotkey] = [func]; + } else { + this.storage[sHotkey].push(func); + } + }, + + keydown : function(event) { + var key = [], kh = this.keyhash; + + if (jQuery.inArray(event.keyCode, [kh.shift, kh.ctrl, kh.alt, kh.meta]) >= 0) return; + + if (event.shiftKey) key.push('shift'); + if (event.altKey) key.push('alt'); + if (event.ctrlKey) key.push('ctrl'); + if (event.metaKey) key.push('meta'); + if (!key.length) return; + if (key.length == 1 && event.metaKey) key = ['ctrl', 'meta']; + + key.push(event.keyCode); + + key = key.join('+'); + + if (!this.storage[key]) return; + + jQuery.each(this.storage[key], function(){ this(); }); + + return false; + }, + + normalize : function(sHotkey) { + var shift, ctrl, alt, meta, key, keys = (sHotkey||"").toLowerCase().split('+'); + + shift = ctrl = alt = meta = key = false; + + jQuery.each(keys, function(){ + var s = ""+this; + switch(s) { + case 'shift': shift = true; + case 'alt' : alt = true; + case 'ctrl' : ctrl = true; + case 'meta' : meta = true; + default: + key = s; + } + }); + + if (!key) return ''; + + keys = []; + if (shift) keys.push('shift'); + if (alt) keys.push('alt'); + if (ctrl) keys.push('ctrl'); + if (meta || (ctrl && !shift && !alt)) keys.push('meta'); + + keys.push(this.keyhash[key] || key.toUpperCase().charCodeAt(0)); + + return keys.join('+'); + } +}); + +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the draggable layers + * @name hp_DialogLayerManager.js + */ +xe.DialogLayerManager = jQuery.Class({ + name : "DialogLayerManager", + aMadeDraggable : null, + aOpenedLayers : null, + + $init : function(){ + this.aMadeDraggable = []; + this.aOpenedLayers = []; + }, + + $ON_SHOW_DIALOG_LAYER : function(oLayer, bModal){ + oLayer = jQuery.$(oLayer); + bModal = jQuery.$(bModal) || false; + if(!oLayer) return; + + if(jQuery.inArray(oLayer, this.aOpenedLayers)) return; + + this.oApp.exec("POSITION_DIALOG_LAYER", [oLayer]); + + this.aOpenedLayers[this.aOpenedLayers.length] = oLayer; + + if(!jQuery.inArray(oLayer, this.aMadeDraggable)){ + new xe.DraggableLayer(oLayer, {bModal: bModal, iMinY: 0}); + this.aMadeDraggable[this.aMadeDraggable.length] = oLayer; + }else{ + oLayer.style.display = "block"; + } + }, + + $ON_HIDE_LAST_DIALOG_LAYER : function(){ + this.oApp.exec("HIDE_DIALOG_LAYER", [this.aOpenedLayers[this.aOpenedLayers.length-1]]); + }, + + $ON_HIDE_ALL_DIALOG_LAYER : function(){ + for(var i=this.aOpenedLayers.length-1; i>=0; i--) + this.oApp.exec("HIDE_DIALOG_LAYER", [this.aOpenedLayers[i]]); + }, + + $ON_HIDE_DIALOG_LAYER : function(oLayer){ + oLayer = jQuery.$(oLayer); + + if(oLayer) oLayer.style.display = "none"; + this.aOpenedLayers = jQuery.grep(this.aOpenedLayers, function(a){return a!=oLayer}); + }, + + $ON_SET_DIALOG_LAYER_POSITION : function(oLayer, iTop, iLeft){ + oLayer.style.top = iTop; + oLayer.style.left = iLeft; + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the layers that should disappear when the focus is lost + * @name hp_ActiveLayerManager.js + */ +xe.ActiveLayerManager = jQuery.Class({ + name : "ActiveLayerManager", + oCurrentLayer : null, + + $ON_TOGGLE_ACTIVE_LAYER : function(oLayer, sOnOpenCmd, aOnOpenParam, sOnCloseCmd, aOnCloseParam){ + if(oLayer == this.oCurrentLayer){ + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + }else{ + this.oApp.exec("SHOW_ACTIVE_LAYER", [oLayer, sOnCloseCmd, aOnCloseParam]); + if(sOnOpenCmd) this.oApp.exec(sOnOpenCmd, aOnOpenParam); + } + }, + + $ON_SHOW_ACTIVE_LAYER : function(oLayer, sOnCloseCmd, aOnCloseParam){ + oLayer = jQuery.$(oLayer); + this.sOnCloseCmd = sOnCloseCmd; + this.aOnCloseParam = aOnCloseParam; + + var oPrevLayer = this.oCurrentLayer; + + if(oLayer == oPrevLayer) return; + + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + + oLayer.style.display = "block"; + this.oCurrentLayer = oLayer; + }, + + $ON_HIDE_ACTIVE_LAYER : function(){ + var oLayer = this.oCurrentLayer; + if(!oLayer) return; + oLayer.style.display = "none"; + this.oCurrentLayer = null; + + if(this.sOnCloseCmd) + this.oApp.exec(this.sOnCloseCmd, this.aOnCloseParam); + }, + + // for backward compatibility only. + // use HIDE_ACTIVE_LAYER instead! + $ON_HIDE_CURRENT_ACTIVE_LAYER : function(){ + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + }, + + $ON_EVENT_EDITING_AREA_KEYDOWN : function(){ + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + }, + + $ON_EVENT_EDITING_AREA_MOUSEDOWN : function(){ + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to string conversion. Ususally used to convert the IR value. + * @name hp_StringConverterManager.js + */ +xe.StringConverterManager = jQuery.Class({ + name : "StringConverterManager", + + oConverters : null, + + $init : function(){ + this.oConverters = {}; + }, + + $BEFORE_MSG_APP_READY : function(){ + this.oApp.exec("ADD_APP_PROPERTY", ["applyConverter", jQuery.fnBind(this.applyConverter, this)]); + this.oApp.exec("ADD_APP_PROPERTY", ["addConverter", jQuery.fnBind(this.addConverter, this)]); + }, + + applyConverter : function(sRuleName, sContent){ + var aConverters = this.oConverters[sRuleName]; + if(!aConverters) return sContent; + + for(var i=0; i*:first-child", aAllLi[i]).get(0); + } + } + }, + + $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.exec("ADD_APP_PROPERTY", ["getToolbarButtonByUIName", jQuery.fnBind(this.getToolbarButtonByUIName, this)]); + }, + + $ON_EVENT_TOOLBAR_MOUSEOVER : function(weEvent){ + if(weEvent.target.tagName == "BUTTON") jQuery(weEvent.target).addClass("hover").parent("span").addClass("hover"); + }, + + $ON_EVENT_TOOLBAR_MOUSEOUT : function(weEvent){ + if(weEvent.target.tagName == "BUTTON") jQuery(weEvent.target).removeClass("hover").parent("span").removeClass("hover"); + }, + + $ON_TOGGLE_TOOLBAR_ACTIVE_LAYER : function(oLayer, oBtn, sOpenCmd, aOpenArgs, sCloseCmd, aCloseArgs){ + this.oApp.exec("TOGGLE_ACTIVE_LAYER", [oLayer, "MSG_TOOLBAR_LAYER_SHOWN", [oLayer, oBtn, sOpenCmd, aOpenArgs], sCloseCmd, aCloseArgs]); + }, + + $ON_MSG_TOOLBAR_LAYER_SHOWN : function(oLayer, oBtn, aOpenCmd, aOpenArgs){ + this.oApp.exec("POSITION_TOOLBAR_LAYER", [oLayer, oBtn]); + if(aOpenCmd) this.oApp.exec(aOpenCmd, aOpenArgs); + }, + + $ON_SHOW_TOOLBAR_ACTIVE_LAYER : function(oLayer, sCmd, aArgs, oBtn){ + this.oApp.exec("SHOW_ACTIVE_LAYER", [oLayer, sCmd, aArgs]); + this.oApp.exec("POSITION_TOOLBAR_LAYER", [oLayer, oBtn]); + }, + + $ON_ENABLE_UI : function(sUIName){ + var elUI = this.htUIList[sUIName]; + if(!elUI) return; + jQuery(elUI).removeClass("off"); + elUI.disabled = false; + + // enable related commands + var sCmd = ""; + if(this.aUICmdMap[sUIName]){ + for(var i=0; i nToolbarLeft) oLayer.style.left = (nToolbarLeft-nLayerLeft-5)+"px"; + }, + + getToolbarButtonByUIName : function(sUIName){ + return this.htUIList[sUIName]; + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that manages multiple number editing area plugins and the IR value + * @name hp_XE_EditingAreaManager.js + */ +xe.XE_EditingAreaManager = jQuery.Class({ + name : "XE_EditingAreaManager", + + // Currently active plugin instance(XE_EditingArea_???) + oActivePlugin : null, + + // Intermediate Representation of the content being edited. + // This should be a textarea element. + oIRField : null, + + bIsDirty : false, + + $init : function(sInitialMode, oIRField, oDimension, fOnBeforeUnload, oAppContainer){ + this.sInitialMode = sInitialMode; + this.oIRField = jQuery.$(oIRField); + this._assignHTMLObjects(oAppContainer); + this.fOnBeforeUnload = fOnBeforeUnload; + + this.oEditingMode = {}; + + this.elEditingAreaContainer.style.height = parseInt(oDimension.nHeight || this.elEditingAreaContainer.offsetHeight)+"px"; + + this.nMinHeight = oDimension.nMinHeight || 10; + this.niMinWidth = oDimension.nMinWidth || 10; + }, + + _assignHTMLObjects : function(oAppContainer){ + oAppContainer = jQuery.$(oAppContainer) || document; + this.elEditingAreaContainer = jQuery("DIV.xpress_xeditor_editing_area_container", oAppContainer).get(0); + this.elEditingAreaSkipUI = jQuery("A.skip", oAppContainer).get(0); + }, + + $BEFORE_MSG_APP_READY : function(msg){ + this.oApp.exec("ADD_APP_PROPERTY", ["elEditingAreaContainer", this.elEditingAreaContainer]); + this.oApp.exec("ADD_APP_PROPERTY", ["getIR", jQuery.fnBind(this.getIR, this)]); + this.oApp.exec("ADD_APP_PROPERTY", ["setIR", this.setIR]); + this.oApp.exec("ADD_APP_PROPERTY", ["getEditingMode", jQuery.fnBind(this.getEditingMode, this)]); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.exec("CHANGE_EDITING_MODE", [this.sInitialMode, true]); + this.oApp.exec("LOAD_IR_FIELD", [false]); + + this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI, "focus", "MSG_EDITING_AREA_SIZE_CHANGED", [], 50); + this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI, "blur", "MSG_EDITING_AREA_SIZE_CHANGED", [], 50); + + var fOnBeforeUnload = this.fOnBeforeUnload||function(){if(this.getIR() != this.oIRField.value || this.bIsDirty) return this.oApp.$MSG("XE_EditingAreaManager.onExit")}; + jQuery(window).bind("beforeunload", jQuery.fnBind(fOnBeforeUnload, this)); + }, + + $AFTER_MSG_APP_READY : function(){ + this.oApp.exec("UPDATE_IR_FIELD", []); + }, + + $ON_LOAD_IR_FIELD : function(bDontAddUndo){ + this.oApp.setIR(this.oIRField.value, bDontAddUndo); + }, + + $ON_UPDATE_IR_FIELD : function(){ + this.oIRField.value = this.oApp.getIR(); + }, + + $BEFORE_CHANGE_EDITING_MODE : function(sMode){ + this._oPrevActivePlugin = this.oActivePlugin; + this.oActivePlugin = this.oEditingMode[sMode]; + }, + + $AFTER_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ + if(this._oPrevActivePlugin){ + var sIR = this._oPrevActivePlugin.getIR(); + this.oApp.exec("SET_IR", [sIR]); + + this.oApp.exec("ENABLE_UI", [this._oPrevActivePlugin.sMode]); + + this._setEditingAreaDimension(); + } + this.oApp.exec("DISABLE_UI", [this.oActivePlugin.sMode]); + + if(!bNoFocus){ + this.oApp.exec("FOCUS", []); + } + }, + + $ON_SET_IS_DIRTY : function(bIsDirty){ + this.bIsDirty = bIsDirty; + }, + + $ON_FOCUS : function(){ + if(!this.oActivePlugin || typeof this.oActivePlugin.setIR != "function") return + + this.oActivePlugin.focus(); + }, + + $BEFORE_SET_IR : function(sIR, bDontAddUndoHistory){ + bDontAddUndoHistory = bDontAddUndoHistory || false; + if(!bDontAddUndoHistory) this.oApp.exec("RECORD_UNDO_ACTION", ["SET CONTENTS"]); + }, + + $ON_SET_IR : function(sIR){ + if(!this.oActivePlugin || typeof this.oActivePlugin.setIR != "function") return + + this.oActivePlugin.setIR(sIR); + }, + + $AFTER_SET_IR : function(sIR, bDontAddUndoHistory){ + bDontAddUndoHistory = bDontAddUndoHistory || false; + if(!bDontAddUndoHistory) this.oApp.exec("RECORD_UNDO_ACTION", ["SET CONTENTS"]); + }, + + $ON_REGISTER_EDITING_AREA : function(oEditingAreaPlugin){ + this.oEditingMode[oEditingAreaPlugin.sMode] = oEditingAreaPlugin; + this.attachDocumentEvents(oEditingAreaPlugin.oEditingArea); + }, + + $ON_MSG_EDITING_AREA_RESIZE_STARTED : function(){ + this.oActivePlugin.elEditingArea.style.display = "none"; + + this.iStartingHeight = parseInt(this.elEditingAreaContainer.style.height); + }, + + $ON_RESIZE_EDITING_AREA: function(ipNewWidth, ipNewHeight){ + var iNewWidth = parseInt(ipNewWidth); + var iNewHeight = parseInt(ipNewHeight); + + if(iNewWidth < this.niMinWidth) iNewWidth = this.niMinWidth; + if(iNewHeight < this.nMinHeight) iNewHeight = this.nMinHeight; + + if(ipNewWidth) this.elEditingAreaContainer.style.width = iNewWidth + "px"; + if(ipNewHeight) this.elEditingAreaContainer.style.height = iNewHeight + "px"; + }, + + $ON_RESIZE_EDITING_AREA_BY : function(ipWidthChange, ipHeightChange){ + var iWidthChange = parseInt(ipWidthChange); + var iHeightChange = parseInt(ipHeightChange); + + var iWidth = this.elEditingAreaContainer.style.width?parseInt(this.elEditingAreaContainer.style.width)+iWidthChange:null; + var iHeight = this.elEditingAreaContainer.style.height?this.iStartingHeight+iHeightChange:null; + + this.oApp.exec("RESIZE_EDITING_AREA", [iWidth, iHeight]); + }, + + $ON_MSG_EDITING_AREA_RESIZE_ENDED : function(FnMouseDown, FnMouseMove, FnMouseUp){ + this.oActivePlugin.elEditingArea.style.display = "block"; + this._setEditingAreaDimension(); + }, + + _setEditingAreaDimension : function(){ + this.oActivePlugin.elEditingArea.style.height = this.elEditingAreaContainer.style.height; + this.oActivePlugin.elEditingArea.style.width = this.elEditingAreaContainer.style.width; + }, + + attachDocumentEvents : function(doc){ + this.oApp.registerBrowserEvent(doc, "click", "EVENT_EDITING_AREA_CLICK"); + this.oApp.registerBrowserEvent(doc, "mousedown", "EVENT_EDITING_AREA_MOUSEDOWN"); + this.oApp.registerBrowserEvent(doc, "mousemove", "EVENT_EDITING_AREA_MOUSEMOVE"); + this.oApp.registerBrowserEvent(doc, "mouseup", "EVENT_EDITING_AREA_MOUSEUP"); + this.oApp.registerBrowserEvent(doc, "keydown", "EVENT_EDITING_AREA_KEYDOWN"); + this.oApp.registerBrowserEvent(doc, "keypress", "EVENT_EDITING_AREA_KEYPRESS"); + this.oApp.registerBrowserEvent(doc, "keyup", "EVENT_EDITING_AREA_KEYUP"); + }, + + getIR : function(){ + return this.oActivePlugin.getIR(); + }, + + setIR : function(sIR, bDontAddUndo){ + this.oApp.exec("SET_IR", [sIR, bDontAddUndo]); + }, + + getEditingMode : function(){ + return this.oActivePlugin.sMode; + } +}); +//} + +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations directly related to editing the HTML source code using Textarea element + * @name hp_XE_EditingArea_HTMLSrc.js + * @required XE_EditingAreaManager + */ +xe.XE_EditingArea_HTMLSrc = jQuery.Class({ + name : "XE_EditingArea_HTMLSrc", + + sMode : "HTMLSrc", + textarea : null, + + $init : function(textarea){ + this.textarea = jQuery.$(textarea); + this.elEditingArea = this.textarea; + }, + + $BEFORE_MSG_APP_READY : function(){ + this.oEditingArea = this.textarea; + this.oApp.exec("REGISTER_EDITING_AREA", [this]); + }, + + $ON_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ + if(sMode == this.sMode){ + this.textarea.style.display = "block"; + }else{ + this.textarea.style.display = "none"; + } + }, + + $ON_PASTE_HTML : function(sHTML, oPSelection){ + if(this.oApp.getEditingMode() != this.sMode) return; + + var o = new TextRange(this.textarea); + o.paste(sHTML); + this.textarea.focus(); + }, + + getIR : function(){ + var sIR; + var sContent = this.textarea.value; + + if(this.oApp.applyConverter) + sIR = this.oApp.applyConverter(this.sMode+"_TO_IR", sContent); + else + sIR = sContent; + + return sIR; + }, + + setIR : function(sIR){ + var sContent; + + if(this.oApp.applyConverter) + sContent = this.oApp.applyConverter("IR_TO_"+this.sMode, sIR); + else + sContent = sIR; + + this.textarea.value = sContent; + }, + + focus : function(){ + this.textarea.focus(); + } +}); + +var TextRange = function(oEl) { + this._o = oEl; +}; + +/** + * Selection for textfield + * + * @author hooriza + */ +TextRange.prototype.getSelection = function() { + var obj = this._o; + var ret = [ -1, -1 ]; + + if (isNaN(this._o.selectionStart)) { + obj.focus(); + + // textarea support added by nagoon97 + var range = document.body.createTextRange(); + var rangeField = null; + + rangeField = document.selection.createRange().duplicate(); + range.moveToElementText(obj); + rangeField.collapse(true); + range.setEndPoint("EndToEnd", rangeField); + ret[0] = range.text.length; + + rangeField = document.selection.createRange().duplicate(); + range.moveToElementText(obj); + rangeField.collapse(false); + range.setEndPoint("EndToEnd", rangeField); + ret[1] = range.text.length; + + obj.blur(); + } else { + ret[0] = obj.selectionStart; + ret[1] = obj.selectionEnd; + } + + return ret; +}; + +TextRange.prototype.setSelection = function(start, end) { + + var obj = this._o; + if (typeof end == 'undefined') end = start; + + if (obj.setSelectionRange) { + + obj.setSelectionRange(start, end); + + } else if (obj.createTextRange) { + + var range = obj.createTextRange(); + + range.collapse(true); + range.moveStart("character", start); + range.moveEnd("character", end - start); + range.select(); + + obj.blur(); + } + +}; + +TextRange.prototype.copy = function() { + + var r = this.getSelection(); + return this._o.value.substring(r[0], r[1]); + +}; + +TextRange.prototype.paste = function(sStr) { + + var obj = this._o; + var sel = this.getSelection(); + + var value = obj.value; + + var pre = value.substr(0, sel[0]); + var post = value.substr(sel[1]); + + value = pre + sStr + post; + obj.value = value; + + var n = 0; + if ( typeof document.body.style.maxHeight == "undefined" ) { + var a = pre.match( /\n/gi ); + n = ( a != null ? a.length : 0 ); + } + this.setSelection(sel[0] + sStr.length - n ); + +}; + +TextRange.prototype.cut = function() { + var r = this.copy(); + this.paste(''); + + return r; +}; +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations directly related to WYSIWYG iframe + * @name hp_XE_EditingArea_WYSIWYG.js + */ +xe.XE_EditingArea_WYSIWYG = jQuery.Class({ + name : "XE_EditingArea_WYSIWYG", + status : xe.PLUGIN_STATUS["NOT_READY"], + + sMode : "WYSIWYG", + iframe : null, + doc : null, + + iLastUndoRecorded : 0, + iMinUndoInterval : 3000, + + _nIFrameReadyCount : 50, + + $init : function(iframe){ + this.iframe = jQuery.$(iframe); + + this.initIframe(); + + this.elEditingArea = iframe; + }, + + $BEFORE_MSG_APP_READY : function(){ + this.oEditingArea = this.doc; + this.oApp.exec("REGISTER_EDITING_AREA", [this]); + this.oApp.exec("ADD_APP_PROPERTY", ["getWYSIWYGWindow", jQuery.fnBind(this.getWindow, this)]); + this.oApp.exec("ADD_APP_PROPERTY", ["getWYSIWYGDocument", jQuery.fnBind(this.getDocument, this)]); + }, + + $ON_MSG_APP_READY : function(){ + // uncomment this line if you wish to use the IE-style cursor in FF + // this.getDocument().body.style.cursor = "text"; + + if(jQuery.browser.msie){ + jQuery(this.doc).bind('keydown', jQuery.fnBind( + function(weEvent){ + if(this.doc.selection.type.toLowerCase() == 'control' && weEvent.keyCode == 8) { + this.oApp.exec("EXECCOMMAND", ['delete', false, false]); + weEvent.preventDefault(); weEvent.stopPropagation(); + } + } + , this)); + jQuery(this.doc.body).bind('mousedown', jQuery.fnBind( + function(weEvent){ + this._oIERange = null; + this._bIERangeReset = true; + } + , this)); + jQuery(this.doc.body).bind('beforedeactivate', jQuery.fnBind( + function(weEvent){ + // without this, cursor won't make it inside a table. + // mousedown(_oIERange gets reset) -> beforedeactivate(gets fired for table) -> RESTORE_IE_SELECTION + if(this._bIERangeReset) return; + + var tmpRange = this.getDocument().selection.createRange(0); + // Control range does not have parentElement + if(tmpRange.parentElement && tmpRange.parentElement() && tmpRange.parentElement().tagName == "INPUT"){ + this._oIERange = this._oPrevIERange; + }else{ + this._oIERange = tmpRange; + } + } + , this)); + jQuery(this.doc.body).bind('mouseup', jQuery.fnBind( + function(weEvent){ + this._bIERangeReset = false; + } + , this)); + } + }, + + $ON_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ + if(sMode == this.sMode){ + this.iframe.style.display = "block"; + + this.oApp.exec("REFRESH_WYSIWYG", []); + this.oApp.exec("SET_EDITING_WINDOW", [this.getWindow()]); + }else{ + this.iframe.style.display = "none"; + } + }, + + $AFTER_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ + this._oIERange = null; + }, + + $ON_REFRESH_WYSIWYG : function(){ + if(!jQuery.browser.mozilla) return; + + this._disableWYSIWYG(); + this._enableWYSIWYG(); + }, + + $ON_ENABLE_WYSIWYG : function(){ + this._enableWYSIWYG(); + }, + + $ON_DISABLE_WYSIWYG : function(){ + this._disableWYSIWYG(); + }, + + $ON_EVENT_EDITING_AREA_KEYUP : function(oEvent){ + // 33, 34: page up/down, 35,36: end/home, 37,38,39,40: left, up, right, down + if(oEvent.keyCode == 229 || oEvent.keyCode == 13 || oEvent.altKey || oEvent.ctrlKey || (oEvent.keyCode >= 33 && oEvent.keyCode <= 40) || oEvent.keyCode == 16) return; + this._recordUndo(oEvent); + }, + + $ON_PASTE_HTML : function(sHTML, oPSelection){ + if(this.oApp.getEditingMode() != this.sMode) return; + + var oSelection = oPSelection || this.oApp.getSelection(); + oSelection.pasteHTML(sHTML); + + // every browser except for IE may modify the innerHTML when it is inserted + if(!jQuery.browser.msie){ + var sTmpBookmark = oSelection.placeStringBookmark(); + this.oApp.getWYSIWYGDocument().body.innerHTML = this.oApp.getWYSIWYGDocument().body.innerHTML; + oSelection.moveToBookmark(sTmpBookmark); + oSelection.collapseToEnd(); + oSelection.select(); + oSelection.removeStringBookmark(sTmpBookmark); + } + + this.oApp.exec("RECORD_UNDO_ACTION", ["INSERT HTML"]); + }, + + $AFTER_MSG_EDITING_AREA_RESIZE_ENDED : function(FnMouseDown, FnMouseMove, FnMouseUp){ + this.oApp.exec("REFRESH_WYSIWYG", []); + }, + + $ON_RESTORE_IE_SELECTION : function(){ + if(this._oIERange){ + this._oIERange.select(); + this._oPrevIERange = this._oIERange; + this._oIERange = null; + } + }, + + initIframe : function(){ + try { + this.doc = this.iframe.contentWindow.document; + if (this.doc == null || this.doc.location.href == 'about:blank') { + throw new Error('Access denied'); + } + + this._enableWYSIWYG(); + + this.status = xe.PLUGIN_STATUS["READY"]; + } catch(e) { + if(this._nIFrameReadyCount-- > 0){ + setTimeout(jQuery.fnBind(this.initIframe, this), 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 sContent = this.doc.body.innerHTML; + var sIR; + + if(this.oApp.applyConverter) + sIR = this.oApp.applyConverter(this.sMode+"_TO_IR", sContent); + else + sIR = sContent; + + return sIR; + }, + + setIR : function(sIR){ + var sContent; + if(this.oApp.applyConverter) + sContent = this.oApp.applyConverter("IR_TO_"+this.sMode, sIR); + else + sContent = sIR; + + this.doc.body.innerHTML = sContent; + + if(jQuery.browser.mozilla){ + if(this.doc.body.innerHTML == "") this.doc.body.innerHTML = "
"; + } + }, + + getWindow : function(){ + return this.iframe.contentWindow; + }, + + getDocument : function(){ + return this.iframe.contentWindow.document; + }, + + focus : function(){ + //this.getWindow().focus(); + //this.oApp.exec("RESTORE_IE_SELECTION", []); + }, + + _recordUndo : function(oKeyInfo){ + var curTime = new Date(); + if(curTime-this.iLastUndoRecorded < this.iMinUndoInterval) return; + this.oApp.exec("RECORD_UNDO_ACTION", ["KEYPRESS"]); + + this.iLastUndoRecorded = new Date(); + + this.prevKeyCode = oKeyInfo.keyCode; + }, + + _enableWYSIWYG : function(){ + if (jQuery.browser.msie){ + var fake = jQuery(''); + jQuery(document.body).prepend(fake); + fake.focus(); + + this.doc.body.contentEditable = true; + + setTimeout(function(){fake.remove()}, 100); + } else { + this.doc.designMode = "on"; + } + }, + + _disableWYSIWYG : function(){ + if (jQuery.browser.msie){ + this.doc.body.contentEditable = false; + } else { + this.doc.designMode = "off"; + } + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to resizing the editing area vertically + * @name hp_XE_EditingAreaVerticalResizer.js + */ +xe.XE_EditingAreaVerticalResizer = jQuery.Class({ + name : "XE_EditingAreaVerticalResizer", + oResizeGrip : null, + + $init : function(oAppContainer){ + this._assignHTMLObjects(oAppContainer); + + this.$FnMouseDown = jQuery.fnBind(this._mousedown, this); + this.$FnMouseMove = jQuery.fnBind(this._mousemove, this); + this.$FnMouseUp = jQuery.fnBind(this._mouseup, this); + + jQuery(this.oResizeGrip).bind("mousedown", this.$FnMouseDown); + }, + + _assignHTMLObjects : function(oAppContainer){ + oAppContainer = jQuery.$(oAppContainer) || document; + + this.oResizeGrip = jQuery(".xpress_xeditor_editingArea_verticalResizer", oAppContainer).get(0); + }, + + _mousedown : function(oEvent){ + this.iStartHeight = oEvent.clientY; + + jQuery(document).bind("mousemove", this.$FnMouseMove); + jQuery(document).bind("mouseup", this.$FnMouseUp); + + this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]); + }, + + _mousemove : function(oEvent){ + var iHeightChange = oEvent.clientY - this.iStartHeight; + + this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, iHeightChange]); + }, + + _mouseup : function(oEvent){ + jQuery(document).unbind("mousemove", this.$FnMouseMove); + jQuery(document).unbind("mouseup", this.$FnMouseUp); + + this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]); + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the basic editor commands + * @name hp_XE_ExecCommand.js + */ +xe.XE_ExecCommand = jQuery.Class({ + name : "XE_ExecCommand", + oEditingArea : null, + + $init : function(oEditingArea){ + this.oEditingArea = oEditingArea; + }, + + $BEFORE_MSG_APP_READY : function(){ + // the right document will be available only when the src is completely loaded + if(this.oEditingArea && this.oEditingArea.tagName == "IFRAME") + this.oEditingArea = this.oEditingArea.contentWindow.document; + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+b", "EXECCOMMAND", ["bold", false, false]]); + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+u", "EXECCOMMAND", ["underline", false, false]]); + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+i", "EXECCOMMAND", ["italic", false, false]]); + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+d", "EXECCOMMAND", ["strikethrough", false, false]]); + + this.oApp.exec("REGISTER_UI_EVENT", ["bold", "click", "EXECCOMMAND", ["bold", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["underline", "click", "EXECCOMMAND", ["underline", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["italic", "click", "EXECCOMMAND", ["italic", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["lineThrough", "click", "EXECCOMMAND", ["strikethrough", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["superscript", "click", "EXECCOMMAND", ["superscript", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["subscript", "click", "EXECCOMMAND", ["subscript", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["justifyleft", "click", "EXECCOMMAND", ["justifyleft", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["justifycenter", "click", "EXECCOMMAND", ["justifycenter", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["justifyright", "click", "EXECCOMMAND", ["justifyright", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["justifyfull", "click", "EXECCOMMAND", ["justifyfull", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["orderedlist", "click", "EXECCOMMAND", ["insertorderedlist", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["unorderedlist", "click", "EXECCOMMAND", ["insertunorderedlist", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["outdent", "click", "EXECCOMMAND", ["outdent", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["indent", "click", "EXECCOMMAND", ["indent", false, false]]); + }, + + $BEFORE_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ + this._bOnlyCursorChanged = false; + + this.oApp.exec("FOCUS", []); + + if(sCommand.match(/^bold|underline|italic|strikethrough|superscript|subscript$/i)){ + var oSelection = this.oApp.getSelection(); + if(oSelection.collapsed) this._bOnlyCursorChanged = true; + } + + if(!this._bOnlyCursorChanged){ + this.oApp.exec("RECORD_UNDO_BEFORE_ACTION", [sCommand]); + } + }, + + $ON_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ + bUserInterface = (bUserInterface == "" || bUserInterface)?bUserInterface:false; + vValue = (vValue == "" || vValue)?vValue:false; + + this.oEditingArea.execCommand(sCommand, bUserInterface, vValue); + }, + + $AFTER_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ + if(!this._bOnlyCursorChanged){ + this.oApp.exec("RECORD_UNDO_AFTER_ACTION", [sCommand]); + } + + this.oApp.exec("CHECK_STYLE_CHANGE", []); + } +}); +//} + +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to wrapping the sentence around with a

tag when enter key is pressed + * @name hp_XE_WYSIWYGEnterKey.js + */ +xe.XE_WYSIWYGEnterKey = jQuery.Class({ + name : "XE_WYSIWYGEnterKey", + // IE/Opera do not need this + unsupportedBrowser : ['ie', 'opera'], + oEditingArea : null, + + $init : function(oEditingArea){ + this.oEditingArea = oEditingArea; + }, + + $BEFORE_MSG_APP_READY : function(){ + // the right document will be available only when the src is completely loaded + if(this.oEditingArea && this.oEditingArea.tagName == "IFRAME") + this.oEditingArea = this.oEditingArea.contentWindow.document; + }, + + $ON_EVENT_EDITING_AREA_KEYDOWN : function(oEvent){ + if(this.oApp.getEditingMode() != "WYSIWYG") return; + + if(oEvent.shiftKey) return; + + if(oEvent.keyCode == 13){ + var oSelection = this.oApp.getSelection(); + var sBM = oSelection.placeStringBookmark(); + var oLineInfo = oSelection.getLineInfo(); + var oStart = oLineInfo.oStart; + var oEnd = oLineInfo.oEnd; + + //top.document.title = oStart.oNode.tagName+":"+oStart.oNode.nodeValue+", "+oEnd.oNode.tagName+":"+oEnd.oNode.nodeValue+"::"+oStart.bParentBreak+", "+oStart.oLineBreaker.tagName; + + // line broke by sibling + // or + // the parent line breaker is just a block container + if(!oStart.bParentBreak || oSelection.rxBlockContainer.test(oStart.oLineBreaker.tagName)){ + oEvent.stopPropagation(); + oEvent.preventDefault(); + + var oSWrapper = this.oEditingArea.createElement("P"); + oSelection.moveToBookmark(sBM); + oSelection.setStartBefore(oStart.oNode); + oSelection.surroundContents(oSWrapper); + + oSelection.collapseToEnd(); + + var oEWrapper = this.oEditingArea.createElement("P"); + oSelection.setEndAfter(oEnd.oNode); + oSelection.surroundContents(oEWrapper); + + oSelection.removeStringBookmark(sBM); + + if(oSWrapper.innerHTML == "") oSWrapper.innerHTML = "
"; + if(oEWrapper.innerHTML == "") oEWrapper.innerHTML = "
"; + + if(oEWrapper.nextSibling && oEWrapper.nextSibling.tagName == "BR") oEWrapper.parentNode.removeChild(oEWrapper.nextSibling); + + oSelection.selectNodeContents(oEWrapper); + oSelection.collapseToStart(); + oSelection.select(); + this.oApp.exec("CHECK_STYLE_CHANGE", []); + }else{ + oSelection.removeStringBookmark(sBM); + } + } + } +}); +//} + +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to styling the font + * @name hp_XE_WYSIWYGStyler.js + * @required XE_EditingArea_WYSIWYG, XpressRangeManager + */ +xe.XE_WYSIWYGStyler = jQuery.Class({ + name : "XE_WYSIWYGStyler", + + $PRECONDITION : function(sFullCommand, aArgs){ + return (this.oApp.getEditingMode() == "WYSIWYG"); + }, + + $ON_SET_WYSIWYG_STYLE : function(oStyles){ + var oSelection = this.oApp.getSelection(); + + // style cursor + if(oSelection.collapsed){ + var oSpan = this.oApp.getWYSIWYGDocument().createElement("SPAN"); + oSelection.insertNode(oSpan); + oSpan.innerHTML = unescape("%uFEFF"); + + var sValue; + for(var sName in oStyles){ + sValue = oStyles[sName]; + + if(typeof sValue != "string") continue; + + oSpan.style[sName] = sValue; + } + + oSelection.selectNodeContents(oSpan); + oSelection.collapseToEnd(); + oSelection._window.focus(); + oSelection._window.document.body.focus(); + oSelection.select(); + + // FF3 will actually display %uFEFF when it is followed by a number AND certain font-family is used(like Gulim), so remove the chcaracter for FF3 + if(jQuery.browser.mozilla && jQuery.browser.nVersion == 3) + oSpan.innerHTML = ""; + + return; + } + + this.oApp.exec("RECORD_UNDO_BEFORE_ACTION", ["FONT STYLE"]); + + oSelection.styleRange(oStyles); + oSelection._window.focus(); + oSelection.select(); + + this.oApp.exec("RECORD_UNDO_AFTER_ACTION", ["FONT STYLE"]); + } +}); +//} + +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to detecting the style change + * @name hp_XE_WYSIWYGStyleGetter.js + */ +xe.XE_WYSIWYGStyleGetter = jQuery.Class({ + name : "XE_WYSIWYGStyleGetter", + + hKeyUp : null, + + getStyleInterval : 200, + + oStyleMap : { + fontFamily : { + type : "Value", + css : "fontFamily" + }, + fontSize : { + type : "Value", + css : "fontSize" + }, + lineHeight : { + type : "Value", + css : "lineHeight", + converter : function(sValue, oStyle){ + if(!sValue.match(/px$/)) return sValue; + + return Math.ceil((parseInt(sValue)/parseInt(oStyle.fontSize))*10)/10; + } + }, + bold : { + command : "bold" + }, + underline : { + command : "underline" + }, + italic : { + command : "italic" + }, + lineThrough : { + command : "strikethrough" + }, + superscript : { + command : "superscript" + }, + subscript : { + command : "subscript" + }, + justifyleft : { + command : "justifyleft" + }, + justifycenter : { + command : "justifycenter" + }, + justifyright : { + command : "justifyright" + }, + justifyfull : { + command : "justifyfull" + }, + orderedlist : { + command : "insertorderedlist" + }, + unorderedlist : { + command : "insertunorderedlist" + } + }, + + $init : function(){ + this.oStyle = this._getBlankStyle(); + }, + + $PRECONDITION : function(){ + if(this.oApp.getEditingMode() != "WYSIWYG") return false; + + return true; + }, + + $ON_MSG_APP_READY : function(){ + this.oDocument = this.oApp.getWYSIWYGDocument(); + this.oApp.exec("ADD_APP_PROPERTY", ["getCurrentStyle", jQuery.fnBind(this.getCurrentStyle, this)]); + }, + + $ON_EVENT_EDITING_AREA_MOUSEUP : function(oEvnet){ + if(this.hKeyUp) clearTimeout(this.hKeyUp); + this.oApp.exec("CHECK_STYLE_CHANGE", []); + }, + + $ON_EVENT_EDITING_AREA_KEYUP : function(oEvent){ + /* + backspace 8 + page up 33 + page down 34 + end 35 + home 36 + left arrow 37 + up arrow 38 + right arrow 39 + down arrow 40 + insert 45 + delete 46 + */ + if(!(oEvent.keyCode == 8 || (oEvent.keyCode >= 33 && oEvent.keyCode <= 40) || oEvent.keyCode == 45 || oEvent.keyCode == 46)) return; + + if(this.hKeyUp) clearTimeout(this.hKeyUp); + + this.hKeyUp = setTimeout(jQuery.fnBind(this.oApp.exec, this.oApp, "CHECK_STYLE_CHANGE", []), this.getStyleInterval); + }, + + $ON_CHECK_STYLE_CHANGE : function(){ + this._getStyle(); + }, + + $ON_RESET_STYLE_STATUS : function(){ + var oBlankStyle = this._getBlankStyle(); + for(var sAttributeName in oBlankStyle) + this.oApp.exec("SET_STYLE_STATUS", [sAttributeName, oBlankStyle[sAttributeName]]); + }, + + getCurrentStyle : function(){ + return this.oStyle; + }, + + _check_style_change : function(){ + this.oApp.exec("CHECK_STYLE_CHANGE", []); + }, + + _getBlankStyle : function(){ + var oBlankStyle = {}; + for(var attributeName in this.oStyleMap){ + if(this.oStyleMap[attributeName].type == "Value") + oBlankStyle[attributeName] = ""; + else + oBlankStyle[attributeName] = 0; + } + + return oBlankStyle; + }, + + _getStyle : function(){ + var oSelection = this.oApp.getSelection(); + + var funcFilter = function(oNode){ + if (!oNode.childNodes || oNode.childNodes.length == 0) + return true; + else + return false; + } + + var aBottomNodes = oSelection.getNodes(false, funcFilter); + + var oStyle, oBaseStyle, oTmpStyle, attributeName; + if(aBottomNodes.length == 0){ + oStyle = this._getStyleOf(oSelection.commonAncestorContainer); + }else{ + oStyle = this._getStyleOf(aBottomNodes[0]); + } + + for(attributeName in oStyle){ + if(this.oStyleMap[attributeName].converter){ + oStyle[attributeName] = this.oStyleMap[attributeName].converter(oStyle[attributeName], oStyle); + } + + if(this.oStyle[attributeName] != oStyle[attributeName]) + this.oApp.exec("MSG_STYLE_CHANGED", [attributeName, oStyle[attributeName]]); + } + + this.oStyle = oStyle; + }, + + _getStyleOf : function(oNode){ + var oStyle = this._getBlankStyle(); + + // this must not happen + if(!oNode) return oStyle; + + if(oNode.nodeType == 3) oNode = oNode.parentNode; + + var welNode = jQuery(oNode); + var attribute, cssName; + for(var styleName in this.oStyle){ + attribute = this.oStyleMap[styleName]; + + if(attribute.type && attribute.type == "Value"){ + if(attribute.css){ + var sValue = welNode.css(attribute.css); + + if(styleName == "fontFamily"){ + sValue = sValue.split(/,/)[0]; + } + + oStyle[styleName] = sValue; + }else{ + if(attribute.command){ + try{ + oStyle[styleName] = this.oDocument.queryCommandState(attribute.command); + }catch(e){} + }else{ + // todo + } + } + }else{ + if(attribute.command){ + try{ + if(this.oDocument.queryCommandState(attribute.command)){ + oStyle[styleName] = 1; + }else{ + oStyle[styleName] = 0; + } + }catch(e){} + }else{ + // todo + } + } + } + return oStyle; + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to changing the font size using Select element + * @name hp_XE_FontSizeWithSelectUI.js + */ +xe.XE_FontSizeWithSelectUI = jQuery.Class({ + name : "XE_FontSizeWithSelectUI", + + $init : function(elAppContainer){ + this._assignHTMLObjects(elAppContainer); + }, + + _assignHTMLObjects : function(elAppContainer){ + this.elFontSizeSelect = jQuery("SELECT.xpress_xeditor_ui_fontSize_select", elAppContainer).get(0); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.registerBrowserEvent(this.elFontSizeSelect, "change", "SET_FONTSIZE_FROM_SELECT_UI"); + this.elFontSizeSelect.selectedIndex = 0; + }, + + $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ + if(sAttributeName == "fontSize"){ + this.elFontSizeSelect.value = sAttributeValue; + if(this.elFontSizeSelect.selectedIndex < 0) this.elFontSizeSelect.selectedIndex = 0; + } + }, + + $ON_SET_FONTSIZE_FROM_SELECT_UI : function(){ + var sFontSize = this.elFontSizeSelect.value; + if(!sFontSize) return; + + this.oApp.exec("SET_WYSIWYG_STYLE", [{"fontSize":sFontSize}]); + this.oApp.exec("CHECK_STYLE_CHANGE", []); + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to changing the font name using Select element + * @name hp_XE_FontNameWithSelectUI.js + */ +xe.XE_FontNameWithSelectUI = jQuery.Class({ + name : "XE_FontNameWithSelectUI", + + $init : function(elAppContainer){ + this._assignHTMLObjects(elAppContainer); + }, + + _assignHTMLObjects : function(elAppContainer){ + this.elFontNameSelect = jQuery("SELECT.xpress_xeditor_ui_fontName_select", elAppContainer).get(0); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.registerBrowserEvent(this.elFontNameSelect, "change", "SET_FONTNAME_FROM_SELECT_UI"); + this.elFontNameSelect.selectedIndex = 0; + }, + + $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ + if(sAttributeName == "fontFamily"){ + this.elFontNameSelect.value = sAttributeValue.toLowerCase(); + if(this.elFontNameSelect.selectedIndex < 0) this.elFontNameSelect.selectedIndex = 0; + } + }, + + $ON_SET_FONTNAME_FROM_SELECT_UI : function(){ + var sFontName = this.elFontNameSelect.value; + if(!sFontName) return; + + this.oApp.exec("SET_WYSIWYG_STYLE", [{"fontFamily":sFontName}]); + this.oApp.exec("CHECK_STYLE_CHANGE", []); + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to setting/changing the lineheight + * @name hp_XE_LineHeight.js + */ +xe.XE_LineHeight = jQuery.Class({ + name : "XE_LineHeight", + + $init : function(oAppContainer){ + this._assignHTMLObjects(oAppContainer); + }, + + _assignHTMLObjects : function(oAppContainer){ + }, + + $ON_SET_LINEHEIGHT : function(nLineHeight){ + this.setLineHeight(nLineHeight); + }, + + getLineHeight : function(){ + var nodes = this._getSelectedNodes(false); + + var curWrapper, prevWrapper; + var iCurHeight, iHeight; + + if(nodes.length == 0) return -1; + + var iLength = nodes.length; + + if(iLength == 0){ + iHeight = -1; + }else{ + prevWrapper = this._getLineWrapper(nodes[0]); + iHeight = this._getWrapperLineheight(prevWrapper); + } + + var firstNode = this.oSelection.getStartNode(); + + if(iHeight > 0){ + for(var i=1; i=0; i--){ + if(aNodes[i].nodeType == 3 || aNodes[i].tagName == "BR"){ + var oP = oSelection._document.createElement("P"); + oInsertionPoint = aNodes[i].nextSibling; + while(i>=0 && aNodes[i] && (aNodes[i].nodeType == 3 || aNodes[i].tagName == "BR")){ + oP.insertBefore(aNodes[i--], oP.firstChild); + } + oFormattingNode.insertBefore(oP, oInsertionPoint); + i++; + } + } + + if(oFormattingNode && oFormattingNode.parentNode){ + var oP = oSelection._document.createElement("P"); + oP.innerHTML = unescape("
"); + oFormattingNode.parentNode.insertBefore(oP, oFormattingNode.nextSibling); + } + + this.oApp.exec("RECORD_UNDO_ACTION", ["Block Quote"]); + + return oFormattingNode; + }, + + _expandToTableStart : function(oSelection, oNode){ + var oC = oSelection.commonAncestorContainer; + var oResultNode = null; + + var bLastIteration = false; + while(oNode && !bLastIteration){ + if(oNode == oC) bLastIteration = true; + + if(/TBODY|TFOOT|THEAD|TR/i.test(oNode.tagName)){ + oResultNode = this._getTableRoot(oNode); + break; + } + oNode = oNode.parentNode; + } + + return oResultNode; + }, + + _getTableRoot : function(oNode){ + while(oNode && oNode.tagName != "TABLE") oNode = oNode.parentNode; + + return oNode; + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to inserting special characters + * @name hp_XE_SCharacter.js + * @required XpressRangeManager + */ +xe.XE_SCharacter = jQuery.Class({ + name : "XE_SCharacter", + + $init : function(oAppContainer){ + this.bIE = jQuery.browser.msie; + + this._assignHTMLObjects(oAppContainer); + + this.charSet = []; + this.charSet[0] = unescape('FF5B FF5D 3014 3015 3008 3009 300A 300B 300C 300D 300E 300F 3010 3011 2018 2019 201C 201D 3001 3002 %B7 2025 2026 %A7 203B 2606 2605 25CB 25CF 25CE 25C7 25C6 25A1 25A0 25B3 25B2 25BD 25BC 25C1 25C0 25B7 25B6 2664 2660 2661 2665 2667 2663 2299 25C8 25A3 25D0 25D1 2592 25A4 25A5 25A8 25A7 25A6 25A9 %B1 %D7 %F7 2260 2264 2265 221E 2234 %B0 2032 2033 2220 22A5 2312 2202 2261 2252 226A 226B 221A 223D 221D 2235 222B 222C 2208 220B 2286 2287 2282 2283 222A 2229 2227 2228 FFE2 21D2 21D4 2200 2203 %B4 FF5E 02C7 02D8 02DD 02DA 02D9 %B8 02DB %A1 %BF 02D0 222E 2211 220F 266D 2669 266A 266C 327F 2192 2190 2191 2193 2194 2195 2197 2199 2196 2198 321C 2116 33C7 2122 33C2 33D8 2121 2668 260F 260E 261C 261E %B6 2020 2021 %AE %AA %BA 2642 2640').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + this.charSet[1] = unescape('%BD 2153 2154 %BC %BE 215B 215C 215D 215E %B9 %B2 %B3 2074 207F 2081 2082 2083 2084 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 FFE6 %24 FFE5 FFE1 20AC 2103 212B 2109 FFE0 %A4 2030 3395 3396 3397 2113 3398 33C4 33A3 33A4 33A5 33A6 3399 339A 339B 339C 339D 339E 339F 33A0 33A1 33A2 33CA 338D 338E 338F 33CF 3388 3389 33C8 33A7 33A8 33B0 33B1 33B2 33B3 33B4 33B5 33B6 33B7 33B8 33B9 3380 3381 3382 3383 3384 33BA 33BB 33BC 33BD 33BE 33BF 3390 3391 3392 3393 3394 2126 33C0 33C1 338A 338B 338C 33D6 33C5 33AD 33AE 33AF 33DB 33A9 33AA 33AB 33AC 33DD 33D0 33D3 33C3 33C9 33DC 33C6').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + this.charSet[2] = unescape('3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 326A 326B 326C 326D 326E 326F 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 327A 327B 24D0 24D1 24D2 24D3 24D4 24D5 24D6 24D7 24D8 24D9 24DA 24DB 24DC 24DD 24DE 24DF 24E0 24E1 24E2 24E3 24E4 24E5 24E6 24E7 24E8 24E9 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 246A 246B 246C 246D 246E 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 320A 320B 320C 320D 320E 320F 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 321A 321B 249C 249D 249E 249F 24A0 24A1 24A2 24A3 24A4 24A5 24A6 24A7 24A8 24A9 24AA 24AB 24AC 24AD 24AE 24AF 24B0 24B1 24B2 24B3 24B4 24B5 2474 2475 2476 2477 2478 2479 247A 247B 247C 247D 247E 247F 2480 2481 2482').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + this.charSet[3] = unescape('3131 3132 3133 3134 3135 3136 3137 3138 3139 313A 313B 313C 313D 313E 313F 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 314A 314B 314C 314D 314E 314F 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 315A 315B 315C 315D 315E 315F 3160 3161 3162 3163 3165 3166 3167 3168 3169 316A 316B 316C 316D 316E 316F 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 317A 317B 317C 317D 317E 317F 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 318A 318B 318C 318D 318E').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + this.charSet[4] = unescape('0391 0392 0393 0394 0395 0396 0397 0398 0399 039A 039B 039C 039D 039E 039F 03A0 03A1 03A3 03A4 03A5 03A6 03A7 03A8 03A9 03B1 03B2 03B3 03B4 03B5 03B6 03B7 03B8 03B9 03BA 03BB 03BC 03BD 03BE 03BF 03C0 03C1 03C3 03C4 03C5 03C6 03C7 03C8 03C9 %C6 %D0 0126 0132 013F 0141 %D8 0152 %DE 0166 014A %E6 0111 %F0 0127 I 0133 0138 0140 0142 0142 0153 %DF %FE 0167 014B 0149 0411 0413 0414 0401 0416 0417 0418 0419 041B 041F 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F 0431 0432 0433 0434 0451 0436 0437 0438 0439 043B 043F 0444 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + this.charSet[5] = unescape('3041 3042 3043 3044 3045 3046 3047 3048 3049 304A 304B 304C 304D 304E 304F 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 305A 305B 305C 305D 305E 305F 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 306A 306B 306C 306D 306E 306F 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 307A 307B 307C 307D 307E 307F 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 308A 308B 308C 308D 308E 308F 3090 3091 3092 3093 30A1 30A2 30A3 30A4 30A5 30A6 30A7 30A8 30A9 30AA 30AB 30AC 30AD 30AE 30AF 30B0 30B1 30B2 30B3 30B4 30B5 30B6 30B7 30B8 30B9 30BA 30BB 30BC 30BD 30BE 30BF 30C0 30C1 30C2 30C3 30C4 30C5 30C6 30C7 30C8 30C9 30CA 30CB 30CC 30CD 30CE 30CF 30D0 30D1 30D2 30D3 30D4 30D5 30D6 30D7 30D8 30D9 30DA 30DB 30DC 30DD 30DE 30DF 30E0 30E1 30E2 30E3 30E4 30E5 30E6 30E7 30E8 30E9 30EA 30EB 30EC 30ED 30EE 30EF 30F0 30F1 30F2 30F3 30F4 30F5 30F6').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + }, + + _assignHTMLObjects : function(oAppContainer){ + oAppContainer = jQuery.$(oAppContainer) || document; + + this.elDropdownLayer = jQuery("DIV.xpress_xeditor_sCharacter_layer", oAppContainer).get(0); + + this.oTextField = jQuery("INPUT", this.elDropdownLayer).get(0); + this.oInsertButton = jQuery("+ BUTTON", this.oTextField).get(0); + this.aCloseButton = jQuery("BUTTON.close", this.elDropdownLayer).get(); + this.aSCharList = jQuery(".list", this.elDropdownLayer).get(); + var oLabelUL = jQuery(">UL", this.elDropdownLayer).get(0); + this.aLabelA = jQuery("A", oLabelUL).get(); + }, + + $ON_MSG_APP_READY : function(){ + var funcInsert = jQuery.fnBind(this.oApp.exec, this.oApp, "INSERT_SCHARACTERS", [this.oTextField.value]); + jQuery(this.oInsertButton).click(funcInsert, this); + + this.oApp.exec("SET_SCHARACTER_LIST", [this.charSet]); + + for(var i=0; i"); + }else{ + button = document.createElement("BUTTON"); + button.type = "button"; + } + span = document.createElement("SPAN"); + span.innerHTML = unescape(this.charSet[i][ii]); + button.appendChild(span); + + aLI[ii].appendChild(button); + this.aSCharList[i].appendChild(aLI[ii]); + } + + // enable this after Jindo framework is updated +// this.oApp.exec("ATTACH_HOVER_EVENTS", [jQuery(">LI>BUTTON", this.aSCharList[i])]).get(); + }, + + _stopBrowserEvent : function(obj, sEvent){ + jQuery(obj).bind(sEvent, function(e){e.stopPropagation();e.preventDefault();} ) + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to Undo/Redo + * @name hp_XE_UndoRedo.js + * @required XE_EditingAreaManager, XpressRangeManager + */ +xe.XE_UndoRedo = jQuery.Class({ + name : "XE_UndoRedo", + actionHistory : null, + // this may also be called, lastAdded/lastRestored + oCurStateIdx : null, + iMinimumSizeChange : 10, + sBlankContentsForFF : "
", + + $init : function(){ + this.aUndoHistory = []; + this.oCurStateIdx = {nIdx: 0, nStep: 0}; + }, + + $PRECONDITION : function(sCmd){ + if(sCmd.match(/_DO_RECORD_UNDO_HISTORY_AT$/)) return true; + + try{ + if(this.oApp.getEditingMode() != "WYSIWYG") return false; + }catch(e){ + return false; + } + + return true; + }, + + $BEFORE_MSG_APP_READY : function(){ + this.oApp.exec("DO_RECORD_UNDO_HISTORY_AT", [this.oCurStateIdx, "", "", null]); + }, + + $ON_MSG_APP_READY : function(){ + this.bFF = jQuery.browser.mozilla; + + this.oApp.exec("ADD_APP_PROPERTY", ["getUndoHistory", jQuery.fnBind(this.getUndoHistory, this)]); + this.oApp.exec("ADD_APP_PROPERTY", ["getUndoStateIdx", jQuery.fnBind(this.getUndoStateIdx, this)]); + + this.oApp.exec("REGISTER_UI_EVENT", ["undo", "click", "UNDO"]); + this.oApp.exec("REGISTER_UI_EVENT", ["redo", "click", "REDO"]); + + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+z", "UNDO"]); + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+y", "REDO"]); + }, + + $ON_UNDO : function(){ + var oTmpStateIdx = {}; + this.oApp.exec("DO_RECORD_UNDO_HISTORY", ["KEYPRESS", false, false, 1]); + if(this.oCurStateIdx.nIdx == 0) return; + + if(this.oCurStateIdx.nStep > 0){ + this.oCurStateIdx.nStep--; + }else{ + var oTmpHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + + this.oCurStateIdx.nIdx--; + + if(oTmpHistory.nTotalSteps>1){ + this.oCurStateIdx.nStep = 0; + }else{ + oTmpHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + this.oCurStateIdx.nStep = oTmpHistory.nTotalSteps-1; + } + } + + this.oApp.exec("RESTORE_UNDO_HISTORY", [this.oCurStateIdx.nIdx, this.oCurStateIdx.nStep]); + + this.oApp.exec("CHECK_STYLE_CHANGE", []); + }, + + + $ON_REDO : function(){ + if(this.oCurStateIdx.nIdx >= this.aUndoHistory.length) return; + + var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + if(this.oCurStateIdx.nIdx == this.aUndoHistory.length-1 && this.oCurStateIdx.nStep >= oCurHistory.nTotalSteps-1) return; + + if(this.oCurStateIdx.nStep < oCurHistory.nTotalSteps-1){ + this.oCurStateIdx.nStep++; + }else{ + this.oCurStateIdx.nIdx++; + oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + this.oCurStateIdx.nStep = oCurHistory.nTotalSteps-1; + } + + this.oApp.exec("RESTORE_UNDO_HISTORY", [this.oCurStateIdx.nIdx, this.oCurStateIdx.nStep]); + + this.oApp.exec("CHECK_STYLE_CHANGE", []); + }, + + $ON_RECORD_UNDO_ACTION : function(sAction){ + this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction]); + }, + + $ON_RECORD_UNDO_BEFORE_ACTION : function(sAction){ + this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction, true, true]); + }, + + $ON_RECORD_UNDO_AFTER_ACTION : function(sAction){ + this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction, true, false]); + }, + + $ON_RESTORE_UNDO_HISTORY : function(nUndoIdx, nUndoStateStep){ + this.oCurStateIdx.nIdx = nUndoIdx; + this.oCurStateIdx.nStep = nUndoStateStep; + + var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + var sContent = oCurHistory.sContent[this.oCurStateIdx.nStep]; + var oBookmark = oCurHistory.oBookmark[this.oCurStateIdx.nStep]; + + this.oApp.setIR(sContent, true); + + // setting the innerHTML may change the internal DOM structure, so save the value again. + var sCurContent = this.oApp.getIR(); + if(this.bFF && sCurContent == this.sBlankContentsForFF){ + sCurContent = ""; + } + oCurHistory.sContent[this.oCurStateIdx.nStep] = sCurContent; + + var oSelection = this.oApp.getEmptySelection(); + if(oSelection.selectionLoaded){ + if(oBookmark){ + oSelection.moveToXPathBookmark(oBookmark); + }else{ + oSelection = this.oApp.getEmptySelection(); + } + + oSelection.select(); + } + }, + + $ON_DO_RECORD_UNDO_HISTORY : function(sAction, bTwoStepAction, bBeforeAction, nForceAddUnlessEqual){ + bTwoStepAction = bTwoStepAction || false; + bBeforeAction = bBeforeAction || false; + nForceAddUnlessEqual = nForceAddUnlessEqual || 0; + + // if we're in the middle of some action history, remove everything after current idx if any "little" change is made + if(!(this.oCurStateIdx.nIdx == this.aUndoHistory.length-1)) nForceAddUnlessEqual = 1; + + var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + + var sCurContent = this.oApp.getIR(); + var sHistoryContent = oCurHistory.sContent[this.oCurStateIdx.nStep]; + + if(this.bFF && sCurContent == this.sBlankContentsForFF){ + sCurContent = ""; + } + + // every TwoStepAction needs to be recorded + if(!bTwoStepAction){ + switch(nForceAddUnlessEqual){ + case 0: + if(Math.abs(sHistoryContent.length - sCurContent.length) .bx", this.oUILayer).get(); + + this.oFindInputSet = oTmp[0]; + this.oReplaceInputSet = oTmp[1]; + + this.oFindInput_Keyword = jQuery("INPUT", this.oFindInputSet).get(0); + + oTmp = jQuery("INPUT", this.oReplaceInputSet).get(); + this.oReplaceInput_Original = oTmp[0]; + this.oReplaceInput_Replacement = oTmp[1]; + + this.oFindNextButton = jQuery("BUTTON.find_next", this.oUILayer).get(0); + this.oCancelButton = jQuery("BUTTON.cancel", this.oUILayer).get(0); + + this.oReplaceButton = jQuery("BUTTON.replace", this.oUILayer).get(0); + this.oReplaceAllButton = jQuery("BUTTON.replace_all", this.oUILayer).get(0); + + this.aCloseButtons = jQuery("BUTTON.close", this.oUILayer).get(); + this.aCloseButtons[this.aCloseButtons.length] = this.oCancelButton; + }, + + $ON_MSG_APP_READY : function(){ + // the right document will be available only when the src is completely loaded + if(this.oEditingWindow && this.oEditingWindow.tagName == "IFRAME") + this.oEditingWindow = this.oEditingWindow.contentWindow; + + this.oFindReplace = new xe.FindReplace(this.oEditingWindow); + if(!this.oFindReplace.bBrowserSupported){ + this.oApp.exec("DISABLE_UI", ["find_replace"]); + return; + } + + for(var i=0; i" + sURL + ""; + this.oSelection.pasteHTML(str); + }else{ + var nSession = Math.ceil(Math.random()*10000); + var arg = ( sURL == "" ? ["unlink"] : ["createLink", false, this.sATagMarker+nSession+sURL] ); + this.oApp.exec("EXECCOMMAND", arg); + + this.oSelection.setFromSelection(); + + var oDoc = this.oApp.getWYSIWYGDocument(); + var aATags = oDoc.body.getElementsByTagName("A"); + var nLen = aATags.length; + var rxMarker = new RegExp(this.sRXATagMarker+nSession, "i"); + var elATag; + for(var i=0; i this.iMaxRows) iRows = this.iMaxRows; + + this.oRowInput.value = iRows; + this._showNewTable(); + }, + + $ON_ST_SET_COLUMN_NUM : function(iColumns, iColumnDiff){ + iColumns = iColumns || parseInt(this.oColumnInput.value); + iColumnDiff = iColumnDiff || 0; + + iColumns += iColumnDiff; + + if(iColumns < this.iMinColumns) iColumns = this.iMinColumns; + if(iColumns > this.iMaxColumns) iColumns = this.iMaxColumns; + + this.oColumnInput.value = iColumns; + this._showNewTable(); + }, + + $ON_ST_INSERT_TABLE : function(){ + var sTable = this._getTableString(); + + this.oApp.exec("PASTE_HTML", [sTable]); + + this.oApp.exec("ST_CLOSE", []); + }, + + $ON_ST_CLOSE : function(){ + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + }, + + $ON_ST_SET_BORDER_WIDTH : function(iBorderWidth, iBorderWidthDiff){ + iBorderWidth = iBorderWidth || parseInt(this.oBorderWidthInput.value); + iBorderWidthDiff = iBorderWidthDiff || 0; + + iBorderWidth += iBorderWidthDiff; + + if(iBorderWidth < this.iMinBorderWidth) iBorderWidth = this.iMinBorderWidth; + if(iBorderWidth > this.iMaxBorderWidth) iBorderWidth = this.iMaxBorderWidth; + + this.oBorderWidthInput.value = iBorderWidth; + this._showNewTable(); + }, + + $ON_ST_INC_BORDER_WIDTH : function(){ + this.oApp.exec("ST_SET_BORDER_WIDTH", [null, 1]); + }, + + $ON_ST_DEC_BORDER_WIDTH : function(){ + this.oApp.exec("ST_SET_BORDER_WIDTH", [null, -1]); + }, + + $ON_ST_TOGGLE_BORDER_COLOR_LAYER : function(){ + if(this.welDropdownLayer.hasClass("p1")) + this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER", []); + else + this.oApp.exec("ST_SHOW_BORDER_COLOR_LAYER", []); + }, + + $ON_ST_SHOW_BORDER_COLOR_LAYER : function(){ + this.welDropdownLayer.addClass("p1"); + this.welDropdownLayer.removeClass("p2"); + + this.oApp.exec("SHOW_COLOR_PALETTE", ["ST_SET_BORDER_COLOR_FROM_PALETTE", this.elDropdownLayer]); + }, + + $ON_ST_HIDE_BORDER_COLOR_LAYER : function(){ + this.welDropdownLayer.removeClass("p1"); + + this.oApp.exec("HIDE_COLOR_PALETTE", []); + }, + + $ON_ST_TOGGLE_BGCOLOR_LAYER : function(){ + if(this.welDropdownLayer.hasClass("p2")) + this.oApp.exec("ST_HIDE_BGCOLOR_LAYER", []); + else + this.oApp.exec("ST_SHOW_BGCOLOR_LAYER", []); + }, + + $ON_ST_SHOW_BGCOLOR_LAYER : function(){ + this.welDropdownLayer.removeClass("p1"); + this.welDropdownLayer.addClass("p2"); + + this.oApp.exec("SHOW_COLOR_PALETTE", ["ST_SET_BGCOLOR_FROM_PALETTE", this.elDropdownLayer]); + }, + + $ON_ST_HIDE_BGCOLOR_LAYER : function(){ + this.welDropdownLayer.removeClass("p2"); + + this.oApp.exec("HIDE_COLOR_PALETTE", []); + }, + + $ON_ST_SET_BORDER_COLOR_FROM_PALETTE : function(sColorCode){ + this.oApp.exec("ST_SET_BORDER_COLOR", [sColorCode]); + this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER", []); + }, + + $ON_ST_SET_BORDER_COLOR : function(sColorCode){ + this.oBorderColorInput.value = sColorCode; + this.oButton_BorderColorPreview.style.backgroundColor = sColorCode; + + this._showNewTable(); + }, + + $ON_ST_SET_BGCOLOR_FROM_PALETTE : function(sColorCode){ + this.oApp.exec("ST_SET_BGCOLOR", [sColorCode]); + this.oApp.exec("ST_HIDE_BGCOLOR_LAYER", []); + }, + + $ON_ST_SET_BGCOLOR : function(sColorCode){ + this.oBGColorInput.value = sColorCode; + this.oButton_BGColorPreview.style.backgroundColor = sColorCode; + + this._showNewTable(); + }, + + _showNewTable : function(){ + var oTmp = document.createElement("DIV"); + oTmp.innerHTML = this._getTableString(); + var oNewTable = oTmp.firstChild; + this.oSampleTable.parentNode.insertBefore(oNewTable, this.oSampleTable); + this.oSampleTable.parentNode.removeChild(this.oSampleTable); + this.oSampleTable = oNewTable; + }, + + // need to do something about the table width as the same HTML code is being used to the actual table and the preview table + _getTableString : function(){ + var sBorderColorCode = this.oBorderColorInput.value; + var sBGColorCode = this.oBGColorInput.value; + var iBorderWidth = this.oBorderWidthInput.value; + var sTD = ""; + if(jQuery.browser.msie){ + sTD = "

"; + }else{ + if(jQuery.browser.firefox){ + sTD = ""; + }else{ + sTD = ""; + } + } + + var sTable = '


 

'; + var sRow = ''; + var iColumns = this.oColumnInput.value; + for(var i=0; i/ig, + regex_meanless_css2 = /(?:(?:margin|padding)\s*:\s*0(?:px)?|\-(?:moz|ms|webkit|opera)\-[\w-]+\s*:\s*.*?|[\w-]+\s*:\s*\-(?:moz|ms|webkit|opera)\-[\w-]+|(?:line-height|font-variant|font-stretch|font-size-adjust|font-size)\s*:\s*[a-z_-]+)\s*;?\s*|font-(?:weight|style)\s*:\s*normal;?/ig, + regex_class = /<(.*?)\s+class\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))(.*?)>/ig, + regex_class2 = /xe_selected_cell/g; + regex_handler = /<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig, + regex_id = /<(.*?)\s+id\s*=(?:[^\s>]+|\s*".*?"|\s*'.*?')(.*?)>/ig, + regex_script = //ig, + regex_font_color = /color\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, + regex_font_face = /face\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, + regex_font_size = /size\s*=(?:\s*"(\d+)"|\s*'(\d+)'|(\d+))/i, + regex_style = /style\s*=\s*(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, + regex_font_weight = /font-weight\s*:\s*([a-z]+);?/i, + regex_font_style = /font-style\s*:\s*italic;?/i, + regex_font_decoration = /text-decoration\s*:\s*([a-z -]+);?/i, + regex_jquery = /jQuery\d+\s*=(\s*"\d+"|\d+)/g, + regex_quote_attr = /([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g; //" + +var + allow_tags = 'a,abbr,acronym,address,area,blockquote,br,caption,center,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,embed,h1,h2,h3,h4,h5,h6,hr,img,ins,kbd,li,map,object,ol,p,param,pre,q,samp,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,u,ul,var,iframe,object,param'.split(','), + lonely_tags = 'area,br,col,embed,hr,img,input,param'.split(','); + +var + replace_tags = { + 'b' : 'strong', + 'i' : 'em', + 's' : 'del', + 'strike' : 'del' + }; + +xe.XE_XHTMLFormatter = $.Class({ + name : "XE_XHTMLFormatter", + + $ON_MSG_APP_READY : function() { + this.oApp.addConverter("WYSIWYG_TO_IR", this.TO_IR); + this.oApp.addConverter("HTMLSrc_TO_IR", this.TO_IR); + this.oApp.addConverter("IR_TO_HTMLSrc", this.IR_TO); + this.oApp.addConverter("IR_TO_WYSIWYG", this.IR_TO); + }, + + TO_IR : function(sContent) { + var stack = []; + + // remove all useless styles + sContent = sContent.replace(regex_meanless_css1, function(m0,m1,m2,m3){ + m2 = m2.replace(regex_meanless_css2, ''); + + return '<'+m1+(m2?' style="'+m2+'"':'')+m3+'>'; + }); + + // remove all useless classes + sContent = sContent.replace(regex_class, function(m0,m1,m2,m3,m4,m5){ + var cls = jQuery.trim((m2 || m3 || m4 || "").replace(regex_class2, '')); + + return '<'+(m1||"")+(cls?' class="'+cls+'"':'')+(m5||"")+'>'; + }); + + // remove all event handler + sContent = sContent.replace(regex_handler, '<$1$2>'); + + // remove all id + sContent = sContent.replace(regex_id, '<$1$2>'); + + // remove all scripts + sContent = sContent.replace(regex_script, ''); + + if (jQuery.browser.msie) { + // remove jQuery attributes + sContent = sContent.replace(regex_jquery, ''); + + // quote all attrs + sContent = sContent.replace(/<(\w+) ([^>]+)>/g, function(m0,m1,m2){ + return '<'+m1+' '+ + m2.replace(regex_quote_attr, function(s0,s1,s2,s3){ + if (s1) return s1; + return s2+'="'+s3+'"'; + }) + '>'; + }); + } + + // remove all useless tag and enclose tags + regex = /<(\/)?([:\w\/-]+)(.*?)>/ig; + sContent = sContent.replace(regex, function(m0,m1,m2,m3){ + var m3s = []; + var state = ''; + + m1 = m1 || ''; + m2 = m2.toLowerCase(); + m3 = $.trim(m3 || ''); + + if (!m1) { + if ($.inArray(m2,lonely_tags) >= 0) { + var len = m3.length; + if (m2 == 'br') m3 = ''; + if (!m3 || m3.substring(len-1,len) != '/') m3 += ' /'; + + return '<'+m2+' '+m3+'>'; + } + + if (replace_tags[m2]) { + stack.push({tag:m2, state:'deleted'}); + + m2 = replace_tags[m2]; + state = 'inserted'; + } else if (m2 == 'font') { + stack.push({tag:m2, state:'deleted'}); + + m2 = 'span'; + m3s = []; + if (regex_font_color.test(m3)) m3s.push('color:'+(RegExp.$1||RegExp.$2||RegExp.$3)+';'); + if (regex_font_face.test(m3)) m3s.push('font-family:'+(RegExp.$1||RegExp.$2||RegExp.$3)+';'); + + m3 = m3s.length?'style="'+m3s.join('')+'"':''; + state = 'inserted'; + } else if (m2 == 'center') { + stack.push({tag:m2, state:'deleted'}); + + m2 = 'div' + m3 = 'style="text-align:center"'; + + state = 'inserted'; + } else if (m2 == 'span') { + var style = ''; + + if (!m3) { + stack.push({tag:m3, state:'deleted'}); + return ''; + } + + if (regex_style.test(m3)) { + var tmpstack = []; + var tmptag = ''; + + style = RegExp.$1||RegExp.$2||RegExp.$3; + m3 = m3.replace(regex_style, ''); + + if (regex_font_weight.test(style)) { + if (RegExp.$1 == 'bold' || RegExp.$1 == 'bolder') { + style = style.replace(regex_font_weight, ''); + tmpstack.push({tag:'strong', state:'inserted'}); + tmptag += ''; + } + } + + if (regex_font_style.test(style)) { + style = style.replace(regex_font_style, ''); + tmpstack.push({tag:'em', state:'inserted'}); + tmptag += ''; + } + + if (regex_font_decoration.test(style)) { + var deco_css = ' '+RegExp.$1.toLowerCase()+' '; + + if (deco_css.indexOf('underline ') > 0) { + deco_css = deco_css.replace('underline ', ''); + tmpstack.push({tag:'u', state:'inserted'}); + tmptag += ''; + } + + if (deco_css.indexOf('line-through ') > 0) { + deco_css = deco_css.replace('line-through ', ''); + tmpstack.push({tag:'del', state:'inserted'}); + tmptag += ''; + } + + deco_css = $.trim(deco_css); + style = style.replace(regex_font_decoration, (deco_css?'text-decoration:'+deco_css+';':'')); + } + + style = $.trim(style); + + stack.push({tag:m2, state:(!m3&&!style?'deleted':'')}); + stack = stack.concat(tmpstack); + + return (!m3&&!style?'':'')+tmptag; + } + } else { + state = (jQuery.inArray(m2,allow_tags) < 0)?'deleted':''; + if (state == 'deleted') return ''; + } + + stack.push({tag:m2, state:state}); + } else { + var tags = [], t = ''; + + if (!stack.length) return ''; + + do { + t = stack.pop(); + if (t.state != 'inserted' && t.tag != m2) { + stack.push(t); + return tags.join(''); + } + if (t.state != 'deleted') tags.push(''); + } while(stack.length && t.tag != m2); + + return tags.join(''); + } + + return '<'+m1+m2+(m3?' '+m3:'')+'>'; + }); + if (stack.length) { + var t = ''; + + do { + t = stack.pop(); + if (t.state != 'deleted') sContent += ''; + } while(stack.length); + } + + return sContent; + }, + + IR_TO : function(sContent) { + return sContent; + } +}); + +// center, font, b, i, s, strike + +})(jQuery); +/** + * Support XE extensions + * @author gony + */ +xe.XE_Extension = jQuery.Class({ + name : "XE_Extension", + seq : '', + + $init : function(elAppContainer, editor_sequence) { + this.seq = editor_sequence; + this._assignHTMLObjects(elAppContainer); + }, + + _assignHTMLObjects : function(elAppContainer) { + this.elDropdownLayer = jQuery('DIV.xpress_xeditor_extension_layer', elAppContainer).get(0); + }, + + _removeAttrs : function(sContent) { + sContent = sContent.replace(/]*?) xe_handled\s*=\s*".+?"([^>]*?)>/i, ''); + + return sContent; + }, + + _addEvent : function() { + if (this.oApp.getEditingMode() != 'WYSIWYG') return; + + var doc = this.oApp.getWYSIWYGDocument(); + var seq = this.seq; + var fn = function(){ + var obj = jQuery(this); + var comp = obj.attr('editor_component'); + + if (comp && jQuery.isFunction(openComponent)) { + editorPrevNode = obj.get(0); + openComponent(comp, seq); + } + }; + + jQuery('img[editor_component],div[editor_component]', doc).each(function(){ + var obj = jQuery(this); + if (!obj.attr('xe_handled')) { + obj.attr('xe_handled', 'yes').dblclick(fn); + } + }); + }, + + $ON_MSG_APP_READY : function() { + this.oApp.exec('REGISTER_UI_EVENT', ['extension', 'click', 'TOGGLE_EXTENSION_LAYER']); + + this.oApp.addConverter("WYSIWYG_TO_IR", this._removeAttrs); + }, + + $ON_TOGGLE_EXTENSION_LAYER : function() { + this.oApp.exec('TOGGLE_TOOLBAR_ACTIVE_LAYER', [this.elDropdownLayer]); + }, + + $ON_CHANGE_EDITING_MODE : function(mode) { + var self = this; + setTimeout(function(){ self._addEvent(); }, 100); + }, + + $ON_PASTE_HTML : function() { + var self = this; + setTimeout(function(){ self._addEvent(); }, 100); + }, + + $ON_LOAD_IR_FIELD : function() { + var self = this; + setTimeout(function(){ self._addEvent(); }, 100); + }, + + $ON_SET_IR : function() { + var self = this; + setTimeout(function(){ self._addEvent(); }, 100); + } +}); +/** + * Auto saving + * @author gony + */ +xe.XE_AutoSave = jQuery.Class({ + name : "XE_AutoSave", + form : null, + textarea : null, + + $init : function(oIRTextarea, elAppContainer) { + this.form = oIRTextarea.form; + this.textarea = oIRTextarea; + + this._assignHTMLObjects(elAppContainer); + }, + + _assignHTMLObjects : function(elAppContainer) { + this.welMessageBox = jQuery('autosave_message'); + }, + + $ON_MSG_APP_READY : function() { + var elTitle = jQuery(this.form._saved_doc_title); + var elContent = jQuery(this.form._saved_doc_content); + var title = jQuery.trim(elTitle.val()); + var content = jQuery.trim(elContent.val()); + + if (title || content) { + if (confirm(this.form._saved_doc_message.value)) { + jQuery(this.form.title).val(title); + this.oApp.setIR(content); + } else { + editorRemoveSavedDoc(); + } + } + + editorEnableAutoSave(this.form, jQuery(this.form).attr("editor_sequence")); + + // register hotkey + this.oApp.exec('REGISTER_HOTKEY', ['ctrl+shift+s','AUTO_SAVE']); + }, + + $ON_AUTO_SAVE : function() { + _editorAutoSave(); + } +}); +/** + * Format Block plugin + * @author gony + */ +xe.XE_FormatWithSelectUI = jQuery.Class({ + name : "XE_FormatWithSelectUI", + + $init : function(elAppContainer){ + this._assignHTMLObjects(elAppContainer); + }, + + _assignHTMLObjects : function(elAppContainer){ + this.elFormatSelect = jQuery("SELECT.xpress_xeditor_ui_format_select", elAppContainer).get(0); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.registerBrowserEvent(this.elFormatSelect, "change", "SET_FORMAT_FROM_SELECT_UI"); + this.elFormatSelect.selectedIndex = 0; + }, + + $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ + var blockName = this.oApp.getWYSIWYGDocument().queryCommandValue("FormatBlock"); + + if (!blockName) return (this.elFormatSelect.selectedIndex = 0); + if (jQuery.browser.msie && /([0-9])/.test(blockName)) blockName = 'h'+(RegExp.$1); + + this.elFormatSelect.value = blockName.toLowerCase(); + if(this.elFormatSelect.selectedIndex < 0) this.elFormatSelect.selectedIndex = 0; + }, + + $ON_SET_FORMAT_FROM_SELECT_UI : function(){ + var sFormat = this.elFormatSelect.value; + if(!sFormat) return; + if(jQuery.browser.msie) sFormat = '<'+sFormat+'>'; + + this.oApp.exec("EXECCOMMAND", ["FormatBlock", false, sFormat]); + this.oApp.exec("CHECK_STYLE_CHANGE", []); + } +}); +/** + * Enhanced Table Fetures + * @author gony + */ + +// 표 편집 확장 기능 +xe.XE_Table = jQuery.Class({ + _startSel : null, + _endSel : null, + + $ON_MSG_APP_READY : function() { + this._doc = jQuery(this.oApp.getWYSIWYGDocument()); + + this.$FnMouseDown = jQuery.fnBind(this._mousedown, this); + this.$FnMouseUp = jQuery.fnBind(this._mouseup, this); + this.$FnMouseMove = jQuery.fnBind(this._mousemove, this); + + this._doc.mousedown(this.$FnMouseDown); + + // initialize + this._startSel = null; + this._endSel = null; + + // register buttons + this.oApp.exec('REGISTER_UI_EVENT', ['merge_cells', 'click', 'MERGE_CELLS']); + this.oApp.exec('REGISTER_UI_EVENT', ['split_col', 'click', 'CELL_SPLIT_BY_COL']); + this.oApp.exec('REGISTER_UI_EVENT', ['split_row', 'click', 'CELL_SPLIT_BY_ROW']); + + // register hotkeys + this.oApp.exec('REGISTER_HOTKEY', ['ctrl+alt+m', 'MERGE_CELLS']); + + // perform default ready action + this.$super.$ON_MSG_APP_READY(); + }, + + $ON_MERGE_CELLS : function() { + var html = ""; + var cell = jQuery('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); + var self = this; + + // 선택된 셀이 없으면 종료 + if (!cell.length) return; + + // UNDO 지점 기록 + this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Merge"]); + + // 선택한 모든 셀의 데이터를 첫번째 셀로 복사 + cell.each(function(){ html += jQuery(this).html() }).eq(0).html(html); + + // 첫번째 셀 가로 확장 + var colspan = 0; + cell.eq(0).nextAll('td,th').andSelf().filter('.xe_selected_cell').each(function(idx){ + colspan += self._getSpan(this, 'col'); + }); + + // 마지막 셀까지 줄의 갯수 계산 + var rect = this._getRect(cell.eq(0)); + var start_tr = cell.eq(0).parent('tr'); + var end_tr = cell.eq(cell.length-1).parent('tr'); + var all_rows = cell.parents('table').eq(0).find('tr'); + var rowspan = all_rows.index(end_tr.get(0)) - all_rows.index(start_tr.get(0)) + this._getSpan(cell.eq(cell.length-1), 'row'); + + // 첫번째 셀 colspan, rowspan 속성 지정 + cell.eq(0).attr('colSpan', colspan).attr('rowSpan', rowspan); + + // 첫번째 셀을 제외한 다른 모든 셀 제거 + cell.slice(1).remove(); + }, + + $ON_CELL_SPLIT_BY_ROW : function(many) { + var cell = jQuery('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); + var table = cell.parents('table').eq(0); + var self = this; + + // 선택된 셀이 없으면 종료 + if (!cell.length) return; + + // UNDO 지점 기록 + this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Split By Row"]); + + // 선택 영역의 상하 좌표 구함 + var _top = this._getRect(cell.eq(0)).top; + var _bottom = this._getRect(cell.eq(cell.length-1)).bottom; + + // 테이블의 모든 셀에서 선택영역에 해당하는 셀을 구한다(상하 기준). + (cell = table.find('td,th').filter(function(){ + var rect = self._getRect(jQuery(this)); + + return !(rect.bottom <= _top || rect.top >= _bottom); + })).filter('.xe_selected_cell').each(function(){ + var t = jQuery(this); + var row = t.parent('tr'); + var rowspan = self._getSpan(t, 'row'); + var rect = self._getRect(t); + var queue = []; + var clone = t.clone().html('
'); + var topspan = 1, botspan = 1; + + // rowspan > 1이면 현재 셀의 rowspan을 절반으로 분할한다. + if (rowspan > 1) { + + topspan = Math.ceil(rowspan/2); + botspan = rowspan - topspan; + + queue.push(function(){ + t.attr('rowSpan', topspan); + }); + + clone.attr('rowSpan', botspan); + } else { + // rowspan이 없으면 현재 셀과 영역이 겹치는 모든 셀에 rowspan을 추가 + cell.filter(function(){ + if (t.get(0) == this) return false; + + var tt = jQuery(this); + var rc = self._getRect(tt); + + // 범위를 넘은 부분은 제외 + if (rc.bottom <= rect.top || rc.top >= rect.bottom) return false; + + return true; + }).each(function(){ + var tt = jQuery(this); + var sp = self._getSpan(tt, 'row')+1; + + // rowspan 1 추가 + queue.push(function(){ + tt.attr('rowSpan', sp); + }); + }); + + // 새 줄을 추가한다. + if (jQuery.browser.msie) { + // Fix bug for IE + row.after(row.clone().empty().get(0).outerHTML); + } else { + row.after(row.clone().empty()); + } + } + + var rows = row.nextAll('tr'); + + // 현재 셀이 마지막 줄에 있다면 한 줄 추가 후 새로운 셀 추가 + if (!rows.length) { + row.after(row.clone().empty().append(clone)); + } else { + var next_sib = rows.eq(topspan - 1).children('td,th').filter(function(){ + return ( self._getRect(jQuery(this)).left > rect.left ); + }); + + if (jQuery.browser.msie) { + next_sib.length? + next_sib.eq(0).before(clone.get(0).outerHTML): + rows.eq(topspan-1).append(clone.get(0).outerHTML); + } else { + next_sib.length? + next_sib.slice(0,1).before(clone): + rows.slice(topspan-1,1).append(clone); + } + } + + // 함수를 바로 실행하면 좌표가 틀어지므로, 큐에 넣은 후 실행 + jQuery.each(queue, function(){ this(); }); + + }); + }, + + $ON_CELL_SPLIT_BY_COL : function(many) { + var cell = jQuery('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); + var table = cell.parents('table').slice(0,1); + var self = this; + var ie_bug = [], tmpId = (new Date).getTime(), tmpStr = ''; + + // 선택된 셀이 없으면 종료 + if (!cell.length) return; + + // UNDO 지점 기록 + this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Split By Column"]); + + // 선택 영역의 좌우 좌표 구함 + var first_row = cell.eq(0).parent('tr'); + var _left = this._getRect(first_row.find('.xe_selected_cell:first')).left; + var _right = this._getRect(first_row.find('.xe_selected_cell:last')).right; + + // 테이블의 모든 셀에서 선택영역에 해당하는 셀을 구한다(좌우 기준). + (cell = table.find('td,th').filter(function(){ + var rect = self._getRect(jQuery(this)); + + return !(rect.right <= _left || rect.left >= _right); + })).filter('.xe_selected_cell').each(function(idx){ + var t = jQuery(this); + var colspan = self._getSpan(t, 'col'); + var clone = t.clone().html('
'); + + // colspan > 1 이면 colspan을 절반으로 분할한다. + if (colspan > 1) { + var leftspan = Math.ceil(colspan/2); + var rightspan = colspan - leftspan; + + t.attr('colSpan', leftspan); + clone.attr('colSpan', rightspan); + } else { + // colspan이 없으면 현재 셀과 영역이 겹치는 모든 셀에 colspan을 추가 + var rect = self._getRect(t); + + cell.filter(function(){ + if (t.get(0) == this) return false; + + var tt = jQuery(this); + var rc = self._getRect(tt); + + // 범위를 넘은 부분은 제외 + if (rc.right <= rect.left || rc.left >= rect.right) return false; + + return true; + }).each(function(){ + var tt = jQuery(this); + + // colspan 1 추가 + tt.attr('colSpan', self._getSpan(tt, 'col')+1); + }); + + clone.attr('colSpan', 1); + } + + if (jQuery.browser.msie) { + // Fix for IE bug + t.after(clone.get(0).outerHTML); + } else { + t.after(clone); + } + }); + }, + + $ON_CHECK_STYLE_CHANGE : function(){ + var ui = ['merge_cells', 'split_col', 'split_row']; + var app = this.oApp; + var command = (this._startSel && this._startSel.is('.xe_selected_cell'))?'ENABLE_UI':'DISABLE_UI'; + + jQuery.each(ui, function(){ app.exec(command, [this]); }); + }, + + _mousedown : function(event) { + var cur = jQuery(event.target); + var sel = cur.parents().andSelf().filter('td,th,table'); + var app = this.oApp; + var self = this; + + // 모든 선택영역 해제 + jQuery('td.xe_selected_cell', this.oApp.getWYSIWYGDocument()).removeClass('xe_selected_cell'); + + this._startSel = null; + this._endSel = null; + + if (!sel.length || !this._isLeftClicked(event.button)) return; + + function delayed(){ + sel = app.getSelection().cloneRange(); + sel.collapseToStart(); + sel = jQuery(sel.startContainer).parents().andSelf().filter('td,th').eq(0); + + if (!sel.length) return self._removeAllListener()||true; + + // 좌표를 구한다 + self._getRect(self._startSel = sel); + + // 이벤트 바인딩 + self._doc.bind('mousemove', self.$FnMouseMove); + self._doc.bind('mouseup', self.$FnMouseUp); + } + + // mousedown이 일어난 후에 선택 영역이 설정되므로 실행을 지연시킨다. + setTimeout(delayed, 0); + }, + + _mouseup : function(event) { + // 선택된 셀 확인 + this._removeAllListener(); + + // 시작셀과 종료셀 제거 + this._startSel = this._endSel = null; + }, + + _mousemove : function(event) { + var cur = jQuery(event.target); + var cell = cur.parents().andSelf().filter('td,th').eq(0); + var self = this; + + // 마우스 왼쪽 버튼이 눌리지 않았으면 종료 + if (!cell.length || !this._isLeftClicked(event.button)) return; + if (!this._endSel && cell.get(0) == this._startSel.get(0)) return; + if (this._endSel && cell.get(0) == this._endSel.get(0)) return; + + // 종료셀 && 종료셀의 좌표 + this._getRect(this._endSel = cell); + + // 선택 범위를 구한다 + var _top = Math.min(this._startSel.rect.top, this._endSel.rect.top); + var _left = Math.min(this._startSel.rect.left, this._endSel.rect.left); + var _bottom = Math.max(this._startSel.rect.bottom, this._endSel.rect.bottom); + var _right = Math.max(this._startSel.rect.right, this._endSel.rect.right); + + var table = cell.parents('table'); + var cells = table.find('td,th').removeClass('xe_selected_cell'); + var i = 0; + + // 복잡한 모양의 테이블을 위한 반복 처리 + var selected = jQuery(); + do { + // 선택한 셀로 최대 영역 재계산 + selected.each(function(){ + var rect = self._getRect(jQuery(this)); + + // 영역 재계산 + if (rect.right > _right) _right = rect.right; + if (rect.left < _left) _left = rect.left; + if (rect.top < _top) _top = rect.top; + if (rect.bottom > _bottom) _bottom = rect.bottom; + }); + + // 좌표 범위 안에 있는 선택할 셀을 추린다. + cells = cells.filter(':not(.xe_selected_cell)'); + selected = cells.filter(function(){ + var rect = self._getRect(jQuery(this)); + + if (rect.right <= _left || rect.left >= _right || rect.bottom <= _top || rect.top >= _bottom) return false; + + return true; + }).addClass('xe_selected_cell'); + } while(selected.length); + + // 브라우저의 기본 선택영역 해제 : FF 제외 - 기본 기능이 충분히 좋아서 + 이 부분을 실행하면 오류가 발생해서 + if (!jQuery.browser.mozilla) { + function delayed() { + var sel = self.oApp.getSelection(); + + if (!self._startSel) return; + if (!self._startSel.get(0).firstChild) self._startSel.text(" "); + + sel.selectNode(self._startSel.get(0).firstChild); + sel.collapseToStart(); + sel.select(); + } + + setTimeout(delayed, 0); + } + + return false; + }, + + _removeAllListener : function() { + // 이벤트 해제 + this._doc.unbind("mousemove", this.$FnMouseMove); + this._doc.unbind("mouseup", this.$FnMouseUp); + }, + + _isLeftClicked : function(value) { + return jQuery.browser.msie?!!(value & 1):(value == 0); + }, + + _getRect : function(obj) { + var el = obj.get(0); + + obj.rect = {}; + obj.rect.top = el.offsetTop; + obj.rect.left = el.offsetLeft; + obj.rect.bottom = obj.rect.top + el.offsetHeight; + obj.rect.right = obj.rect.left + el.offsetWidth; + + return obj.rect; + }, + + _getSpan : function(obj, type) { + var span = parseInt(jQuery(obj).attr(type+'span')); + + return isNaN(span)?1:span; + } +}).extend(xe.XE_Table); diff --git a/modules/editor/skins/xpresseditor/js/xe_interface.js b/modules/editor/skins/xpresseditor/js/xe_interface.js index 6cb3a7d61..f14cd1ec9 100644 --- a/modules/editor/skins/xpresseditor/js/xe_interface.js +++ b/modules/editor/skins/xpresseditor/js/xe_interface.js @@ -1,166 +1,249 @@ -if (!window.xe) xe = {}; - -xe.Editors = []; - -function editorStart_xe(editor_sequence, primary_key, content_key, editor_height) { - - var textarea = jQuery("#xpress-editor-"+editor_sequence); - var iframe = jQuery('