From da6391718547356faf65f9c46929d03569562158 Mon Sep 17 00:00:00 2001 From: sejin7940 Date: Sat, 9 Aug 2014 00:07:57 +0900 Subject: [PATCH 01/10] Update member.admin.view.php --- modules/member/member.admin.view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/member/member.admin.view.php b/modules/member/member.admin.view.php index eebe090dc..d7fe43ade 100644 --- a/modules/member/member.admin.view.php +++ b/modules/member/member.admin.view.php @@ -94,7 +94,7 @@ class memberAdminView extends member } } $config = $this->memberConfig; - $memberIdentifiers = array('email_address'=>'email_address', 'user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name'); + $memberIdentifiers = array('user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name'); $usedIdentifiers = array(); if(is_array($config->signupForm)) From 565614696f567c32e3fb256e5dff292df65aee3e Mon Sep 17 00:00:00 2001 From: akasima Date: Tue, 12 Aug 2014 15:30:24 +0900 Subject: [PATCH 02/10] #905 install using config/install.config.php --- modules/install/install.view.php | 20 ++++++++++++++++++++ modules/install/script/ko.install.php | 12 ++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/modules/install/install.view.php b/modules/install/install.view.php index 38e34fdaa..55fcd644c 100644 --- a/modules/install/install.view.php +++ b/modules/install/install.view.php @@ -35,6 +35,26 @@ class installView extends install $install_config_file = FileHandler::getRealPath('./config/install.config.php'); if(file_exists($install_config_file)) { + /** + * If './config/install.config.php' file created and write array shown in the example below, XE installed using config file. + * ex ) + $install_config = array( + 'db_type' =>'mysqli_innodb', + 'db_port' =>'3306', + 'db_hostname' =>'localhost', + 'db_userid' =>'root', + 'db_password' =>'root', + 'db_database' =>'xe_database', + 'db_table_prefix' =>'xe', + 'user_rewrite' =>'N', + 'time_zone' =>'0000', + 'email_address' =>'admin@xe.com', + 'password' =>'pass', + 'password2' =>'pass', + 'nick_name' =>'admin', + 'user_id' =>'admin', + ); + */ include $install_config_file; if(is_array($install_config)) { diff --git a/modules/install/script/ko.install.php b/modules/install/script/ko.install.php index be74a5750..d0475ff8c 100644 --- a/modules/install/script/ko.install.php +++ b/modules/install/script/ko.install.php @@ -2,6 +2,7 @@ // ko/en/... $lang = Context::getLangType(); +$logged_info = Context::get('logged_info'); // insertMenu $oMenuAdminController = getAdminController('menu'); /* @var $oMenuAdminController menuAdminController */ @@ -114,20 +115,27 @@ $oDocumentModel = getModel('document'); /* @var $oDocumentModel documentModel */ $oDocumentController = getController('document'); /* @var $oDocumentController documentController */ $obj = new stdClass; + +$obj->member_srl = $logged_info->member_srl; +$obj->user_id = htmlspecialchars_decode($logged_info->user_id); +$obj->user_name = htmlspecialchars_decode($logged_info->user_name); +$obj->nick_name = htmlspecialchars_decode($logged_info->nick_name); +$obj->email_address = $logged_info->email_address; + $obj->module_srl = $module_srl; Context::set('version', __XE_VERSION__); $obj->title = 'Welcome XE'; $obj->content = $oTemplateHandler->compile(_XE_PATH_ . 'modules/install/script/welcome_content', 'welcome_content_'.$lang); -$output = $oDocumentController->insertDocument($obj); +$output = $oDocumentController->insertDocument($obj, true); if(!$output->toBool()) return $output; $document_srl = $output->get('document_srl'); unset($obj->document_srl); $obj->title = 'Welcome mobile XE'; -$output = $oDocumentController->insertDocument($obj); +$output = $oDocumentController->insertDocument($obj, true); if(!$output->toBool()) return $output; // save PageWidget From 72dd48a59600a16cca4b714621868de1cc969fe2 Mon Sep 17 00:00:00 2001 From: akasima Date: Tue, 12 Aug 2014 15:04:16 +0900 Subject: [PATCH 03/10] #904 autoinstall without ftp --- classes/file/FileHandler.class.php | 27 ++++ .../autoinstall.admin.controller.php | 21 ++- .../autoinstall/autoinstall.admin.model.php | 55 ++++++++ .../autoinstall/autoinstall.admin.view.php | 7 + modules/autoinstall/autoinstall.lib.php | 125 ++++++++++++++++++ modules/autoinstall/lang/lang.xml | 5 + modules/autoinstall/tpl/install.html | 10 +- modules/autoinstall/tpl/uninstall.html | 11 +- 8 files changed, 253 insertions(+), 8 deletions(-) diff --git a/classes/file/FileHandler.class.php b/classes/file/FileHandler.class.php index db1a82f62..968233923 100644 --- a/classes/file/FileHandler.class.php +++ b/classes/file/FileHandler.class.php @@ -1017,6 +1017,33 @@ class FileHandler $path = self::getRealPath($path); return is_dir($path) ? $path : FALSE; } + + /** + * Check is writable dir + * + * @param string $path Target dir path + * @return bool + */ + function isWritableDir($path) + { + $path = self::getRealPath($path); + if(is_dir($path)==FALSE) + { + return FALSE; + } + + $checkFile = $path . '/_CheckWritableDir'; + + $fp = fopen($checkFile, 'w'); + if(!is_resource($fp)) + { + return FALSE; + } + fclose($fp); + + self::removeFile($checkFile); + return TRUE; + } } /* End of file FileHandler.class.php */ diff --git a/modules/autoinstall/autoinstall.admin.controller.php b/modules/autoinstall/autoinstall.admin.controller.php index 0559ed293..25c4e7efe 100644 --- a/modules/autoinstall/autoinstall.admin.controller.php +++ b/modules/autoinstall/autoinstall.admin.controller.php @@ -181,6 +181,7 @@ class autoinstallAdminController extends autoinstall @set_time_limit(0); $package_srls = Context::get('package_srl'); $oModel = getModel('autoinstall'); + $oAdminModel = getAdminModel('autoinstall'); $packages = explode(',', $package_srls); $ftp_info = Context::getFTPInfo(); if(!$_SESSION['ftp_password']) @@ -196,7 +197,11 @@ class autoinstallAdminController extends autoinstall foreach($packages as $package_srl) { $package = $oModel->getPackage($package_srl); - if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) + if($oAdminModel->checkUseDirectModuleInstall($package)->toBool()) + { + $oModuleInstaller = new DirectModuleInstaller($package); + } + else if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) { $oModuleInstaller = new SFTPModuleInstaller($package); } @@ -308,7 +313,11 @@ class autoinstallAdminController extends autoinstall { $package_srl = Context::get('package_srl'); - $this->uninstallPackageByPackageSrl($package_srl); + $output = $this->uninstallPackageByPackageSrl($package_srl); + if($output->toBool()==FALSE) + { + return $output; + } if(Context::get('return_url')) { @@ -348,6 +357,8 @@ class autoinstallAdminController extends autoinstall { $path = $package->path; + $oAdminModel = getAdminModel('autoinstall'); + if(!$_SESSION['ftp_password']) { $ftp_password = Context::get('ftp_password'); @@ -359,7 +370,11 @@ class autoinstallAdminController extends autoinstall $ftp_info = Context::getFTPInfo(); $isSftpSupported = function_exists(ssh2_sftp); - if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) + if($oAdminModel->checkUseDirectModuleInstall($package)->toBool()) + { + $oModuleInstaller = new DirectModuleInstaller($package); + } + else if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) { $oModuleInstaller = new SFTPModuleInstaller($package); } diff --git a/modules/autoinstall/autoinstall.admin.model.php b/modules/autoinstall/autoinstall.admin.model.php index 0b228e801..cae7cf93d 100644 --- a/modules/autoinstall/autoinstall.admin.model.php +++ b/modules/autoinstall/autoinstall.admin.model.php @@ -348,6 +348,61 @@ class autoinstallAdminModel extends autoinstall $this->add('package', $package); } + public function checkUseDirectModuleInstall($package) + { + $directModuleInstall = TRUE; + $arrUnwritableDir = array(); + $output = $this->isWritableDir($package->path); + if($output->toBool()==FALSE) + { + $directModuleInstall = FALSE; + $arrUnwritableDir[] = $output->get('path'); + } + + foreach($package->depends as $dep) + { + $output = $this->isWritableDir($dep->path); + if($output->toBool()==FALSE) + { + $directModuleInstall = FALSE; + $arrUnwritableDir[] = $output->get('path'); + } + } + + if($directModuleInstall==FALSE) + { + $output = new Object(-1, 'msg_direct_inall_invalid'); + $output->add('path', $arrUnwritableDir); + return $output; + } + + return new Object(); + } + + public function isWritableDir($path) + { + $path_list = explode('/', dirname($path)); + $real_path = './'; + + while($path_list) + { + $check_path = $real_path . implode('/', $path_list); + if(FileHandler::isDir($check_path)) + { + break; + } + array_pop($path_list); + } + + if(FileHandler::isWritableDir($check_path)==FALSE) + { + $output = new Object(-1, 'msg_unwritable_directory'); + $output->add('path', FileHandler::getRealPath($check_path)); + return $output; + } + return new Object(); + } + } /* End of file autoinstall.admin.model.php */ /* Location: ./modules/autoinstall/autoinstall.admin.model.php */ diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index 956ac3e3f..2f5c02717 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -368,6 +368,9 @@ class autoinstallAdminView extends autoinstall Context::set('need_password', TRUE); } + $output = $oAdminModel->checkUseDirectModuleInstall($package); + Context::set('directModuleInstall', $output); + $this->setTemplateFile('install'); $security = new Security(); @@ -503,6 +506,7 @@ class autoinstallAdminView extends autoinstall } $oModel = getModel('autoinstall'); + $oAdminModel = getAdminModel('autoinstall'); $installedPackage = $oModel->getInstalledPackage($package_srl); if(!$installedPackage) { @@ -529,6 +533,9 @@ class autoinstallAdminView extends autoinstall return $this->stop("msg_invalid_request"); } + $output = $oAdminModel->checkUseDirectModuleInstall($installedPackage); + Context::set('directModuleInstall', $output); + $params["act"] = "getResourceapiPackages"; $params["package_srls"] = $package_srl; $body = XmlGenerater::generate($params); diff --git a/modules/autoinstall/autoinstall.lib.php b/modules/autoinstall/autoinstall.lib.php index f1ebfbad2..ec75d030b 100644 --- a/modules/autoinstall/autoinstall.lib.php +++ b/modules/autoinstall/autoinstall.lib.php @@ -867,6 +867,131 @@ class FTPModuleInstaller extends ModuleInstaller return new Object(); } +} + +/** + * Module installer for Direct. Not use FTP + * @author NAVER (developers@xpressengine.com) + */ +class DirectModuleInstaller extends ModuleInstaller +{ + /** + * Constructor + * + * @param object $package Package information + */ + function DirectModuleInstaller(&$package) + { + $this->package = &$package; + } + + /** + * empty + * + * @return Object + */ + function _connect() + { + return new Object(); + } + + /** + * Remove file + * + * @param string $path Path to remove + * @return Object + */ + function _removeFile($path) + { + if(substr($path, 0, 2) == "./") + { + $path = substr($path, 2); + } + $target_path = FileHandler::getRealPath($path); + + if(!FileHandler::removeFile($target_path)) + { + return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path)); + } + return new Object(); + } + + /** + * Remove directory + * @param string $path Path to remove + * @return Object + */ + function _removeDir_real($path) + { + if(substr($path, 0, 2) == "./") + { + $path = substr($path, 2); + } + $target_path = FileHandler::getRealPath($path); + + FileHandler::removeDir($target_path); + + return new Object(); + } + + /** + * Close + * + * @return void + */ + function _close() + { + } + + /** + * Copy directory + * + * @param array $file_list File list to copy + * @return Object + */ + function _copyDir(&$file_list) + { + $output = $this->_connect(); + if(!$output->toBool()) + { + return $output; + } + $target_dir = $this->target_path; + + if(is_array($file_list)) + { + foreach($file_list as $k => $file) + { + $org_file = $file; + if($this->package->path == ".") + { + $file = substr($file, 3); + } + $path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file); + $path_list = explode('/', dirname($this->target_path . "/" . $file)); + $real_path = "./"; + + for($i = 0; $i < count($path_list); $i++) + { + if($path_list == "") + { + continue; + } + $real_path .= $path_list[$i] . "/"; + if(!file_exists(FileHandler::getRealPath($real_path))) + { + FileHandler::makeDir($real_path); + } + } + FileHandler::copyFile( FileHandler::getRealPath($this->download_path . "/" . $org_file), FileHandler::getRealPath("./" . $target_dir . '/' . $file)); + } + } + + $this->_close(); + + return new Object(); + } + } /* End of file autoinstall.lib.php */ /* Location: ./modules/autoinstall/autoinstall.lib.php */ diff --git a/modules/autoinstall/lang/lang.xml b/modules/autoinstall/lang/lang.xml index 00aad260d..5998c0f52 100644 --- a/modules/autoinstall/lang/lang.xml +++ b/modules/autoinstall/lang/lang.xml @@ -323,6 +323,11 @@ + + + + + diff --git a/modules/autoinstall/tpl/install.html b/modules/autoinstall/tpl/install.html index 7cf5e506d..3efbc0fd4 100644 --- a/modules/autoinstall/tpl/install.html +++ b/modules/autoinstall/tpl/install.html @@ -40,10 +40,10 @@ - + - +
@@ -52,6 +52,12 @@
+ +

{$lang->msg_direct_install_not_supported}

+
    +
  • {$path}
  • +
+
diff --git a/modules/autoinstall/tpl/uninstall.html b/modules/autoinstall/tpl/uninstall.html index 23a75e646..d6f6b5c2c 100644 --- a/modules/autoinstall/tpl/uninstall.html +++ b/modules/autoinstall/tpl/uninstall.html @@ -17,10 +17,10 @@ - + - +
@@ -29,7 +29,12 @@
- + +

{$lang->msg_direct_install_not_supported}

+
    +
  • {$path}
  • +
+
From eb3da2617e46be24353e9d82dee154db2c8d9095 Mon Sep 17 00:00:00 2001 From: akasima Date: Wed, 13 Aug 2014 11:21:03 +0900 Subject: [PATCH 04/10] #900 add error option in exec_json, exec_html --- common/js/xe.js | 114 ++++++++++++++++++++++++++++----------- common/js/xe.min.js | 2 +- common/js/xml_handler.js | 114 ++++++++++++++++++++++++++++----------- 3 files changed, 165 insertions(+), 65 deletions(-) diff --git a/common/js/xe.js b/common/js/xe.js index 7b6ad2a92..c86fe3edd 100644 --- a/common/js/xe.js +++ b/common/js/xe.js @@ -1650,31 +1650,55 @@ function xml2json(xml, tab, ignoreAttrib) { if(typeof(xeVid)!='undefined') $.extend(data,{vid:xeVid}); - $.ajax({ - type: "POST", - dataType: "json", - url: request_uri, - contentType: "application/json", - data: $.param(data), - success: function(data) { - $(".wfsr").hide().trigger('cancel_confirm'); - if(data.error != '0' && data.error > -1000) { - if(data.error == -1 && data.message == 'msg_is_not_administrator') { - alert('You are not logged in as an administrator'); - if($.isFunction(callback_error)) callback_error(data); + try { + $.ajax({ + type: "POST", + dataType: "json", + url: request_uri, + contentType: "application/json", + data: $.param(data), + success: function(data) { + $(".wfsr").hide().trigger('cancel_confirm'); + if(data.error != '0' && data.error > -1000) { + if(data.error == -1 && data.message == 'msg_is_not_administrator') { + alert('You are not logged in as an administrator'); + if($.isFunction(callback_error)) callback_error(data); - return; - } else { - alert(data.message); - if($.isFunction(callback_error)) callback_error(data); + return; + } else { + alert(data.message); + if($.isFunction(callback_error)) callback_error(data); - return; + return; + } } - } - if($.isFunction(callback_sucess)) callback_sucess(data); - } - }); + if($.isFunction(callback_sucess)) callback_sucess(data); + }, + error: function(xhr, textStatus) { + $(".wfsr").hide(); + + var msg = ''; + + if (textStatus == 'parsererror') { + msg = 'The result is not valid JSON :\n-------------------------------------\n'; + + if(xhr.responseText === "") return; + + msg += xhr.responseText.replace(/<[^>]+>/g, ''); + } else { + msg = textStatus; + } + + try{ + console.log(msg); + } catch(ee){} + } + }); + } catch(e) { + alert(e); + return; + } } }; @@ -1694,17 +1718,43 @@ function xml2json(xml, tab, ignoreAttrib) { if(show_waiting_message) $(".wfsr").html(waiting_message).show(); $.extend(data,{module:action[0],act:action[1]}); - $.ajax({ - type:"POST", - dataType:"html", - url:request_uri, - data:$.param(data), - success : function(html){ - $(".wfsr").hide().trigger('cancel_confirm'); - self[type](html); - if($.isFunction(func)) func(args); - } - }); + try { + $.ajax({ + type:"POST", + dataType:"html", + url:request_uri, + data:$.param(data), + success : function(html){ + $(".wfsr").hide().trigger('cancel_confirm'); + self[type](html); + if($.isFunction(func)) func(args); + }, + error: function(xhr, textStatus) { + $(".wfsr").hide(); + + var msg = ''; + + if (textStatus == 'parsererror') { + msg = 'The result is not valid page :\n-------------------------------------\n'; + + if(xhr.responseText === "") return; + + msg += xhr.responseText.replace(/<[^>]+>/g, ''); + } else { + msg = textStatus; + } + + try{ + console.log(msg); + } catch(ee){} + } + + }); + + } catch(e) { + alert(e); + return; + } } }; diff --git a/common/js/xe.min.js b/common/js/xe.min.js index c971b5c4d..0e871f313 100644 --- a/common/js/xe.min.js +++ b/common/js/xe.min.js @@ -3,4 +3,4 @@ * @file common.js + js_app.js + xml_handler.js + xml_js_filter.js * @brief XE Common JavaScript **/ -function xSleep(a){a/=1e3;for(var b=new Date,c=new Date;c.getTime()-b.getTime()-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid));try{"_blank"!=b&&winopen_list[b]&&(winopen_list[b].close(),winopen_list[b]=null)}catch(d){}"undefined"==typeof b&&(b="_blank"),"undefined"==typeof c&&(c="");var e=window.open(a,b,c);e.focus(),"_blank"!=b&&(winopen_list[b]=e)}function popopen(a,b){"undefined"==typeof b&&(b="_blank"),"undefined"!=typeof xeVid&&a.indexOf(request_uri)>-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid)),winopen(a,b,"width=800,height=600,scrollbars=yes,resizable=yes,toolbars=no")}function sendMailTo(a){location.href="mailto:"+a}function move_url(a,b){return a?("undefined"==typeof b&&(b="N"),b="N"==b?!1:!0,/^\./.test(a)&&(a=request_uri+a),b?winopen(a):location.href=a,!1):!1}function displayMultimedia(a,b,c,d){var e=_displayMultimedia(a,b,c,d);e&&document.writeln(e)}function _displayMultimedia(a,b,c,d){0===a.indexOf("files")&&(a=request_uri+a);var e={wmode:"transparent",allowScriptAccess:"never",quality:"high",flashvars:"",autostart:!1},f=jQuery.extend(e,d||{}),g=f.autostart&&"false"!=f.autostart?"true":"false";delete f.autostart;var h="",i="",j="";if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(a))j='';else if(/\.flv$/i.test(a)||/\.mov$/i.test(a)||/\.moov$/i.test(a)||/\.m4v$/i.test(a))j='';else if(/\.swf/i.test(a)){h="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",i="undefined"!=typeof enforce_ssl&&enforce_ssl?"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0":"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0",j='',j+='';for(var k in f)"undefined"!=f[k]&&""!==f[k]&&(j+='');j+=''}else(jQuery.browser.mozilla||jQuery.browser.opera)&&(g=f.autostart&&"false"!=f.autostart?"1":"0"),j='.popup");e=h.css({overflow:"scroll"}).offset(),a=h.width(10).height(1e4).get(0).scrollWidth+2*e.left,b=h.height(10).width(1e4).get(0).scrollHeight+2*e.top,800>a&&(a=800+2*e.left),c=g.width(),d=g.height(),a!=c&&window.resizeBy(a-c,0),b!=d&&window.resizeBy(0,b-d),h.width(a-2*e.left).css({overflow:"",height:""})}function doCallModuleAction(a,b,c){var d={target_srl:c,cur_mid:current_mid,mid:current_mid};exec_xml(a,b,d,completeCallModuleAction)}function completeCallModuleAction(a){"success"!=a.message&&alert(a.message),location.reload()}function completeMessage(a){alert(a.message),location.reload()}function doChangeLangType(a){if("string"==typeof a)setLangType(a);else{var b=a.options[a.selectedIndex].value;setLangType(b)}location.href=location.href.setQuery("l","")}function setLangType(a){var b=new Date;b.setTime(b.getTime()+6048e8),setCookie("lang_type",a,b,"/")}function doDocumentPreview(a){for(var b=a;"FORM"!=b.nodeName;)b=b.parentNode;if("FORM"==b.nodeName){var c=b.getAttribute("editor_sequence"),d=editorGetContent(c),e=(window.open("","previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes"),jQuery("#previewDocument"));e.length?e=e[0]:(jQuery('
').appendTo(document.body),e=jQuery("#previewDocument")[0]),e&&(e.content.value=d,e.submit())}}function doDocumentSave(a){var b=a.form.getAttribute("editor_sequence"),c=editorRelKeys[b].content.value;if("undefined"!=typeof b&&b&&"undefined"!=typeof editorRelKeys&&"function"==typeof editorGetContent){var d=editorGetContent(b);editorRelKeys[b].content.value=d}var e={},f=["error","message","document_srl"],g=(a.form.elements,jQuery(a.form).serializeArray());return jQuery.each(g,function(a,b){var c=jQuery.trim(b.value);return c?(/\[\]$/.test(b.name)&&(b.name=b.name.replace(/\[\]$/,"")),void(e[b.name]?e[b.name]+="|@|"+c:e[b.name]=b.value)):!0}),exec_xml("document","procDocumentTempSave",e,completeDocumentSave,f,e,a.form),editorRelKeys[b].content.value=c,!1}function completeDocumentSave(a){jQuery("input[name=document_srl]").eq(0).val(a.document_srl),alert(a.message)}function doDocumentLoad(a){objForSavedDoc=a.form,popopen(request_uri.setQuery("module","document").setQuery("act","dispTempSavedList"))}function doDocumentSelect(a,b){if(!opener||!opener.objForSavedDoc)return void window.close();switch(void 0===b&&(b="document"),b){case"page":opener.location.href=opener.current_url.setQuery("document_srl",a).setQuery("act","dispPageAdminContentModify");break;default:opener.location.href=opener.current_url.setQuery("document_srl",a).setQuery("act","dispBoardWrite")}window.close()}function viewSkinInfo(a,b){popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+a+"&skin="+b,"SkinInfo")}function doAddDocumentCart(a){var b=a.value;addedDocument[addedDocument.length]=b,setTimeout(function(){callAddDocumentCart(addedDocument.length)},100)}function callAddDocumentCart(a){if(!(addedDocument.length<1||a!=addedDocument.length)){var b=[];b.srls=addedDocument.join(","),exec_xml("document","procDocumentAddCart",b,null),addedDocument=[]}}function transRGB2Hex(a){if(!a)return a;if(a.indexOf("#")>-1)return a.replace(/^#/,"");if(a.toLowerCase().indexOf("rgb")<0)return a;a=a.replace(/^rgb\(/i,"").replace(/\)$/,""),value_list=a.split(",");for(var b="",c=0;cf&&2>g){d.removeWhite(a);for(var j=a.firstChild;j;j=j.nextSibling)3==j.nodeType?b=d.escape(j.nodeValue):4==j.nodeType?b=d.escape(j.nodeValue):b[j.nodeName]?b[j.nodeName]instanceof Array?b[j.nodeName][b[j.nodeName].length]=d.toObj(j):b[j.nodeName]=[b[j.nodeName],d.toObj(j)]:b[j.nodeName]=d.toObj(j)}else a.attributes.length?b["#text"]=d.escape(d.innerXml(a)):b=d.escape(d.innerXml(a));else if(f)a.attributes.length?b["#text"]=d.escape(d.innerXml(a)):b=d.escape(d.innerXml(a));else if(g)if(g>1)b=d.escape(d.innerXml(a));else for(var k=a.firstChild;k;k=k.nextSibling)b=d.escape(k.nodeValue)}a.attributes.length||a.firstChild||(b=null)}else 9==a.nodeType?b=d.toObj(a.documentElement):alert("unhandled node type: "+a.nodeType);return b},toJson:function(a,b,c){var e=b?'"'+b+'"':"";if(a instanceof Array){for(var f=0,g=a.length;g>f;f++)a[f]=d.toJson(a[f],"",c+" ");e+=(b?":[":"[")+(a.length>1?"\n"+c+" "+a.join(",\n"+c+" ")+"\n"+c:a.join(""))+"]"}else if(null===a)e+=(b&&":")+"null";else if("object"==typeof a){var h=[];for(var i in a)h[h.length]=d.toJson(a[i],i,c+" ");e+=(b?":{":"{")+(h.length>1?"\n"+c+" "+h.join(",\n"+c+" ")+"\n"+c:h.join(""))+"}"}else e+="string"==typeof a?(b&&":")+'"'+a.toString()+'"':(b&&":")+a.toString();return e},innerXml:function(a){var b="";if("innerHTML"in a)b=a.innerHTML;else for(var c=function(a){var b="";if(1==a.nodeType){b+="<"+a.nodeName;for(var d=0;d"}else b+="/>"}else 3==a.nodeType?b+=a.nodeValue:4==a.nodeType&&(b+="");return b},d=a.firstChild;d;d=d.nextSibling)b+=c(d);return b},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();for(var b=a.firstChild;b;)if(3==b.nodeType)if(b.nodeValue.match(/[^ \f\n\r\t\v]/))b=b.nextSibling;else{var c=b.nextSibling;a.removeChild(b),b=c}else 1==b.nodeType?(d.removeWhite(b),b=b.nextSibling):b=b.nextSibling;return a}};9==a.nodeType&&(a=a.documentElement);var e,f=d.toObj(d.removeWhite(a));return e=d.toJson(f,a.nodeName,""),"{"+(b?e.replace(/\t/g,b):e.replace(/\t|\n/g,""))+"}"}function filterAlertMessage(a){var b=(a.error,a.message),c=a.act,d=a.redirect_url,e=location.href;"undefined"!=typeof b&&b&&"success"!=b&&alert(b),"undefined"!=typeof c&&c?e=current_url.setQuery("act",c):"undefined"!=typeof d&&d&&(e=d),e==location.href&&(e=e.replace(/#(.*)$/,"")),location.href=e}function procFilter(a,b){return b(a),!1}function legacy_filter(a,b,c,d,e,f,g,h){var i=xe.getApp("Validator")[0],j=jQuery,k=[];return i?(b.elements._filter||j(b).prepend(''),b.elements._filter.value=a,k[0]=a,k[1]=function(a){var i={},k=(a.elements,j(a).serializeArray());return j.each(k,function(a,b){var c=j.trim(b.value),d=b.name;return c&&d?(h[d]&&(d=h[d]),/\[\]$/.test(d)&&(d=d.replace(/\[\]$/,"")),void(i[d]?i[d]+="|@|"+c:i[d]=b.value)):!0}),g&&!confirm(g)?!1:void exec_xml(c,d,i,e,f,i,b)},i.cast("ADD_CALLBACK",k),i.cast("VALIDATE",[b,a]),!1):!1}jQuery&&jQuery.noConflict(),function(a){var b=navigator.userAgent.toLowerCase();a.os={Linux:/linux/.test(b),Unix:/x11/.test(b),Mac:/mac/.test(b),Windows:/win/.test(b)},a.os.name=a.os.Windows?"Windows":a.os.Linux?"Linux":a.os.Unix?"Unix":a.os.Mac?"Mac":"",window.XE={loaded_popup_menus:[],addedDocument:[],checkboxToggleAll:function(b){is_def(b)||(b="cart");var c,d={wrap:null,checked:"toggle",doClick:!1};switch(arguments.length){case 1:"string"==typeof arguments[0]?b=arguments[0]:(a.extend(d,arguments[0]||{}),b="cart");break;case 2:b=arguments[0],a.extend(d,arguments[1]||{})}d.doClick===!0&&(d.checked=null),"string"==typeof d.wrap&&(d.wrap="#"+d.wrap),c=d.wrap?a(d.wrap).find('input[name="'+b+'"]:checkbox'):a('input[name="'+b+'"]:checkbox'),"toggle"==d.checked?c.each(function(){a(this).attr("checked",a(this).attr("checked")?!1:!0)}):d.doClick===!0?c.click():c.attr("checked",d.checked)},displayPopupMenu:function(b,c,d){var e=(d.target_srl,d.menu_id),f=b.menus,g="";if(this.loaded_popup_menus[e])g=this.loaded_popup_menus[e];else{if(f){var h=f.item;if(("undefined"==typeof h.length||h.length<1)&&(h=new Array(h)),h.length)for(var i=0;i"+k+" "}}this.loaded_popup_menus[e]=g}if(g){var o=a("#popup_menu_area").html("
    "+g+"
"),p={top:d.page_y,left:d.page_x};o.outerHeight()+p.top>a(window).height()+a(window).scrollTop()&&(p.top=a(window).height()-o.outerHeight()+a(window).scrollTop()),o.outerWidth()+p.left>a(window).width()+a(window).scrollLeft()&&(p.left=a(window).width()-o.outerWidth()+a(window).scrollLeft()),o.css({top:p.top,left:p.left}).show().focus()}}}}(jQuery),jQuery(function(a){a.browser.msie&&a("select").each(function(a,b){for(var c=!1,d=[],e=0;e-1?d[a]:e;c&&(b.oldonchange=b.onchange,b.onchange=function(){this.options[this.selectedIndex].disabled?this.selectedIndex=d[a]:this.oldonchange&&this.oldonchange()},b.selectedIndex>=0&&b.options[b.selectedIndex].disabled&&b.onchange())});var b=a(".xe_content .fold_button");if(b.size()){var c=a("div.fold_container",b);a("button.more",b).click(function(){a(this).hide().next("button").show().parent().next(c).show()}),a("button.less",b).click(function(){a(this).hide().prev("button").show().parent().next(c).hide()})}jQuery('input[type="submit"],button[type="submit"]').click(function(a){var b=jQuery(a.currentTarget);setTimeout(function(){return function(){b.attr("disabled","disabled")}}(),0),setTimeout(function(){return function(){b.removeAttr("disabled")}}(),3e3)})}),function(){function a(a,b){return a.replace(/#.*$/,"")===b.replace(/#.*$/,"")}var b=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)};String.prototype.getQuery=function(b){var c=a(this,window.location.href)?current_url:this,d=c.indexOf("?");if(-1==d)return null;var e=c.substr(d+1,this.length),f={};e.replace(/([^=]+)=([^&]*)(&|$)/g,function(){f[arguments[1]]=arguments[2]});var g=f[b];return"undefined"==typeof g&&(g=""),g},String.prototype.setQuery=function(c,d){var e,f,g,h,i=a(this,window.location.href)?current_url:this,j=i.indexOf("?"),k=i.replace(/#$/,"");if("undefined"==typeof d&&(d=""),-1!=j){var l=k.substr(j+1,i.length),m={},n=[];k=i.substr(0,j),l.replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){m[b]=c}),m[c]=d;for(var o in m)m.hasOwnProperty(o)&&(g=String(m[o]).trim())&&n.push(o+"="+decodeURI(g));l=n.join("&"),k+=l?"?"+l:""}else String(d).trim()&&(k=k+"?"+c+"="+d);f=/^https:\/\/([^:\/]+)(:\d+|)/i,f.test(k)&&(h="http://"+RegExp.$1,window.http_port&&80!=http_port&&(h+=":"+http_port),k=k.replace(f,h));var p=!!window.enforce_ssl;if(!p&&b(window.ssl_actions)&&(e=k.getQuery("act")))for(var q=0,r=ssl_actions.length;r>q;q++)if(ssl_actions[q]===e){p=!0;break}return f=/http:\/\/([^:\/]+)(:\d+|)/i,p&&f.test(k)&&(h="https://"+RegExp.$1,window.https_port&&443!=https_port&&(h+=":"+https_port),k=k.replace(f,h)),k=k.replace(/\/(index\.php)?\?/,"/index.php?"),encodeURI(k)},String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")}}();var winopen_list=[],objForSavedDoc=null,addedDocument=[],Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=Base64._utf8_encode(a);j>2,f=(3&b)<<4|c>>4,g=(15&c)<<2|d>>6,h=63&d,isNaN(c)?g=h=64:isNaN(d)&&(h=64),i=i+this._keyStr.charAt(e)+this._keyStr.charAt(f)+this._keyStr.charAt(g)+this._keyStr.charAt(h);return i},decode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");j>4,c=(15&f)<<4|g>>2,d=(3&g)<<6|h,i+=String.fromCharCode(b),64!=g&&(i+=String.fromCharCode(c)),64!=h&&(i+=String.fromCharCode(d));return i=Base64._utf8_decode(i)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;cd?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=0,e=0,f=0;cd?(b+=String.fromCharCode(d),c++):d>191&&224>d?(e=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&e),c+=2):(e=a.charCodeAt(c+1),f=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&e)<<6|63&f),c+=3);return b}};"undefined"==typeof resizeImageContents&&(window.resizeImageContents=function(){}),"undefined"==typeof activateOptionDisabled&&(window.activateOptionDisabled=function(){}),objectExtend=jQuery.extend;var loaded_popup_menus=XE.loaded_popup_menus;jQuery(function(a){a(document).click(function(b){var c=a("#popup_menu_area");c.length||(c=a(' -
- -
- - {$val->description} -
-
+ + + +

{$var->group}

+ {@$group = $var->group} +
+ {@$not_first = true} +
+
+ +
+ + + + {nl2br($var->description)} +
+
+
+
+ +
From e2ecc73fba69044365ece50681fa6edd9e6efac4 Mon Sep 17 00:00:00 2001 From: akasima Date: Wed, 13 Aug 2014 16:27:13 +0900 Subject: [PATCH 07/10] #907 replace to addBack() because andSelf() deprecated --- modules/editor/skins/xpresseditor/js/Xpress_Editor.js | 8 ++++---- modules/editor/skins/xpresseditor/js/xpresseditor.js | 8 ++++---- modules/editor/skins/xpresseditor/js/xpresseditor.min.js | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/editor/skins/xpresseditor/js/Xpress_Editor.js b/modules/editor/skins/xpresseditor/js/Xpress_Editor.js index 195227a63..3c50a3018 100644 --- a/modules/editor/skins/xpresseditor/js/Xpress_Editor.js +++ b/modules/editor/skins/xpresseditor/js/Xpress_Editor.js @@ -5492,7 +5492,7 @@ xe.XE_Table = $.Class({ // 첫번째 셀 가로 확장 var colspan = 0; - cell.eq(0).nextAll('td,th').andSelf().filter('.xe_selected_cell').each(function(idx){ + cell.eq(0).nextAll('td,th').addBack().filter('.xe_selected_cell').each(function(idx){ colspan += self._getSpan(this, 'col'); }); @@ -5685,7 +5685,7 @@ xe.XE_Table = $.Class({ _mousedown : function(event) { var cur = $(event.target); - var sel = cur.parents().andSelf().filter('td,th,table'); + var sel = cur.parents().addBack().filter('td,th,table'); var app = this.oApp; var self = this; @@ -5700,7 +5700,7 @@ xe.XE_Table = $.Class({ function delayed(){ sel = app.getSelection().cloneRange(); sel.collapseToStart(); - sel = $(sel.startContainer).parents().andSelf().filter('td,th').eq(0); + sel = $(sel.startContainer).parents().addBack().filter('td,th').eq(0); if (!sel.length) return self._removeAllListener()||true; @@ -5726,7 +5726,7 @@ xe.XE_Table = $.Class({ _mousemove : function(event) { var cur = $(event.target); - var cell = cur.parents().andSelf().filter('td,th').eq(0); + var cell = cur.parents().addBack().filter('td,th').eq(0); var self = this; // 마우스 왼쪽 버튼이 눌리지 않았으면 종료 diff --git a/modules/editor/skins/xpresseditor/js/xpresseditor.js b/modules/editor/skins/xpresseditor/js/xpresseditor.js index 09253b924..9db74d536 100644 --- a/modules/editor/skins/xpresseditor/js/xpresseditor.js +++ b/modules/editor/skins/xpresseditor/js/xpresseditor.js @@ -5497,7 +5497,7 @@ xe.XE_Table = $.Class({ // 첫번째 셀 가로 확장 var colspan = 0; - cell.eq(0).nextAll('td,th').andSelf().filter('.xe_selected_cell').each(function(idx){ + cell.eq(0).nextAll('td,th').addBack().filter('.xe_selected_cell').each(function(idx){ colspan += self._getSpan(this, 'col'); }); @@ -5690,7 +5690,7 @@ xe.XE_Table = $.Class({ _mousedown : function(event) { var cur = $(event.target); - var sel = cur.parents().andSelf().filter('td,th,table'); + var sel = cur.parents().addBack().filter('td,th,table'); var app = this.oApp; var self = this; @@ -5705,7 +5705,7 @@ xe.XE_Table = $.Class({ function delayed(){ sel = app.getSelection().cloneRange(); sel.collapseToStart(); - sel = $(sel.startContainer).parents().andSelf().filter('td,th').eq(0); + sel = $(sel.startContainer).parents().addBack().filter('td,th').eq(0); if (!sel.length) return self._removeAllListener()||true; @@ -5731,7 +5731,7 @@ xe.XE_Table = $.Class({ _mousemove : function(event) { var cur = $(event.target); - var cell = cur.parents().andSelf().filter('td,th').eq(0); + var cell = cur.parents().addBack().filter('td,th').eq(0); var self = this; // 마우스 왼쪽 버튼이 눌리지 않았으면 종료 diff --git a/modules/editor/skins/xpresseditor/js/xpresseditor.min.js b/modules/editor/skins/xpresseditor/js/xpresseditor.min.js index 3c8c36122..9b9f35605 100644 --- a/modules/editor/skins/xpresseditor/js/xpresseditor.min.js +++ b/modules/editor/skins/xpresseditor/js/xpresseditor.min.js @@ -1,4 +1,4 @@ function editorStart_xe(a,b,c,d,e,f,g,h){function i(){try{var a,b=q.contentWindow.document;if("about:blank"==b.location)throw"blank";b.body.innerHTML=b.body.innerHTML.trim(),a=b.body.innerHTML,p.registerPlugin(new xe.XE_EditingArea_WYSIWYG(q)),p.registerPlugin(new xe.XpressRangeManager(q)),p.registerPlugin(new xe.XE_ExecCommand(q)),g&&!b.body.style.fontFamily&&(b.body.style.fontFamily=g),h&&!b.body.style.fontSize&&(b.body.style.fontSize=h),p.run()}catch(c){setTimeout(i,0)}}"undefined"==typeof e&&(e="white"),"undefined"==typeof f&&(f="xeStyle"),"undefined"==typeof g&&(g=""),"undefined"==typeof h&&(h="");var j=request_uri+"modules/editor/styles/"+f+"/editor.html",k=jQuery("#xpress-editor-"+a),l=jQuery(''),m=jQuery(''),n=k.get(0).form;n.setAttribute("editor_sequence",a),k.css("display","none");var o="";jQuery("input[name=content]",n).size()>0&&(o=jQuery("input[name=content]",n).val().replace(/src=\"files\/attach/g,'src="'+request_uri+"files/attach"),jQuery("#xpress-editor-"+a).val(o)),k.hide().css("width","100%").before(l).after(m);var p=new xe.XpressCore,q=l.get(0),r=k.get(0),t=m.get(0),u=jQuery(".xpress-editor",n).get(0);p.getFrame=function(){return q},p.getContent=function(){editorGetContentTextarea_xe(a)};var v=n[c].value;return xFF&&!v&&(v="
"),v=editorReplacePath(v),n[c].value=v,jQuery("#xpress-editor-"+a).val(v),editorRelKeys[a]=new Array,editorRelKeys[a].primary=n[b],editorRelKeys[a].content=n[c],editorRelKeys[a].func=editorGetContentTextarea_xe,editorRelKeys[a].editor=p,editorRelKeys[a].pasteHTML=function(a){p.exec("PASTE_HTML",[a])},xe.Editors[a]=p,p.registerPlugin(new xe.CorePlugin(null)),p.registerPlugin(new xe.XE_PreservTemplate(jQuery("#xpress-editor-"+a).val())),p.registerPlugin(new xe.StringConverterManager),p.registerPlugin(new xe.XE_EditingAreaManager("WYSIWYG",r,{nHeight:parseInt(d),nMinHeight:100},null,u)),p.registerPlugin(new xe.XE_EditingArea_HTMLSrc(t)),p.registerPlugin(new xe.XE_EditingAreaVerticalResizer(u)),p.registerPlugin(new xe.Utils),p.registerPlugin(new xe.DialogLayerManager),p.registerPlugin(new xe.ActiveLayerManager),p.registerPlugin(new xe.Hotkey),p.registerPlugin(new xe.XE_WYSIWYGStyler),p.registerPlugin(new xe.XE_WYSIWYGStyleGetter),p.registerPlugin(new xe.MessageManager(xe.XpressCore.oMessageMap)),p.registerPlugin(new xe.XE_Toolbar(u)),p.registerPlugin(new xe.XE_XHTMLFormatter),p.registerPlugin(new xe.XE_GET_WYSYWYG_MODE(a)),jQuery("ul.extra1").length&&(p.registerPlugin(new xe.XE_ColorPalette(u)),p.registerPlugin(new xe.XE_FontColor(u)),p.registerPlugin(new xe.XE_BGColor(u)),p.registerPlugin(new xe.XE_Quote(u)),p.registerPlugin(new xe.XE_FontNameWithSelectUI(u)),p.registerPlugin(new xe.XE_FontSizeWithSelectUI(u)),p.registerPlugin(new xe.XE_LineHeightWithSelectUI(u)),p.registerPlugin(new xe.XE_UndoRedo),p.registerPlugin(new xe.XE_Table(u)),p.registerPlugin(new xe.XE_Hyperlink(u)),p.registerPlugin(new xe.XE_FormatWithSelectUI(u)),p.registerPlugin(new xe.XE_SCharacter(u))),jQuery("ul.extra2").length&&p.registerPlugin(new xe.XE_Extension(u,a)),jQuery("ul.extra3").length&&p.registerPlugin(new xe.XE_EditingModeToggler(u)),jQuery("#editorresize").length&&p.registerPlugin(new xe.XE_Editorresize(u,q)),jQuery.browser.msie||jQuery.browser.opera||p.registerPlugin(new xe.XE_WYSIWYGEnterKey(q)),(s=n._saved_doc_title)&&p.registerPlugin(new xe.XE_AutoSave(r,u)),i(),p}function editorGetContentTextarea_xe(a){var b=xe.Editors[a]||null;if(!b)return"";var c=b.getIR();if(!jQuery.trim(c.replace(/( |<\/?(p|br|span|div)([^>]+)?>)/gi,"")))return"";if(c=c.replace(/
$/i,""),c.length<1024){var d=Array("#text","A","BR","IMG","EM","STRONG","SPAN","BIG","CITE","CODE","DD","DFN","HR","INS","KBD","LINK","Q","SAMP","SMALL","SUB","SUP","TT"),e=!0,f=jQuery("
"+c+"
").eq(0),g=f.contents();jQuery.each(g,function(){3!=this.nodeType&&-1==jQuery.inArray(this.nodeName,d)&&(e=!1)}),e&&(c="

"+c+"

")}return c=c.replace(/src\s?=\s?(["']?)(?:\.\.\/)+(files\/attach\/)/gi,function(a,b,c){return"src="+(b||"")+c}),c=c.replace(/\<(\/)?([A-Z]+)([^>]*)\>/gi,function(a,b,c,d){return d=d?d.replace(/ ([A-Z]+?)\=/gi,function(a,b){return b=b.toLowerCase()," "+b+"="}):"",c=c.toLowerCase(),b||(b=""),"<"+b+c+d+">"}),c=c.replace("
","
")}function editorGetIframe(a){return jQuery("iframe#editor_iframe_"+a).get(0)}function editorReplaceHTML(a,b){b=editorReplacePath(b);var c=parseInt(a.id.replace(/^.*_/,""),10);editorRelKeys[c].pasteHTML(b)}function editorReplacePath(a){return a=a.replace(/\<([^\>\<]*)(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>)*/gi,function(a,b,c,d,e,f,g){"url("==c?(d="",f=")"):("undefined"==typeof d&&(d='"'),"undefined"==typeof f&&(f='"'),"undefined"==typeof g&&(g=""));var h=jQuery.trim(e).replace(/^\.\//,"");return/^(http\:|https\:|ftp\:|telnet\:|mms\:|mailto\:|\/|\.\.|\#)/i.test(h)?a:"<"+b+c+d+request_uri+h+f+g})}function editorGetAutoSavedDoc(a){var b=new Array;b.mid=current_mid,b.editor_sequence=a.getAttribute("editor_sequence"),setTimeout(function(){var a=new Array("error","message","editor_sequence","title","content","document_srl");exec_xml("editor","procEditorLoadSavedDocument",b,function(a){editorRelKeys[b.editor_sequence].primary.value=a.document_srl,"object"==typeof uploadSettingObj[b.editor_sequence]&&editorUploadInit(uploadSettingObj[b.editor_sequence],!0)},a)},0)}!function(a){function b(b){function c(a){return function(){return a.apply(this.$this,arguments)}}var d=b.prototype;this.prototype.$super={};for(var e in d)d.propertyIsEnumerable(e)&&("undefined"==typeof this.prototype[e]&&(this.prototype[e]=d[e]),this.prototype.$super[e]=a.isFunction(d[e])?c(d[e]):d[e]);return this}a.extend({Class:function(c){function d(){"undefined"!=typeof this.$super&&(this.$super.$this=this),a.isFunction(this.$init)&&this.$init.apply(this,arguments)}return d.prototype=c,d.constructor=d,d.extend=b,d},$:function(b){return"string"==typeof b?"<"==b.substring(0,1)?a(b).get(0):a("#"+b).get(0):b},fnBind:function(b,c){var d=a.makeArray(arguments);return d.shift(),d.shift(),function(){var e=d.concat(a.makeArray(arguments));return b.apply(c,e)}}}),a.browser.nVersion=parseFloat(a.browser.version),"undefined"==typeof window.xe&&(window.xe={}),xe.XpressCore=a.Class({name:"XpressCore",$init:function(b){b=b?a.Class({}).extend({oDebugger:null}).extend(b):{},b.oDebugger&&(this.oDebugger=b.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(a,b,c){return this.appStatus==xe.APP_STATUS.NOT_READY?(this.commandQueue[this.commandQueue.length]={msg:a,args:b,event:c},!0):(this.exec=this._exec,void this.exec(a,b,c))},delayedExec:function(b,c,d,e){var f=a.fnBind(this.exec,this,b,c,e);setTimeout(f,d)},_exec:function(a,b,c){return(this._exec=this.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this,a,b,c)},_execWithDebugger:function(a,b,c){this.oDebugger.log_MessageStart(a,b);var d=this._doExec(a,b,c);return this.oDebugger.log_MessageEnd(a,b),d},_execWithoutDebugger:function(a,b,c){return this._doExec(a,b,c)},_doExec:function(a,b,c){var d=!1;if(!this.oDisabledCommand[a]){var e=[];if(b&&b.length)for(var f=b.length,g=0;f>g;g++)e[g]=b[g];c&&(e[e.length]=c);var d=!0;d=this._execMsgStep("BEFORE",a,e),d&&(d=this._execMsgStep("ON",a,e)),d&&(d=this._execMsgStep("AFTER",a,e))}return d},registerPlugin:function(a){if(!a)throw"An error occured in registerPlugin(): invalid plug-in";return a.nIdx=this.aPlugins.length,a.oApp=this,this.aPlugins[a.nIdx]=a,a.status!=xe.PLUGIN_STATUS.NOT_READY&&(a.status=xe.PLUGIN_STATUS.READY),this.exec("MSG_PLUGIN_REGISTERED",[a]),a.nIdx},disableCommand:function(a,b){this.oDisabledCommand[a]=b},registerBrowserEvent:function(b,c,d,e,f){if(b){e=e||[];var g=f?a.fnBind(this.delayedExec,this,d,e,f):a.fnBind(this.exec,this,d,e);a(b).bind(c,g)}},run:function(){this._changeAppStatus(xe.APP_STATUS.WAITING_FOR_PLUGINS_READY);var a=this.commandQueue.length;for(i=0;a>i;i++){var b=this.commandQueue[i];this.exec(b.msg,b.args,b.event)}this._waitForPluginReady()},createCommandMap:function(a){this.oCommandMap[a]=[];for(var b=this.aPlugins.length,c=0;b>c;c++)this._doAddToCommandMap(a,this.aPlugins[c])},addToCommandMap:function(a,b){this.oCommandMap[a]&&this._addToCommandMap(a,b)},_changeAppStatus:function(a){this.appStatus=a,this.appStatus==xe.APP_STATUS.READY&&this.exec("MSG_APP_READY")},_execMsgStep:function(a,b,c){return(this._execMsgStep=this.oDebugger?this._execMsgStepWithDebugger:this._execMsgStepWithoutDebugger).call(this,a,b,c)},_execMsgStepWithDebugger:function(a,b,c){this.oDebugger.log_MessageStepStart(a,b,c);var d=this._execMsgHandler("$"+a+"_"+b,c);return this.oDebugger.log_MessageStepEnd(a,b,c),d},_execMsgStepWithoutDebugger:function(a,b,c){return this._execMsgHandler("$"+a+"_"+b,c)},_execMsgHandler:function(a,b){this.oCommandMap[a]||this.createCommandMap(a);var c=this.oCommandMap[a],d=c.length;if(0==d)return!0;var e,f=!0;if(a.match(/^\$(BEFORE|ON|AFTER)_MSG_APP_READY$/)){for(var g=0;d>g;g++)if(e=this._execHandler(c[g],a,b),e===!1){f=!1;break}}else for(var g=0;d>g;g++)if(("function"!=typeof c[g].$PRECONDITION||this._execHandler(c[g],"$PRECONDITION",[a,b]))&&(e=this._execHandler(c[g],a,b),e===!1)){f=!1;break}return f},_execHandler:function(a,b,c){return(this._execHandler=this.oDebugger?this._execHandlerWithDebugger:this._execHandlerWithoutDebugger).call(this,a,b,c)},_execHandlerWithDebugger:function(a,b,c){this.oDebugger.log_CallHandlerStart(a,b,c);var d=a[b].apply(a,c);return this.oDebugger.log_CallHandlerEnd(a,b,c),d},_execHandlerWithoutDebugger:function(a,b,c){return a[b].apply(a,c)},_doAddToCommandMap:function(a,b){"function"==typeof b[a]&&(this.oCommandMap[a][this.oCommandMap[a].length]=b)},_waitForPluginReady:function(){for(var b=!0,c=0;cb)return b;var i=b-1,j=a[b].cloneNode(!1);for(a[b]==e&&(c=j),a[b]==f&&(d=j);i>=0&&xe.DOMFix.parentNode(a[i])==a[b];)i=this._recurConstructClonedTree(a,i,a[b],j,c,d);return h.insertBefore(j,h.firstChild),i},a[a.length]=xe.DOMFix.parentNode(a[a.length-1]),_recurConstructClonedTree(a,a.length-1,a[a.length-1],b),{oStartContainer:c,oEndContainer:d}},cloneRange:function(){return this._copyRange(new xe.W3CDOMRange(this._document))},_copyRange:function(a){return a.collapsed=this.collapsed,a.commonAncestorContainer=this.commonAncestorContainer,a.endContainer=this.endContainer,a.endOffset=this.endOffset,a.startContainer=this.startContainer,a.startOffset=this.startOffset,a._document=this._document,a},collapse:function(a){a?(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset=this.endOffset),this._updateRangeInfo()},compareBoundaryPoints:function(a,b){switch(a){case xe.W3CDOMRange.START_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,b.startContainer,b.startOffset);case xe.W3CDOMRange.START_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,b.startContainer,b.startOffset);case xe.W3CDOMRange.END_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,b.endContainer,b.endOffset);case xe.W3CDOMRange.END_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,b.endContainer,b.endOffset)}},_findBody:function(a){if(!a)return null;for(;a;){if("BODY"==a.tagName)return a;a=xe.DOMFix.parentNode(a)}return null},_compareEndPoint:function(a,b,c,d){var e,f;a&&this._findBody(a)==this._document.body||(a=this._document.body,b=0),c&&this._findBody(c)==this._document.body||(c=this._document.body,d=0);var g=function(a,b){return-1==b&&(b=a+1),b>a?-1:a==b?0:1},h=this._getCommonAncestorContainer(a,c),i=a;if(i!=h){for(;(oTmpNode=xe.DOMFix.parentNode(i))!=h;)i=oTmpNode;e=this._getPosIdx(i)+.5}else e=b;var j=c;if(j!=h){for(;(oTmpNode=xe.DOMFix.parentNode(j))!=h;)j=oTmpNode;f=this._getPosIdx(j)+.5}else f=d;return g(e,f)},_getCommonAncestorContainer:function(a,b){for(var c=b;a;){for(;c;){if(a==c)return a;c=xe.DOMFix.parentNode(c)}c=b,a=xe.DOMFix.parentNode(a)}return this._document.body},deleteContents:function(){if(!this.collapsed){this._splitTextEndNodesOfTheRange();var a=this._getNodesInRange();if(!(a.length<1)){for(var b=a[0].previousSibling;b&&this._isBlankTextNode(b);)b=b.previousSibling;var c,d;b||(c=xe.DOMFix.parentNode(a[0]),d=0);for(var e=0;ea.nodeValue.length&&(b=a.nodeValue.length):b>xe.DOMFix.childNodes(a).length&&(b=xe.DOMFix.childNodes(a).length),b},setEnd:function(a,b){b=this._endsNodeValidation(a,b),this.endContainer=a,this.endOffset=b,this.startContainer&&-1==this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)||this.collapse(!1),this._updateRangeInfo()},setEndAfter:function(a){if(!a)throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter");return"BODY"==a.tagName?void this.setEnd(a,xe.DOMFix.childNodes(a).length):void this.setEnd(xe.DOMFix.parentNode(a),this._getPosIdx(a)+1)},setEndBefore:function(a){if(!a)throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore");return"BODY"==a.tagName?void this.setEnd(a,0):void this.setEnd(xe.DOMFix.parentNode(a),this._getPosIdx(a))},setStart:function(a,b){b=this._endsNodeValidation(a,b),this.startContainer=a,this.startOffset=b,this.endContainer&&-1==this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)||this.collapse(!0),this._updateRangeInfo()},setStartAfter:function(a){if(!a)throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter");return"BODY"==a.tagName?void this.setStart(a,xe.DOMFix.childNodes(a).length):void this.setStart(xe.DOMFix.parentNode(a),this._getPosIdx(a)+1)},setStartBefore:function(a){if(!a)throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore");return"BODY"==a.tagName?void this.setStart(a,0):void this.setStart(xe.DOMFix.parentNode(a),this._getPosIdx(a))},surroundContents:function(a){a.appendChild(this.extractContents()),this.insertNode(a),this.selectNode(a)},toString:function(){var a=this._document.createElement("DIV");return a.appendChild(this.cloneContents()),a.textContent||a.innerText||""},_isBlankTextNode:function(a){return 3==a.nodeType&&""==a.nodeValue?!0:!1},_getPosIdx:function(a){for(var b=0,c=a.previousSibling;c;c=c.previousSibling)b++;return b},_updateRangeInfo:function(){return this.startContainer?(this.collapsed=this._isCollapsed(this.startContainer,this.startOffset,this.endContainer,this.endOffset),void(this.commonAncestorContainer=this._getCommonAncestorContainer(this.startContainer,this.endContainer))):void this.init(this._document)},_isCollapsed:function(a,b,c,d){var e=!1;if(a==c&&b==d)e=!0;else{var f=this._getActualStartNode(a,b),g=this._getActualEndNode(c,d);f=this._getNextNode(this._getPrevNode(f)),g=this._getPrevNode(this._getNextNode(g)),f&&g&&"BODY"!=g.tagName&&(this._getNextNode(g)==f||g==f&&this._isBlankTextNode(g))&&(e=!0)}return e},_splitTextEndNodesOfTheRange:function(){var a=this._splitTextEndNodes({oStartContainer:this.startContainer,iStartOffset:this.startOffset,oEndContainer:this.endContainer,iEndOffset:this.endOffset});this.startContainer=a.oStartContainer,this.startOffset=a.iStartOffset,this.endContainer=a.oEndContainer,this.endOffset=a.iEndOffset},_splitTextEndNodes:function(a){return a=this._splitStartTextNode(a),a=this._splitEndTextNode(a)},_splitStartTextNode:function(a){var b=a.oStartContainer,c=a.iStartOffset,d=a.oEndContainer,e=a.iEndOffset;if(!b)return a;if(3!=b.nodeType)return a;if(0==c)return a;if(b.nodeValue.length<=c)return a;var f=b.splitText(c);return b==d&&(e-=c,d=f),b=f,c=0,{oStartContainer:b,iStartOffset:c,oEndContainer:d,iEndOffset:e}},_splitEndTextNode:function(a){var b=a.oStartContainer,c=a.iStartOffset,d=a.oEndContainer,e=a.iEndOffset;return d?3!=d.nodeType?a:e>=d.nodeValue.length?a:0==e?a:(d.splitText(e),{oStartContainer:b,iStartOffset:c,oEndContainer:d,iEndOffset:e}):a},_getNodesInRange:function(){if(this.collapsed)return[];var a=this._getActualStartNode(this.startContainer,this.startOffset),b=this._getActualEndNode(this.endContainer,this.endOffset);return this._getNodesBetween(a,b)},_getActualStartNode:function(a,b){var c=a;return 3==a.nodeType?b>=a.nodeValue.length?(c=this._getNextNode(a),"BODY"==c.tagName&&(c=null)):c=a:b=this.startContainer.nodeValue.length?this._getNextNode(this.startContainer):this.startContainer:this.startOffset>=xe.DOMFix.childNodes(this.startContainer).length?this._getNextNode(this.startContainer):xe.DOMFix.childNodes(this.startContainer)[this.startOffset]},getEndNode:function(){return this.collapsed?this.getStartNode():3==this.endContainer.nodeType?0==this.endOffset?this._getPrevNode(this.endContainer):this.endContainer:0==this.endOffset?this._getPrevNode(this.endContainer):xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]},getNodeAroundRange:function(a,b){if(this.collapsed&&this.startContainer&&3==this.startContainer.nodeType)return this.startContainer;if(!this.collapsed||this.startContainer&&3==this.startContainer.nodeType)return this.getStartNode();var c,d,e;return d=this.startOffset>=xe.DOMFix.childNodes(this.startContainer).length?this._getNextNode(this.startContainer):xe.DOMFix.childNodes(this.startContainer)[this.startOffset],c=0==this.endOffset?this._getPrevNode(this.endContainer):xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1],a?(e=c,e||b||(e=d)):(e=d,e||b||(e=c)),e},_getXPath:function(a){for(var b="";a&&1==a.nodeType;)b="/"+a.tagName+"["+this._getPosIdx4XPath(a)+"]"+b,a=xe.DOMFix.parentNode(a);return b},_getPosIdx4XPath:function(a){for(var b=0,c=a.previousSibling;c;c=c.previousSibling)c.tagName==a.tagName&&b++;return b},_evaluateXPath:function(a,b){a=a.substring(1,a.length-1);for(var c=a.split(/\//),d=b.body,e=2;el;l++)h[l].tagName==f&&(i[k++]=h[l]);d=i.length-1&&e){for(var f=xe.DOMFix.childNodes(e),g=null,h=c,i=d;(g=f[h])&&3==g.nodeType&&g.nodeValue.length=b&&e>=0?!0:bIncludePartlyIncluded?1==c?!1:-1==d?!1:!0:!1},isNodeInRange:function(a,b,c){var d=new xe.XpressRange(this._window);return c&&a.firstChild?(d.setStartBefore(a.firstChild),d.setEndAfter(a.lastChild)):d.selectNode(a),isRangeInRange(d,b)},pasteHTML:function(a){if(""==a)return void this.deleteContents();var b=this._document.createElement("DIV");b.innerHTML=a;for(var c=b.firstChild,d=b.lastChild,e=this.cloneRange(),f=e.placeStringBookmark();b.lastChild;)this.insertNode(b.lastChild);this.setEndNodes(c,d),e.moveToBookmark(f),e.deleteContents(),e.removeStringBookmark(f)},toString:function(){return this.toString=xe.W3CDOMRange.prototype.toString,this.toString()},toHTMLString:function(){var a=this._document.createElement("DIV");return a.appendChild(this.cloneContents()),a.innerHTML},findAncestorByTagName:function(a){for(var b=this.commonAncestorContainer;b&&b.tagName!=a;)b=xe.DOMFix.parentNode(b);return b},selectNodeContents:function(a){if(a){var b=a.firstChild?a.firstChild:a,c=a.lastChild?a.lastChild:a;3==b.nodeType?this.setStart(b,0):this.setStartBefore(b),3==c.nodeType?this.setEnd(c,c.nodeValue.length):this.setEndAfter(c)}},styleRange:function(b,c,d){var e=this._getStyleParentNodes(d);if(!(e.length<1)){for(var f,g,h=0;ho;o++)if(c=k[o],c&&3==c.nodeType&&""!=c.nodeValue){if(h=xe.DOMFix.parentNode(c),"SPAN"==h.tagName){var p=a(h).html();if(d=this._getVeryFirstRealChild(h),f=d==c?1:p.indexOf(d),-1!=f&&(d=this._getVeryLastRealChild(h),g=d==c?1:p.indexOf(d)),-1!=f&&-1!=g){l[m++]=h;continue}}e=this._document.createElement("SPAN"),h.insertBefore(e,c),e.appendChild(c),l[m++]=e,b&&e.setAttribute(b,"true")}return this.setStartBefore(i),this.setEndAfter(j),l},_getVeryFirstChild:function(a){return a.firstChild?this._getVeryFirstChild(a.firstChild):a},_getVeryLastChild:function(a){return a.lastChild?this._getVeryLastChild(a.lastChild):a},_getFirstRealChild:function(a){for(var b=a.firstChild;b&&3==b.nodeType&&""==b.nodeValue;)b=b.nextSibling;return b},_getLastRealChild:function(a){for(var b=a.lastChild;b&&3==b.nodeType&&""==b.nodeValue;)b=b.previousSibling;return b},_getVeryFirstRealChild:function(a){var b=this._getFirstRealChild(a);return b?this._getVeryFirstRealChild(b):a},_getVeryLastRealChild:function(a){var b=this._getLastRealChild(a);return b?this._getVeryLastChild(b):a},_getLineStartInfo:function(a){function b(a){if(a&&!d){if(h.test(a.tagName))return f=a,d=e,void(g=!0);e=a,c(a.previousSibling),d||b(xe.DOMFix.parentNode(a))}}function c(a){if(a&&!d){if(h.test(a.tagName))return f=a,d=e,void(g=!1);if(a.firstChild&&"TABLE"!=a.tagName)for(var b=a.lastChild;b&&!d;)c(b),b=b.previousSibling;else e=a;d||c(a.previousSibling)}}var d=null,e=a,f=a,g=!0,h=this.rxLineBreaker;return b(a),{oNode:d,oLineBreaker:f,bParentBreak:g}},_getLineEndInfo:function(a){function b(a){if(a&&!d){if(h.test(a.tagName))return f=a,d=e,void(g=!0);e=a,c(a.nextSibling),d||b(xe.DOMFix.parentNode(a))}}function c(a){if(a&&!d){if(h.test(a.tagName))return f=a,d=e,void(g=!1);if(a.firstChild&&"TABLE"!=a.tagName)for(var b=a.firstChild;b&&!d;)c(b),b=b.nextSibling;else e=a;d||c(a.nextSibling)}}var d=null,e=a,f=a,g=!0,h=this.rxLineBreaker;return b(a),{oNode:d,oLineBreaker:f,bParentBreak:g}},getLineInfo:function(){var a=this.getStartNode(),b=this.getEndNode();a||(a=this.getNodeAroundRange(!0,!0)),b||(b=this.getNodeAroundRange(!0,!0));var c=this._getLineStartInfo(a),d=c.oNode,e=this._getLineEndInfo(b),f=e.oNode,g=this._compareEndPoint(xe.DOMFix.parentNode(d),this._getPosIdx(d),this.endContainer,this.endOffset),h=this._compareEndPoint(xe.DOMFix.parentNode(f),this._getPosIdx(f)+1,this.startContainer,this.startOffset);return 0>=g&&h>=0||(a=this.getNodeAroundRange(!1,!0),b=this.getNodeAroundRange(!1,!0),c=this._getLineStartInfo(a),e=this._getLineEndInfo(b)),{oStart:c,oEnd:e}}}).extend(xe.W3CDOMRange),xe.SimpleSelection=function(b){this.init=function(a){this._window=a||window,this._document=this._window.document},this.init(b),a.browser.msie?xe.SimpleSelectionImpl_IE.apply(this):xe.SimpleSelectionImpl_FF.apply(this),this.selectRange=function(a){this.selectNone(),this.addRange(a)},this.selectionLoaded=!0,this._oSelection||(this.selectionLoaded=!1)},xe.SimpleSelectionImpl_FF=function(){this._oSelection=this._window.getSelection(),this.getRangeAt=function(a){a=a||0;try{var b=this._oSelection.getRangeAt(a)}catch(c){return new xe.W3CDOMRange(this._document)}return this._FFRange2W3CRange(b)},this.addRange=function(a){var b=this._W3CRange2FFRange(a);this._oSelection.addRange(b)},this.selectNone=function(){this._oSelection.removeAllRanges()},this._FFRange2W3CRange=function(a){var b=new xe.W3CDOMRange(this._document);return b.setStart(a.startContainer,a.startOffset),b.setEnd(a.endContainer,a.endOffset),b},this._W3CRange2FFRange=function(a){var b=this._document.createRange(); return b.setStart(a.startContainer,a.startOffset),b.setEnd(a.endContainer,a.endOffset),b}},xe.SimpleSelectionImpl_IE=function(){this._oSelection=this._document.selection,this.getRangeAt=function(a){if(a=a||0,"Control"==this._oSelection.type){var b=new xe.W3CDOMRange(this._document),c=this._oSelection.createRange().item(a);return c&&c.ownerDocument==this._document?(b.selectNode(c),b):b}var c=this._oSelection.createRangeCollection().item(a).parentElement();if(!c||c.ownerDocument!=this._document){var b=new xe.W3CDOMRange(this._document);return b}return this._IERange2W3CRange(this._oSelection.createRangeCollection().item(a))},this.addRange=function(a){var b=this._W3CRange2IERange(a);b.select()},this.selectNone=function(){this._oSelection.empty()},this._W3CRange2IERange=function(a){var b=this._getIERangeAt(a.startContainer,a.startOffset),c=this._getIERangeAt(a.endContainer,a.endOffset);return b.setEndPoint("EndToEnd",c),b},this._getIERangeAt=function(a,b){var c=this._document.body.createTextRange(),d=this._getSelectableNodeAndOffsetForIE(a,b),e=d.oSelectableNodeForIE,f=d.iOffsetForIE;return c.moveToElementText(e),c.collapse(d.bCollapseToStart),c.moveStart("character",f),c},this._getSelectableNodeAndOffsetForIE=function(a,b){var c=this._document.body.createTextRange(),d=null,e=null,f=0;3==a.nodeType?(d=xe.DOMFix.parentNode(a),e=xe.DOMFix.childNodes(d),f=e.length):(d=a,e=xe.DOMFix.childNodes(d),f=b);for(var g=null,h=0,i=!0,j=0;f>j;j++)if(g=e[j],3==g.nodeType){if(g==a)break;h+=g.nodeValue.length}else c.moveToElementText(g),d=g,h=0,i=!1;return 3==a.nodeType&&(h+=b),{oSelectableNodeForIE:d,iOffsetForIE:h,bCollapseToStart:i}},this._IERange2W3CRange=function(a){var b=new xe.W3CDOMRange(this._document),c=null,d=null;c=a.duplicate(),c.collapse(!0),d=this._getW3CContainerAndOffset(c,!0),b.setStart(d.oContainer,d.iOffset);var e=a.duplicate();return e.collapse(!0),e.isEqual(a)?b.collapse(!0):(c=a.duplicate(),c.collapse(!1),d=this._getW3CContainerAndOffset(c),b.setEnd(d.oContainer,d.iOffset)),b},this._getW3CContainerAndOffset=function(a,b){for(var c=a,d=c.parentElement(),e=-1,f=this._document.body.createTextRange(),g=xe.DOMFix.childNodes(d),h=null,i=0,j=0;j=0)break;h=g[j]}var i=j;if(0!=i&&3==g[i-1].nodeType){var k=this._document.body.createTextRange(),l=null;h?(k.moveToElementText(h),k.collapse(!1),l=h.nextSibling):(k.moveToElementText(d),k.collapse(!0),l=d.firstChild);var m=c.duplicate();m.setEndPoint("StartToStart",k);for(var n=m.text.length;n>l.nodeValue.length&&l.nextSibling;)n-=l.nodeValue.length,l=l.nextSibling;{l.nodeValue}b&&l.nextSibling&&3==l.nextSibling.nodeType&&n==l.nodeValue.length&&(n-=l.nodeValue.length,l=l.nextSibling),d=l,e=n}else d=c.parentElement(),e=i;return{oContainer:d,iOffset:e}}},xe.DOMFix=new(a.Class({$init:function(){a.browser.msie||a.browser.opera?(this.childNodes=this._childNodes_Fix,this.parentNode=this._parentNode_Fix):(this.childNodes=this._childNodes_Native,this.parentNode=this._parentNode_Native)},_parentNode_Native:function(a){return a.parentNode},_parentNode_Fix:function(a){if(!a)return a;for(;a.previousSibling;)a=a.previousSibling;return a.parentNode},_childNodes_Native:function(a){return a.childNodes},_childNodes_Fix:function(a){var b=null,c=0;if(a){var b=[];for(a=a.firstChild;a;)b[c++]=a,a=a.nextSibling}return b}})),xe.DraggableLayer=a.Class({$init:function(b,c){this.oOptions=a.extend({bModal:"false",oHandle:b,iMinX:-999999,iMinY:-999999,iMaxX:999999,iMaxY:999999},c),this.oHandle=this.oOptions.oHandle,b.style.display="block",b.style.position="absolute",b.style.zIndex="9999",this.aBasePosition=this.getBaseOffset(b),b.style.top=this.toInt(a(b).offset().top)-this.aBasePosition.top+"px",b.style.left=this.toInt(a(b).offset().left)-this.aBasePosition.left+"px",this.$FnMouseDown=a.fnBind(this._mousedown,this,b),this.$FnMouseMove=a.fnBind(this._mousemove,this,b),this.$FnMouseUp=a.fnBind(this._mouseup,this,b),a(this.oHandle).bind("mousedown",this.$FnMouseDown)},_mousedown:function(b,c){"INPUT"!=c.target.tagName&&(this.MouseOffsetY=c.pageY-this.toInt(b.style.top)-this.aBasePosition.top,this.MouseOffsetX=c.pageX-this.toInt(b.style.left)-this.aBasePosition.left,a(b).bind("mousemove",this.$FnMouseMove),a(b).bind("mouseup",this.$FnMouseUp))},_mousemove:function(a,b){var c=b.pageY-this.MouseOffsetY-this.aBasePosition.top,d=b.pageX-this.MouseOffsetX-this.aBasePosition.left;cthis.oOptions.iMaxY&&(c=this.oOptions.iMaxY),dthis.oOptions.iMaxX&&(d=this.oOptions.iMaxX),a.style.top=c+"px",a.style.left=d+"px"},_mouseup:function(b){a(b).unbind("mousemove",this.$FnMouseMove),a(b).unbind("mouseup",this.$FnMouseUp)},toInt:function(a){var b=parseInt(a);return b||0},findNonStatic:function(b){return b?"BODY"==b.tagName?b:a(b).css("position").match(/absolute|relative/i)?b:this.findNonStatic(b.offsetParent):null},getBaseOffset:function(b){var c=this.findNonStatic(b.offsetParent),d=a(c).offset();return{top:d.top,left:d.left}}}),xe.CorePlugin=a.Class({name:"CorePlugin",$init:function(a){this.funcOnReady=a},$AFTER_MSG_APP_READY:function(){this.oApp.exec("EXEC_ON_READY_FUNCTION",[])},$ON_ADD_APP_PROPERTY:function(a,b){this.oApp[a]=b},$ON_REGISTER_BROWSER_EVENT:function(a,b,c,d,e){this.oApp.registerBrowserEvent(a,b,c,d,e)},$ON_DISABLE_COMMAND:function(a){this.oApp.disableCommand(a,!0)},$ON_ENABLE_COMMAND:function(a){this.oApp.disableCommand(a,!1)},$ON_EXEC_ON_READY_FUNCTION:function(){"function"==typeof this.funcOnReady&&this.funcOnReady()}}),xe.Utils=a.Class({name:"Utils",$init:function(){if(a.browser.msie&&6==a.browser.nVersion)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(b){}},$ON_ATTACH_HOVER_EVENTS:function(b,c){c=c||"hover",b&&a(b).hover(function(){a(this).addClass(c)},function(){a(this).removeClass(c)})}}),xe.XpressRangeManager=a.Class({name:"XpressRangeManager",oWindow:null,$init:function(a){this.oWindow=a||window},$BEFORE_MSG_APP_READY:function(){this.oWindow&&"IFRAME"==this.oWindow.tagName&&(this.oWindow=this.oWindow.contentWindow),this.oApp.exec("ADD_APP_PROPERTY",["getSelection",a.fnBind(this.getSelection,this)]),this.oApp.exec("ADD_APP_PROPERTY",["getEmptySelection",a.fnBind(this.getEmptySelection,this)])},$ON_SET_EDITING_WINDOW:function(a){this.oWindow=a},getEmptySelection:function(){var a=new xe.XpressRange(this.oWindow);return a},getSelection:function(){this.oApp.exec("RESTORE_IE_SELECTION",[]);var a=this.getEmptySelection();try{a.setFromSelection()}catch(b){}return a}}),xe.Hotkey=a.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},(a.browser.msie||a.browser.safari)&&(this.keyhash.hyphen=189,this.keyhash.equal=187,this.keyhash.meta=91)},$ON_MSG_APP_READY:function(){a(this.oApp.getWYSIWYGDocument()||document).keydown(a.fnBind(this.keydown,this))},$ON_REGISTER_HOTKEY:function(b,c,d){d||(d=[]);var e=a.fnBind(this.oApp.exec,this.oApp,c,d);return(b=this.normalize(b))?void this.add(b,e):!1},add:function(a,b){"undefined"==typeof this.storage[a]?this.storage[a]=[b]:this.storage[a].push(b)},keydown:function(b){var c=[],d=this.keyhash;if(!(a.inArray(b.keyCode,[d.shift,d.ctrl,d.alt,d.meta])>=0)&&(b.shiftKey&&c.push("shift"),b.altKey&&c.push("alt"),b.ctrlKey&&c.push("ctrl"),b.metaKey&&c.push("meta"),c.length&&(1==c.length&&b.metaKey&&(c=["ctrl","meta"]),c.push(b.keyCode),c=c.join("+"),this.storage[c])))return a.each(this.storage[c],function(){this()}),!1},normalize:function(b){var c,d,e,f,g,h=(b||"").toLowerCase().split("+");return c=d=e=f=g=!1,a.each(h,function(){var a=""+this;switch(a){case"shift":c=!0;case"alt":e=!0;case"ctrl":d=!0;case"meta":f=!0;default:g=a}}),g?(h=[],c&&h.push("shift"),e&&h.push("alt"),d&&h.push("ctrl"),(f||d&&!c&&!e)&&h.push("meta"),h.push(this.keyhash[g]||g.toUpperCase().charCodeAt(0)),h.join("+")):""}}),xe.DialogLayerManager=a.Class({name:"DialogLayerManager",aMadeDraggable:null,aOpenedLayers:null,$init:function(){this.aMadeDraggable=[],this.aOpenedLayers=[]},$ON_SHOW_DIALOG_LAYER:function(b,c){b=a.$(b),c=a.$(c)||!1,b&&-1==a.inArray(b,this.aOpenedLayers)&&(this.oApp.exec("POSITION_DIALOG_LAYER",[b]),this.aOpenedLayers[this.aOpenedLayers.length]=b,-1==a.inArray(b,this.aMadeDraggable)?(new xe.DraggableLayer(b,{bModal:c,iMinY:0}),this.aMadeDraggable[this.aMadeDraggable.length]=b):b.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 a=this.aOpenedLayers.length-1;a>=0;a--)this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[a]])},$ON_HIDE_DIALOG_LAYER:function(b){b=a.$(b),b&&(b.style.display="none"),this.aOpenedLayers=a.grep(this.aOpenedLayers,function(a){return a!=b})},$ON_SET_DIALOG_LAYER_POSITION:function(a,b,c){a.style.top=b,a.style.left=c}}),xe.ActiveLayerManager=a.Class({name:"ActiveLayerManager",oCurrentLayer:null,$ON_TOGGLE_ACTIVE_LAYER:function(a,b,c,d,e){a==this.oCurrentLayer?this.oApp.exec("HIDE_ACTIVE_LAYER",[]):(this.oApp.exec("SHOW_ACTIVE_LAYER",[a,d,e]),b&&this.oApp.exec(b,c))},$ON_SHOW_ACTIVE_LAYER:function(b,c,d){b=a.$(b),this.sOnCloseCmd=c,this.aOnCloseParam=d;var e=this.oCurrentLayer;b!=e&&(this.oApp.exec("HIDE_ACTIVE_LAYER",[]),b.style.display="block",this.oCurrentLayer=b)},$ON_HIDE_ACTIVE_LAYER:function(){var a=this.oCurrentLayer;a&&(a.style.display="none",this.oCurrentLayer=null,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=a.Class({name:"StringConverterManager",oConverters:null,$init:function(){this.oConverters={}},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["applyConverter",a.fnBind(this.applyConverter,this)]),this.oApp.exec("ADD_APP_PROPERTY",["addConverter",a.fnBind(this.addConverter,this)])},applyConverter:function(a,b){var c=this.oConverters[a];if(!c)return b;for(var d=0;df;f++)if(e.test(c[f].className)){var g=RegExp.$1;if(null!=this.htUIList[g])continue;this.htUIList[g]=a(">*:first-child",c[f]).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",a.fnBind(this.getToolbarButtonByUIName,this)])},$ON_EVENT_TOOLBAR_MOUSEOVER:function(b){"BUTTON"==b.target.tagName&&a(b.target).addClass("hover").parent("span").addClass("hover")},$ON_EVENT_TOOLBAR_MOUSEOUT:function(b){"BUTTON"==b.target.tagName&&a(b.target).removeClass("hover").parent("span").removeClass("hover")},$ON_TOGGLE_TOOLBAR_ACTIVE_LAYER:function(a,b,c,d,e,f){this.oApp.exec("TOGGLE_ACTIVE_LAYER",[a,"MSG_TOOLBAR_LAYER_SHOWN",[a,b,c,d],e,f])},$ON_MSG_TOOLBAR_LAYER_SHOWN:function(a,b,c,d){this.oApp.exec("POSITION_TOOLBAR_LAYER",[a,b]),c&&this.oApp.exec(c,d)},$ON_SHOW_TOOLBAR_ACTIVE_LAYER:function(a,b,c,d){this.oApp.exec("SHOW_ACTIVE_LAYER",[a,b,c]),this.oApp.exec("POSITION_TOOLBAR_LAYER",[a,d])},$ON_ENABLE_UI:function(b){var c=this.htUIList[b];if(c){a(c).removeClass("off"),c.disabled=!1;var d="";if(this.aUICmdMap[b])for(var e=0;ef&&(b.style.left=f-e-5+"px")}},getToolbarButtonByUIName:function(a){return this.htUIList[a]}}),xe.XE_EditingAreaManager=a.Class({name:"XE_EditingAreaManager",oActivePlugin:null,oIRField:null,bIsDirty:!1,$init:function(b,c,d,e,f){this.sInitialMode=b,this.oIRField=a.$(c),this._assignHTMLObjects(f),this.fOnBeforeUnload=e,this.oEditingMode={},this.elEditingAreaContainer.style.height=parseInt(d.nHeight||this.elEditingAreaContainer.offsetHeight)+"px",this.nMinHeight=d.nMinHeight||10,this.niMinWidth=d.nMinWidth||10},_assignHTMLObjects:function(b){b=a.$(b)||document,this.elEditingAreaContainer=a("DIV.xpress_xeditor_editing_area_container",b).get(0),this.elEditingAreaSkipUI=a("A.skip",b).get(0)},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["elEditingAreaContainer",this.elEditingAreaContainer]),this.oApp.exec("ADD_APP_PROPERTY",["getIR",a.fnBind(this.getIR,this)]),this.oApp.exec("ADD_APP_PROPERTY",["setIR",this.setIR]),this.oApp.exec("ADD_APP_PROPERTY",["getEditingMode",a.fnBind(this.getEditingMode,this)])},$ON_MSG_APP_READY:function(){this.oApp.exec("CHANGE_EDITING_MODE",[this.sInitialMode,!0]),this.oApp.exec("LOAD_IR_FIELD",[!1]),this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"focus","MSG_EDITING_AREA_SIZE_CHANGED",[],50),this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"blur","MSG_EDITING_AREA_SIZE_CHANGED",[],50)},$AFTER_MSG_APP_READY:function(){this.oApp.exec("UPDATE_IR_FIELD",[])},$ON_LOAD_IR_FIELD:function(a){this.oApp.setIR(this.oIRField.value,a)},$ON_UPDATE_IR_FIELD:function(){this.oIRField.value=this.oApp.getIR()},$BEFORE_CHANGE_EDITING_MODE:function(a){this._oPrevActivePlugin=this.oActivePlugin,this.oActivePlugin=this.oEditingMode[a]},$AFTER_CHANGE_EDITING_MODE:function(a,b){if(this._oPrevActivePlugin){var c=this._oPrevActivePlugin.getIR();this.oApp.exec("SET_IR",[c]),this.oApp.exec("ENABLE_UI",[this._oPrevActivePlugin.sMode]),this._setEditingAreaDimension()}this.oApp.exec("DISABLE_UI",[this.oActivePlugin.sMode]),b||this.oApp.exec("FOCUS",[])},$ON_SET_IS_DIRTY:function(a){this.bIsDirty=a},$ON_FOCUS:function(){this.oActivePlugin&&"function"==typeof this.oActivePlugin.setIR&&this.oActivePlugin.focus()},$BEFORE_SET_IR:function(a,b){b=b||!1,b||this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"])},$ON_SET_IR:function(a){this.oActivePlugin&&"function"==typeof this.oActivePlugin.setIR&&this.oActivePlugin.setIR(a)},$AFTER_SET_IR:function(a,b){b=b||!1,b||this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"])},$ON_REGISTER_EDITING_AREA:function(a){this.oEditingMode[a.sMode]=a,this.attachDocumentEvents(a.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(a,b){var c=parseInt(a),d=parseInt(b);c"]);break;default:return}a.preventDefault(),a.stopPropagation()}},$ON_EVENT_EDITING_AREA_KEYUP:function(a){229==a.keyCode||13==a.keyCode||a.altKey||a.ctrlKey||a.keyCode>=33&&a.keyCode<=40||16==a.keyCode||this._recordUndo(a)},$ON_PASTE_HTML:function(b,c){if(this.oApp.getEditingMode()==this.sMode){var d=c||this.oApp.getSelection();if(d.pasteHTML(b),!a.browser.msie){var e=d.placeStringBookmark();this.oApp.getWYSIWYGDocument().body.innerHTML=this.oApp.getWYSIWYGDocument().body.innerHTML,d.moveToBookmark(e),d.collapseToEnd(),d.select(),d.removeStringBookmark(e)}this.oApp.exec("RECORD_UNDO_ACTION",["INSERT HTML"])}},$AFTER_MSG_EDITING_AREA_RESIZE_ENDED:function(){this.oApp.exec("REFRESH_WYSIWYG",[])},$ON_RESTORE_IE_SELECTION:function(){this._oIERange&&(this._oIERange.select(),this._oPrevIERange=this._oIERange,this._oIERange=null)},initIframe:function(){try{if(this.doc=this.iframe.contentWindow.document,null==this.doc||"about:blank"==this.doc.location.href)throw new Error("Access denied");this._enableWYSIWYG(),this.status=xe.PLUGIN_STATUS.READY}catch(b){if(!(this._nIFrameReadyCount-->0))throw"iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). ";setTimeout(a.fnBind(this.initIframe,this),100)}},getIR:function(){var a,b=this.doc.body.innerHTML;return a=this.oApp.applyConverter?this.oApp.applyConverter(this.sMode+"_TO_IR",b):b},setIR:function(b){var c;c=this.oApp.applyConverter?this.oApp.applyConverter("IR_TO_"+this.sMode,b):b,this.doc.body.innerHTML=c,a.browser.mozilla&&""==this.doc.body.innerHTML&&(this.doc.body.innerHTML="
")},getWindow:function(){return this.iframe.contentWindow},getDocument:function(){return this.iframe.contentWindow.document},focus:function(){},_recordUndo:function(a){var b=new Date;b-this.iLastUndoRecorded"),""==h.innerHTML&&(h.innerHTML="
"),h.nextSibling&&"BR"==h.nextSibling.tagName&&h.parentNode.removeChild(h.nextSibling),b.selectNodeContents(h),b.collapseToStart(),b.select(),this.oApp.exec("CHECK_STYLE_CHANGE",[])}else b.removeStringBookmark(c)}}}),xe.XE_WYSIWYGStyler=a.Class({name:"XE_WYSIWYGStyler",$PRECONDITION:function(){return"WYSIWYG"==this.oApp.getEditingMode()},$ON_SET_WYSIWYG_STYLE:function(b){var c=this.oApp.getSelection();if(c.collapsed){var d=this.oApp.getWYSIWYGDocument().createElement("SPAN");c.insertNode(d),d.innerHTML=unescape("%uFEFF");var e;for(var f in b)e=b[f],"string"==typeof e&&(d.style[f]=e);return c.selectNodeContents(d),c.collapseToEnd(),c._window.focus(),c._window.document.body.focus(),c.select(),void(a.browser.mozilla&&3==a.browser.nVersion&&(d.innerHTML=""))}this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["FONT STYLE"]),c.styleRange(b),c._window.focus(),c.select(),this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["FONT STYLE"])}}),xe.XE_WYSIWYGStyleGetter=a.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(a,b){return a.match(/px$/)?Math.ceil(parseInt(a)/parseInt(b.fontSize)*10)/10:a}},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(){return"WYSIWYG"!=this.oApp.getEditingMode()?!1:!0},$ON_MSG_APP_READY:function(){this.oDocument=this.oApp.getWYSIWYGDocument(),this.oApp.exec("ADD_APP_PROPERTY",["getCurrentStyle",a.fnBind(this.getCurrentStyle,this)])},$ON_EVENT_EDITING_AREA_MOUSEUP:function(){this.hKeyUp&&clearTimeout(this.hKeyUp),this.oApp.exec("CHECK_STYLE_CHANGE",[])},$ON_EVENT_EDITING_AREA_KEYUP:function(b){(8==b.keyCode||b.keyCode>=33&&b.keyCode<=40||45==b.keyCode||46==b.keyCode)&&(this.hKeyUp&&clearTimeout(this.hKeyUp),this.hKeyUp=setTimeout(a.fnBind(this.oApp.exec,this.oApp,"CHECK_STYLE_CHANGE",[]),this.getStyleInterval))},$ON_CHECK_STYLE_CHANGE:function(){this._getStyle()},$ON_RESET_STYLE_STATUS:function(){var a=this._getBlankStyle();for(var b in a)this.oApp.exec("SET_STYLE_STATUS",[b,a[b]])},getCurrentStyle:function(){return this.oStyle},_check_style_change:function(){this.oApp.exec("CHECK_STYLE_CHANGE",[])},_getBlankStyle:function(){var a={};for(var b in this.oStyleMap)a[b]="Value"==this.oStyleMap[b].type?"":0; return a},_getStyle:function(){var a,b,c=this.oApp.getSelection(),d=function(a){return a.childNodes&&0!=a.childNodes.length?!1:!0},e=c.getNodes(!1,d);a=this._getStyleOf(0==e.length?c.commonAncestorContainer:e[0]);for(b in a)this.oStyleMap[b].converter&&(a[b]=this.oStyleMap[b].converter(a[b],a)),this.oStyle[b]!=a[b]&&this.oApp.exec("MSG_STYLE_CHANGED",[b,a[b]]);this.oStyle=a},_getStyleOf:function(b){var c=this._getBlankStyle();if(!b)return c;3==b.nodeType&&(b=b.parentNode);var d,e=a(b);for(var f in this.oStyle)if(d=this.oStyleMap[f],d.type&&"Value"==d.type){if(d.css){var g=e.css(d.css);"fontFamily"==f&&(g=g.split(/,/)[0]),c[f]=g}else if(d.command)try{c[f]=this.oDocument.queryCommandState(d.command)}catch(h){}}else if(d.command)try{c[f]=this.oDocument.queryCommandState(d.command)?1:0}catch(h){}return c}}),xe.XE_FontSizeWithSelectUI=a.Class({name:"XE_FontSizeWithSelectUI",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){this.elFontSizeSelect=a("SELECT.xpress_xeditor_ui_fontSize_select",b).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(a,b){"fontSize"==a&&(this.elFontSizeSelect.value=b,this.elFontSizeSelect.selectedIndex<0&&(this.elFontSizeSelect.selectedIndex=0))},$ON_SET_FONTSIZE_FROM_SELECT_UI:function(){var a=this.elFontSizeSelect.value;a&&(this.oApp.exec("SET_WYSIWYG_STYLE",[{fontSize:a}]),this.oApp.exec("CHECK_STYLE_CHANGE",[]))}}),xe.XE_FontNameWithSelectUI=a.Class({name:"XE_FontNameWithSelectUI",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){this.elFontNameSelect=a("SELECT.xpress_xeditor_ui_fontName_select",b).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(a,b){"fontFamily"==a&&(this.elFontNameSelect.value=b.toLowerCase(),this.elFontNameSelect.selectedIndex<0&&(this.elFontNameSelect.selectedIndex=0))},$ON_SET_FONTNAME_FROM_SELECT_UI:function(){var a=this.elFontNameSelect.value;a&&(this.oApp.exec("SET_WYSIWYG_STYLE",[{fontFamily:a}]),this.oApp.exec("CHECK_STYLE_CHANGE",[]))}}),xe.XE_LineHeight=a.Class({name:"XE_LineHeight",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(){},$ON_SET_LINEHEIGHT:function(a){this.setLineHeight(a)},getLineHeight:function(){var b,c,d,e=this._getSelectedNodes(!1);if(0==e.length)return-1;var f=e.length;0==f?d=-1:(c=this._getLineWrapper(e[0]),d=this._getWrapperLineheight(c));var g=this.oSelection.getStartNode();if(d>0)for(var h=1;f>h;h++)if(!this._isChildOf(e[h],b)&&e[h]&&(b=this._getLineWrapper(e[h]),b!=c)){if(curHeight=this._getWrapperLineheight(b),curHeight!=d){d=-1;break}c=b}b=this._getLineWrapper(e[f-1]);var i=this.oSelection.getEndNode();return selectText=a.fnBind(function(a,b){this.oSelection.setEndNodes(a,b),this.oSelection.select()},this,g,i),setTimeout(selectText,100),d},setLineHeight:function(b){function c(a,b){if(!a)try{a=thisRef.oSelection.surroundContentsWithNewNode("P")}catch(c){a=thisRef.oSelection.surroundContentsWithNewNode("DIV")}return a.style.lineHeight=b,a}function d(a){for(;a&&"BODY"!=a.tagName;)a=xe.DOMFix.parentNode(a);return a?!0:!1}thisRef=this;var e=this._getSelectedNodes(!1);if(0!=e.length){var f,g,h=e.length;this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["LINEHEIGHT"]),g=this._getLineWrapper(e[0]),g=c(g,b);for(var i=g,j=g,k=1;h>k;k++){try{if(!d(xe.DOMFix.parentNode(e[k])))continue}catch(l){continue}this._isChildOf(e[k],f)||(f=this._getLineWrapper(e[k]),f!=g&&(f=c(f,b),g=f))}j=f||i,setTimeout(a.fnBind(function(a,b){this.oSelection.setEndNodes(a,b),this.oSelection.select(),this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["LINEHEIGHT"])},this,i,j),100)}},_getSelectedNodes:function(a){a||(this.oSelection=this.oApp.getSelection()),this.oSelection.collapsed&&this.oSelection.selectNode(this.oSelection.commonAncestorContainer);var b=this.oSelection.getTextNodes();if(0==b.length){var c=this.oSelection.getStartNode();c?b[0]=c:b=[]}return b},_getWrapperLineheight:function(a){var b="";if(a&&a.style.lineHeight)b=a.style.lineHeight;else for(a=this.oSelection.commonAncesterContainer;a&&!this.oSelection.rxLineBreaker.test(a.tagName);){if(a&&a.style.lineHeight){b=a.style.lineHeight;break}a=xe.DOMFix.parentNode(a)}return b},_isChildOf:function(a,b){for(;a&&"BODY"!=a.tagName;){if(a==b)return!0;a=xe.DOMFix.parentNode(a)}return!1},_getLineWrapper:function(a){var b=this.oApp.getEmptySelection();b.selectNode(a);var c,d,e,f,g=b.getLineInfo(),h=g.oStart,i=g.oEnd,j=null;return c=h.oNode,e=h.oLineBreaker,d=i.oNode,f=i.oLineBreaker,this.oSelection.setEndNodes(c,d),e==f&&("P"==e.tagName||"DIV"==e.tagName?j=e:this.oSelection.setEndNodes(e.firstChild,e.lastChild)),j}}),xe.XE_LineHeightWithSelectUI=a.Class({name:"XE_LineHeightWithSelectUI",_assignHTMLObjects:function(b){this.elLineHeightSelect=a("SELECT.xpress_xeditor_ui_lineHeight_select",b).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elLineHeightSelect,"change","SET_LINEHEIGHT_FROM_SELECT_UI"),this.elLineHeightSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(a,b){"lineHeight"==a&&(this.elLineHeightSelect.value=b,this.elLineHeightSelect.selectedIndex<0&&(this.elLineHeightSelect.selectedIndex=0))},$ON_SET_LINEHEIGHT_FROM_SELECT_UI:function(){var a=this.elLineHeightSelect.value;a&&(this.elLineHeightSelect.selectedIndex=0,this.oApp.exec("SET_LINEHEIGHT",[a]),this.oApp.exec("CHECK_STYLE_CHANGE",[]))}}).extend(xe.XE_LineHeight),xe.XE_ColorPalette=a.Class({name:"XE_ColorPalette",rxRGBColorPattern:/rgb\((\d+), ?(\d+), ?(\d+)\)/i,$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){this.elColorPaletteLayer=a("UL.xpress_xeditor_color_palette",b).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elColorPaletteLayer,"click","EVENT_MOUSEUP_COLOR_PALETTE")},$ON_SHOW_COLOR_PALETTE:function(a,b){this.sCallbackCmd=a,this.oLayerContainer=b,this.oLayerContainer.insertBefore(this.elColorPaletteLayer,null),this.elColorPaletteLayer.style.display="block"},$ON_HIDE_COLOR_PALETTE:function(){this.elColorPaletteLayer.style.display="none"},$ON_COLOR_PALETTE_APPLY_COLOR:function(a){function b(a){var b=parseInt(a).toString(16);return b.length<2&&(b="0"+b),b.toUpperCase()}if(this.rxRGBColorPattern.test(a)){var c=b(RegExp.$1),d=b(RegExp.$2),e=b(RegExp.$3);a="#"+c+d+e}this.oApp.exec(this.sCallbackCmd,[a])},$ON_EVENT_MOUSEUP_COLOR_PALETTE:function(a){var b=a.target;b.style.backgroundColor&&this.oApp.exec("COLOR_PALETTE_APPLY_COLOR",[b.style.backgroundColor])}}),xe.XE_FontColor=a.Class({name:"XE_FontColor",rxColorPattern:/^#?[0-9a-fA-F]{6}$|^rgb\(\d+, ?\d+, ?\d+\)$/i,$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){this.elDropdownLayer=a("DIV.xpress_xeditor_fontcolor_layer",b).get(0)},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["fontColor","click","TOGGLE_FONTCOLOR_LAYER"])},$ON_TOGGLE_FONTCOLOR_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer,null,"SHOW_COLOR_PALETTE",["APPLY_FONTCOLOR",this.elDropdownLayer]])},$ON_APPLY_FONTCOLOR:function(a){return this.rxColorPattern.test(a)?(this.oApp.exec("SET_WYSIWYG_STYLE",[{color:a}]),void this.oApp.exec("HIDE_ACTIVE_LAYER")):void alert(this.oApp.$MSG("XE_FontColor.invalidColorCode"))}}),xe.XE_BGColor=a.Class({name:"XE_BGColor",rxColorPattern:/^#?[0-9a-fA-F]{6}$|^rgb\(\d+, ?\d+, ?\d+\)$/i,$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){this.elDropdownLayer=a("DIV.xpress_xeditor_bgcolor_layer",b).get(0)},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["bgColor","click","TOGGLE_BGCOLOR_LAYER"]),this.oApp.registerBrowserEvent(this.elDropdownLayer,"click","EVENT_APPLY_BGCOLOR",[])},$ON_TOGGLE_BGCOLOR_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer,null,"SHOW_COLOR_PALETTE",["APPLY_BGCOLOR",this.elDropdownLayer]])},$ON_EVENT_APPLY_BGCOLOR:function(a){var b=a.target;if("SPAN"==b.tagName&&(b=b.parentNode),"BUTTON"==b.tagName){var c,d;c=b.style.backgroundColor,d=b.style.color,this.oApp.exec("APPLY_BGCOLOR",[c,d])}},$ON_APPLY_BGCOLOR:function(a,b){if(!this.rxColorPattern.test(a))return void alert(this.oApp.$MSG("XE_BGColor.invalidColorCode"));var c={backgroundColor:a};b&&(c.color=b),this.oApp.exec("SET_WYSIWYG_STYLE",[c]),this.oApp.exec("HIDE_ACTIVE_LAYER")}}),xe.XE_Quote=a.Class({name:"XE_Quote",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){this.elDropdownLayer=a("DIV.xpress_xeditor_blockquote_layer",b).get(0)},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["quote","click","TOGGLE_BLOCKQUOTE_LAYER"]),this.oApp.registerBrowserEvent(this.elDropdownLayer,"click","EVENT_APPLY_SEDITOR_BLOCKQUOTE",[])},$ON_TOGGLE_BLOCKQUOTE_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer])},$ON_EVENT_APPLY_SEDITOR_BLOCKQUOTE:function(a){var b=a.target;if("BUTTON"==b.tagName){var c=b.parentNode.className;"q8"!=c?this._wrapBlock("BLOCKQUOTE",c):this._unwrapBlock("BLOCKQUOTE"),this.oApp.exec("HIDE_ACTIVE_LAYER",[])}},_unwrapBlock:function(a){for(var b=this.oApp.getSelection(),c=b.commonAncestorContainer;c&&c.tagName!=a;)c=c.parentNode;if(c){for(;c.firstChild;)c.parentNode.insertBefore(c.firstChild,c);c.parentNode.removeChild(c)}},_wrapBlock:function(a,b){var c,d,e=this.oApp.getSelection(),f=e.getLineInfo(),g=f.oStart,h=f.oEnd,i=/BODY|TD|LI/i;c=g.bParentBreak&&!i.test(g.oLineBreaker.tagName)?g.oNode.parentNode:g.oNode,d=h.bParentBreak&&!i.test(h.oLineBreaker.tagName)?h.oNode.parentNode:h.oNode,e.setStartBefore(c),e.setEndAfter(d);var j=this._expandToTableStart(e,d);j&&(d=j,e.setEndAfter(j)),j=this._expandToTableStart(e,c),j&&(c=j,e.setStartBefore(j)),j=c;for(var k=e.commonAncestorContainer;j&&j!=k&&j.parentNode!=k;)j=j.parentNode;oFormattingNode=e._document.createElement(a),b&&(oFormattingNode.className=b),j==k?k.insertBefore(oFormattingNode,k.firstChild):k.insertBefore(oFormattingNode,j),e.setStartAfter(oFormattingNode),e.setEndAfter(d),e.surroundContents(oFormattingNode);for(var l,m=oFormattingNode.childNodes,n=m.length-1;n>=0;n--)if(3==m[n].nodeType||"BR"==m[n].tagName){var o=e._document.createElement("P");for(l=m[n].nextSibling;n>=0&&m[n]&&(3==m[n].nodeType||"BR"==m[n].tagName);)o.insertBefore(m[n--],o.firstChild);oFormattingNode.insertBefore(o,l),n++}if(oFormattingNode&&oFormattingNode.parentNode){var o=e._document.createElement("P");o.innerHTML=unescape("
"),oFormattingNode.parentNode.insertBefore(o,oFormattingNode.nextSibling)}return this.oApp.exec("RECORD_UNDO_ACTION",["Block Quote"]),oFormattingNode},_expandToTableStart:function(a,b){for(var c=a.commonAncestorContainer,d=null,e=!1;b&&!e;){if(b==c&&(e=!0),/TBODY|TFOOT|THEAD|TR/i.test(b.tagName)){d=this._getTableRoot(b);break}b=b.parentNode}return d},_getTableRoot:function(a){for(;a&&"TABLE"!=a.tagName;)a=a.parentNode;return a}}),xe.XE_SCharacter=a.Class({name:"XE_SCharacter",$init:function(b){this.bIE=a.browser.msie,this._assignHTMLObjects(b),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(b){b=a.$(b)||document,this.elDropdownLayer=a("DIV.xpress_xeditor_sCharacter_layer",b).get(0),this.oTextField=a("INPUT",this.elDropdownLayer).get(0),this.oInsertButton=a("+ BUTTON",this.oTextField).get(0),this.aCloseButton=a("BUTTON.close",this.elDropdownLayer).get(),this.aSCharList=a(".list",this.elDropdownLayer).get();var c=a(">UL",this.elDropdownLayer).get(0);this.aLabelA=a("A",c).get()},$ON_MSG_APP_READY:function(){var b=a.fnBind(this.oApp.exec,this.oApp,"INSERT_SCHARACTERS",[this.oTextField.value]);a(this.oInsertButton).click(b),this.oApp.exec("SET_SCHARACTER_LIST",[this.charSet]);for(var c=0;cd;d++)c[d]=document.createElement("LI"),c[d].innerHTML='",this.aSCharList[a].appendChild(c[d])}},_stopBrowserEvent:function(b,c){a(b).bind(c,function(a){a.stopPropagation(),a.preventDefault()})}}),xe.XE_UndoRedo=a.Class({name:"XE_UndoRedo",actionHistory:null,oCurStateIdx:null,iMinimumSizeChange:10,sBlankContentsForFF:"
",$init:function(){this.aUndoHistory=[],this.oCurStateIdx={nIdx:0,nStep:0}},$PRECONDITION:function(a){if(a.match(/_DO_RECORD_UNDO_HISTORY_AT$/))return!0;try{if("WYSIWYG"!=this.oApp.getEditingMode())return!1}catch(b){return!1}return!0},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("DO_RECORD_UNDO_HISTORY_AT",[this.oCurStateIdx,"","",null])},$ON_MSG_APP_READY:function(){this.bFF=a.browser.mozilla,this.oApp.exec("ADD_APP_PROPERTY",["getUndoHistory",a.fnBind(this.getUndoHistory,this)]),this.oApp.exec("ADD_APP_PROPERTY",["getUndoStateIdx",a.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(){if(this.oApp.exec("DO_RECORD_UNDO_HISTORY",["KEYPRESS",!1,!1,1]),0!=this.oCurStateIdx.nIdx){if(this.oCurStateIdx.nStep>0)this.oCurStateIdx.nStep--;else{var a=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nIdx--,a.nTotalSteps>1?this.oCurStateIdx.nStep=0:(a=this.aUndoHistory[this.oCurStateIdx.nIdx],this.oCurStateIdx.nStep=a.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)){var a=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nIdx==this.aUndoHistory.length-1&&this.oCurStateIdx.nStep>=a.nTotalSteps-1||(this.oCurStateIdx.nStep"+b+"";this.oSelection.pasteHTML(e)}else{var f=Math.ceil(1e4*Math.random()),g=this.sATagMarker+f,h=""==b?["unlink"]:["createLink",!1,g+b];this.oApp.exec("EXECCOMMAND",h);try{this.oSelection.setFromSelection()}catch(i){}var j=this.oApp.getWYSIWYGDocument();a(j.body.getElementsByTagName("A")).filter('[href^="'+g+'"]').attr("href",function(){var b=new RegExp("^"+g.replace(/([\.\\])/g,"\\$1"),"i");return d?a(this).attr("target",d):a(this).removeAttr("target"),this.href.replace(b,"")})}this.oApp.exec("HIDE_ACTIVE_LAYER"),setTimeout(a.fnBind(function(){try{this.oSelection.select()}catch(a){}},this),0)},_validateURL:function(a){return/^(http|https|ftp|mailto):(?:\/\/)?((\w|-)+(?:[\.:@](\w|-))+)(?:\/|@)?([^"\?]*?)(?:\?([^\?"]*?))?$/.test(a)},$ON_EVENT_XE_HYPERLINK_KEYDOWN:function(a){13==a.keyCode&&(this.oApp.exec("XE_APPLY_HYPERLINK"),a.preventDefault(),a.stopPropagation())}}),xe.XE_Table=a.Class({name:"XE_Table",iMinRows:1,iMaxRows:20,iMinColumns:1,iMaxColumns:10,iMinBorderWidth:1,iMaxBorderWidth:10,oSelection:null,$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){var c=null;this.elDropdownLayer=a("DIV.xpress_xeditor_table_layer",b).get(0),this.welDropdownLayer=a(this.elDropdownLayer),c=a("INPUT",this.elDropdownLayer).get(),this.oRowInput=c[0],this.oColumnInput=c[1],this.oBorderWidthInput=c[2],this.oBorderColorInput=c[3],this.oBGColorInput=c[4],c=a("BUTTON",this.elDropdownLayer).get(),this.oButton_AddRow=c[0],this.oButton_RemoveRow=c[1],this.oButton_AddColumn=c[2],this.oButton_RemoveColumn=c[3],this.oButton_IncBorderWidth=c[4],this.oButton_DecBorderWidth=c[5],this.oButton_BorderColorPreview=c[6],this.oButton_BorderColor=c[7],this.oButton_BGColorPreview=c[8],this.oButton_BGColor=c[9],this.oButton_Insert=c[10],this.oButton_Cancel=c[11],this.oSampleTable=a("TABLE",this.elDropdownLayer).get(0)},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["table","click","ST_TOGGLE_TOOLBAR_LAYER"]),this.oApp.registerBrowserEvent(this.oRowInput,"change","ST_SET_ROW_NUM",[null,0]),this.oApp.registerBrowserEvent(this.oColumnInput,"change","ST_SET_COLUMN_NUM",[null,0]),this.oApp.registerBrowserEvent(this.oBorderWidthInput,"change","ST_SET_BORDER_WIDTH",[null,0]),this.oApp.registerBrowserEvent(this.oButton_AddRow,"click","ST_ADD_ROW"),this.oApp.registerBrowserEvent(this.oButton_RemoveRow,"click","ST_REMOVE_ROW"),this.oApp.registerBrowserEvent(this.oButton_AddColumn,"click","ST_ADD_COLUMN"),this.oApp.registerBrowserEvent(this.oButton_RemoveColumn,"click","ST_REMOVE_COLUMN"),this.oApp.registerBrowserEvent(this.oButton_IncBorderWidth,"click","ST_INC_BORDER_WIDTH"),this.oApp.registerBrowserEvent(this.oButton_DecBorderWidth,"click","ST_DEC_BORDER_WIDTH"),this.oApp.registerBrowserEvent(this.oButton_BorderColorPreview,"click","ST_TOGGLE_BORDER_COLOR_LAYER"),this.oApp.registerBrowserEvent(this.oButton_BGColorPreview,"click","ST_TOGGLE_BGCOLOR_LAYER"),this.oApp.registerBrowserEvent(this.oButton_BorderColor,"click","ST_TOGGLE_BORDER_COLOR_LAYER"),this.oApp.registerBrowserEvent(this.oButton_BGColor,"click","ST_TOGGLE_BGCOLOR_LAYER"),this.oApp.registerBrowserEvent(this.oButton_Insert,"click","ST_INSERT_TABLE"),this.oApp.registerBrowserEvent(this.oButton_Cancel,"click","ST_CLOSE"),this.oApp.exec("ST_SET_BORDER_COLOR",["#CCCCCC"]),this.oApp.exec("ST_SET_BGCOLOR",["#FFFFFF"])},$ON_ST_TOGGLE_TOOLBAR_LAYER:function(){this.oApp.exec("RECORD_UNDO_ACTION_FORCED",["KEYPRESS"]),this._showNewTable(),this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer])},$ON_ST_ADD_ROW:function(){this.oApp.exec("ST_SET_ROW_NUM",[null,1])},$ON_ST_REMOVE_ROW:function(){this.oApp.exec("ST_SET_ROW_NUM",[null,-1])},$ON_ST_ADD_COLUMN:function(){this.oApp.exec("ST_SET_COLUMN_NUM",[null,1])},$ON_ST_REMOVE_COLUMN:function(){this.oApp.exec("ST_SET_COLUMN_NUM",[null,-1])},$ON_ST_SET_ROW_NUM:function(a,b){a=a||parseInt(this.oRowInput.value),b=b||0,a+=b,athis.iMaxRows&&(a=this.iMaxRows),this.oRowInput.value=a,this._showNewTable()},$ON_ST_SET_COLUMN_NUM:function(a,b){a=a||parseInt(this.oColumnInput.value),b=b||0,a+=b,athis.iMaxColumns&&(a=this.iMaxColumns),this.oColumnInput.value=a,this._showNewTable()},$ON_ST_INSERT_TABLE:function(){var a=this._getTableString();this.oApp.exec("PASTE_HTML",[a]),this.oApp.exec("ST_CLOSE",[])},$ON_ST_CLOSE:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_ST_SET_BORDER_WIDTH:function(a,b){a=a||parseInt(this.oBorderWidthInput.value),b=b||0,a+=b,athis.iMaxBorderWidth&&(a=this.iMaxBorderWidth),this.oBorderWidthInput.value=a,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(){this.welDropdownLayer.hasClass("p1")?this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER",[]):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(){this.welDropdownLayer.hasClass("p2")?this.oApp.exec("ST_HIDE_BGCOLOR_LAYER",[]):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(a){this.oApp.exec("ST_SET_BORDER_COLOR",[a]),this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER",[])},$ON_ST_SET_BORDER_COLOR:function(a){this.oBorderColorInput.value=a,this.oButton_BorderColorPreview.style.backgroundColor=a,this._showNewTable()},$ON_ST_SET_BGCOLOR_FROM_PALETTE:function(a){this.oApp.exec("ST_SET_BGCOLOR",[a]),this.oApp.exec("ST_HIDE_BGCOLOR_LAYER",[])},$ON_ST_SET_BGCOLOR:function(a){this.oBGColorInput.value=a,this.oButton_BGColorPreview.style.backgroundColor=a,this._showNewTable()},_showNewTable:function(){var a=document.createElement("DIV");a.innerHTML=this._getTableString();var b=a.firstChild;this.oSampleTable.parentNode.insertBefore(b,this.oSampleTable),this.oSampleTable.parentNode.removeChild(this.oSampleTable),this.oSampleTable=b},_getTableString:function(){var b=this.oBorderColorInput.value,c=this.oBGColorInput.value,d=this.oBorderWidthInput.value,e="";e=a.browser.msie?"

":a.browser.firefox?"


":"

 

";for(var f='',g='',h=this.oColumnInput.value,i=0;h>i;i++)g+=e;g+="\n";var j=this.oRowInput.value;f+="";for(var i=0;j>i;i++)f+=g;return f+="",f+="
"}}),xe.XE_EditingModeToggler=a.Class({name:"XE_EditingModeToggler",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){b=a.$(b)||document,this.elModeToggleButton=a("BUTTON.xpress_xeditor_mode_toggle_button",b).get(0),this.welModeToggleButton=a(this.elModeToggleButton)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elModeToggleButton,"click","EVENT_TOGGLE_EDITING_MODE",[])},$ON_EVENT_TOGGLE_EDITING_MODE:function(){"WYSIWYG"==this.oApp.getEditingMode()?this.oApp.exec("CHANGE_EDITING_MODE",["HTMLSrc"]):this.oApp.exec("CHANGE_EDITING_MODE",["WYSIWYG"])},$ON_CHANGE_EDITING_MODE:function(a){"HTMLSrc"==a?(this.welModeToggleButton.addClass("active").parent("span").addClass("active"),this.oApp.exec("DISABLE_ALL_UI",[])):(this.welModeToggleButton.removeClass("active").parent("span").removeClass("active"),this.oApp.exec("ENABLE_ALL_UI",[])) -}}),xe.XE_Editorresize=a.Class({name:"XE_Editorresize",$init:function(b,c){this.inputArea=a(".xpress_xeditor_editing_area_container",b).get(0),this.oVerticalResizer=a(".xpress_xeditor_editingArea_verticalResizer",b).get(0),this.oCheckBox=a("#editorresize",b).get(0),this.oIframe=c;var d=this;a(c).load(function(){d.oIframeBody=a(c).contents().find("body")})},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.oCheckBox,"change","XE_TOGGLE_EDITOR_RESIZE")},$ON_XE_TOGGLE_EDITOR_RESIZE:function(){1==this.oCheckBox.checked?(void 0==this._prevHeight&&(this._prevHeight=this.inputArea.style.height),this.oVerticalResizer.style.display="none",this.oApp.registerBrowserEvent(this.oIframeBody,"keydown","XE_EDITOR_RESIZE"),this.inputArea.style.height=this.oIframe.style.height=this.oIframeBody[0].scrollHeight+"px"):(a(this.oIframeBody).unbind("keydown"),this.oVerticalResizer.style.display="block",this.inputArea.style.height=this._prevHeight,this.oIframe.style.height=this._prevHeight)},$ON_XE_EDITOR_RESIZE:function(){var a=this;setTimeout(function(){a.inputArea.style.height=a.oIframe.style.height=a.oIframeBody[0].scrollHeight+"px"},0)}});var d={"XE_EditingAreaManager.onExit":"%uB0B4%uC6A9%uC774%20%uBCC0%uACBD%uB418%uC5C8%uC2B5%uB2C8%uB2E4.","XE_FontColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff","XE_BGColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff","XE_Hyperlink.invalidURL":"%uC785%uB825%uD558%uC2E0%20URL%uC774%20%uC62C%uBC14%uB974%uC9C0%20%uC54A%uC2B5%uB2C8%uB2E4."};xe.XpressCore.oMessageMap=d;regex_handler=/<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/gi,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+)/gi,regex_quote_attr=/([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g;var e=("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,style".split(","),"area,br,col,embed,hr,img,input,param,base,meta,link,basefont,isindex".split(",")),f={b:"strong",i:"em",s:"del",strike:"del"};xe.XE_XHTMLFormatter=a.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(b){var c=[];if(a.browser.msie&&(b=b.replace(regex_jquery,""),b=b.replace(/<(\w+) ([^>]+)>/g,function(a,b,c){return"<"+b+" "+c.replace(regex_quote_attr,function(a,b,c,d){return b?b:/^"/.test(d)||/"$/.test(d)?c+"="+d:c+'="'+(d||c)+'"'})+">"})),regex=/<(\/)?([:\w\/-]+)(.*?)>/gi,b=b.replace(regex,function(b,d,g,h){var i="";if(d=d||"",g=g.toLowerCase(),h=a.trim(h||""),void 0!=f[g]&&(g=f[g]),d){var j=[],k="";if(a.inArray(g,e)>=0)return"";if(!c.length)return"";do k=c.pop(),k.tag==g&&"deleted"!=k.state&&j.push("");while(c.length&&k.tag!=g);return j.join("")}if(a.inArray(g,e)>=0){var l=h.length;return"br"==g&&(h=""),h&&"/"==h.substring(l-1,l)||(h+=" /"),"<"+g+" "+a.trim(h)+">"}return c.push({tag:g,state:i}),"<"+d+g+(h?" "+h:"")+">"}),c.length){var d="";do d=c.pop(),"deleted"!=d.state&&(b+="");while(c.length)}return regex=/<\/p>[ \t]*(\n)?/gi,b=b.replace(regex,"

\n")},IR_TO:function(a){return a}}),xe.XE_Extension=a.Class({name:"XE_Extension",seq:"",last_doc:"",$init:function(a,b){this.seq=b,this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){this.elDropdownLayer=a("DIV.xpress_xeditor_extension_layer",b).get(0)},_removeAttrs:function(a){return a},_addEvent:function(){if("WYSIWYG"==this.oApp.getEditingMode()){var b=this.oApp.getWYSIWYGDocument(),c=this.seq,d=function(){var b=a(this),d=b.attr("editor_component");d&&a.isFunction(openComponent)&&(editorPrevNode=b.get(0),openComponent(d,c))};a(b).find("img,div[editor_component]").each(function(){var c=a(this);"IMG"!=this.nodeName||c.attr("editor_component")||c.attr("widget")||c.attr("editor_component","image_link"),this.last_doc!=b&&(c.unbind("dblclick.widget").bind("dblclick.widget",d),this.last_doc=b)})}},$ON_MSG_APP_READY:function(){var b=this.oApp;b.exec("REGISTER_UI_EVENT",["extension","click","TOGGLE_EXTENSION_LAYER"]);var c=function(){b.exec("HIDE_ACTIVE_LAYER",[])};a("a",this.elDropdownLayer).each(function(){var b=a(this);b.attr("component_onclick_event_added")||(b.click(c),b.attr("component_onclick_event_added","Y"))})},$ON_TOGGLE_EXTENSION_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer])},$ON_CHANGE_EDITING_MODE:function(){var a=this;setTimeout(function(){a._addEvent()},100)},$ON_PASTE_HTML:function(){var a=this;setTimeout(function(){a._addEvent()},100)},$ON_LOAD_IR_FIELD:function(){var a=this;setTimeout(function(){a._addEvent()},100)},$ON_SET_IR:function(){var a=this;setTimeout(function(){a._addEvent()},100)}}),xe.XE_AutoSave=a.Class({name:"XE_AutoSave",form:null,textarea:null,$init:function(a,b){this.form=a.form,this.textarea=a,this._assignHTMLObjects(b)},_assignHTMLObjects:function(){this.welMessageBox=a("autosave_message")},$ON_MSG_APP_READY:function(){var b=a(this.form._saved_doc_title),c=a(this.form._saved_doc_content),d=a(this.form._saved_doc_document_srl),e=a.trim(b.val()),f=a.trim(c.val()),g=a.trim(d.val());(e||f||g)&&(confirm(this.form._saved_doc_message.value)?(a(this.form.title).val(e),this.oApp.setIR(f),"function"==typeof editorGetAutoSavedDoc&&editorGetAutoSavedDoc(this.form)):editorRemoveSavedDoc()),editorEnableAutoSave(this.form,a(this.form).attr("editor_sequence")),this.oApp.exec("REGISTER_HOTKEY",["ctrl+shift+s","AUTO_SAVE"])},$ON_AUTO_SAVE:function(){_editorAutoSave()}}),xe.XE_FormatWithSelectUI=a.Class({name:"XE_FormatWithSelectUI",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){this.elFormatSelect=a("SELECT.xpress_xeditor_ui_format_select",b).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(){var b=this.oApp.getWYSIWYGDocument().queryCommandValue("FormatBlock");return b?(a.browser.msie&&/([0-9])/.test(b)&&(b="h"+RegExp.$1),this.elFormatSelect.value=b.toLowerCase(),this.elFormatSelect.selectedIndex<0&&(this.elFormatSelect.selectedIndex=0),void(this.elFormatSelect.value!=b.toLowerCase()&&(this.elFormatSelect.selectedIndex=0))):this.elFormatSelect.selectedIndex=0},$ON_SET_FORMAT_FROM_SELECT_UI:function(){var b=this.elFormatSelect.value;b&&(a.browser.msie&&(b="<"+b+">"),this.oApp.exec("EXECCOMMAND",["FormatBlock",!1,b]),this.oApp.exec("CHECK_STYLE_CHANGE",[]))}}),xe.XE_Table=a.Class({_startSel:null,_endSel:null,$ON_MSG_APP_READY:function(){this._doc=a(this.oApp.getWYSIWYGDocument()),this.$FnMouseDown=a.fnBind(this._mousedown,this),this.$FnMouseUp=a.fnBind(this._mouseup,this),this.$FnMouseMove=a.fnBind(this._mousemove,this),this._doc.mousedown(this.$FnMouseDown),this._startSel=null,this._endSel=null,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"]),this.oApp.exec("REGISTER_HOTKEY",["ctrl+alt+m","MERGE_CELLS"]),this.$super.$ON_MSG_APP_READY()},$ON_MERGE_CELLS:function(){var b="",c=a(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),d=this;if(c.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Merge"]),c.each(function(){b+=a(this).html()}).eq(0).html(b);var e=0;c.eq(0).nextAll("td,th").andSelf().filter(".xe_selected_cell").each(function(){e+=d._getSpan(this,"col")});var f=(this._getRect(c.eq(0)),c.eq(0).parent("tr")),g=c.eq(c.length-1).parent("tr"),h=c.parents("table").eq(0).find("tr"),i=h.index(g.get(0))-h.index(f.get(0))+this._getSpan(c.eq(c.length-1),"row");c.eq(0).attr("colSpan",e).attr("rowSpan",i),c.slice(1).remove()}},$ON_CELL_SPLIT_BY_ROW:function(){var b=a(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),c=b.parents("table").eq(0),d=this;if(b.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Row"]);var e=this._getRect(b.eq(0)).top,f=this._getRect(b.eq(b.length-1)).bottom;(b=c.find("td,th").filter(function(){var b=d._getRect(a(this));return!(b.bottom<=e||b.top>=f)})).filter(".xe_selected_cell").each(function(){var c=a(this),e=c.parent("tr"),f=d._getSpan(c,"row"),g=d._getRect(c),h=[],i=c.clone().html("
"),j=1,k=1;f>1?(j=Math.ceil(f/2),k=f-j,h.push(function(){c.attr("rowSpan",j)}),i.attr("rowSpan",k)):(b.filter(function(){if(c.get(0)==this)return!1;var b=a(this),e=d._getRect(b);return e.bottom<=g.top||e.top>=g.bottom?!1:!0}).each(function(){var b=a(this),c=d._getSpan(b,"row")+1;h.push(function(){b.attr("rowSpan",c)})}),e.after(a.browser.msie?e.clone().empty().get(0).outerHTML:e.clone().empty()));var l=e.nextAll("tr");if(l.length){var m=l.eq(j-1).children("td,th").filter(function(){return d._getRect(a(this)).left>g.left});a.browser.msie?m.length?m.eq(0).before(i.get(0).outerHTML):l.eq(j-1).append(i.get(0).outerHTML):m.length?m.slice(0,1).before(i):l.slice(j-1,1).append(i)}else e.after(e.clone().empty().append(i));a.each(h,function(){this()})})}},$ON_CELL_SPLIT_BY_COL:function(){{var b=a(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),c=b.parents("table").slice(0,1),d=this;(new Date).getTime()}if(b.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Column"]);var e=b.eq(0).parent("tr"),f=this._getRect(e.find(".xe_selected_cell:first")).left,g=this._getRect(e.find(".xe_selected_cell:last")).right;(b=c.find("td,th").filter(function(){var b=d._getRect(a(this));return!(b.right<=f||b.left>=g)})).filter(".xe_selected_cell").each(function(){var c=a(this),e=d._getSpan(c,"col"),f=c.clone().html("
");if(e>1){var g=Math.ceil(e/2),h=e-g;c.attr("colSpan",g),f.attr("colSpan",h)}else{var i=d._getRect(c);b.filter(function(){if(c.get(0)==this)return!1;var b=a(this),e=d._getRect(b);return e.right<=i.left||e.left>=i.right?!1:!0}).each(function(){var b=a(this);b.attr("colSpan",d._getSpan(b,"col")+1)}),f.attr("colSpan",1)}c.after(a.browser.msie?f.get(0).outerHTML:f)})}},$ON_CHECK_STYLE_CHANGE:function(){var b=["merge_cells","split_col","split_row"],c=this.oApp,d=this._startSel&&this._startSel.is(".xe_selected_cell")?"ENABLE_UI":"DISABLE_UI";a.each(b,function(){c.exec(d,[this])})},_mousedown:function(b){function c(){return e=f.getSelection().cloneRange(),e.collapseToStart(),e=a(e.startContainer).parents().andSelf().filter("td,th").eq(0),e.length?(g._getRect(g._startSel=e),g._doc.bind("mousemove",g.$FnMouseMove),void g._doc.bind("mouseup",g.$FnMouseUp)):g._removeAllListener()||!0}var d=a(b.target),e=d.parents().andSelf().filter("td,th,table"),f=this.oApp,g=this;a("td.xe_selected_cell",this.oApp.getWYSIWYGDocument()).removeClass("xe_selected_cell"),this._startSel=null,this._endSel=null,e.length&&this._isLeftClicked(b.button)&&setTimeout(c,0)},_mouseup:function(){this._removeAllListener(),this._startSel=this._endSel=null},_mousemove:function(b){function c(){var a=f.oApp.getSelection();f._startSel&&(f._startSel.get(0).firstChild||f._startSel.text(" "),a.selectNode(f._startSel.get(0).firstChild),a.collapseToStart(),a.select())}var d=a(b.target),e=d.parents().andSelf().filter("td,th").eq(0),f=this;if(e.length&&this._isLeftClicked(b.button)&&!(!this._endSel&&e.get(0)==this._startSel.get(0)||this._endSel&&e.get(0)==this._endSel.get(0))){this._getRect(this._endSel=e);var g=Math.min(this._startSel.rect.top,this._endSel.rect.top),h=Math.min(this._startSel.rect.left,this._endSel.rect.left),i=Math.max(this._startSel.rect.bottom,this._endSel.rect.bottom),j=Math.max(this._startSel.rect.right,this._endSel.rect.right),k=e.parents("table"),l=k.find("td,th").removeClass("xe_selected_cell"),m=a();do m.each(function(){var b=f._getRect(a(this));b.right>j&&(j=b.right),b.lefti&&(i=b.bottom)}),l=l.filter(":not(.xe_selected_cell)"),m=l.filter(function(){var b=f._getRect(a(this));return b.right<=h||b.left>=j||b.bottom<=g||b.top>=i?!1:!0}).addClass("xe_selected_cell");while(m.length);return a.browser.mozilla||setTimeout(c,0),!1}},_removeAllListener:function(){this._doc.unbind("mousemove",this.$FnMouseMove),this._doc.unbind("mouseup",this.$FnMouseUp)},_isLeftClicked:function(b){return a.browser.msie?!!(1&b):0==b},_getRect:function(a){var b=a.get(0);return a.rect={},a.rect.top=b.offsetTop,a.rect.left=b.offsetLeft,a.rect.bottom=a.rect.top+b.offsetHeight,a.rect.right=a.rect.left+b.offsetWidth,a.rect},_getSpan:function(b,c){var d=parseInt(a(b).attr(c+"span"));return isNaN(d)?1:d}}).extend(xe.XE_Table)}(jQuery),window.xe||(xe={}),xe.Editors=[],xe.XE_GET_WYSYWYG_MODE=jQuery.Class({name:"XE_GET_WYSYWYG_MODE",$init:function(a){this.editor_sequence=a},$ON_CHANGE_EDITING_MODE:function(a){editorMode[this.editor_sequence]="HTMLSrc"==a?"html":"wysiwyg"}}),xe.XE_PreservTemplate=jQuery.Class({name:"XE_PreservTemplate",isRun:!1,$BEFORE_SET_IR:function(a){return this.isRun||a?void 0:(this.isRun=!0,!1)}}),xe.XE_Preview=jQuery.Class({name:"XE_Preview",elPreviewButton:null,$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elPreviewButton=jQuery("BUTTON.xpress_xeditor_preview_button",a)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elPreviewButton.get(0),"click","EVENT_PREVIEW",[])},$ON_EVENT_PREVIEW:function(){}}); \ No newline at end of file +}}),xe.XE_Editorresize=a.Class({name:"XE_Editorresize",$init:function(b,c){this.inputArea=a(".xpress_xeditor_editing_area_container",b).get(0),this.oVerticalResizer=a(".xpress_xeditor_editingArea_verticalResizer",b).get(0),this.oCheckBox=a("#editorresize",b).get(0),this.oIframe=c;var d=this;a(c).load(function(){d.oIframeBody=a(c).contents().find("body")})},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.oCheckBox,"change","XE_TOGGLE_EDITOR_RESIZE")},$ON_XE_TOGGLE_EDITOR_RESIZE:function(){1==this.oCheckBox.checked?(void 0==this._prevHeight&&(this._prevHeight=this.inputArea.style.height),this.oVerticalResizer.style.display="none",this.oApp.registerBrowserEvent(this.oIframeBody,"keydown","XE_EDITOR_RESIZE"),this.inputArea.style.height=this.oIframe.style.height=this.oIframeBody[0].scrollHeight+"px"):(a(this.oIframeBody).unbind("keydown"),this.oVerticalResizer.style.display="block",this.inputArea.style.height=this._prevHeight,this.oIframe.style.height=this._prevHeight)},$ON_XE_EDITOR_RESIZE:function(){var a=this;setTimeout(function(){a.inputArea.style.height=a.oIframe.style.height=a.oIframeBody[0].scrollHeight+"px"},0)}});var d={"XE_EditingAreaManager.onExit":"%uB0B4%uC6A9%uC774%20%uBCC0%uACBD%uB418%uC5C8%uC2B5%uB2C8%uB2E4.","XE_FontColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff","XE_BGColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff","XE_Hyperlink.invalidURL":"%uC785%uB825%uD558%uC2E0%20URL%uC774%20%uC62C%uBC14%uB974%uC9C0%20%uC54A%uC2B5%uB2C8%uB2E4."};xe.XpressCore.oMessageMap=d;regex_handler=/<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/gi,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+)/gi,regex_quote_attr=/([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g;var e=("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,style".split(","),"area,br,col,embed,hr,img,input,param,base,meta,link,basefont,isindex".split(",")),f={b:"strong",i:"em",s:"del",strike:"del"};xe.XE_XHTMLFormatter=a.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(b){var c=[];if(a.browser.msie&&(b=b.replace(regex_jquery,""),b=b.replace(/<(\w+) ([^>]+)>/g,function(a,b,c){return"<"+b+" "+c.replace(regex_quote_attr,function(a,b,c,d){return b?b:/^"/.test(d)||/"$/.test(d)?c+"="+d:c+'="'+(d||c)+'"'})+">"})),regex=/<(\/)?([:\w\/-]+)(.*?)>/gi,b=b.replace(regex,function(b,d,g,h){var i="";if(d=d||"",g=g.toLowerCase(),h=a.trim(h||""),void 0!=f[g]&&(g=f[g]),d){var j=[],k="";if(a.inArray(g,e)>=0)return"";if(!c.length)return"";do k=c.pop(),k.tag==g&&"deleted"!=k.state&&j.push("");while(c.length&&k.tag!=g);return j.join("")}if(a.inArray(g,e)>=0){var l=h.length;return"br"==g&&(h=""),h&&"/"==h.substring(l-1,l)||(h+=" /"),"<"+g+" "+a.trim(h)+">"}return c.push({tag:g,state:i}),"<"+d+g+(h?" "+h:"")+">"}),c.length){var d="";do d=c.pop(),"deleted"!=d.state&&(b+="");while(c.length)}return regex=/<\/p>[ \t]*(\n)?/gi,b=b.replace(regex,"

\n")},IR_TO:function(a){return a}}),xe.XE_Extension=a.Class({name:"XE_Extension",seq:"",last_doc:"",$init:function(a,b){this.seq=b,this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){this.elDropdownLayer=a("DIV.xpress_xeditor_extension_layer",b).get(0)},_removeAttrs:function(a){return a},_addEvent:function(){if("WYSIWYG"==this.oApp.getEditingMode()){var b=this.oApp.getWYSIWYGDocument(),c=this.seq,d=function(){var b=a(this),d=b.attr("editor_component");d&&a.isFunction(openComponent)&&(editorPrevNode=b.get(0),openComponent(d,c))};a(b).find("img,div[editor_component]").each(function(){var c=a(this);"IMG"!=this.nodeName||c.attr("editor_component")||c.attr("widget")||c.attr("editor_component","image_link"),this.last_doc!=b&&(c.unbind("dblclick.widget").bind("dblclick.widget",d),this.last_doc=b)})}},$ON_MSG_APP_READY:function(){var b=this.oApp;b.exec("REGISTER_UI_EVENT",["extension","click","TOGGLE_EXTENSION_LAYER"]);var c=function(){b.exec("HIDE_ACTIVE_LAYER",[])};a("a",this.elDropdownLayer).each(function(){var b=a(this);b.attr("component_onclick_event_added")||(b.click(c),b.attr("component_onclick_event_added","Y"))})},$ON_TOGGLE_EXTENSION_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer])},$ON_CHANGE_EDITING_MODE:function(){var a=this;setTimeout(function(){a._addEvent()},100)},$ON_PASTE_HTML:function(){var a=this;setTimeout(function(){a._addEvent()},100)},$ON_LOAD_IR_FIELD:function(){var a=this;setTimeout(function(){a._addEvent()},100)},$ON_SET_IR:function(){var a=this;setTimeout(function(){a._addEvent()},100)}}),xe.XE_AutoSave=a.Class({name:"XE_AutoSave",form:null,textarea:null,$init:function(a,b){this.form=a.form,this.textarea=a,this._assignHTMLObjects(b)},_assignHTMLObjects:function(){this.welMessageBox=a("autosave_message")},$ON_MSG_APP_READY:function(){var b=a(this.form._saved_doc_title),c=a(this.form._saved_doc_content),d=a(this.form._saved_doc_document_srl),e=a.trim(b.val()),f=a.trim(c.val()),g=a.trim(d.val());(e||f||g)&&(confirm(this.form._saved_doc_message.value)?(a(this.form.title).val(e),this.oApp.setIR(f),"function"==typeof editorGetAutoSavedDoc&&editorGetAutoSavedDoc(this.form)):editorRemoveSavedDoc()),editorEnableAutoSave(this.form,a(this.form).attr("editor_sequence")),this.oApp.exec("REGISTER_HOTKEY",["ctrl+shift+s","AUTO_SAVE"])},$ON_AUTO_SAVE:function(){_editorAutoSave()}}),xe.XE_FormatWithSelectUI=a.Class({name:"XE_FormatWithSelectUI",$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(b){this.elFormatSelect=a("SELECT.xpress_xeditor_ui_format_select",b).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(){var b=this.oApp.getWYSIWYGDocument().queryCommandValue("FormatBlock");return b?(a.browser.msie&&/([0-9])/.test(b)&&(b="h"+RegExp.$1),this.elFormatSelect.value=b.toLowerCase(),this.elFormatSelect.selectedIndex<0&&(this.elFormatSelect.selectedIndex=0),void(this.elFormatSelect.value!=b.toLowerCase()&&(this.elFormatSelect.selectedIndex=0))):this.elFormatSelect.selectedIndex=0},$ON_SET_FORMAT_FROM_SELECT_UI:function(){var b=this.elFormatSelect.value;b&&(a.browser.msie&&(b="<"+b+">"),this.oApp.exec("EXECCOMMAND",["FormatBlock",!1,b]),this.oApp.exec("CHECK_STYLE_CHANGE",[]))}}),xe.XE_Table=a.Class({_startSel:null,_endSel:null,$ON_MSG_APP_READY:function(){this._doc=a(this.oApp.getWYSIWYGDocument()),this.$FnMouseDown=a.fnBind(this._mousedown,this),this.$FnMouseUp=a.fnBind(this._mouseup,this),this.$FnMouseMove=a.fnBind(this._mousemove,this),this._doc.mousedown(this.$FnMouseDown),this._startSel=null,this._endSel=null,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"]),this.oApp.exec("REGISTER_HOTKEY",["ctrl+alt+m","MERGE_CELLS"]),this.$super.$ON_MSG_APP_READY()},$ON_MERGE_CELLS:function(){var b="",c=a(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),d=this;if(c.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Merge"]),c.each(function(){b+=a(this).html()}).eq(0).html(b);var e=0;c.eq(0).nextAll("td,th").addBack().filter(".xe_selected_cell").each(function(){e+=d._getSpan(this,"col")});var f=(this._getRect(c.eq(0)),c.eq(0).parent("tr")),g=c.eq(c.length-1).parent("tr"),h=c.parents("table").eq(0).find("tr"),i=h.index(g.get(0))-h.index(f.get(0))+this._getSpan(c.eq(c.length-1),"row");c.eq(0).attr("colSpan",e).attr("rowSpan",i),c.slice(1).remove()}},$ON_CELL_SPLIT_BY_ROW:function(){var b=a(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),c=b.parents("table").eq(0),d=this;if(b.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Row"]);var e=this._getRect(b.eq(0)).top,f=this._getRect(b.eq(b.length-1)).bottom;(b=c.find("td,th").filter(function(){var b=d._getRect(a(this));return!(b.bottom<=e||b.top>=f)})).filter(".xe_selected_cell").each(function(){var c=a(this),e=c.parent("tr"),f=d._getSpan(c,"row"),g=d._getRect(c),h=[],i=c.clone().html("
"),j=1,k=1;f>1?(j=Math.ceil(f/2),k=f-j,h.push(function(){c.attr("rowSpan",j)}),i.attr("rowSpan",k)):(b.filter(function(){if(c.get(0)==this)return!1;var b=a(this),e=d._getRect(b);return e.bottom<=g.top||e.top>=g.bottom?!1:!0}).each(function(){var b=a(this),c=d._getSpan(b,"row")+1;h.push(function(){b.attr("rowSpan",c)})}),e.after(a.browser.msie?e.clone().empty().get(0).outerHTML:e.clone().empty()));var l=e.nextAll("tr");if(l.length){var m=l.eq(j-1).children("td,th").filter(function(){return d._getRect(a(this)).left>g.left});a.browser.msie?m.length?m.eq(0).before(i.get(0).outerHTML):l.eq(j-1).append(i.get(0).outerHTML):m.length?m.slice(0,1).before(i):l.slice(j-1,1).append(i)}else e.after(e.clone().empty().append(i));a.each(h,function(){this()})})}},$ON_CELL_SPLIT_BY_COL:function(){{var b=a(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th"),c=b.parents("table").slice(0,1),d=this;(new Date).getTime()}if(b.length){this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Column"]);var e=b.eq(0).parent("tr"),f=this._getRect(e.find(".xe_selected_cell:first")).left,g=this._getRect(e.find(".xe_selected_cell:last")).right;(b=c.find("td,th").filter(function(){var b=d._getRect(a(this));return!(b.right<=f||b.left>=g)})).filter(".xe_selected_cell").each(function(){var c=a(this),e=d._getSpan(c,"col"),f=c.clone().html("
");if(e>1){var g=Math.ceil(e/2),h=e-g;c.attr("colSpan",g),f.attr("colSpan",h)}else{var i=d._getRect(c);b.filter(function(){if(c.get(0)==this)return!1;var b=a(this),e=d._getRect(b);return e.right<=i.left||e.left>=i.right?!1:!0}).each(function(){var b=a(this);b.attr("colSpan",d._getSpan(b,"col")+1)}),f.attr("colSpan",1)}c.after(a.browser.msie?f.get(0).outerHTML:f)})}},$ON_CHECK_STYLE_CHANGE:function(){var b=["merge_cells","split_col","split_row"],c=this.oApp,d=this._startSel&&this._startSel.is(".xe_selected_cell")?"ENABLE_UI":"DISABLE_UI";a.each(b,function(){c.exec(d,[this])})},_mousedown:function(b){function c(){return e=f.getSelection().cloneRange(),e.collapseToStart(),e=a(e.startContainer).parents().addBack().filter("td,th").eq(0),e.length?(g._getRect(g._startSel=e),g._doc.bind("mousemove",g.$FnMouseMove),void g._doc.bind("mouseup",g.$FnMouseUp)):g._removeAllListener()||!0}var d=a(b.target),e=d.parents().addBack().filter("td,th,table"),f=this.oApp,g=this;a("td.xe_selected_cell",this.oApp.getWYSIWYGDocument()).removeClass("xe_selected_cell"),this._startSel=null,this._endSel=null,e.length&&this._isLeftClicked(b.button)&&setTimeout(c,0)},_mouseup:function(){this._removeAllListener(),this._startSel=this._endSel=null},_mousemove:function(b){function c(){var a=f.oApp.getSelection();f._startSel&&(f._startSel.get(0).firstChild||f._startSel.text(" "),a.selectNode(f._startSel.get(0).firstChild),a.collapseToStart(),a.select())}var d=a(b.target),e=d.parents().addBack().filter("td,th").eq(0),f=this;if(e.length&&this._isLeftClicked(b.button)&&!(!this._endSel&&e.get(0)==this._startSel.get(0)||this._endSel&&e.get(0)==this._endSel.get(0))){this._getRect(this._endSel=e);var g=Math.min(this._startSel.rect.top,this._endSel.rect.top),h=Math.min(this._startSel.rect.left,this._endSel.rect.left),i=Math.max(this._startSel.rect.bottom,this._endSel.rect.bottom),j=Math.max(this._startSel.rect.right,this._endSel.rect.right),k=e.parents("table"),l=k.find("td,th").removeClass("xe_selected_cell"),m=a();do m.each(function(){var b=f._getRect(a(this));b.right>j&&(j=b.right),b.lefti&&(i=b.bottom)}),l=l.filter(":not(.xe_selected_cell)"),m=l.filter(function(){var b=f._getRect(a(this));return b.right<=h||b.left>=j||b.bottom<=g||b.top>=i?!1:!0}).addClass("xe_selected_cell");while(m.length);return a.browser.mozilla||setTimeout(c,0),!1}},_removeAllListener:function(){this._doc.unbind("mousemove",this.$FnMouseMove),this._doc.unbind("mouseup",this.$FnMouseUp)},_isLeftClicked:function(b){return a.browser.msie?!!(1&b):0==b},_getRect:function(a){var b=a.get(0);return a.rect={},a.rect.top=b.offsetTop,a.rect.left=b.offsetLeft,a.rect.bottom=a.rect.top+b.offsetHeight,a.rect.right=a.rect.left+b.offsetWidth,a.rect},_getSpan:function(b,c){var d=parseInt(a(b).attr(c+"span"));return isNaN(d)?1:d}}).extend(xe.XE_Table)}(jQuery),window.xe||(xe={}),xe.Editors=[],xe.XE_GET_WYSYWYG_MODE=jQuery.Class({name:"XE_GET_WYSYWYG_MODE",$init:function(a){this.editor_sequence=a},$ON_CHANGE_EDITING_MODE:function(a){editorMode[this.editor_sequence]="HTMLSrc"==a?"html":"wysiwyg"}}),xe.XE_PreservTemplate=jQuery.Class({name:"XE_PreservTemplate",isRun:!1,$BEFORE_SET_IR:function(a){return this.isRun||a?void 0:(this.isRun=!0,!1)}}),xe.XE_Preview=jQuery.Class({name:"XE_Preview",elPreviewButton:null,$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elPreviewButton=jQuery("BUTTON.xpress_xeditor_preview_button",a)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elPreviewButton.get(0),"click","EVENT_PREVIEW",[])},$ON_EVENT_PREVIEW:function(){}}); \ No newline at end of file From 71d97e631c4061dcc526959600425bd62aca14e0 Mon Sep 17 00:00:00 2001 From: akasima Date: Wed, 13 Aug 2014 16:51:22 +0900 Subject: [PATCH 08/10] #908 attach ajax event to document element --- common/js/xe.js | 2 +- common/js/xe.min.js | 2 +- common/js/xml_handler.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/js/xe.js b/common/js/xe.js index c86fe3edd..3f2f81453 100644 --- a/common/js/xe.js +++ b/common/js/xe.js @@ -1763,7 +1763,7 @@ function xml2json(xml, tab, ignoreAttrib) { } $(function($){ - $('.wfsr') + $(document) .ajaxStart(function(){ $(window).bind('beforeunload', beforeUnloadHandler); }) diff --git a/common/js/xe.min.js b/common/js/xe.min.js index 0e871f313..41d546bb4 100644 --- a/common/js/xe.min.js +++ b/common/js/xe.min.js @@ -3,4 +3,4 @@ * @file common.js + js_app.js + xml_handler.js + xml_js_filter.js * @brief XE Common JavaScript **/ -function xSleep(a){a/=1e3;for(var b=new Date,c=new Date;c.getTime()-b.getTime()-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid));try{"_blank"!=b&&winopen_list[b]&&(winopen_list[b].close(),winopen_list[b]=null)}catch(d){}"undefined"==typeof b&&(b="_blank"),"undefined"==typeof c&&(c="");var e=window.open(a,b,c);e.focus(),"_blank"!=b&&(winopen_list[b]=e)}function popopen(a,b){"undefined"==typeof b&&(b="_blank"),"undefined"!=typeof xeVid&&a.indexOf(request_uri)>-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid)),winopen(a,b,"width=800,height=600,scrollbars=yes,resizable=yes,toolbars=no")}function sendMailTo(a){location.href="mailto:"+a}function move_url(a,b){return a?("undefined"==typeof b&&(b="N"),b="N"==b?!1:!0,/^\./.test(a)&&(a=request_uri+a),b?winopen(a):location.href=a,!1):!1}function displayMultimedia(a,b,c,d){var e=_displayMultimedia(a,b,c,d);e&&document.writeln(e)}function _displayMultimedia(a,b,c,d){0===a.indexOf("files")&&(a=request_uri+a);var e={wmode:"transparent",allowScriptAccess:"never",quality:"high",flashvars:"",autostart:!1},f=jQuery.extend(e,d||{}),g=f.autostart&&"false"!=f.autostart?"true":"false";delete f.autostart;var h="",i="",j="";if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(a))j='';else if(/\.flv$/i.test(a)||/\.mov$/i.test(a)||/\.moov$/i.test(a)||/\.m4v$/i.test(a))j='';else if(/\.swf/i.test(a)){h="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",i="undefined"!=typeof enforce_ssl&&enforce_ssl?"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0":"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0",j='',j+='';for(var k in f)"undefined"!=f[k]&&""!==f[k]&&(j+='');j+=''}else(jQuery.browser.mozilla||jQuery.browser.opera)&&(g=f.autostart&&"false"!=f.autostart?"1":"0"),j='.popup");e=h.css({overflow:"scroll"}).offset(),a=h.width(10).height(1e4).get(0).scrollWidth+2*e.left,b=h.height(10).width(1e4).get(0).scrollHeight+2*e.top,800>a&&(a=800+2*e.left),c=g.width(),d=g.height(),a!=c&&window.resizeBy(a-c,0),b!=d&&window.resizeBy(0,b-d),h.width(a-2*e.left).css({overflow:"",height:""})}function doCallModuleAction(a,b,c){var d={target_srl:c,cur_mid:current_mid,mid:current_mid};exec_xml(a,b,d,completeCallModuleAction)}function completeCallModuleAction(a){"success"!=a.message&&alert(a.message),location.reload()}function completeMessage(a){alert(a.message),location.reload()}function doChangeLangType(a){if("string"==typeof a)setLangType(a);else{var b=a.options[a.selectedIndex].value;setLangType(b)}location.href=location.href.setQuery("l","")}function setLangType(a){var b=new Date;b.setTime(b.getTime()+6048e8),setCookie("lang_type",a,b,"/")}function doDocumentPreview(a){for(var b=a;"FORM"!=b.nodeName;)b=b.parentNode;if("FORM"==b.nodeName){var c=b.getAttribute("editor_sequence"),d=editorGetContent(c),e=(window.open("","previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes"),jQuery("#previewDocument"));e.length?e=e[0]:(jQuery('
').appendTo(document.body),e=jQuery("#previewDocument")[0]),e&&(e.content.value=d,e.submit())}}function doDocumentSave(a){var b=a.form.getAttribute("editor_sequence"),c=editorRelKeys[b].content.value;if("undefined"!=typeof b&&b&&"undefined"!=typeof editorRelKeys&&"function"==typeof editorGetContent){var d=editorGetContent(b);editorRelKeys[b].content.value=d}var e={},f=["error","message","document_srl"],g=(a.form.elements,jQuery(a.form).serializeArray());return jQuery.each(g,function(a,b){var c=jQuery.trim(b.value);return c?(/\[\]$/.test(b.name)&&(b.name=b.name.replace(/\[\]$/,"")),void(e[b.name]?e[b.name]+="|@|"+c:e[b.name]=b.value)):!0}),exec_xml("document","procDocumentTempSave",e,completeDocumentSave,f,e,a.form),editorRelKeys[b].content.value=c,!1}function completeDocumentSave(a){jQuery("input[name=document_srl]").eq(0).val(a.document_srl),alert(a.message)}function doDocumentLoad(a){objForSavedDoc=a.form,popopen(request_uri.setQuery("module","document").setQuery("act","dispTempSavedList"))}function doDocumentSelect(a,b){if(!opener||!opener.objForSavedDoc)return void window.close();switch(void 0===b&&(b="document"),b){case"page":opener.location.href=opener.current_url.setQuery("document_srl",a).setQuery("act","dispPageAdminContentModify");break;default:opener.location.href=opener.current_url.setQuery("document_srl",a).setQuery("act","dispBoardWrite")}window.close()}function viewSkinInfo(a,b){popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+a+"&skin="+b,"SkinInfo")}function doAddDocumentCart(a){var b=a.value;addedDocument[addedDocument.length]=b,setTimeout(function(){callAddDocumentCart(addedDocument.length)},100)}function callAddDocumentCart(a){if(!(addedDocument.length<1||a!=addedDocument.length)){var b=[];b.srls=addedDocument.join(","),exec_xml("document","procDocumentAddCart",b,null),addedDocument=[]}}function transRGB2Hex(a){if(!a)return a;if(a.indexOf("#")>-1)return a.replace(/^#/,"");if(a.toLowerCase().indexOf("rgb")<0)return a;a=a.replace(/^rgb\(/i,"").replace(/\)$/,""),value_list=a.split(",");for(var b="",c=0;cf&&2>g){d.removeWhite(a);for(var j=a.firstChild;j;j=j.nextSibling)3==j.nodeType?b=d.escape(j.nodeValue):4==j.nodeType?b=d.escape(j.nodeValue):b[j.nodeName]?b[j.nodeName]instanceof Array?b[j.nodeName][b[j.nodeName].length]=d.toObj(j):b[j.nodeName]=[b[j.nodeName],d.toObj(j)]:b[j.nodeName]=d.toObj(j)}else a.attributes.length?b["#text"]=d.escape(d.innerXml(a)):b=d.escape(d.innerXml(a));else if(f)a.attributes.length?b["#text"]=d.escape(d.innerXml(a)):b=d.escape(d.innerXml(a));else if(g)if(g>1)b=d.escape(d.innerXml(a));else for(var k=a.firstChild;k;k=k.nextSibling)b=d.escape(k.nodeValue)}a.attributes.length||a.firstChild||(b=null)}else 9==a.nodeType?b=d.toObj(a.documentElement):alert("unhandled node type: "+a.nodeType);return b},toJson:function(a,b,c){var e=b?'"'+b+'"':"";if(a instanceof Array){for(var f=0,g=a.length;g>f;f++)a[f]=d.toJson(a[f],"",c+" ");e+=(b?":[":"[")+(a.length>1?"\n"+c+" "+a.join(",\n"+c+" ")+"\n"+c:a.join(""))+"]"}else if(null===a)e+=(b&&":")+"null";else if("object"==typeof a){var h=[];for(var i in a)h[h.length]=d.toJson(a[i],i,c+" ");e+=(b?":{":"{")+(h.length>1?"\n"+c+" "+h.join(",\n"+c+" ")+"\n"+c:h.join(""))+"}"}else e+="string"==typeof a?(b&&":")+'"'+a.toString()+'"':(b&&":")+a.toString();return e},innerXml:function(a){var b="";if("innerHTML"in a)b=a.innerHTML;else for(var c=function(a){var b="";if(1==a.nodeType){b+="<"+a.nodeName;for(var d=0;d"}else b+="/>"}else 3==a.nodeType?b+=a.nodeValue:4==a.nodeType&&(b+="");return b},d=a.firstChild;d;d=d.nextSibling)b+=c(d);return b},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();for(var b=a.firstChild;b;)if(3==b.nodeType)if(b.nodeValue.match(/[^ \f\n\r\t\v]/))b=b.nextSibling;else{var c=b.nextSibling;a.removeChild(b),b=c}else 1==b.nodeType?(d.removeWhite(b),b=b.nextSibling):b=b.nextSibling;return a}};9==a.nodeType&&(a=a.documentElement);var e,f=d.toObj(d.removeWhite(a));return e=d.toJson(f,a.nodeName,""),"{"+(b?e.replace(/\t/g,b):e.replace(/\t|\n/g,""))+"}"}function filterAlertMessage(a){var b=(a.error,a.message),c=a.act,d=a.redirect_url,e=location.href;"undefined"!=typeof b&&b&&"success"!=b&&alert(b),"undefined"!=typeof c&&c?e=current_url.setQuery("act",c):"undefined"!=typeof d&&d&&(e=d),e==location.href&&(e=e.replace(/#(.*)$/,"")),location.href=e}function procFilter(a,b){return b(a),!1}function legacy_filter(a,b,c,d,e,f,g,h){var i=xe.getApp("Validator")[0],j=jQuery,k=[];return i?(b.elements._filter||j(b).prepend(''),b.elements._filter.value=a,k[0]=a,k[1]=function(a){var i={},k=(a.elements,j(a).serializeArray());return j.each(k,function(a,b){var c=j.trim(b.value),d=b.name;return c&&d?(h[d]&&(d=h[d]),/\[\]$/.test(d)&&(d=d.replace(/\[\]$/,"")),void(i[d]?i[d]+="|@|"+c:i[d]=b.value)):!0}),g&&!confirm(g)?!1:void exec_xml(c,d,i,e,f,i,b)},i.cast("ADD_CALLBACK",k),i.cast("VALIDATE",[b,a]),!1):!1}jQuery&&jQuery.noConflict(),function(a){var b=navigator.userAgent.toLowerCase();a.os={Linux:/linux/.test(b),Unix:/x11/.test(b),Mac:/mac/.test(b),Windows:/win/.test(b)},a.os.name=a.os.Windows?"Windows":a.os.Linux?"Linux":a.os.Unix?"Unix":a.os.Mac?"Mac":"",window.XE={loaded_popup_menus:[],addedDocument:[],checkboxToggleAll:function(b){is_def(b)||(b="cart");var c,d={wrap:null,checked:"toggle",doClick:!1};switch(arguments.length){case 1:"string"==typeof arguments[0]?b=arguments[0]:(a.extend(d,arguments[0]||{}),b="cart");break;case 2:b=arguments[0],a.extend(d,arguments[1]||{})}d.doClick===!0&&(d.checked=null),"string"==typeof d.wrap&&(d.wrap="#"+d.wrap),c=d.wrap?a(d.wrap).find('input[name="'+b+'"]:checkbox'):a('input[name="'+b+'"]:checkbox'),"toggle"==d.checked?c.each(function(){a(this).attr("checked",a(this).attr("checked")?!1:!0)}):d.doClick===!0?c.click():c.attr("checked",d.checked)},displayPopupMenu:function(b,c,d){var e=(d.target_srl,d.menu_id),f=b.menus,g="";if(this.loaded_popup_menus[e])g=this.loaded_popup_menus[e];else{if(f){var h=f.item;if(("undefined"==typeof h.length||h.length<1)&&(h=new Array(h)),h.length)for(var i=0;i"+k+" "}}this.loaded_popup_menus[e]=g}if(g){var o=a("#popup_menu_area").html("
    "+g+"
"),p={top:d.page_y,left:d.page_x};o.outerHeight()+p.top>a(window).height()+a(window).scrollTop()&&(p.top=a(window).height()-o.outerHeight()+a(window).scrollTop()),o.outerWidth()+p.left>a(window).width()+a(window).scrollLeft()&&(p.left=a(window).width()-o.outerWidth()+a(window).scrollLeft()),o.css({top:p.top,left:p.left}).show().focus()}}}}(jQuery),jQuery(function(a){a.browser.msie&&a("select").each(function(a,b){for(var c=!1,d=[],e=0;e-1?d[a]:e;c&&(b.oldonchange=b.onchange,b.onchange=function(){this.options[this.selectedIndex].disabled?this.selectedIndex=d[a]:this.oldonchange&&this.oldonchange()},b.selectedIndex>=0&&b.options[b.selectedIndex].disabled&&b.onchange())});var b=a(".xe_content .fold_button");if(b.size()){var c=a("div.fold_container",b);a("button.more",b).click(function(){a(this).hide().next("button").show().parent().next(c).show()}),a("button.less",b).click(function(){a(this).hide().prev("button").show().parent().next(c).hide()})}jQuery('input[type="submit"],button[type="submit"]').click(function(a){var b=jQuery(a.currentTarget);setTimeout(function(){return function(){b.attr("disabled","disabled")}}(),0),setTimeout(function(){return function(){b.removeAttr("disabled")}}(),3e3)})}),function(){function a(a,b){return a.replace(/#.*$/,"")===b.replace(/#.*$/,"")}var b=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)};String.prototype.getQuery=function(b){var c=a(this,window.location.href)?current_url:this,d=c.indexOf("?");if(-1==d)return null;var e=c.substr(d+1,this.length),f={};e.replace(/([^=]+)=([^&]*)(&|$)/g,function(){f[arguments[1]]=arguments[2]});var g=f[b];return"undefined"==typeof g&&(g=""),g},String.prototype.setQuery=function(c,d){var e,f,g,h,i=a(this,window.location.href)?current_url:this,j=i.indexOf("?"),k=i.replace(/#$/,"");if("undefined"==typeof d&&(d=""),-1!=j){var l=k.substr(j+1,i.length),m={},n=[];k=i.substr(0,j),l.replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){m[b]=c}),m[c]=d;for(var o in m)m.hasOwnProperty(o)&&(g=String(m[o]).trim())&&n.push(o+"="+decodeURI(g));l=n.join("&"),k+=l?"?"+l:""}else String(d).trim()&&(k=k+"?"+c+"="+d);f=/^https:\/\/([^:\/]+)(:\d+|)/i,f.test(k)&&(h="http://"+RegExp.$1,window.http_port&&80!=http_port&&(h+=":"+http_port),k=k.replace(f,h));var p=!!window.enforce_ssl;if(!p&&b(window.ssl_actions)&&(e=k.getQuery("act")))for(var q=0,r=ssl_actions.length;r>q;q++)if(ssl_actions[q]===e){p=!0;break}return f=/http:\/\/([^:\/]+)(:\d+|)/i,p&&f.test(k)&&(h="https://"+RegExp.$1,window.https_port&&443!=https_port&&(h+=":"+https_port),k=k.replace(f,h)),k=k.replace(/\/(index\.php)?\?/,"/index.php?"),encodeURI(k)},String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")}}();var winopen_list=[],objForSavedDoc=null,addedDocument=[],Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=Base64._utf8_encode(a);j>2,f=(3&b)<<4|c>>4,g=(15&c)<<2|d>>6,h=63&d,isNaN(c)?g=h=64:isNaN(d)&&(h=64),i=i+this._keyStr.charAt(e)+this._keyStr.charAt(f)+this._keyStr.charAt(g)+this._keyStr.charAt(h);return i},decode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");j>4,c=(15&f)<<4|g>>2,d=(3&g)<<6|h,i+=String.fromCharCode(b),64!=g&&(i+=String.fromCharCode(c)),64!=h&&(i+=String.fromCharCode(d));return i=Base64._utf8_decode(i)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;cd?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=0,e=0,f=0;cd?(b+=String.fromCharCode(d),c++):d>191&&224>d?(e=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&e),c+=2):(e=a.charCodeAt(c+1),f=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&e)<<6|63&f),c+=3);return b}};"undefined"==typeof resizeImageContents&&(window.resizeImageContents=function(){}),"undefined"==typeof activateOptionDisabled&&(window.activateOptionDisabled=function(){}),objectExtend=jQuery.extend;var loaded_popup_menus=XE.loaded_popup_menus;jQuery(function(a){a(document).click(function(b){var c=a("#popup_menu_area");c.length||(c=a('