Merge pull request #925 from kijin/pr/remove-xpresseditor

XpressEditor 제거 #895
This commit is contained in:
Kijin Sung 2017-09-29 11:38:14 +09:00 committed by GitHub
commit 336b6ee144
49 changed files with 3 additions and 15330 deletions

View file

@ -294,18 +294,6 @@ jQuery(function($) {
});
}
/* 단락에디터 fold 컴포넌트 펼치기/접기 */
var drEditorFold = $('.xe_content .fold_button');
if(drEditorFold.size()) {
var fold_container = $('div.fold_container', drEditorFold);
$('button.more', drEditorFold).click(function() {
$(this).hide().next('button').show().parent().next(fold_container).show();
});
$('button.less', drEditorFold).click(function() {
$(this).hide().prev('button').show().parent().next(fold_container).hide();
});
}
jQuery('input[type="submit"],button[type="submit"]').click(function(ev){
var $el = jQuery(ev.currentTarget);

View file

@ -53,4 +53,3 @@ $lang->typename['m.skin'] = 'Mobile Skin';
$lang->typename['skin'] = 'Skin';
$lang->typename['widgetstyle'] = 'Widget style';
$lang->typename['style'] = 'Document style';
$lang->typename['drcomponent'] = 'DrEditor component';

View file

@ -55,4 +55,3 @@ $lang->typename['m.skin'] = 'モバイルスキン';
$lang->typename['skin'] = 'スキン';
$lang->typename['widgetstyle'] = 'ウィジェットスタイル';
$lang->typename['style'] = 'ドキュメントスタイル';
$lang->typename['drcomponent'] = '段落エディタコンポーネント';

View file

@ -55,4 +55,3 @@ $lang->typename['m.skin'] = '모바일 스킨';
$lang->typename['skin'] = '스킨';
$lang->typename['widgetstyle'] = '위젯스타일';
$lang->typename['style'] = '문서스타일';
$lang->typename['drcomponent'] = '단락에디터 콤포넌트';

View file

@ -45,6 +45,7 @@ class editorAdminView extends editor
$component_list = $oEditorModel->getComponentList(false, $site_srl, true);
$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
$editor_skin_list = array_filter($editor_skin_list, function($name) { return !starts_with('xpresseditor', $name) && !starts_with('dreditor', $name); });
$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin);
$comment_skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->comment_editor_skin);

View file

@ -91,103 +91,6 @@ class editorModel extends editor
return $skin_config;
}
function loadDrComponents()
{
$drComponentPath = _XE_PATH_ . 'modules/editor/skins/dreditor/drcomponents/';
$drComponentList = FileHandler::readDir($drComponentPath);
$oTemplate = &TemplateHandler::getInstance();
$drComponentInfo = array();
if($drComponentList)
{
foreach($drComponentList as $i => $drComponent)
{
unset($obj);
$obj = $this->getDrComponentXmlInfo($drComponent);
Context::loadLang(sprintf('%s%s/lang/',$drComponentPath,$drComponent));
$path = sprintf('%s%s/tpl/',$drComponentPath,$drComponent);
$obj->html = $oTemplate->compile($path,$drComponent);
$drComponentInfo[$drComponent] = $obj;
}
}
Context::set('drComponentList',$drComponentInfo);
}
function getDrComponentXmlInfo($drComponentName)
{
$lang_type = Context::getLangType();
// Get the xml file path of requested component
$component_path = sprintf('%s/skins/dreditor/drcomponents/%s/', $this->module_path, $drComponentName);
$xml_file = sprintf('%sinfo.xml', $component_path);
$cache_file = sprintf('./files/cache/editor/dr_%s.%s.php', $drComponentName, $lang_type);
// Return information after including it after cached xml file exists
if(file_exists($cache_file) && file_exists($xml_file) && filemtime($cache_file) > filemtime($xml_file))
{
include($cache_file);
return $xml_info;
}
// Return after parsing and caching if the cached file does not exist
$oParser = new XmlParser();
$xml_doc = $oParser->loadXmlFile($xml_file);
$component_info->component_name = $drComponentName;
$component_info->title = $xml_doc->component->title->body;
$component_info->description = str_replace('\n', "\n", $xml_doc->component->description->body);
$component_info->version = $xml_doc->component->version->body;
$component_info->date = $xml_doc->component->date->body;
$component_info->homepage = $xml_doc->component->link->body;
$component_info->license = $xml_doc->component->license->body;
$component_info->license_link = $xml_doc->component->license->attrs->link;
$buff = '<?php if(!defined("__XE__")) exit(); ';
$buff .= sprintf('$xml_info->component_name = "%s";', $component_info->component_name);
$buff .= sprintf('$xml_info->title = "%s";', $component_info->title);
$buff .= sprintf('$xml_info->description = "%s";', $component_info->description);
$buff .= sprintf('$xml_info->version = "%s";', $component_info->version);
$buff .= sprintf('$xml_info->date = "%s";', $component_info->date);
$buff .= sprintf('$xml_info->homepage = "%s";', $component_info->homepage);
$buff .= sprintf('$xml_info->license = "%s";', $component_info->license);
$buff .= sprintf('$xml_info->license_link = "%s";', $component_info->license_link);
// Author information
if(!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author;
else $author_list = $xml_doc->component->author;
for($i=0; $i < count($author_list); $i++)
{
$buff .= sprintf('$xml_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
$buff .= sprintf('$xml_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
$buff .= sprintf('$xml_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link);
}
// List extra variables (text type only in the editor component)
$extra_vars = $xml_doc->component->extra_vars->var;
if($extra_vars)
{
if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
foreach($extra_vars as $key => $val)
{
unset($obj);
$key = $val->attrs->name;
$title = $val->title->body;
$description = $val->description->body;
$xml_info->extra_vars->{$key}->title = $title;
$xml_info->extra_vars->{$key}->description = $description;
$buff .= sprintf('$xml_info->extra_vars->%s->%s = "%s";', $key, 'title', $title);
$buff .= sprintf('$xml_info->extra_vars->%s->%s = "%s";', $key, 'description', $description);
}
}
FileHandler::writeFile($cache_file, $buff, "w");
unset($xml_info);
include($cache_file);
return $xml_info;
}
/**
* @brief Return the editor template
@ -215,7 +118,7 @@ class editorModel extends editor
{
$option->editor_skin = $option->skin;
}
if (!$option->editor_skin || !file_exists($this->module_path . 'skins/' . $option->editor_skin . '/editor.html'))
if (!$option->editor_skin || !file_exists($this->module_path . 'skins/' . $option->editor_skin . '/editor.html') || starts_with('xpresseditor', $option->editor_skin) || starts_with('dreditor', $option->editor_skin))
{
$option->editor_skin = $this->default_editor_config['editor_skin'];
}
@ -271,10 +174,6 @@ class editorModel extends editor
// Load editor components.
$site_srl = Context::get('site_module_info')->site_srl ?: 0;
if($option->editor_skin === 'dreditor')
{
$this->loadDrComponents();
}
if($option->enable_component)
{
if(!Context::get('component_list'))

View file

@ -99,6 +99,7 @@ class editorView extends editor
$oModuleModel = getModel('module');
// Get a list of editor skin
$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
$editor_skin_list = array_filter($editor_skin_list, function($name) { return !starts_with('xpresseditor', $name) && !starts_with('dreditor', $name); });
Context::set('editor_skin_list', $editor_skin_list);
$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin);

View file

@ -1,9 +0,0 @@
XpressEditor - http://www.xpressengine.com
XpressEditor는 nhn에서 개발한 SmartEditor Basic을 기반으로 했습니다.
SmartEditor Basic이 LGPL v2를 따르고 있으므로, XpressEditor 또한 해당 라이센스를 따릅니다.
또한 XpressEditor를 사용한다는 것은 XpressEditor의 라이센스에 동의했음을 의미합니다.
LGPL v2라이센스는 다음 URL에서 확인할 수 있습니다.
http://www.gnu.org/licenses/lgpl-2.1.html

View file

@ -1,348 +0,0 @@
@charset "utf-8";
/* NAVER (developers@xpressengine.com) */
/* TextEditor */
.xeTextEditor {margin:0 12px 0 0}
.xeTextEditor textarea {display:block;margin:0;padding:5px}
.xeTextEditor.black textarea {color:#fff;background-color:#000}
/* Type Selector */
.xpress-editor *{margin:0;padding:0;font-style:normal;font-size:12px}
.xpress-editor img,
.xpress-editor fieldset,
.xpress-editor button{border:0}
.xpress-editor button{background:none;background-repeat:no-repeat;cursor:pointer}
.xpress-editor button *{visibility:hidden}
.xpress-editor legend{position:absolute;width:0;height:0;font-size:0;line-height:0;overflow:hidden;visibility:hidden}
.xpress-editor label{cursor:pointer}
.xpress-editor hr{display:none}
.xpress-editor li{list-style:none}
/* Layout Selector */
.xpress-editor{position:relative;background:transparent}
.xpress-editor #smart_content{position:relative;clear:both;margin:0 0 10px 0;border:1px solid #c2c2c2;*zoom:1;z-index:1;background:#fff}
.xpress-editor.black #smart_content {background:transparent}
.xpress-editor #smart_footer{position:relative;text-align:center;padding:10px 0}
/* Footer */
.xpress-editor #smart_footer *{vertical-align:top}
.xpress-editor #smart_footer button{position:relative;width:67px;height:25px;margin:0 5px 0 0}
.xpress-editor #smart_footer button.save_temp{background:url(../img/btn_save_temp.gif) no-repeat}
.xpress-editor #smart_footer button.preview{background:url(../img/btn_preview.gif) no-repeat}
.xpress-editor #smart_footer input{margin:0}
.xpress-editor #smart_footer input.reset{width:67px;height:25px;border:0;background:url(../img/btn_cancel.gif) no-repeat;cursor:pointer;margin-left:5px}
/* Content > Input Area */
.xpress-editor a.skip{position:absolute;display:block;top:0;right:0;width:1px;height:1px;overflow:hidden;clear:both;zoom:1}
.xpress-editor a.skip:hover,
.xpress-editor a.skip:active,
.xpress-editor a.skip:focus{position:relative;display:block;padding:5px;right:0;z-index:60;width:auto;height:auto;text-align:right;white-space:nowrap;color:#000;text-decoration:none;letter-spacing:-1px;_zoom:1}
.xpress-editor .input_area{position:relative;margin:10px 10px 20px 10px;z-index:30;*zoom:1;height:300px;overflow:hidden}
.xpress-editor .input_area iframe,
.xpress-editor .input_area textarea{display:block;width:100% !important;position:relative;height:100%;border:0 !important;padding:0 !important;overflow:auto}
.xpress-editor .input_area textarea{*margin:0 -10px;_margin-bottom:-2px}
.xpress-editor .input_area textarea.blind{display:none}
.xpress-editor .input_control{position:relative;display:block;width:100%;height:25px;clear:both;text-align:center;border-top:1px solid #ccc;background:#f8f8f8 url(../img/btn_expand.gif) no-repeat center center;cursor:n-resize;margin:0 0 -25px 0}
.xpress-editor .input_control span{display:block;zoom:1;height:21px;visibility:hidden;overflow:visible;font-size:0;line-height:0;white-space:nowrap;color:#fff}
.xpress-editor .input_auto{position:relative;z-index:2;zoom:1;white-space:nowrap;display:block;height:0;border-top:1px solid #ccc;margin:0 0 24px 0;*margin:0}
.xpress-editor .input_auto input{margin:0 4px 0 0 !important;padding:0;width:13px;height:13px;vertical-align:middle}
.xpress-editor .input_auto label{position:absolute;font-size:11px;color:#666;padding:0 5px !important;line-height:25px;font-weight:normal !important}
.xpress-editor.black .input_control {background:#111 url(../img/btn_expand.black.gif) no-repeat center center}
.xpress-editor.black .input_control span{border-top:1px solid #333; color:#000}
.xpress-editor .tool{position:relative;overflow:visible;padding:5px 10px 6px 10px;*padding:5px 10px 8px 10px;z-index:40;clear:both;background:#f8f8f8 url(../img/bg_tool.gif) repeat-x left bottom;border:0;*zoom:1}
.xpress-editor .tool.disable {display:none}
.xpress-editor.black .tool{background:#111 url(../img/bg_tool.black.gif) repeat-x left bottom}
.xpress-editor .tool:after{content:"";display:block;clear:both}
.xpress-editor .tool ul{position:relative;overflow:visible;float:left;margin:0 5px 2px 0 !important;z-index:2;border:0 !important}
.xpress-editor .tool ul.action{width:43px}
.xpress-editor .tool ul.type{width:auto;white-space:nowrap;height:21px}
.xpress-editor .tool ul.style{width:169px;z-index:6}
.xpress-editor .tool ul.paragraph{width:169px;z-index:5}
.xpress-editor .tool ul.extra1{width:69px;z-index:4}
.xpress-editor .tool ul.table{width:85px;z-index:3}
.xpress-editor .tool ul.extra2{width:auto;z-index:2}
.xpress-editor .tool ul.extra3{float:left;width:auto;z-index:1;margin-right:1px}
.xpress-editor .tool ul.extra3 li{margin-right:4px}
.xpress-editor .tool li{position:relative;float:left;margin:0 !important;padding:0 !important;border:0 !important}
.xpress-editor .tool li button{width:21px;height:21px;background:url(../img/btn_set.gif) no-repeat 0 0;vertical-align:top;float:left}
.xpress-editor.black .tool li button{width:21px;height:21px;background:url(../img/btn_set.black.gif) no-repeat 0 0;vertical-align:top}
.xpress-editor .tool li button span{position:absolute;top:0;left:0;width:0;height:0;overflow:hidden;visibility:hidden}
.xpress-editor .tool li.extensions span.exButton,
.xpress-editor .tool li.extensions span.exButton button{float:left;position:relative;display:inline-block;width:auto;background:url(../img/btn_set_blank.gif) no-repeat left top}
.xpress-editor .tool li.extensions span.exButton button{left:2px;height:21px;background-position:right top;padding:0 4px;font:11px/21px Tahoma, Sans-serif;text-align:left;*overflow:visible;*line-height:20px}
.xpress-editor.black .tool li.extensions span.exButton,
.xpress-editor.black .tool li.extensions span.exButton button{color:#fff;background-image:url(../img/btn_set_blank.black.gif)}
.xpress-editor .tool li.html span,
.xpress-editor .tool li.html span button,
.xpress-editor .tool li.preview span,
.xpress-editor .tool li.preview span button{float:left;position:relative;display:inline-block;width:auto;height:auto;visibility:visible;background:url(../img/btn_set_blank.gif) no-repeat 0 0;white-space:nowrap}
.xpress-editor.black .tool li.html span,
.xpress-editor.black .tool li.html span button,
.xpress-editor.black .tool li.preview span,
.xpress-editor.black .tool li.preview span button{color:#fff;background-image:url(../img/btn_set_blank.black.gif)}
.xpress-editor .tool li.html span,
.xpress-editor .tool li.preview span{margin-right:2px;background-position:left top}
.xpress-editor .tool li.html span button,
.xpress-editor .tool li.preview span button{left:2px;height:21px;background-position:right top;font:11px/21px Tahoma, Sans-serif;padding:0 4px;*overflow:visible;*line-height:20px}
.xpress-editor .tool ul.type li{float:none;display:inline;*top:1px}
.xpress-editor .tool ul.type li select{height:21px;width:64px;white-space:nowrap;min-width:64px;padding:0;font-size:12px}
.xpress-editor .tool ul.type li option{white-space:nowrap}
.xpress-editor.black .tool ul.type li select{color:#fff;background-color:#000}
/* Content > Tool > Button Default */
.xpress-editor .tool li.undo button{width:22px;background-position:0 0}
.xpress-editor .tool li.redo button{background-position:-22px 0}
.xpress-editor .tool li.bold button{width:22px;background-position:-43px 0}
.xpress-editor .tool li.underline button{background-position:-65px 0}
.xpress-editor .tool li.italic button{background-position:-86px 0}
.xpress-editor .tool li.del button{background-position:-107px 0}
.xpress-editor .tool li.fcolor button{background-position:-128px 0}
.xpress-editor .tool li.bcolor button{background-position:-149px 0}
.xpress-editor .tool li.sup button{background-position:-170px 0}
.xpress-editor .tool li.sub button{background-position:-191px 0}
.xpress-editor .tool li.left button{width:22px;background-position:-212px 0}
.xpress-editor .tool li.center button{background-position:-234px 0}
.xpress-editor .tool li.right button{background-position:-255px 0}
.xpress-editor .tool li.justify button{background-position:-276px 0}
.xpress-editor .tool li.ol button{background-position:-297px 0}
.xpress-editor .tool li.ul button{background-position:-318px 0}
.xpress-editor .tool li.outdent button{background-position:-339px 0}
.xpress-editor .tool li.indent button{background-position:-360px 0}
.xpress-editor .tool li.blockquote button{width:22px;background-position:-381px 0}
.xpress-editor .tool li.url button{width:26px;background-position:-403px 0}
.xpress-editor .tool li.character button{background-position:-429px 0}
.xpress-editor .tool li.table{width:auto}
.xpress-editor .tool li.table button{width:22px;background-position:-450px 0}
.xpress-editor .tool li.merge button{background-position:-472px 0}
.xpress-editor .tool li.splitCol button{background-position:-493px 0}
.xpress-editor .tool li.splitRow button{background-position:-514px 0}
.xpress-editor .tool li.extensions span{background-position:0 0}
.xpress-editor .tool li.extensions span button{background-position:right 0}
.xpress-editor .tool li.html span{background-position:0 0}
.xpress-editor .tool li.html span button{background-position:right 0}
.xpress-editor .tool li.preview span{background-position:0 0}
.xpress-editor .tool li.preview span button{background-position:right 0}
/* Content > Tool > Button Hover */
.xpress-editor .tool li.undo button.hover{width:22px;background-position:0 -21px}
.xpress-editor .tool li.redo button.hover{background-position:-22px -21px}
.xpress-editor .tool li.bold button.hover{width:22px;background-position:-43px -21px}
.xpress-editor .tool li.underline button.hover{background-position:-65px -21px}
.xpress-editor .tool li.italic button.hover{background-position:-86px -21px}
.xpress-editor .tool li.del button.hover{background-position:-107px -21px}
.xpress-editor .tool li.fcolor button.hover{background-position:-128px -21px}
.xpress-editor .tool li.bcolor button.hover{background-position:-149px -21px}
.xpress-editor .tool li.sup button.hover{background-position:-170px -21px}
.xpress-editor .tool li.sub button.hover{background-position:-191px -21px}
.xpress-editor .tool li.left button.hover{width:22px;background-position:-212px -21px}
.xpress-editor .tool li.center button.hover{background-position:-234px -21px}
.xpress-editor .tool li.right button.hover{background-position:-255px -21px}
.xpress-editor .tool li.justify button.hover{background-position:-276px -21px}
.xpress-editor .tool li.ol button.hover{background-position:-297px -21px}
.xpress-editor .tool li.ul button.hover{background-position:-318px -21px}
.xpress-editor .tool li.outdent button.hover{background-position:-339px -21px}
.xpress-editor .tool li.indent button.hover{background-position:-360px -21px}
.xpress-editor .tool li.blockquote button.hover{width:22px;background-position:-381px -21px}
.xpress-editor .tool li.url button.hover{width:26px;background-position:-403px -21px}
.xpress-editor .tool li.character button.hover{background-position:-429px -21px}
.xpress-editor .tool li.table button.hover{width:22px;background-position:-450px -21px}
.xpress-editor .tool li.merge button.hover{background-position:-472px -21px}
.xpress-editor .tool li.splitCol button.hover{background-position:-493px -21px}
.xpress-editor .tool li.splitRow button.hover{background-position:-514px -21px}
.xpress-editor .tool li.extensions span.hover{background-position:0 -21px}
.xpress-editor .tool li.extensions span.hover button{background-position:right -21px}
.xpress-editor .tool li.html span.hover{background-position:0 -21px}
.xpress-editor .tool li.html span.hover button{background-position:right -21px}
.xpress-editor .tool li.preview span.hover{background-position:0 -21px}
.xpress-editor .tool li.preview span.hover button{background-position:right -21px}
/* Content > Tool > Button Active */
.xpress-editor .tool li.undo button.active{width:22px;background-position:0 -42px}
.xpress-editor .tool li.redo button.active{background-position:-22px -42px}
.xpress-editor .tool li.bold button.active{width:22px;background-position:-43px -42px}
.xpress-editor .tool li.underline button.active{background-position:-65px -42px}
.xpress-editor .tool li.italic button.active{background-position:-86px -42px}
.xpress-editor .tool li.del button.active{background-position:-107px -42px}
.xpress-editor .tool li.fcolor button.active{background-position:-128px -42px}
.xpress-editor .tool li.bcolor button.active{background-position:-149px -42px}
.xpress-editor .tool li.sup button.active{background-position:-170px -42px}
.xpress-editor .tool li.sub button.active{background-position:-191px -42px}
.xpress-editor .tool li.left button.active{width:22px;background-position:-212px -42px}
.xpress-editor .tool li.center button.active{background-position:-234px -42px}
.xpress-editor .tool li.right button.active{background-position:-255px -42px}
.xpress-editor .tool li.justify button.active{background-position:-276px -42px}
.xpress-editor .tool li.ol button.active{background-position:-297px -42px}
.xpress-editor .tool li.ul button.active{background-position:-318px -42px}
.xpress-editor .tool li.outdent button.active{background-position:-339px -42px}
.xpress-editor .tool li.indent button.active{background-position:-360px -42px}
.xpress-editor .tool li.blockquote button.active{width:22px;background-position:-381px -42px}
.xpress-editor .tool li.url button.active{width:26px;background-position:-403px -42px}
.xpress-editor .tool li.character button.active{background-position:-429px -42px}
.xpress-editor .tool li.table button.active{width:22px;background-position:-450px -42px}
.xpress-editor .tool li.merge button.active{background-position:-472px -42px}
.xpress-editor .tool li.splitCol button.active{background-position:-493px -42px}
.xpress-editor .tool li.splitRow button.active{background-position:-514px -42px}
.xpress-editor .tool li.extensions span.active{background-position:0 -42px}
.xpress-editor .tool li.extensions span.active button{background-position:right -42px}
.xpress-editor .tool li.html span.active{background-position:0 -42px}
.xpress-editor .tool li.html span.active button{background-position:right -42px}
.xpress-editor .tool li.preview span.active{background-position:0 -42px}
.xpress-editor .tool li.preview span.active button{background-position:right -42px}
/* Content > Tool > Button Off */
.xpress-editor .tool.off li.undo button,
.xpress-editor .tool li.undo button.off{width:22px;background-position:0 -63px}
.xpress-editor .tool.off li.redo button,
.xpress-editor .tool li.redo button.off{background-position:-22px -63px}
.xpress-editor .tool.off li.bold button{width:22px;background-position:-43px -63px}
.xpress-editor .tool.off li.underline button{background-position:-65px -63px}
.xpress-editor .tool.off li.italic button{background-position:-86px -63px}
.xpress-editor .tool.off li.del button{background-position:-107px -63px}
.xpress-editor .tool.off li.fcolor button{background-position:-128px -63px}
.xpress-editor .tool.off li.bcolor button{background-position:-149px -63px}
.xpress-editor .tool.off li.sup button{background-position:-170px -63px}
.xpress-editor .tool.off li.sub button{background-position:-191px -63px}
.xpress-editor .tool.off li.left button{width:22px;background-position:-212px -63px}
.xpress-editor .tool.off li.center button{background-position:-234px -63px}
.xpress-editor .tool.off li.right button{background-position:-255px -63px}
.xpress-editor .tool.off li.justify button{background-position:-276px -63px}
.xpress-editor .tool.off li.ol button{background-position:-297px -63px}
.xpress-editor .tool.off li.ul button{background-position:-318px -63px}
.xpress-editor .tool.off li.outdent button{background-position:-339px -63px}
.xpress-editor .tool.off li.indent button{background-position:-360px -63px}
.xpress-editor .tool.off li.blockquote button{width:22px;background-position:-381px -63px}
.xpress-editor .tool.off li.url button{width:26px;background-position:-403px -63px}
.xpress-editor .tool.off li.character button{background-position:-429px -63px}
.xpress-editor .tool.off li.table button{width:22px;background-position:-450px -63px}
.xpress-editor .tool.off li.merge button,
.xpress-editor .tool li.merge button.off{background-position:-472px -63px}
.xpress-editor .tool.off li.splitCol button,
.xpress-editor .tool li.splitCol button.off{background-position:-493px -63px}
.xpress-editor .tool.off li.splitRow button,
.xpress-editor .tool li.splitRow button.off{background-position:-514px -63px}
.xpress-editor .tool.off li.extensions span{background-position:0 -63px}
.xpress-editor .tool.off li.extensions span button{background-position:right -63px;color:#bcbcbc}
.xpress-editor .tool.off li button{cursor:default}
.xpress-editor .tool.off ul.extra3 li button{cursor:pointer}
/* Content > Tool > Layer */
.xpress-editor .tool .layer{display:none;position:absolute;left:0;top:20px;background-color:#fbfbfb;border:1px solid #c5c5c5;border-right:1px solid #9f9f9f;border-bottom:1px solid #9f9f9f}
.xpress-editor .tool .layer li{float:none;left:0}
.xpress-editor .tool .layer button,
.xpress-editor.black .tool .layer button{margin:0 !important;width:auto;height:auto;background:none;float:none}
.xpress-editor .tool .layer button span{position:absolute;width:0;height:0;font-size:0;line-height:0;overflow:hidden;visibility:hidden}
.xpress-editor .tool .btn_area{position:relative;clear:both;text-align:center !important;padding:7px 0 12px 0;width:100%;white-space:nowrap;*zoom:1}
.xpress-editor .tool .btn_area *{vertical-align:top}
.xpress-editor .tool button.close{position:absolute;top:4px;right:3px;width:21px;height:20px;background:url(../img/btn_layer_close.gif) no-repeat center center !important}
.xpress-editor .tool button.close span{position:absolute;width:0;height:0;overflow:hidden;visibility:hidden}
.xpress-editor .tool .layer .btn_area button{*margin:0 2px !important}
.xpress-editor .tool .layer .btn_area button.confirm{width:38px;height:21px;background:url(../img/btn_layer_confirm.gif) no-repeat}
.xpress-editor .tool .layer .btn_area button.cancel{width:38px;height:21px;background:url(../img/btn_layer_cancel.gif) no-repeat}
.xpress-editor .tool li.fcolor .layer{width:218px !important;height:auto !important;background-image:none !important;overflow:hidden}
.xpress-editor .tool .layer .palette{width:210px;position:relative;left:7px;padding:8px 0 7px 0;margin:0}
.xpress-editor .tool .layer .palette li{float:left;margin:0 1px 1px 0 !important;font-size:0;line-height:0}
.xpress-editor .tool .layer .palette button{position:relative;overflow:hidden;width:11px !important;height:11px !important}
.xpress-editor .tool li.bcolor .layer {width:218px;overflow:hidden}
.xpress-editor .tool .layer .background{width:210px;position:relative;left:7px;margin:0 0 -2px 0;padding:8px 0 0 0;*padding-bottom:8px;_padding-bottom:4px}
.xpress-editor .tool .layer .background li{float:left;margin:0 5px 2px 0 !important}
.xpress-editor .tool .layer .background button{position:relative;overflow:hidden;width:65px;height:19px;text-align:left;padding:4px}
.xpress-editor .tool .layer .background button span{position:relative;visibility:visible;font-size:12px;line-height:normal;width:auto;height:auto}
.xpress-editor .tool li.style .layer{padding:4px 2px;_overflow:hidden;filter:progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=135,strength=2)}
.xpress-editor .tool li.style .layer li{position:relative;background:#fbfbfb}
.xpress-editor .tool li.style .layer li button{display:block;width:134px;position:relative}
.xpress-editor .tool li.style .layer li button span{display:block;width:130px;text-align:left;letter-spacing:normal}
.xpress-editor .tool li.style .layer li.h3 button span{padding:3px 0 1px 4px;height:15px;font-size:16px;font-weight:bold}
.xpress-editor .tool li.style .layer li.h4 button span{padding:3px 0 2px 4px;height:13px;font-size:14px;font-weight:bold}
.xpress-editor .tool li.style .layer li.h5 button span{padding:3px 0 1px 4px;height:11px;font-size:12px;font-weight:bold}
.xpress-editor .tool li.style .layer li.h6 button span{padding:3px 0 1px 4px;height:11px;font-size:12px}
.xpress-editor .tool li.style .layer li.p button span{padding:3px 0 1px 4px;height:11px;font-size:12px;color:#5d5d5d}
.xpress-editor .tool li.style .layer li button.hover{background:#c1f471;*height:1%}
.xpress-editor .tool li.blockquote .layer{padding:6px 0 6px 7px;left:0;width:294px}
.xpress-editor .tool li.blockquote .layer ul{*zoom:1;margin:0}
.xpress-editor .tool li.blockquote .layer ul:after{content:"";display:block;clear:both}
.xpress-editor .tool li.blockquote .layer li{position:relative;float:left;overflow:hidden;width:32px;height:34px;margin:0 2px 0 0 !important;border:1px solid #cdcecc !important;background-image:url(../img/btn_qmark.gif);background-repeat:no-repeat}
.xpress-editor .tool li.blockquote .layer li.q1{background-position:0 0}
.xpress-editor .tool li.blockquote .layer li.q2{background-position:-32px 0}
.xpress-editor .tool li.blockquote .layer li.q3{background-position:-64px 0}
.xpress-editor .tool li.blockquote .layer li.q4{background-position:-96px 0}
.xpress-editor .tool li.blockquote .layer li.q5{background-position:-128px 0}
.xpress-editor .tool li.blockquote .layer li.q6{background-position:-160px 0}
.xpress-editor .tool li.blockquote .layer li.q7{background-position:-192px 0}
.xpress-editor .tool li.blockquote .layer li.q8{background-position:-224px 0}
.xpress-editor .tool li.blockquote .layer li button{width:32px;height:34px}
.xpress-editor .tool li.url .layer{width:231px;height:125px;background-image:url(../img/bx_url.gif);background-repeat:no-repeat;background-position:10px 14px}
.xpress-editor .tool li.url .layer fieldset{position:absolute;width:212px;left:10px;top:14px}
.xpress-editor .tool li.url .layer fieldset h3{position:absolute;top:-4px;left:15px;color:#404040;visibility:visible;font-size:12px;line-height:normal;width:auto;height:auto;background:none;margin:0;padding:0;font-weight:normal}
.xpress-editor .tool li.url .layer fieldset input.link{position:absolute;left:12px;top:19px;width:179px;padding:2px 0 1px 6px;*margin:-1px 0;font-size:11px;height:13px;border:1px solid #818181;border-right:1px solid #dadada;border-bottom:1px solid #dadada}
.xpress-editor .tool li.url .layer fieldset p{position:absolute;left:12px;top:44px}
.xpress-editor .tool li.url .layer fieldset p input{width:13px;height:13px;vertical-align:middle;margin-right:3px}
.xpress-editor .tool li.url .layer .btn_area{position:absolute;bottom:12px;padding:0}
.xpress-editor .tool li.table .layer{width:242px;height:239px;background-image:url(../img/bx_table.gif);background-repeat:no-repeat;background-position:10px 14px}
.xpress-editor .tool li.table .layer fieldset{position:absolute;width:222px;left:10px}
.xpress-editor .tool li.table .layer fieldset h3{position:absolute;top:-4px;left:15px;color:#404040;visibility:visible;font-size:12px;line-height:normal;width:auto;height:auto;background:none;margin:0;padding:0;font-weight:normal}
.xpress-editor .tool li.table .layer fieldset dl{position:absolute;left:10px}
.xpress-editor .tool li.table .layer fieldset dt{float:left;padding:3px 0 0 0;height:20px;white-space:nowrap;letter-spacing:-1px}
.xpress-editor .tool li.table .layer fieldset dd{float:right;position:relative}
.xpress-editor .tool li.table .layer fieldset dd button.add,
.xpress-editor .tool li.table .layer fieldset dd button.del{position:absolute;left:27px;width:15px;height:8px;background:url(../img/btn_layer_cell_adjust.gif) no-repeat}
.xpress-editor .tool li.table .layer fieldset dd button.add{top:1px}
.xpress-editor .tool li.table .layer fieldset dd button.del{top:9px;background-position:0 -8px}
.xpress-editor .tool li.table .layer fieldset dd .preview_palette{display:block;float:left;margin:0 3px 0 0;padding:2px;position:relative;border:1px solid #c8c9c6;width:14px;height:14px;overflow:hidden}
.xpress-editor .tool li.table .layer fieldset dd .preview_palette button{width:14px;height:14px;font-size:500px;line-height:0}
.xpress-editor .tool li.table .layer fieldset dd .find_palette{width:33px;height:20px;background:url(../img/btn_search.gif) no-repeat}
.xpress-editor .tool li.table .layer fieldset.num{top:14px}
.xpress-editor .tool li.table .layer fieldset.num dl{top:18px;width:60px}
.xpress-editor .tool li.table .layer fieldset.num dt{height:20px}
.xpress-editor .tool li.table .layer fieldset.num dd{height:23px}
.xpress-editor .tool li.table .layer fieldset.num dt label{font-size:11px;color:#333}
.xpress-editor .tool li.table .layer fieldset.num dd input{padding:3px 0 0 6px;*margin:-1px 0;width:35px;height:13px;font-size:11px;border:1px solid #818181;border-right:1px solid #dadada;border-bottom:1px solid #dadada}
.xpress-editor .tool li.table .layer fieldset.color{top:96px}
.xpress-editor .tool li.table .layer fieldset.color dl{top:18px;width:210px}
.xpress-editor .tool li.table .layer fieldset.color dt{height:23px}
.xpress-editor .tool li.table .layer fieldset.color dd{height:26px;width:146px}
.xpress-editor .tool li.table .layer fieldset.color dt label{font-size:11px;color:#333}
.xpress-editor .tool li.table .layer fieldset.color dd input{padding:3px 0 0 6px;*margin:-1px 0;font-size:11px;border:1px solid #818181;border-right:1px solid #dadada;border-bottom:1px solid #dadada}
.xpress-editor .tool li.table .layer fieldset.color dd input#table_border_width{width:35px;height:13px}
.xpress-editor .tool li.table .layer fieldset.color dd input#table_border_color,
.xpress-editor .tool li.table .layer fieldset.color dd input#table_bg_color{width:70px;height:15px;*margin-right:3px}
.xpress-editor .tool li.table .layer table{position:absolute;top:18px;left:75px;width:137px;height:40px;table-layout:fixed;border-collapse:separate;border:0}
.xpress-editor .tool li.table .layer table *{font-size:0;line-height:0}
.xpress-editor .tool li.table .layer table th,
.xpress-editor .tool li.table .layer table td{text-align:center;padding:0;border:0}
.xpress-editor .tool li.table .layer .btn_area{position:absolute;bottom:12px;padding:0;z-index:1}
.xpress-editor .tool li.table .layer .palette{display:none;position:absolute;z-index:2;left:11px;width:204px;padding:8px 7px 7px 7px;_padding-right:6px;background-color:#fbfbfb;border:1px solid #c5c5c5;border-right:1px solid #9f9f9f;border-bottom:1px solid #9f9f9f}
.xpress-editor .tool li.table .layer.p1 .palette{display:block;top:163px}
.xpress-editor .tool li.table .layer.p2 .palette{display:block;top:189px}
.xpress-editor .tool li.character .layer{width:433px;height:242px;overflow:hidden}
.xpress-editor .tool li.character .layer ul{margin:0}
.xpress-editor .tool li.character .layer h3{position:absolute;width:0;height:0;overflow:hidden;visibility:hidden}
.xpress-editor .tool li.character .layer .characterNav{position:absolute;top:11px;left:-1px;overflow:hidden;white-space:nowrap}
.xpress-editor .tool li.character .layer .characterNav li{display:inline;margin:0 -4px 0 0;padding:0 8px !important;background:url(../img/vr_layer_character.gif) no-repeat 0 0}
.xpress-editor .tool li.character .layer .characterNav li a{color:#444;text-decoration:none;letter-spacing:-1px}
.xpress-editor .tool li.character .layer .characterNav li a:hover,
.xpress-editor .tool li.character .layer .characterNav li a:active,
.xpress-editor .tool li.character .layer .characterNav li a:focus{text-decoration:underline}
.xpress-editor .tool li.character .layer .characterNav li a.on{font-weight:bold;color:#004790;display:inline}
.xpress-editor .tool li.character .layer .list{position:absolute;left:7px;top:30px;width:421px;height:172px;background:url(../img/bx_character.gif) no-repeat}
.xpress-editor .tool li.character .layer .list li{position:relative;top:1px;left:1px;float:left;width:20px;height:18px;margin:0 1px 1px 0 !important}
.xpress-editor .tool li.character .layer .list li button{width:20px;height:18px}
.xpress-editor .tool li.character .layer .list li button.hover{border:2px solid #27c11a}
.xpress-editor .tool li.character .layer .list li button span{overflow:visible;font-size:12px;width:auto;height:auto;position:relative;visibility:visible;line-height:normal}
.xpress-editor .tool li.character .layer p{position:absolute;top:212px;left:7px}
.xpress-editor .tool li.character .layer p *{vertical-align:top}
.xpress-editor .tool li.character .layer p label{position:relative;top:4px;margin:0 7px 0 0;color:#333;letter-spacing:-1px}
.xpress-editor .tool li.character .layer p input{padding:3px 0 0 4px;margin:0 4px 0 0;width:300px;_width /**/:306px;height:16px;_height /**/:20px;border:1px solid #acacac;border-right:1px solid #dadada;border-bottom:1px solid #dadada}
.xpress-editor .tool li.character .layer p button{position:relative;*top:1px;width:38px;height:21px;background:url(../img/btn_layer_confirm.gif) no-repeat}
.xpress-editor .tool li.character .layer p button span{position:absolute;width:0;height:0;overflow:hidden;visibility:hidden}
.xpress-editor .tool li.extensions .layer{width:auto;white-space:nowrap;padding:5px 10px}
.xpress-editor .tool li.extensions .layer li{margin:2px 0}
.xpress-editor .tool li.extensions .layer li a {color:#000;text-decoration:none}
.xpress-editor .tool li.extensions .layer li a:hover {text-decoration:underline}
/* File Uploader */
.xpress-editor .fileUploader{clear:both;padding-top:5px;margin-bottom:10px}
.xpress-editor .fileUploader:after{content:"";display:block;clear:both}
.xpress-editor .fileUploader .preview{float:left;width:64px;height:64px;border:1px solid #ccc;;padding:2px;margin:0 10px 5px 0}
.xpress-editor .fileUploader .preview.black {background-color:#000;border:1px solid #666}
.xpress-editor .fileUploader .preview img{display:block;width:64px;height:64px}
.xpress-editor .fileUploader .fileListArea{float:left;width:260px;margin:0 10px 5px 0}
.xpress-editor .fileUploader .fileListArea select{width:100%;height:70px;overflow:auto;margin:0;padding:0;float:none}
.xpress-editor .fileUploader .fileListArea select option{font-size:11px}
.xpress-editor .fileUploader .fileListArea.black select {background-color:#000;border:1px solid #666}
.xpress-editor .fileUploader .fileListArea.black select option {color:#aaa}
.xpress-editor .fileUploader .fileUploadControl{clear:right}
.xpress-editor .fileUploader .fileUploadControl .text{margin:0 0 5px 0;font-size:11px;text-decoration:underline}
.xpress-editor .fileUploader .file_attach_info{clear:right;margin:5px 0;font-size:11px;color:#333}
/* Auto Save */
.xpress-editor .autosave_message {display:none;background: #f6ffdb;padding:6px 10px;margin:0;line-height:1}
.xpress-editor.black .autosave_message {display:none;background:#222;padding:6px 10px;margin:0;line-height:1;color:#fff}
.xpress-editor .input_syntax.black {background:transparent;color:#fff}

View file

@ -1 +0,0 @@
/* This file is not used in Rhymix. */

View file

@ -1,483 +0,0 @@
<!--// 스킨 css 로드 -->
<load target="css/default.css" />
<!--// 기본 JS 로드 -->
<load target="../../tpl/js/editor_common.js" />
<!--@if($colorset == "black" || $colorset == "black_texteditor" || $colorset == "black_text_nohtml" || $colorset == "black_text_usehtml")-->
<!--%import("css/black.css")-->
{@ $editor_class = "black" }
<!--@end-->
<!--@if($colorset == "white_texteditor" || $colorset == "black_texteditor" || $colorset == "white_text_nohtml" || $colorset == "black_text_nohtml" || $colorset == "white_text_usehtml" || $colorset == "black_text_usehtml")-->
<load target="js/xe_textarea.js" />
<div class="xeTextEditor {$editor_class}">
<input type="hidden" id="htm_{$editor_sequence}" value="<!--@if($colorset == "white_text_nohtml" || $colorset == "black_text_nohtml")-->n<!--@end--><!--@if($colorset == "white_texteditor" || $colorset == "white_texteditor")-->br<!--@end-->" />
<textarea id="editor_{$editor_sequence}" style="height:{$editor_height}px;font-family:{$content_font};" rows="8" cols="42" class="iTextArea"></textarea>
</div>
<script>//<![CDATA[
editorStartTextarea({$editor_sequence}, "{$editor_content_key_name}", "{$editor_primary_key_name}");
//]]></script>
<!--@else-->
<!--// 기본 js/언어파일 로드 -->
<load target="js/Xpress_Editor.js" />
<load target="js/xe_interface.js" />
<!-- 자동저장용 폼 -->
<!--@if($enable_autosave)-->
<input type="hidden" name="_saved_doc_title" value="{htmlspecialchars($saved_doc->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}" />
<input type="hidden" name="_saved_doc_content" value="{htmlspecialchars($saved_doc->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}" />
<input type="hidden" name="_saved_doc_document_srl" value="{$saved_doc->document_srl}" />
<input type="hidden" name="_saved_doc_message" value="{$lang->msg_load_saved_doc}" />
<!--@end-->
<!-- 에디터 -->
<div class="xpress-editor {$editor_class}">
<div id="smart_content"> <a href="#xe-editor-container-{$editor_sequence}" class="skip">&raquo; {$lang->edit->jumptoedit}</a>
<!--@if($enable_default_component||$enable_component||$html_mode)-->
<!-- 편집 컴포넌트 -->
<div class="tool off">
<!--@if($enable_default_component)-->
<!-- 기본 컴포넌트 출력 -->
<ul class="do item">
<li class="xpress_xeditor_ui_undo undo"><button type="button" title="Ctrl+Z:{$lang->edit->undo}"><span>{$lang->edit->undo}</span></button></li>
<li class="xpress_xeditor_ui_redo redo"><button type="button" title="Ctrl+Y:{$lang->edit->redo}"><span>{$lang->edit->redo}</span></button></li>
</ul>
<ul class="type">
<li class="xpress_xeditor_ui_format">
<select class="xpress_xeditor_ui_format_select" disabled="disabled">
<option value="">{$lang->edit->header}</option>
<!--@foreach($lang->edit->header_list as $key=>$obj)-->
<option value="{$key}">{$obj}</option>
<!--@end-->
</select>
</li>
<li class="xpress_xeditor_ui_fontName">
<select class="xpress_xeditor_ui_fontName_select" disabled="disabled">
<option value="">{$lang->edit->fontname}</option>
<!--@foreach($lang->edit->fontlist as $key=>$obj)-->
{@ $fontname_simplified = trim(array_first(explode(',', $obj)), "'\" ")}
<option value="{htmlspecialchars($obj, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}" style="font-family:{$obj}">{$fontname_simplified}</option>
<!--@end-->
</select>
</li>
<li class="xpress_xeditor_ui_fontSize">
<select class="xpress_xeditor_ui_fontSize_select" disabled="disabled">
<option value="">{$lang->edit->fontsize}</option>
<option value="9px" style="font-size:9px">9px</option>
<option value="10px" style="font-size:10px">10px</option>
<option value="11px" style="font-size:11px">11px</option>
<option value="12px" style="font-size:12px">12px</option>
<option value="13px" style="font-size:13px">13px</option>
<option value="14px" style="font-size:14px">14px</option>
<option value="16px" style="font-size:16px">16px</option>
<option value="18px" style="font-size:18px">18px</option>
<option value="24px" style="font-size:24px">24px</option>
<option value="32px" style="font-size:32px">32px</option>
</select>
</li>
<li class="xpress_xeditor_ui_lineHeight">
<select class="xpress_xeditor_ui_lineHeight_select" disabled="disabled">
<option value="">{$lang->edit->lineheight}</option>
<option value="1">100%</option>
<option value="1.2">120%</option>
<option value="1.4">140%</option>
<option value="1.6">160%</option>
<option value="1.8">180%</option>
<option value="2">200%</option>
</select>
</li>
</ul>
<ul class="style">
<li class="bold xpress_xeditor_ui_bold">
<button type="button" title="Ctrl+B:{$lang->edit->help_bold}"><span>{$lang->edit->bold}</span></button>
</li>
<li class="underline xpress_xeditor_ui_underline">
<button type="button" title="Ctrl+U:{$lang->edit->help_underline}"><span>{$lang->edit->underline}</span></button>
</li>
<li class="italic xpress_xeditor_ui_italic">
<button type="button" title="Ctrl+I:{$lang->edit->help_italic}"><span>{$lang->edit->italic}</span></button>
</li>
<li class="del xpress_xeditor_ui_lineThrough">
<button type="button" title="Ctrl+D:{$lang->edit->help_strike}"><span>{$lang->edit->strike}</span></button>
</li>
<li class="fcolor xpress_xeditor_ui_fontColor">
<button type="button" title="{$lang->edit->help_fontcolor}"><span>{$lang->edit->fontcolor}</span></button>
<!-- 팔레트 레이어 -->
<div class="layer xpress_xeditor_fontcolor_layer" style="display:none;">
<ul class="palette xpress_xeditor_color_palette">
<li><button type="button" title="#ff0000" style="background:#ff0000"><span>#ff0000</span></button></li>
<li><button type="button" title="#ff6c00" style="background:#ff6c00"><span>#ff6c00</span></button></li>
<li><button type="button" title="#ffaa00" style="background:#ffaa00"><span>#ffaa00</span></button></li>
<li><button type="button" title="#ffef00" style="background:#ffef00"><span>#ffef00</span></button></li>
<li><button type="button" title="#a6cf00" style="background:#a6cf00"><span>#a6cf00</span></button></li>
<li><button type="button" title="#009e25" style="background:#009e25"><span>#009e25</span></button></li>
<li><button type="button" title="#00b0a2" style="background:#00b0a2"><span>#00b0a2</span></button></li>
<li><button type="button" title="#0075c8" style="background:#0075c8"><span>#0075c8</span></button></li>
<li><button type="button" title="#3a32c3" style="background:#3a32c3"><span>#3a32c3</span></button></li>
<li><button type="button" title="#7820b9" style="background:#7820b9"><span>#7820b9</span></button></li>
<li><button type="button" title="#ef007c" style="background:#ef007c"><span>#ef007c</span></button></li>
<li><button type="button" title="#000000" style="background:#000000"><span>#000000</span></button></li>
<li><button type="button" title="#252525" style="background:#252525"><span>#252525</span></button></li>
<li><button type="button" title="#464646" style="background:#464646"><span>#464646</span></button></li>
<li><button type="button" title="#636363" style="background:#636363"><span>#636363</span></button></li>
<li><button type="button" title="#7d7d7d" style="background:#7d7d7d"><span>#7d7d7d</span></button></li>
<li><button type="button" title="#9a9a9a" style="background:#9a9a9a"><span>#9a9a9a</span></button></li>
<li><button type="button" title="#ffe8e8" style="background:#ffe8e8"><span>#ffe8e8</span></button></li>
<li><button type="button" title="#f7e2d2" style="background:#f7e2d2"><span>#f7e2d2</span></button></li>
<li><button type="button" title="#f5eddc" style="background:#f5eddc"><span>#f5eddc</span></button></li>
<li><button type="button" title="#f5f4e0" style="background:#f5f4e0"><span>#f5f4e0</span></button></li>
<li><button type="button" title="#edf2c2" style="background:#edf2c2"><span>#edf2c2</span></button></li>
<li><button type="button" title="#def7e5" style="background:#def7e5"><span>#def7e5</span></button></li>
<li><button type="button" title="#d9eeec" style="background:#d9eeec"><span>#d9eeec</span></button></li>
<li><button type="button" title="#c9e0f0" style="background:#c9e0f0"><span>#c9e0f0</span></button></li>
<li><button type="button" title="#d6d4eb" style="background:#d6d4eb"><span>#d6d4eb</span></button></li>
<li><button type="button" title="#e7dbed" style="background:#e7dbed"><span>#e7dbed</span></button></li>
<li><button type="button" title="#f1e2ea" style="background:#f1e2ea"><span>#f1e2ea</span></button></li>
<li><button type="button" title="#acacac" style="background:#acacac"><span>#acacac</span></button></li>
<li><button type="button" title="#c2c2c2" style="background:#c2c2c2"><span>#c2c2c2</span></button></li>
<li><button type="button" title="#cccccc" style="background:#cccccc"><span>#cccccc</span></button></li>
<li><button type="button" title="#e1e1e1" style="background:#e1e1e1"><span>#e1e1e1</span></button></li>
<li><button type="button" title="#ebebeb" style="background:#ebebeb"><span>#ebebeb</span></button></li>
<li><button type="button" title="#ffffff" style="background:#ffffff"><span>#ffffff</span></button></li>
<li><button type="button" title="#e97d81" style="background:#e97d81"><span>#e97d81</span></button></li>
<li><button type="button" title="#e19b73" style="background:#e19b73"><span>#e19b73</span></button></li>
<li><button type="button" title="#d1b274" style="background:#d1b274"><span>#d1b274</span></button></li>
<li><button type="button" title="#cfcca2" style="background:#cfcca2"><span>#cfcca2</span></button></li>
<li><button type="button" title="#cfcca2" style="background:#cfcca2"><span>#cfcca2</span></button></li>
<li><button type="button" title="#61b977" style="background:#61b977"><span>#61b977</span></button></li>
<li><button type="button" title="#53aea8" style="background:#53aea8"><span>#53aea8</span></button></li>
<li><button type="button" title="#518fbb" style="background:#518fbb"><span>#518fbb</span></button></li>
<li><button type="button" title="#6a65bb" style="background:#6a65bb"><span>#6a65bb</span></button></li>
<li><button type="button" title="#9a54ce" style="background:#9a54ce"><span>#9a54ce</span></button></li>
<li><button type="button" title="#e573ae" style="background:#e573ae"><span>#e573ae</span></button></li>
<li><button type="button" title="#5a504b" style="background:#5a504b"><span>#5a504b</span></button></li>
<li><button type="button" title="#767b86" style="background:#767b86"><span>#767b86</span></button></li>
<li><button type="button" title="#00ffff" style="background:#00ffff"><span>#00ffff</span></button></li>
<li><button type="button" title="#00ff00" style="background:#00ff00"><span>#00ff00</span></button></li>
<li><button type="button" title="#a0f000" style="background:#a0f000"><span>#a0f000</span></button></li>
<li><button type="button" title="#ffff00" style="background:#ffff00"><span>#ffff00</span></button></li>
<li><button type="button" title="#951015" style="background:#951015"><span>#951015</span></button></li>
<li><button type="button" title="#6e391a" style="background:#6e391a"><span>#6e391a</span></button></li>
<li><button type="button" title="#785c25" style="background:#785c25"><span>#785c25</span></button></li>
<li><button type="button" title="#5f5b25" style="background:#5f5b25"><span>#5f5b25</span></button></li>
<li><button type="button" title="#4c511f" style="background:#4c511f"><span>#4c511f</span></button></li>
<li><button type="button" title="#1c4827" style="background:#1c4827"><span>#1c4827</span></button></li>
<li><button type="button" title="#0d514c" style="background:#0d514c"><span>#0d514c</span></button></li>
<li><button type="button" title="#1b496a" style="background:#1b496a"><span>#1b496a</span></button></li>
<li><button type="button" title="#2b285f" style="background:#2b285f"><span>#2b285f</span></button></li>
<li><button type="button" title="#45245b" style="background:#45245b"><span>#45245b</span></button></li>
<li><button type="button" title="#721947" style="background:#721947"><span>#721947</span></button></li>
<li><button type="button" title="#352e2c" style="background:#352e2c"><span>#352e2c</span></button></li>
<li><button type="button" title="#3c3f45" style="background:#3c3f45"><span>#3c3f45</span></button></li>
<li><button type="button" title="#00aaff" style="background:#00aaff"><span>#00aaff</span></button></li>
<li><button type="button" title="#0000ff" style="background:#0000ff"><span>#0000ff</span></button></li>
<li><button type="button" title="#a800ff" style="background:#a800ff"><span>#a800ff</span></button></li>
<li><button type="button" title="#ff00ff" style="background:#ff00ff"><span>#ff00ff</span></button></li>
</ul>
</div>
<!-- /팔레트 레이어 -->
</li>
<li class="bcolor xpress_xeditor_ui_bgColor">
<button type="button" title="{$lang->edit->help_fontbgcolor}"><span>{$lang->edit->fontbgcolor}</span></button>
<!-- 배경색 + 팔레트 레이어 -->
<div class="layer xpress_xeditor_bgcolor_layer" style="display:none;">
<ul class="background">
<li><button type="button" title="#000000" style="background:#000000; color:#ffffff"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#9334d8" style="background:#9334d8; color:#ffffff"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#ff0000" style="background:#ff0000; color:#ffffff"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#333333" style="background:#333333; color:#ffff00"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#0000ff" style="background:#0000ff; color:#ffffff"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#ff6600" style="background:#ff6600; color:#ffffff"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#8e8e8e" style="background:#8e8e8e; color:#ffffff"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#009999" style="background:#009999; color:#ffffff"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#ffa700" style="background:#ffa700; color:#ffffff"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#ffdaed" style="background:#ffdaed; color:#000000"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#e4ff75" style="background:#e4ff75; color:#000000"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#cc9900" style="background:#cc9900; color:#ffffff"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#99dcff" style="background:#99dcff; color:#000000"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#a6ff4d" style="background:#a6ff4d; color:#000000"><span>{$lang->edit->fontbgsampletext}</span></button></li>
<li><button type="button" title="#ffffff" style="background:#ffffff; color:#000000"><span>{$lang->edit->fontbgsampletext}</span></button></li>
</ul>
</div>
<!-- /배경색 + 팔레트 레이어 -->
</li>
<li class="sup xpress_xeditor_ui_superscript">
<button type="button" title="{$lang->edit->help_sup}"><span>{$lang->edit->sup}</span></button>
</li>
<li class="sub xpress_xeditor_ui_subscript">
<button type="button" title="{$lang->edit->help_sub}"><span>{$lang->edit->sub}</span></button>
</li>
</ul>
<ul class="paragraph">
<li class="left xpress_xeditor_ui_justifyleft">
<button type="button" title="{$lang->edit->help_align_left}"><span>{$lang->edit->align_left}</span></button>
</li>
<li class="center xpress_xeditor_ui_justifycenter">
<button type="button" title="{$lang->edit->help_align_center}"><span>{$lang->edit->align_center}</span></button>
</li>
<li class="right xpress_xeditor_ui_justifyright">
<button type="button" title="{$lang->edit->help_align_right}"><span>{$lang->edit->align_right}</span></button>
</li>
<li class="justify xpress_xeditor_ui_justifyfull">
<button type="button" title="{$lang->edit->help_align_justify}"><span>{$lang->edit->align_justify}</span></button>
</li>
<li class="ol xpress_xeditor_ui_orderedlist">
<button type="button" title="{$lang->edit->help_list_number}"><span>{$lang->edit->list_number}</span></button>
</li>
<li class="ul xpress_xeditor_ui_unorderedlist">
<button type="button" title="{$lang->edit->help_list_bullet}"><span>{$lang->edit->list_bullet}</span></button>
</li>
<li class="outdent xpress_xeditor_ui_outdent">
<button type="button" title="Shift+Tab:{$lang->edit->help_remove_indent}"><span>{$lang->edit->help_remove_indent}</span></button>
</li>
<li class="indent xpress_xeditor_ui_indent">
<button type="button" title="Tab:{$lang->edit->help_add_indent}"><span>{$lang->edit->add_indent}</span></button>
</li>
</ul>
<ul class="extra1">
<li class="blockquote xpress_xeditor_ui_quote">
<button type="button" title="{$lang->edit->blockquote}"><span>{$lang->edit->blockquote}</span></button>
<!-- 인용 레이어 -->
<div class="layer xpress_xeditor_blockquote_layer" style="display:none">
<ul>
<li class="q1"><button type="button"><span>{$lang->edit->quotestyle1}</span></button></li>
<li class="q2"><button type="button"><span>{$lang->edit->quotestyle2}</span></button></li>
<li class="q3"><button type="button"><span>{$lang->edit->quotestyle3}</span></button></li>
<li class="q4"><button type="button"><span>{$lang->edit->quotestyle4}</span></button></li>
<li class="q5"><button type="button"><span>{$lang->edit->quotestyle5}</span></button></li>
<li class="q6"><button type="button"><span>{$lang->edit->quotestyle6}</span></button></li>
<li class="q7"><button type="button"><span>{$lang->edit->quotestyle7}</span></button></li>
<li class="q8"><button type="button"><span>{$lang->edit->quotestyle8}</span></button></li>
</ul>
</div>
<!-- /인용 레이어 -->
</li>
<li class="url xpress_xeditor_ui_hyperlink">
<button type="button" title="{$lang->edit->url}"><span>{$lang->edit->url}</span></button>
<!-- URL 레이어 -->
<div class="layer xpress_xeditor_hyperlink_layer" style="display:none;">
<fieldset>
<h3>{$lang->edit->hyperlink}</h3>
<input name="" class="link" type="text" value="http://" title="URL" />
<p><input name="" id="target" type="checkbox" value="" /><label for="target">{$lang->edit->target_blank}</label></p>
</fieldset>
<div class="btn_area">
<button type="button" class="confirm" title="{$lang->cmd_confirm}"><span>{$lang->cmd_confirm}</span></button>
<button type="button" class="cancel" title="{$lang->cmd_cancel}"><span>{$lang->cmd_cancel}</span></button>
</div>
</div>
<!-- /URL 레이어 -->
</li>
<li class="character xpress_xeditor_ui_sCharacter">
<button type="button" title="{$lang->edit->special_character}"><span>{$lang->edit->special_character}</span></button>
<!-- 특수문자 레이어 -->
<div class="layer xpress_xeditor_sCharacter_layer" style="display:none">
<h3>{$lang->edit->insert_special_character}</h3>
<button type="button" class="close" title="{$lang->edit->close_special_character}"><span>{$lang->edit->close_special_character}</span></button>
<ul class="characterNav">
<li><a href="#character1" class="on">{$lang->edit->symbol}</a></li>
<li><a href="#character2">{$lang->edit->number_unit}</a></li>
<li><a href="#character3">{$lang->edit->circle_bracket}</a></li>
<li><a href="#character4">{$lang->edit->korean}</a></li>
<li><a href="#character5">{$lang->edit->greece},{$lang->edit->Latin}</a></li>
<li><a href="#character6">{$lang->edit->japan}</a></li>
</ul>
<ul style="display: block;" id="character1" class="list"></ul>
<ul style="display: none;" id="character2" class="list"></ul>
<ul style="display: none;" id="character3" class="list"></ul>
<ul style="display: none;" id="character4" class="list"></ul>
<ul style="display: none;" id="character5" class="list"></ul>
<ul style="display: none;" id="character6" class="list"></ul>
<p>
<label for="preview">{$lang->edit->selected_symbol}</label>
<input id="preview" name="" type="text" />
<button type="button" title="{$lang->confirm}"><span>{$lang->confirm}</span></button>
</p>
<button type="button" class="close" title="{$lang->edit->close_special_character}"><span>{$lang->edit->close_special_character}</span></button>
</div>
<!-- /특수문자 레이어 -->
</li>
</ul>
<ul class="table">
<li class="table xpress_xeditor_ui_table">
<button type="button" title="{$lang->edit->table}"><span>{$lang->edit->table}</span></button>
<!-- 표 레이어 -->
<div class="layer xpress_xeditor_table_layer" style="display:none;">
<fieldset class="num">
<h3>{$lang->edit->set_sel}</h3>
<dl>
<dt>
<label for="row">{$lang->edit->row}</label>
</dt>
<dd>
<input id="row" name="" type="text" maxlength="2" value="4" />
<button type="button" class="add"><span>{$lang->edit->add_one_row}</span></button>
<button type="button" class="del"><span>{$lang->edit->del_one_row}</span></button>
</dd>
<dt>
<label for="col">{$lang->edit->col}</label>
</dt>
<dd>
<input id="col" name="" type="text" maxlength="2" value="4" />
<button type="button" class="add"><span>{$lang->edit->add_one_col}</span></button>
<button type="button" class="del"><span>{$lang->edit->del_one_col}</span></button>
</dd>
</dl>
<table border="1">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</fieldset>
<fieldset class="color">
<h3>{$lang->edit->table_config}</h3>
<dl>
<dt>
<label for="table_border_width">{$lang->edit->border_width}</label>
</dt>
<dd>
<input id="table_border_width" name="" type="text" maxlength="2" value="1" />
<button type="button" class="add"><span>1px {$lang->edit->add}</span></button>
<button type="button" class="del"><span>1px {$lang->edit->del}</span></button>
</dd>
<dt>
<label for="table_border_color">{$lang->edit->border_color}</label>
</dt>
<dd>
<span class="preview_palette"><button type="button" style="background:#cccccc;">{$lang->edit->search_color}</button></span>
<input id="table_border_color" name="" type="text" maxlength="7" value="#CCCCCC" />
<button type="button" class="find_palette"><span>{$lang->edit->search_color}</span></button>
</dd>
<dt>
<label for="table_bg_color">{$lang->edit->table_backgroundcolor}</label>
</dt>
<dd>
<span class="preview_palette"><button type="button" style="background:#000000;">{$lang->edit->search_color}</button></span>
<input id="table_bg_color" name="" type="text" maxlength="7" value="#000000" />
<button type="button" class="find_palette"><span>{$lang->edit->search_color}</span></button>
</dd>
</dl>
</fieldset>
<div class="btn_area">
<button type="button" class="confirm" title="{$lang->confirm}"><span>{$lang->confirm}</span></button>
<button type="button" class="cancel" title="{$lang->cancel}"><span>{$lang->cancel}</span></button>
</div>
</div>
<!-- /표 레이어 -->
</li>
<li class="merge xpress_xeditor_ui_merge_cells"><button type="button" title="{$lang->edit->merge_cells}"><span>{$lang->edit->merge_cells}</span></button></li>
<li class="splitCol xpress_xeditor_ui_split_col"><button type="button" title="{$lang->edit->split_col}"><span>{$lang->edit->split_col}</span></button></li>
<li class="splitRow xpress_xeditor_ui_split_row"><button type="button" title="{$lang->edit->split_row}"><span>{$lang->edit->split_row}</span></button></li>
</ul>
<!--@end-->
<!--@if($enable_component)-->
<ul class="extra2">
<!-- 확장 컴포넌트 출력 -->
<li class="extensions xpress_xeditor_ui_extension">
<span class="exButton"><button type="button" title="{$lang->edit->extension}">{$lang->edit->extension}</button></span>
<div class="layer extension2 xpress_xeditor_extension_layer" id="editorExtension_{$editor_sequence}">
<ul id="editor_component_{$editor_sequence}" class="editorComponent">
<!--@foreach($component_list as $component_name => $component)-->
<li><img src="../../components/{$component_name}/component_icon.gif" style="width:13px !important;height:12px !important;padding-right:5px;" alt="" onError="this.onerror=null;this.src='./common/img/blank.gif';" /><a href="#" onclick="return false;" id="component_{$editor_sequence}_{$component_name}" style="vertical-align: top;">{$component->title}</a></li>
<!--@end-->
</ul>
</div>
</li>
</ul>
<!--@end-->
<ul class="extra3"<!--@if(!$html_mode)--> style="display:none"<!--@end-->>
<!--// HTML 모드 사용 -->
<li class="html"><span><button class="xpress_xeditor_mode_toggle_button" type="button" title="{$lang->edit->html_editor}">{$lang->edit->html_editor}</button></span></li>
<!--// li class="preview"><span><button type="button" class="xpress_xeditor_preview_button" title="{$lang->cmd_preview}">{$lang->cmd_preview}</button></span></li-->
</ul>
</div>
<!--@else-->
<div class="tool off disable"></div>
<!--@end-->
<!-- 에디터 출력 -->
<div id="xe-editor-container-{$editor_sequence}" class="input_area xpress_xeditor_editing_area_container">
<textarea id="xpress-editor-{$editor_sequence}" rows="8" cols="42"></textarea>
</div>
<!--@if($enable_autosave)-->
<p class="editor_autosaved_message autosave_message" id="editor_autosaved_message_{$editor_sequence}">&nbsp;</p>
<!--@end-->
<!-- /입력 -->
<button type="button" class="input_control xpress_xeditor_editingArea_verticalResizer" title="{$lang->edit->edit_height_control}"><span>{$lang->edit->edit_height_control}</span></button>
<span class="input_auto xpress_xeditor_ui_editorresize"><label for="editorresize"><input type="checkbox" id="editorresize">{$lang->edit->edit_height_auto}</label></span>
</div>
<div id="fileUploader_{$editor_sequence}" class="fileUploader" cond="$allow_fileupload"><!--File upload zone-->
<div class="preview {$btn_class}" id="preview_uploaded_{$editor_sequence}"></div>
<div class="fileListArea {$btn_class}">
<select id="uploaded_file_list_{$editor_sequence}" multiple="multiple" class="fileList" title="Attached File List"><option></option></select>
</div>
<div class="fileUploadControl">
<button type="button" id="swfUploadButton{$editor_sequence}" class="text">{$lang->edit->upload_file}</button>
<button type="button" onclick="removeUploadedFile('{$editor_sequence}');" class="text">{$lang->edit->delete_selected}</button>
<button type="button" onclick="insertUploadedFile('{$editor_sequence}');" class="text">{$lang->edit->link_file}</button>
</div>
<div class="file_attach_info" id="uploader_status_{$editor_sequence}">{$upload_status}</div>
</div>
</div>
<!-- 에디터 활성화 -->
<script>//<![CDATA[
var editor_path = "{$editor_path}";
var auto_saved_msg = "{$lang->msg_auto_saved}";
var oEditor;
jQuery(function(){
oEditor = editorStart_xe("{$editor_sequence}", "{$editor_primary_key_name}", "{$editor_content_key_name}", "{$editor_height}", "{$colorset}", "{$content_style}", '{$content_font}', '{$content_font_size}', '{$content_line_height}', '{$content_paragraph_spacing}', '{$content_word_break}');
<!--@if($allow_fileupload)-->
<load target="../../tpl/js/uploader.js" />
<load target="../../tpl/js/swfupload.js" />
editorUploadInit({
"editorSequence" : {$editor_sequence},
"sessionName" : "{session_name()}",
"allowedFileSize" : "{$file_config->allowed_filesize}",
"allowedFileTypes" : "{$file_config->allowed_filetypes}",
"allowedFileTypesDescription" : "{$file_config->allowed_filetypes}",
"insertedFiles" : {(int)$files_count},
"replaceButtonID" : "swfUploadButton{$editor_sequence}",
"fileListAreaID" : "uploaded_file_list_{$editor_sequence}",
"previewAreaID" : "preview_uploaded_{$editor_sequence}",
"uploaderStatusID" : "uploader_status_{$editor_sequence}"
});
<!--@end-->
});
//]]></script>
<!--@end-->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 B

File diff suppressed because it is too large Load diff

View file

@ -1,296 +0,0 @@
if (!window.xe) xe = {};
xe.Editors = [];
function editorStart_xe(editor_sequence, primary_key, content_key, editor_height, colorset, content_style, content_font, content_font_size, content_line_height, content_paragraph_spacing, content_word_break) {
if(typeof(colorset)=='undefined') colorset = 'white';
if(typeof(content_style)=='undefined') content_style = 'xeStyle';
if(typeof(content_font)=='undefined') content_font= '';
if(typeof(content_font_size)=='undefined') content_font_size= '';
if(typeof(content_line_height)=='undefined') content_line_height= '';
if(typeof(content_paragraph_spacing)=='undefined') content_paragraph_spacing= '';
if(typeof(content_word_break)=='undefined') content_word_break= '';
var target_src = request_uri+'modules/editor/styles/'+content_style+'/editor.html';
var textarea = jQuery("#xpress-editor-"+editor_sequence);
var iframe = jQuery('<iframe id="editor_iframe_'+editor_sequence+'" allowTransparency="true" frameborder="0" src="'+target_src+'" scrolling="yes" style="width:100%;height:'+editor_height+'px"></iframe>');
var htmlsrc = jQuery('<textarea rows="8" cols="42" class="input_syntax '+colorset+'" style="display:none"></textarea>');
var form = textarea.get(0).form;
form.setAttribute('editor_sequence', editor_sequence);
textarea.css("display","none");
var saved_content = '';
if(jQuery("input[name=content]",form).size()>0){
saved_content=jQuery("input[name=content]",form).val().replace(/src=\"files\/attach/g,'src="'+request_uri+'files/attach'); //'
jQuery("#xpress-editor-"+editor_sequence).val(saved_content);
}
// hide textarea
textarea.hide().css('width', '100%').before(iframe).after(htmlsrc);
// create an editor
var oEditor = new xe.XpressCore();
var oWYSIWYGIFrame = iframe.get(0);
var oIRTextarea = textarea.get(0);
var oHTMLSrcTextarea = htmlsrc.get(0);
var elAppContainer = jQuery('.xpress-editor', form).get(0);
oEditor.getFrame = function(){ return oWYSIWYGIFrame;}
oEditor.getContent = function(){
editorGetContentTextarea_xe(editor_sequence);
}
var content = form[content_key].value;
if(xFF && !content) content = '<br />';
form[content_key].value = content;
jQuery("#xpress-editor-"+editor_sequence).val(content);
// Set standard API
editorRelKeys[editor_sequence] = new Array();
editorRelKeys[editor_sequence]["primary"] = form[primary_key];
editorRelKeys[editor_sequence]["content"] = form[content_key];
editorRelKeys[editor_sequence]["func"] = editorGetContentTextarea_xe;
editorRelKeys[editor_sequence]["editor"] = oEditor;
editorRelKeys[editor_sequence]["pasteHTML"] = function(text){
oEditor.exec('PASTE_HTML',[text]);
}
xe.Editors[editor_sequence] = oEditor;
// register plugins
oEditor.registerPlugin(new xe.CorePlugin(null));
oEditor.registerPlugin(new xe.XE_PreservTemplate(jQuery("#xpress-editor-"+editor_sequence).val()));
oEditor.registerPlugin(new xe.StringConverterManager());
oEditor.registerPlugin(new xe.XE_EditingAreaManager("WYSIWYG", oIRTextarea, {nHeight:parseInt(editor_height), nMinHeight:100}, null, elAppContainer));
oEditor.registerPlugin(new xe.XE_EditingArea_HTMLSrc(oHTMLSrcTextarea));
oEditor.registerPlugin(new xe.XE_EditingAreaVerticalResizer(elAppContainer));
oEditor.registerPlugin(new xe.Utils());
oEditor.registerPlugin(new xe.DialogLayerManager());
oEditor.registerPlugin(new xe.ActiveLayerManager());
oEditor.registerPlugin(new xe.Hotkey());
oEditor.registerPlugin(new xe.XE_WYSIWYGStyler());
oEditor.registerPlugin(new xe.XE_WYSIWYGStyleGetter());
oEditor.registerPlugin(new xe.MessageManager(xe.XpressCore.oMessageMap));
oEditor.registerPlugin(new xe.XE_Toolbar(elAppContainer));
oEditor.registerPlugin(new xe.XE_XHTMLFormatter);
oEditor.registerPlugin(new xe.XE_GET_WYSYWYG_MODE(editor_sequence));
if(jQuery("ul.extra1").length) {
oEditor.registerPlugin(new xe.XE_ColorPalette(elAppContainer));
oEditor.registerPlugin(new xe.XE_FontColor(elAppContainer));
oEditor.registerPlugin(new xe.XE_BGColor(elAppContainer));
oEditor.registerPlugin(new xe.XE_Quote(elAppContainer));
oEditor.registerPlugin(new xe.XE_FontNameWithSelectUI(elAppContainer));
oEditor.registerPlugin(new xe.XE_FontSizeWithSelectUI(elAppContainer));
oEditor.registerPlugin(new xe.XE_LineHeightWithSelectUI(elAppContainer));
oEditor.registerPlugin(new xe.XE_UndoRedo());
oEditor.registerPlugin(new xe.XE_Table(elAppContainer));
oEditor.registerPlugin(new xe.XE_Hyperlink(elAppContainer));
oEditor.registerPlugin(new xe.XE_FormatWithSelectUI(elAppContainer));
oEditor.registerPlugin(new xe.XE_SCharacter(elAppContainer));
}
if(jQuery("ul.extra2").length) {
oEditor.registerPlugin(new xe.XE_Extension(elAppContainer, editor_sequence));
}
if(jQuery("ul.extra3").length) {
oEditor.registerPlugin(new xe.XE_EditingModeToggler(elAppContainer));
}
if(jQuery("#editorresize").length) {
oEditor.registerPlugin(new xe.XE_Editorresize(elAppContainer, oWYSIWYGIFrame));
}
//oEditor.registerPlugin(new xe.XE_Preview(elAppContainer));
if (!jQuery.browser.msie && !jQuery.browser.opera) {
oEditor.registerPlugin(new xe.XE_WYSIWYGEnterKey(oWYSIWYGIFrame));
}
// 자동 저장 사용
if (s=form._saved_doc_title) {
oEditor.registerPlugin(new xe.XE_AutoSave(oIRTextarea, elAppContainer));
}
function load_proc() {
try {
var doc = oWYSIWYGIFrame.contentWindow.document, str;
if (doc.location == 'about:blank') throw 'blank';
// get innerHTML
doc.body.innerHTML = doc.body.innerHTML.trim();
str = doc.body.innerHTML;
// register plugin
oEditor.registerPlugin(new xe.XE_EditingArea_WYSIWYG(oWYSIWYGIFrame));
oEditor.registerPlugin(new xe.XpressRangeManager(oWYSIWYGIFrame));
oEditor.registerPlugin(new xe.XE_ExecCommand(oWYSIWYGIFrame));
if(content_font && !doc.body.style.fontFamily) {
doc.body.style.fontFamily = content_font;
}
if(content_font_size && !doc.body.style.fontSize) {
doc.body.style.fontSize = content_font_size;
}
if(content_line_height && !doc.body.style.lineHeight) {
doc.body.style.lineHeight = content_line_height;
}
if(content_word_break === "none") {
doc.body.style.whiteSpace = "nowrap";
} else {
doc.body.style.wordBreak = content_word_break ? content_word_break : "normal";
doc.body.style.wordWrap = "break-word";
}
var paragraph_css;
if(!content_paragraph_spacing) {
paragraph_css = '.xe_content.editable p { margin: 0; }';
} else {
paragraph_css = '.xe_content.editable p { margin: 0 0 ' + content_paragraph_spacing + ' 0; }';
}
var style = doc.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
style.styleSheet.cssText = paragraph_css;
} else {
style.appendChild(doc.createTextNode(paragraph_css));
}
var head = doc.head || doc.getElementsByTagName('head')[0];
head.appendChild(style);
if(content_style === "ckeditor_light") {
doc.body.style.margin = "0";
}
// run
oEditor.run();
} catch(e) {
setTimeout(load_proc, 0);
}
}
load_proc();
return oEditor;
}
function editorGetContentTextarea_xe(editor_sequence) {
var oEditor = xe.Editors[editor_sequence] || null;
if (!oEditor) return '';
var str = oEditor.getIR();
if(!jQuery.trim(str.replace(/(&nbsp;|<\/?(p|br|span|div)([^>]+)?>)/ig, ''))) return '';
// 파이어폭스의 경우 의미없는 <br>이 컨텐트 마지막에 추가될 수 있다.
str = str.replace(/<br ?\/?>$/i, '');
// 속도 문제가 있으므로 1024 문자 미만일 때만 첫 노드가 텍스트 노드인지 테스트
// 그 이상이면 P 노드가 정상적으로 생성되었다고 가정한다.
if (str.length < 1024) {
var inline_elements = Array('#text','A','BR','IMG','EM','STRONG','SPAN','BIG','CITE','CODE','DD','DFN','HR','INS','KBD','LINK','Q','SAMP','SMALL','SUB','SUP','TT');
var is_inline_contents = true;
var div = jQuery('<div>'+str+'</div>').eq(0);
var nodes = div.contents();
jQuery.each(nodes, function() {
if (this.nodeType != 3) {
if(jQuery.inArray(this.nodeName, inline_elements ) == -1) {
is_inline_contents = false;
}
}
});
if(is_inline_contents) str = '<p>'+str+'</p>';
}
// 이미지 경로를 수정한다. - 20091125
str = str.replace(/src\s?=\s?(["']?)(?:\.\.\/)+(files\/attach\/)/ig, function(m0,m1,m2){
return 'src='+(m1||'')+m2;
});
str = str.replace(/\<(\/)?([A-Z]+)([^>]*)\>/ig, function(m0,m1,m2,m3) {
if(m3) {
m3 = m3.replace(/ ([A-Z]+?)\=/ig, function(n0,n1) {
n1 = n1.toLowerCase();
return ' '+n1+'=';
});
} else { m3 = ''; }
m2 = m2.toLowerCase();
if(!m1) m1='';
return '<'+m1+m2+m3+'>';
});
str = str.replace('<br>','<br />');
return str;
}
function editorGetIframe(srl) {
return jQuery('iframe#editor_iframe_'+srl).get(0);
}
function editorReplaceHTML(iframe_obj, content) {
var srl = parseInt(iframe_obj.id.replace(/^.*_/,''),10);
editorRelKeys[srl]["pasteHTML"](content);
}
function editorGetAutoSavedDoc(form) {
var param = new Array();
param['mid'] = current_mid;
param['editor_sequence'] = form.getAttribute('editor_sequence')
setTimeout(function() {
var response_tags = new Array("error","message","editor_sequence","title","content","document_srl");
exec_xml('editor',"procEditorLoadSavedDocument", param, function(a,b,c) { editorRelKeys[param['editor_sequence']]['primary'].value = a['document_srl']; if(typeof(uploadSettingObj[param['editor_sequence']]) == 'object') editorUploadInit(uploadSettingObj[param['editor_sequence']], true); }, response_tags);
}, 0);
}
// WYSIWYG 모드를 저장하는 확장기능
xe.XE_GET_WYSYWYG_MODE = jQuery.Class({
name : "XE_GET_WYSYWYG_MODE",
$init : function(editor_sequence) {
this.editor_sequence = editor_sequence;
},
$ON_CHANGE_EDITING_MODE : function(mode) {
editorMode[this.editor_sequence] = (mode =='HTMLSrc') ? 'html' : 'wysiwyg';
}
});
// 서식 기본 내용을 보존
xe.XE_PreservTemplate = jQuery.Class({
name : "XE_PreservTemplate",
isRun : false,
$BEFORE_SET_IR : function(content) {
if(!this.isRun && !content) {
this.isRun = true;
return false;
}
}
});
// 미리보기 확장기능
xe.XE_Preview = jQuery.Class({
name : "XE_Preview",
elPreviewButton : null,
$init : function(elAppContainer) {
this._assignHTMLObjects(elAppContainer);
},
_assignHTMLObjects : function(elAppContainer) {
this.elPreviewButton = jQuery("BUTTON.xpress_xeditor_preview_button", elAppContainer);
},
$ON_MSG_APP_READY : function() {
this.oApp.registerBrowserEvent(this.elPreviewButton.get(0), "click", "EVENT_PREVIEW", []);
},
$ON_EVENT_PREVIEW : function() {
// TODO : 버튼이 눌렸을 때의 동작 정의
}
});

View file

@ -1,40 +0,0 @@
function editorStartTextarea(editor_sequence, content_key, primary_key) {
var obj = xGetElementById('editor_'+editor_sequence);
var use_html = xGetElementById('htm_'+editor_sequence).value;
obj.form.setAttribute('editor_sequence', editor_sequence);
obj.style.width = '100%';
editorRelKeys[editor_sequence] = new Array();
editorRelKeys[editor_sequence]["primary"] = obj.form[primary_key];
editorRelKeys[editor_sequence]["content"] = obj.form[content_key];
editorRelKeys[editor_sequence]["func"] = editorGetContentTextarea;
var content = obj.form[content_key].value;
if(use_html) {
content = content.replace(/<br([^>]*)>/ig,"\n");
if(use_html!='br') {
content = content.replace(/&lt;/g, "<");
content = content.replace(/&gt;/g, ">");
content = content.replace(/&quot;/g, '"');
content = content.replace(/&amp;/g, "&");
}
}
obj.value = content;
}
function editorGetContentTextarea(editor_sequence) {
var obj = xGetElementById('editor_'+editor_sequence);
var use_html = xGetElementById('htm_'+editor_sequence).value;
var content = obj.value.trim();
if(use_html) {
if(use_html!='br') {
content = content.replace(/&/g, "&amp;");
content = content.replace(/</g, "&lt;");
content = content.replace(/>/g, "&gt;");
content = content.replace(/\"/g, "&quot;");
}
content = content.replace(/(\r\n|\n)/g, "<br />");
}
return content;
}

View file

@ -1 +0,0 @@
This file is not used in Rhymix.

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
This file is not used in Rhymix.

View file

@ -1,114 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<skin version="0.2">
<title xml:lang="ko">XpressEditor Skin</title>
<title xml:lang="es">XpressEditor Skin</title>
<title xml:lang="en">XpressEditor Skin</title>
<title xml:lang="vi">XpressEditor Skin</title>
<title xml:lang="jp">XpressEditorスキン</title>
<title xml:lang="zh-CN">XpressEditor皮肤</title>
<title xml:lang="zh-TW">XpressEditor面板</title>
<title xml:lang="tr">XpressEditor Dış Görünümü</title>
<description xml:lang="ko">
XpressEditor based on SmartEditor Basic by NAVER
</description>
<description xml:lang="en">
XpressEditor based on SmartEditor Basic by NAVER
</description>
<description xml:lang="vi">
XpressEditor dựa trên SmartEditor cơ bản, được tạo bởi NAVER
</description>
<description xml:lang="es">
XpressEditor based on SmartEditor Basic by NAVER
</description>
<description xml:lang="jp">
XpressEditor based on SmartEditor Basic by NAVER
</description>
<description xml:lang="zh-CN">
XpressEditor based on SmartEditor Basic by NAVER
</description>
<description xml:lang="zh-TW">
XpressEditor based on SmartEditor Basic by NAVER
</description>
<description xml:lang="tr">
XpressEditor, SmartEditor 'e dayanmaktadır.
</description>
<version>1.7</version>
<date>2013-11-27</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NAVER</name>
<name xml:lang="es">NAVER</name>
<name xml:lang="en">NAVER</name>
<name xml:lang="vi">NAVER</name>
<name xml:lang="jp">NAVER</name>
<name xml:lang="zh-CN">NAVER</name>
<name xml:lang="zh-TW">NAVER</name>
<name xml:lang="tr">NAVER</name>
</author>
<colorset>
<color name="white">
<title xml:lang="ko">하얀색 위지윅(기본)</title>
<title xml:lang="jp">白 WYSIWYGデフォルト</title>
<title xml:lang="zh-CN">白色 WYSIWYG默认</title>
<title xml:lang="en">White WYSIWYG(default)</title>
<title xml:lang="vi">White WYSIWYG(Mặc định)</title>
<title xml:lang="es">Blanco WYSIWYG(por defecto)</title>
<title xml:lang="zh-TW">白色 WYSIWYG(預設)</title>
<title xml:lang="tr">Beyaz WYSIWYG(varsayılan)</title>
</color>
<color name="black">
<title xml:lang="ko">검은색 위지윅</title>
<title xml:lang="jp">黒 WYSIWYG</title>
<title xml:lang="en">Black WYSIWYG</title>
<title xml:lang="vi">Black WYSIWYG</title>
<title xml:lang="ru">Черного WYSIWYG</title>
<title xml:lang="es">Negro WYSIWYG</title>
<title xml:lang="zh-CN">黑色 WYSIWYG</title>
<title xml:lang="zh-TW">黑色 WYSIWYG</title>
<title xml:lang="tr">Siyah WYSIWYG</title>
</color>
<color name="white_text_usehtml">
<title xml:lang="ko">하얀색 텍스트(HTML 사용)</title>
<title xml:lang="jp">白色テキスト(HTMLタグを使う)</title>
<title xml:lang="en">White Text(Use HTML)</title>
<title xml:lang="vi">White Text(Sử dụng HTML)</title>
<title xml:lang="ru">White Text(Use HTML)</title>
<title xml:lang="es">Editor de texto en blanco (Uso de HTML)</title>
<title xml:lang="zh-CN">白色文本编辑器(使用HTML不自动换行)</title>
<title xml:lang="zh-TW">白色文字編輯器(使用HTML不自動換行)</title>
<title xml:lang="tr">Beyaz Metin Editörü(HTML Kullan)</title>
</color>
<color name="black_text_usehtml">
<title xml:lang="ko">검은색 텍스트(HTML 사용)</title>
<title xml:lang="jp">黒色テキスト(HTMLタグを使う)</title>
<title xml:lang="en">Black Text(Use HTML)</title>
<title xml:lang="vi">Black Text(Sử dụng HTML)</title>
<title xml:lang="ru">Black Text(Use HTML)</title>
<title xml:lang="es">Editor de texto negro (Uso de HTML)</title>
<title xml:lang="zh-CN">黑色文本编辑器(使用HTML不自动换行)</title>
<title xml:lang="zh-TW">黑色文字編輯器(使用HTML不自動換行)</title>
<title xml:lang="tr">Siyah Metin Editörü(HTML kullan)</title>
</color>
<color name="white_text_nohtml">
<title xml:lang="ko">하얀색 텍스트(HTML 사용 안함)</title>
<title xml:lang="jp">白色テキスト(HTMLタグを使わない)</title>
<title xml:lang="en">White Text(No HTML)</title>
<title xml:lang="vi">White Text(Không có HTML)</title>
<title xml:lang="ru">White Text(No HTML)</title>
<title xml:lang="es">Editor de texto en blanco (no HTML)</title>
<title xml:lang="zh-CN">白色文本编辑器(不使用HTML自动换行)</title>
<title xml:lang="zh-TW">白色文字編輯器(不使用HTML自動換行)</title>
<title xml:lang="tr">Beyaz Metin Editörü(HTML yok)</title>
</color>
<color name="black_text_nohtml">
<title xml:lang="ko">검은색 텍스트(HTML 사용 안함)</title>
<title xml:lang="jp">黒色テキスト(HTMLタグを使わない)</title>
<title xml:lang="en">Black Text(No HTML)</title>
<title xml:lang="vi">Black Text(Không có HTML)</title>
<title xml:lang="ru">Black Text(No HTML)</title>
<title xml:lang="es">Editor de texto negro (no HTML)</title>
<title xml:lang="zh-CN">黑色文本编辑器(不使用HTML自动换行)</title>
<title xml:lang="zh-TW">黑色文字編輯器(不使用HTML自動換行)</title>
<title xml:lang="tr">Siyah Metin Editörü(HTML yok)</title>
</color>
</colorset>
</skin>

View file

@ -1,568 +0,0 @@
/**
* @author NAVER (developers@xpressengine.com)
* @version 0.1
* @brief 에디터 관련 스크립트
*/
/**
* 에디터 사용시 사용되는 이벤트 연결 함수 호출
**/
/**
* 에디터의 상태나 객체를 구하기 위한 함수
**/
// editor_sequence값에 해당하는 textarea object를 return
function editorGetTextArea(editor_sequence) {
return jQuery('#editor_textarea_' + editor_sequence)[0];
}
function editorGetPreviewArea(editor_sequence) {
return jQuery( '#editor_preview_' + editor_sequence )[0];
}
// editor_sequence에 해당하는 form문 구함
function editorGetForm(editor_sequence) {
var iframe_obj = editorGetIFrame(editor_sequence);
if(!iframe_obj) return;
var fo_obj = iframe_obj.parentNode;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
if(fo_obj.nodeName == 'FORM') return fo_obj;
return;
}
// 에디터의 전체 내용 return
function editorGetContent_xe(editor_sequence) {
var html = "";
if(editorMode[editor_sequence]=='html') {
var textarea_obj = editorGetTextArea(editor_sequence);
if(!textarea_obj) return "";
html = textarea_obj.value;
} else {
var iframe_obj = editorGetIFrame(editor_sequence);
if(!iframe_obj) return "";
html = jQuery(iframe_obj.contentWindow.document.body).html().replace(/^<br([^>]*)>$/i,'');
}
return html;
}
// 에디터 내의 선택된 부분의 NODE를 return
function editorGetSelectedNode(editor_sequence) {
var iframe_obj = editorGetIFrame(editor_sequence), w, range;
w = iframe_obj.contentWindow;
if(w.document.selection) {
range = w.document.selection.createRange();
return jQuery('<div />').html(range.htmlText)[0].firstChild;
} else {
range = w.getSelection().getRangeAt(0);
return jQuery('<div />').append(range.cloneContents())[0].firstChild;
}
}
/**
* editor 시작 (editor_sequence로 iframe객체를 얻어서 쓰기 모드로 전환)
**/
var _editorFontColor = [];
function editorStart(editor_sequence, primary_key, content_key, editor_height, font_color) {
if(typeof(font_color)=='undefined') font_color = '#000';
_editorFontColor[editor_sequence] = font_color;
// iframe obj를 찾음
var iframe_obj = editorGetIFrame(editor_sequence);
if(!iframe_obj) return;
jQuery(iframe_obj).css('width', '100%').parent().css('width', '100%');
// 현 에디터를 감싸고 있는 form문을 찾음
var fo_obj = editorGetForm(editor_sequence);
if(!fo_obj) return;
// fo_obj에 editor_sequence 값 지정
fo_obj.setAttribute('editor_sequence', editor_sequence);
// 모듈 연관 키 값을 세팅
editorRelKeys[editor_sequence] = [];
editorRelKeys[editor_sequence].primary = fo_obj[primary_key];
editorRelKeys[editor_sequence].content = fo_obj[content_key];
editorRelKeys[editor_sequence].func = editorGetContent_xe;
// saved document(자동저장 문서)에 대한 확인
if(typeof(fo_obj._saved_doc_title)!= "undefined") { ///<< _saved_doc_title field가 없으면 자동저장 하지 않음
var saved_title = fo_obj._saved_doc_title.value;
var saved_content = fo_obj._saved_doc_content.value;
if(saved_title || saved_content) {
// 자동저장된 문서 활용여부를 물은 후 사용하지 않는다면 자동저장된 문서 삭제
if(confirm(fo_obj._saved_doc_message.value)) {
if(typeof(fo_obj.title)!='undefined') fo_obj.title.value = saved_title;
editorRelKeys[editor_sequence].content.value = saved_content;
var param = [];
param.editor_sequence = editor_sequence;
param.primary_key = primary_key;
param.mid = current_mid;
var response_tags = new Array("error","message","editor_sequence","key","title","content","document_srl");
exec_xml('editor',"procEditorLoadSavedDocument", param, getAutoSavedSrl, response_tags);
} else {
editorRemoveSavedDoc();
}
}
}
// 대상 form의 content element에서 데이터를 구함
var content = editorRelKeys[editor_sequence].content.value;
// IE가 아니고 내용이 없으면 <br /> 추가 (FF등에서 iframe 선택시 focus를 주기 위한 꽁수)
if(!content && !xIE4Up) content = "<br />";
// IE일 경우 ctrl-Enter 안내 문구를 노출
var ieHelpObj = xGetElementById("for_ie_help_"+editor_sequence);
if(xIE4Up && ieHelpObj) {
ieHelpObj.style.display = "block";
}
// content 생성
editor_path = editor_path.replace(/^\.\//ig, '');
var contentHtml = ''+
'<!DOCTYPE html>'+
'<html><head><meta charset="utf-8"/>'+
'<style>'+
'body{font-size:.75em;line-height:1.6;font-family:Sans-serif;height:'+editor_height+'px;padding:0;margin:0;background-color:transparent;color:'+font_color+';}'+
'</style>'+
'</head><body editor_sequence="'+editor_sequence+'">'+
content+
'</body></html>'+
'';
iframe_obj.contentWindow.document.open("text/html","replace");
iframe_obj.contentWindow.document.write(contentHtml);
iframe_obj.contentWindow.document.close();
// editorMode를 기본으로 설정
editorMode[editor_sequence] = null;
// 에디터를 시작 시킴
try {
iframe_obj.contentWindow.document.designMode = 'On';
} catch(e) {
}
try {
iframe_obj.contentWindow.document.execCommand("undo", false, null);
iframe_obj.contentWindow.document.execCommand("useCSS", false, true);
} catch (e) {
}
/**
* 더블클릭이나 키눌림등의 각종 이벤트에 대해 listener 추가
* 작성시 필요한 이벤트 체크
* 이벤트의 경우 윈도우 sp1 (NT or xp sp1) 에서 iframe_obj.contentWindow.document에 대한 권한이 없기에 try 문으로 감싸서
* 에러를 무시하도록 해야 .
**/
// 위젯 감시를 위한 더블클릭 이벤트 걸기
try {
jQuery(iframe_obj.contentWindow.document)
.unbind('dblclick.widget')
.bind('dblclick.widget', editorSearchComponent);
} catch(e) {
}
// 에디터에서 키가 눌러질때마다 이벤트를 체크함 (enter키의 처리나 FF에서 alt-s등을 처리)
try {
if(xIE4Up) xAddEventListener(iframe_obj.contentWindow.document, 'keydown',editorKeyPress);
else xAddEventListener(iframe_obj.contentWindow.document, 'keypress',editorKeyPress);
} catch(e) {
}
// 자동저장 필드가 있다면 자동 저장 기능 활성화
if(typeof(fo_obj._saved_doc_title)!="undefined" ) editorEnableAutoSave(fo_obj, editor_sequence);
// 좋지는 않으나;; 스타일 변형을 막기 위해 start 할때 html이면 바꿔주자
if (xGetCookie('editor_mode') == 'html'){
iframe_obj = editorGetIFrame(editor_sequence);
if(xGetElementById('fileUploader_'+editor_sequence)) xGetElementById('fileUploader_'+editor_sequence).style.display='block';
textarea_obj = editorGetTextArea(editor_sequence);
textarea_obj.value = content;
xWidth(textarea_obj, xWidth(iframe_obj.parentNode));
xHeight(textarea_obj, xHeight(iframe_obj.parentNode));
editorMode[editor_sequence] = 'html';
if(xGetElementById('xeEditor_'+editor_sequence)) {
xGetElementById('xeEditor_'+editor_sequence).className = 'xeEditor html';
xGetElementById('use_rich_'+editor_sequence).className = '';
xGetElementById('preview_html_'+editor_sequence).className = '';
xGetElementById('use_html_'+editor_sequence).className = 'active';
}
}
}
/**
* 에디터의 세부 설정과 데이터 핸들링을 정의한 함수들
**/
/**
* 또는 마우스 이벤트 핸들링 정의 함수
**/
// 입력 키에 대한 이벤트 체크
function editorKeyPress(evt) {
var e = new xEvent(evt);
// 대상을 구함
var obj = e.target;
var body_obj = null;
if(obj.nodeName == "BODY") body_obj = obj;
else body_obj = obj.firstChild.nextSibling;
if(!body_obj) return;
// editor_sequence는 에디터의 body에 attribute로 정의되어 있음
var editor_sequence = body_obj.getAttribute("editor_sequence");
if(!editor_sequence) return;
// IE에서 enter키를 눌렀을때 P 태그 대신 BR 태그 입력
if (xIE4Up && !e.ctrlKey && !e.shiftKey && e.keyCode == 13 && !editorMode[editor_sequence]) {
var iframe_obj = editorGetIFrame(editor_sequence);
if(!iframe_obj) return;
obj = contentDocument.selection.createRange();
var contentDocument = iframe_obj.contentWindow.document;
var pTag = obj.parentElement().tagName.toLowerCase();
switch(pTag) {
case 'li' :
return;
default :
obj.pasteHTML("<br />");
break;
}
obj.select();
evt.cancelBubble = true;
evt.returnValue = false;
return;
}
// ctrl-S, alt-S 클릭시 submit하기
if( e.keyCode == 115 && (e.altKey || e.ctrlKey) ) {
// iframe 에디터를 찾음
if(!editorGetIFrame(editor_sequence)) return;
// 대상 form을 찾음
var fo_obj = editorGetForm(editor_sequence);
if(!fo_obj) return;
// 데이터 동기화
editorRelKeys[editor_sequence].content.value = editorGetContent(editor_sequence);
// form문 전송
if(fo_obj.onsubmit) fo_obj.onsubmit();
// 이벤트 중단
evt.cancelBubble = true;
evt.returnValue = false;
xPreventDefault(evt);
xStopPropagation(evt);
return;
}
// ctrl-b, i, u, s 키에 대한 처리 (파이어폭스에서도 에디터 상태에서 단축키 쓰도록)
if (e.ctrlKey) {
// iframe 에디터를 찾음
if(!editorGetIFrame(editor_sequence)) return;
// html 에디터 모드일 경우 이벤트 취소 시킴
if(editorMode[editor_sequence]) {
evt.cancelBubble = true;
evt.returnValue = false;
xPreventDefault(evt);
xStopPropagation(evt);
return;
}
switch(e.keyCode) {
// ctrl+1~6
case 49 :
case 50 :
case 51 :
case 52 :
case 53 :
case 54 :
editorDo('formatblock',"<H"+(e.keyCode-48)+">",e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
// ctrl+7
case 55 :
editorDo('formatblock',"<P>",e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
// ie에서 ctrlKey + enter일 경우 P 태그 입력
case 13 :
if(xIE4Up) {
if(e.target.parentElement.document.designMode!="On") return;
obj = e.target.parentElement.document.selection.createRange();
obj.pasteHTML('<P>');
obj.select();
evt.cancelBubble = true;
evt.returnValue = false;
return;
}
break;
// bold
case 98 :
editorDo('Bold',null,e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
// italic
case 105 :
editorDo('Italic',null,e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
// underline
case 117 :
editorDo('Underline',null,e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
//RemoveFormat
case 100 :
editorDo('RemoveFormat',null,e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
// strike
/*
case 83 :
case 115 :
editorDo('StrikeThrough',null,e.target);
xPreventDefault(evt);
xStopPropagation(evt);
break;
*/
}
}
}
// 편집 기능 실행
function editorDo(command, value, target) {
var doc = null;
// target이 object인지 editor_sequence인지에 따라 document를 구함
if(typeof(target)=="object") {
if(xIE4Up) doc = target.parentElement.document;
else doc = target.parentNode;
} else {
var iframe_obj = editorGetIFrame(target);
doc = iframe_obj.contentWindow.document;
}
var editor_sequence = doc.body.getAttribute('editor_sequence');
if(editorMode[editor_sequence]) return;
// 포커스
if(typeof(target)=="object") target.focus();
else editorFocus(target);
// 실행
doc.execCommand(command, false, value);
// 포커스
if(typeof(target)=="object") target.focus();
else editorFocus(target);
}
// 폰트를 변경
function editorChangeFontName(obj,srl) {
var value = obj.options[obj.selectedIndex].value;
if(!value) return;
editorDo('FontName',value,srl);
obj.selectedIndex = 0;
}
function editorChangeFontSize(obj,srl) {
var value = obj.options[obj.selectedIndex].value;
if(!value) return;
editorDo('FontSize',value,srl);
obj.selectedIndex = 0;
}
function editorUnDo(obj,srl) {
editorDo('undo','',srl);
obj.selectedIndex = 0;
}
function editorReDo(obj,srl) {
editorDo('redo','',srl);
obj.selectedIndex = 0;
}
function editorChangeHeader(obj,srl) {
var value = obj.options[obj.selectedIndex].value;
if(!value) return;
value = "<"+value+">";
editorDo('formatblock',value,srl);
obj.selectedIndex = 0;
}
/**
* HTML 편집 기능 활성/비활성
**/
function editorChangeMode(mode, editor_sequence) {
/* jshint -W041 */
if(mode == 'html' || mode == ''){
var expire = new Date();
expire.setTime(expire.getTime()+ (7000 * 24 * 3600000));
xSetCookie('editor_mode', mode, expire);
}
var iframe_obj = editorGetIFrame(editor_sequence);
if(!iframe_obj) return;
var textarea_obj = editorGetTextArea(editor_sequence);
var preview_obj = editorGetPreviewArea(editor_sequence);
var contentDocument = iframe_obj.contentWindow.document;
var html = null;
if(editorMode[editor_sequence]=='html') {
html = textarea_obj.value;
contentDocument.body.innerHTML = textarea_obj.value;
} else if (editorMode[editor_sequence]=='preview') {
// html = xInnerHtml(preview_obj);
html = textarea_obj.value;
preview_obj.contentWindow.document.body.innerHTML = '';
// xAddEventListener(xGetElementById('editor_preview_'+editor_sequence), 'load', function(){setPreviewHeight(editor_sequence)});
} else {
html = contentDocument.body.innerHTML;
textarea_obj.value = html;
html = html.replace(/<br>/ig,"<br />\n");
html = html.replace(/<br \/>\n\n/ig,"<br />\n");
}
// html 편집 사용시
if(mode == 'html' && textarea_obj) {
preview_obj.style.display='none';
if(xGetElementById('fileUploader_'+editor_sequence)) xGetElementById('fileUploader_'+editor_sequence).style.display='block';
textarea_obj.value = html;
xWidth(textarea_obj, xWidth(iframe_obj.parentNode));
xHeight(textarea_obj, xHeight(iframe_obj.parentNode));
editorMode[editor_sequence] = 'html';
if(xGetElementById('xeEditor_'+editor_sequence)) {
xGetElementById('xeEditor_'+editor_sequence).className = 'xeEditor html';
xGetElementById('use_rich_'+editor_sequence).className = '';
xGetElementById('preview_html_'+editor_sequence).className = '';
xGetElementById('use_html_'+editor_sequence).className = 'active';
}
// 미리보기
} else if(mode == 'preview' && preview_obj) {
preview_obj.style.display='';
if(xGetElementById('fileUploader_'+editor_sequence)) xGetElementById('fileUploader_'+editor_sequence).style.display='none';
var fo_obj = xGetElementById("preview_form");
if(!fo_obj) {
fo_obj = xCreateElement('form');
fo_obj.id = "preview_form";
fo_obj.method = "post";
fo_obj.action = request_uri;
fo_obj.target = "editor_preview_"+editor_sequence;
xInnerHtml(fo_obj,'<input type="hidden" name="module" value="editor" /><input type="hidden" name="editor_sequence" value="'+editor_sequence+'" /><input type="hidden" name="act" value="dispEditorPreview" /><input type="hidden" name="content" />');
document.body.appendChild(fo_obj);
}
fo_obj.content.value = html;
fo_obj.submit();
xWidth(preview_obj, xWidth(iframe_obj.parentNode));
editorMode[editor_sequence] = 'preview';
if(xGetElementById('xeEditor_'+editor_sequence)) {
xGetElementById('xeEditor_'+editor_sequence).className = 'xeEditor preview';
xGetElementById('use_rich_'+editor_sequence).className = '';
xGetElementById('preview_html_'+editor_sequence).className = 'active';
if(xGetElementById('use_html_'+editor_sequence)) xGetElementById('use_html_'+editor_sequence).className = '';
}
// 위지윅 모드 사용시
} else {
preview_obj.style.display='none';
if(xGetElementById('fileUploader_'+editor_sequence)) xGetElementById('fileUploader_'+editor_sequence).style.display='block';
contentDocument.body.innerHTML = html;
editorMode[editor_sequence] = null;
if(xGetElementById('xeEditor_'+editor_sequence)) {
xGetElementById('xeEditor_'+editor_sequence).className = 'xeEditor rich';
xGetElementById('use_rich_'+editor_sequence).className = 'active';
xGetElementById('preview_html_'+editor_sequence).className = '';
if(xGetElementById('use_html_'+editor_sequence)) xGetElementById('use_html_'+editor_sequence).className = '';
}
}
}
// Editor Info Close
function closeEditorInfo(editor_sequence) {
xGetElementById('editorInfo_'+editor_sequence).style.display='none';
var expire = new Date();
expire.setTime(expire.getTime()+ (7000 * 24 * 3600000));
xSetCookie('EditorInfo', '1', expire);
}
function showEditorHelp(e,editor_sequence){
jQuery('#helpList_'+editor_sequence).toggleClass('open');
}
function showEditorExtension(evt,editor_sequence){
var oid = '#editorExtension_'+editor_sequence;
var e = new xEvent(evt);
if(jQuery(oid).hasClass('extension2')){
jQuery(oid).addClass('open');
if(e.pageX <= xWidth('editor_component_'+editor_sequence)){
jQuery('#editor_component_'+editor_sequence).css('right','auto').css('left', 0);
}else{
jQuery('#editor_component_'+editor_sequence).css('right', 0).css('left', 'auto');
}
}else{
jQuery(oid).attr('class', 'extension2');
}
}
function showPreviewContent(editor_sequence) {
if(typeof(editor_sequence)=='undefined') return;
if(typeof(_editorFontColor[editor_sequence])=='undefined') return;
var preview_obj = editorGetPreviewArea(editor_sequence);
preview_obj.contentWindow.document.body.style.color = _editorFontColor[editor_sequence];
}
function setPreviewHeight(editor_sequence){
var h = xGetElementById('editor_preview_'+editor_sequence).contentWindow.document.body.scrollHeight;
if(h < 400) h=400;
xHeight('editor_preview_'+editor_sequence,h+20);
}
function getAutoSavedSrl(ret_obj, response_tags, c) {
var editor_sequence = ret_obj.editor_sequence;
var primary_key = ret_obj.key;
var fo_obj = editorGetForm(editor_sequence);
fo_obj[primary_key].value = ret_obj.document_srl;
if(uploadSettingObj[editor_sequence]) editorUploadInit(uploadSettingObj[editor_sequence], true);
}

View file

@ -1 +0,0 @@
This file is not used in Rhymix.

View file

@ -1,980 +0,0 @@
/**
* SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
*
* mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/
*
* SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
*/
/* ******************* */
/* Constructor & Init */
/* ******************* */
var SWFUpload;
if (SWFUpload == undefined) {
SWFUpload = function (settings) {
this.initSWFUpload(settings);
};
}
SWFUpload.prototype.initSWFUpload = function (settings) {
try {
this.customSettings = {}; // A container where developers can place their own settings associated with this instance.
this.settings = settings;
this.eventQueue = [];
this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
this.movieElement = null;
// Setup global control tracking
SWFUpload.instances[this.movieName] = this;
// Load the settings. Load the Flash movie.
this.initSettings();
this.loadFlash();
this.displayDebugInfo();
} catch (ex) {
delete SWFUpload.instances[this.movieName];
throw ex;
}
};
/* *************** */
/* Static Members */
/* *************** */
SWFUpload.instances = {};
SWFUpload.movieCount = 0;
SWFUpload.version = "2.2.0 2009-03-25";
SWFUpload.QUEUE_ERROR = {
QUEUE_LIMIT_EXCEEDED : -100,
FILE_EXCEEDS_SIZE_LIMIT : -110,
ZERO_BYTE_FILE : -120,
INVALID_FILETYPE : -130
};
SWFUpload.UPLOAD_ERROR = {
HTTP_ERROR : -200,
MISSING_UPLOAD_URL : -210,
IO_ERROR : -220,
SECURITY_ERROR : -230,
UPLOAD_LIMIT_EXCEEDED : -240,
UPLOAD_FAILED : -250,
SPECIFIED_FILE_ID_NOT_FOUND : -260,
FILE_VALIDATION_FAILED : -270,
FILE_CANCELLED : -280,
UPLOAD_STOPPED : -290
};
SWFUpload.FILE_STATUS = {
QUEUED : -1,
IN_PROGRESS : -2,
ERROR : -3,
COMPLETE : -4,
CANCELLED : -5
};
SWFUpload.BUTTON_ACTION = {
SELECT_FILE : -100,
SELECT_FILES : -110,
START_UPLOAD : -120
};
SWFUpload.CURSOR = {
ARROW : -1,
HAND : -2
};
SWFUpload.WINDOW_MODE = {
WINDOW : "window",
TRANSPARENT : "transparent",
OPAQUE : "opaque"
};
// Private: takes a URL, determines if it is relative and converts to an absolute URL
// using the current site. Only processes the URL if it can, otherwise returns the URL untouched
SWFUpload.completeURL = function(url) {
if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) {
return url;
}
var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
var indexSlash = window.location.pathname.lastIndexOf("/");
if (indexSlash <= 0) {
path = "/";
} else {
path = window.location.pathname.substr(0, indexSlash) + "/";
}
return /*currentURL +*/ path + url;
};
/* ******************** */
/* Instance Members */
/* ******************** */
// Private: initSettings ensures that all the
// settings are set, getting a default value if one was not assigned.
SWFUpload.prototype.initSettings = function () {
this.ensureDefault = function (settingName, defaultValue) {
this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
};
// Upload backend settings
this.ensureDefault("upload_url", "");
this.ensureDefault("preserve_relative_urls", false);
this.ensureDefault("file_post_name", "Filedata");
this.ensureDefault("post_params", {});
this.ensureDefault("use_query_string", false);
this.ensureDefault("requeue_on_error", false);
this.ensureDefault("http_success", []);
this.ensureDefault("assume_success_timeout", 0);
// File Settings
this.ensureDefault("file_types", "*.*");
this.ensureDefault("file_types_description", "All Files");
this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited"
this.ensureDefault("file_upload_limit", 0);
this.ensureDefault("file_queue_limit", 0);
// Flash Settings
this.ensureDefault("flash_url", "swfupload.swf");
this.ensureDefault("prevent_swf_caching", true);
// Button Settings
this.ensureDefault("button_image_url", "");
this.ensureDefault("button_width", 1);
this.ensureDefault("button_height", 1);
this.ensureDefault("button_text", "");
this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;");
this.ensureDefault("button_text_top_padding", 0);
this.ensureDefault("button_text_left_padding", 0);
this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
this.ensureDefault("button_disabled", false);
this.ensureDefault("button_placeholder_id", "");
this.ensureDefault("button_placeholder", null);
this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
// Debug Settings
this.ensureDefault("debug", false);
this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API
// Event Handlers
this.settings.return_upload_start_handler = this.returnUploadStart;
this.ensureDefault("swfupload_loaded_handler", null);
this.ensureDefault("file_dialog_start_handler", null);
this.ensureDefault("file_queued_handler", null);
this.ensureDefault("file_queue_error_handler", null);
this.ensureDefault("file_dialog_complete_handler", null);
this.ensureDefault("upload_start_handler", null);
this.ensureDefault("upload_progress_handler", null);
this.ensureDefault("upload_error_handler", null);
this.ensureDefault("upload_success_handler", null);
this.ensureDefault("upload_complete_handler", null);
this.ensureDefault("debug_handler", this.debugMessage);
this.ensureDefault("custom_settings", {});
// Other settings
this.customSettings = this.settings.custom_settings;
// Update the flash url if needed
if (!!this.settings.prevent_swf_caching) {
this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
}
if (!this.settings.preserve_relative_urls) {
//this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it
this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
}
delete this.ensureDefault;
};
// Private: loadFlash replaces the button_placeholder element with the flash movie.
SWFUpload.prototype.loadFlash = function () {
var targetElement, tempParent;
// Make sure an element with the ID we are going to use doesn't already exist
if (document.getElementById(this.movieName) !== null) {
throw "ID " + this.movieName + " is already in use. The Flash Object could not be added";
}
// Get the element where we will be placing the flash movie
targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;
if (targetElement == undefined) {
throw "Could not find the placeholder element: " + this.settings.button_placeholder_id;
}
// Append the container and load the flash
tempParent = document.createElement("div");
tempParent.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);
// Fix IE Flash/Form bug
if (window[this.movieName] == undefined) {
window[this.movieName] = this.getMovieElement();
}
};
// Private: getFlashHTML generates the object tag needed to embed the flash in to the document
SWFUpload.prototype.getFlashHTML = function () {
// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
'<param name="wmode" value="', this.settings.button_window_mode, '" />',
'<param name="movie" value="', this.settings.flash_url, '" />',
'<param name="quality" value="high" />',
'<param name="menu" value="false" />',
'<param name="allowScriptAccess" value="always" />',
'<param name="flashvars" value="' + this.getFlashVars() + '" />',
'</object>'].join("");
};
// Private: getFlashVars builds the parameter string that will be passed
// to flash in the flashvars param.
SWFUpload.prototype.getFlashVars = function () {
// Build a string from the post param object
var paramString = this.buildParamString();
var httpSuccessString = this.settings.http_success.join(",");
// Build the parameter string
return ["movieName=", encodeURIComponent(this.movieName),
"&amp;uploadURL=", encodeURIComponent(this.settings.upload_url),
"&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string),
"&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error),
"&amp;httpSuccess=", encodeURIComponent(httpSuccessString),
"&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout),
"&amp;params=", encodeURIComponent(paramString),
"&amp;filePostName=", encodeURIComponent(this.settings.file_post_name),
"&amp;fileTypes=", encodeURIComponent(this.settings.file_types),
"&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description),
"&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit),
"&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit),
"&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit),
"&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled),
"&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url),
"&amp;buttonWidth=", encodeURIComponent(this.settings.button_width),
"&amp;buttonHeight=", encodeURIComponent(this.settings.button_height),
"&amp;buttonText=", encodeURIComponent(this.settings.button_text),
"&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding),
"&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding),
"&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style),
"&amp;buttonAction=", encodeURIComponent(this.settings.button_action),
"&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled),
"&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)
].join("");
};
// Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload
// The element is cached after the first lookup
SWFUpload.prototype.getMovieElement = function () {
if (this.movieElement == undefined) {
this.movieElement = document.getElementById(this.movieName);
}
if (this.movieElement === null) {
throw "Could not find Flash element";
}
return this.movieElement;
};
// Private: buildParamString takes the name/value pairs in the post_params setting object
// and joins them up in to a string formatted "name=value&amp;name=value"
SWFUpload.prototype.buildParamString = function () {
var postParams = this.settings.post_params;
var paramStringPairs = [];
if (typeof(postParams) === "object") {
for (var name in postParams) {
if (postParams.hasOwnProperty(name)) {
paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString()));
}
}
}
return paramStringPairs.join("&amp;");
};
// Public: Used to remove a SWFUpload instance from the page. This method strives to remove
// all references to the SWF, and other objects so memory is properly freed.
// Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state.
// Credits: Major improvements provided by steffen
SWFUpload.prototype.destroy = function () {
try {
// Make sure Flash is done before we try to remove it
this.cancelUpload(null, false);
// Remove the SWFUpload DOM nodes
var movieElement = null;
movieElement = this.getMovieElement();
if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
// Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround)
for (var i in movieElement) {
try {
if (typeof(movieElement[i]) === "function") {
movieElement[i] = null;
}
} catch (ex1) {}
}
// Remove the Movie Element from the page
try {
movieElement.parentNode.removeChild(movieElement);
} catch (ex) {}
}
// Remove IE form fix reference
window[this.movieName] = null;
// Destroy other references
SWFUpload.instances[this.movieName] = null;
delete SWFUpload.instances[this.movieName];
this.movieElement = null;
this.settings = null;
this.customSettings = null;
this.eventQueue = null;
this.movieName = null;
return true;
} catch (ex2) {
return false;
}
};
// Public: displayDebugInfo prints out settings and configuration
// information about this SWFUpload instance.
// This function (and any references to it) can be deleted when placing
// SWFUpload in production.
SWFUpload.prototype.displayDebugInfo = function () {
this.debug(
[
"---SWFUpload Instance Info---\n",
"Version: ", SWFUpload.version, "\n",
"Movie Name: ", this.movieName, "\n",
"Settings:\n",
"\t", "upload_url: ", this.settings.upload_url, "\n",
"\t", "flash_url: ", this.settings.flash_url, "\n",
"\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n",
"\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n",
"\t", "http_success: ", this.settings.http_success.join(", "), "\n",
"\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n",
"\t", "file_post_name: ", this.settings.file_post_name, "\n",
"\t", "post_params: ", this.settings.post_params.toString(), "\n",
"\t", "file_types: ", this.settings.file_types, "\n",
"\t", "file_types_description: ", this.settings.file_types_description, "\n",
"\t", "file_size_limit: ", this.settings.file_size_limit, "\n",
"\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n",
"\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n",
"\t", "debug: ", this.settings.debug.toString(), "\n",
"\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n",
"\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n",
"\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n",
"\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n",
"\t", "button_width: ", this.settings.button_width.toString(), "\n",
"\t", "button_height: ", this.settings.button_height.toString(), "\n",
"\t", "button_text: ", this.settings.button_text.toString(), "\n",
"\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n",
"\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n",
"\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n",
"\t", "button_action: ", this.settings.button_action.toString(), "\n",
"\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n",
"\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n",
"Event Handlers:\n",
"\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n",
"\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n",
"\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n",
"\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n",
"\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n",
"\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n",
"\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n",
"\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n",
"\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n",
"\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n"
].join("")
);
};
/* Note: addSetting and getSetting are no longer used by SWFUpload but are included
the maintain v2 API compatibility
*/
// Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used.
SWFUpload.prototype.addSetting = function (name, value, default_value) {
if (value == undefined) {
return (this.settings[name] = default_value);
} else {
return (this.settings[name] = value);
}
};
// Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found.
SWFUpload.prototype.getSetting = function (name) {
if (this.settings[name] != undefined) {
return this.settings[name];
}
return "";
};
// Private: callFlash handles function calls made to the Flash element.
// Calls are made with a setTimeout for some functions to work around
// bugs in the ExternalInterface library.
SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
argumentArray = argumentArray || [];
var movieElement = this.getMovieElement();
var returnValue, returnString;
// Flash's method if calling ExternalInterface methods (code adapted from MooTools).
try {
returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>');
returnValue = eval(returnString);
} catch (ex) {
throw "Call to " + functionName + " failed";
}
// Unescape file post param values
if (returnValue != undefined && typeof returnValue.post === "object") {
returnValue = this.unescapeFilePostParams(returnValue);
}
return returnValue;
};
/* *****************************
-- Flash control methods --
Your UI should use these
to operate SWFUpload
***************************** */
// WARNING: this function does not work in Flash Player 10
// Public: selectFile causes a File Selection Dialog window to appear. This
// dialog only allows 1 file to be selected.
SWFUpload.prototype.selectFile = function () {
this.callFlash("SelectFile");
};
// WARNING: this function does not work in Flash Player 10
// Public: selectFiles causes a File Selection Dialog window to appear/ This
// dialog allows the user to select any number of files
// Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names.
// If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around
// for this bug.
SWFUpload.prototype.selectFiles = function () {
this.callFlash("SelectFiles");
};
// Public: startUpload starts uploading the first file in the queue unless
// the optional parameter 'fileID' specifies the ID
SWFUpload.prototype.startUpload = function (fileID) {
this.callFlash("StartUpload", [fileID]);
};
// Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index.
// If you do not specify a fileID the current uploading file or first file in the queue is cancelled.
// If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter.
SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) {
if (triggerErrorEvent !== false) {
triggerErrorEvent = true;
}
this.callFlash("CancelUpload", [fileID, triggerErrorEvent]);
};
// Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
// If nothing is currently uploading then nothing happens.
SWFUpload.prototype.stopUpload = function () {
this.callFlash("StopUpload");
};
/* ************************
* Settings methods
* These methods change the SWFUpload settings.
* SWFUpload settings should not be changed directly on the settings object
* since many of the settings need to be passed to Flash in order to take
* effect.
* *********************** */
// Public: getStats gets the file statistics object.
SWFUpload.prototype.getStats = function () {
return this.callFlash("GetStats");
};
// Public: setStats changes the SWFUpload statistics. You shouldn't need to
// change the statistics but you can. Changing the statistics does not
// affect SWFUpload accept for the successful_uploads count which is used
// by the upload_limit setting to determine how many files the user may upload.
SWFUpload.prototype.setStats = function (statsObject) {
this.callFlash("SetStats", [statsObject]);
};
// Public: getFile retrieves a File object by ID or Index. If the file is
// not found then 'null' is returned.
SWFUpload.prototype.getFile = function (fileID) {
if (typeof(fileID) === "number") {
return this.callFlash("GetFileByIndex", [fileID]);
} else {
return this.callFlash("GetFile", [fileID]);
}
};
// Public: addFileParam sets a name/value pair that will be posted with the
// file specified by the Files ID. If the name already exists then the
// exiting value will be overwritten.
SWFUpload.prototype.addFileParam = function (fileID, name, value) {
return this.callFlash("AddFileParam", [fileID, name, value]);
};
// Public: removeFileParam removes a previously set (by addFileParam) name/value
// pair from the specified file.
SWFUpload.prototype.removeFileParam = function (fileID, name) {
this.callFlash("RemoveFileParam", [fileID, name]);
};
// Public: setUploadUrl changes the upload_url setting.
SWFUpload.prototype.setUploadURL = function (url) {
this.settings.upload_url = url.toString();
this.callFlash("SetUploadURL", [url]);
};
// Public: setPostParams changes the post_params setting
SWFUpload.prototype.setPostParams = function (paramsObject) {
this.settings.post_params = paramsObject;
this.callFlash("SetPostParams", [paramsObject]);
};
// Public: addPostParam adds post name/value pair. Each name can have only one value.
SWFUpload.prototype.addPostParam = function (name, value) {
this.settings.post_params[name] = value;
this.callFlash("SetPostParams", [this.settings.post_params]);
};
// Public: removePostParam deletes post name/value pair.
SWFUpload.prototype.removePostParam = function (name) {
delete this.settings.post_params[name];
this.callFlash("SetPostParams", [this.settings.post_params]);
};
// Public: setFileTypes changes the file_types setting and the file_types_description setting
SWFUpload.prototype.setFileTypes = function (types, description) {
this.settings.file_types = types;
this.settings.file_types_description = description;
this.callFlash("SetFileTypes", [types, description]);
};
// Public: setFileSizeLimit changes the file_size_limit setting
SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) {
this.settings.file_size_limit = fileSizeLimit;
this.callFlash("SetFileSizeLimit", [fileSizeLimit]);
};
// Public: setFileUploadLimit changes the file_upload_limit setting
SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) {
this.settings.file_upload_limit = fileUploadLimit;
this.callFlash("SetFileUploadLimit", [fileUploadLimit]);
};
// Public: setFileQueueLimit changes the file_queue_limit setting
SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) {
this.settings.file_queue_limit = fileQueueLimit;
this.callFlash("SetFileQueueLimit", [fileQueueLimit]);
};
// Public: setFilePostName changes the file_post_name setting
SWFUpload.prototype.setFilePostName = function (filePostName) {
this.settings.file_post_name = filePostName;
this.callFlash("SetFilePostName", [filePostName]);
};
// Public: setUseQueryString changes the use_query_string setting
SWFUpload.prototype.setUseQueryString = function (useQueryString) {
this.settings.use_query_string = useQueryString;
this.callFlash("SetUseQueryString", [useQueryString]);
};
// Public: setRequeueOnError changes the requeue_on_error setting
SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
this.settings.requeue_on_error = requeueOnError;
this.callFlash("SetRequeueOnError", [requeueOnError]);
};
// Public: setHTTPSuccess changes the http_success setting
SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) {
if (typeof http_status_codes === "string") {
http_status_codes = http_status_codes.replace(" ", "").split(",");
}
this.settings.http_success = http_status_codes;
this.callFlash("SetHTTPSuccess", [http_status_codes]);
};
// Public: setHTTPSuccess changes the http_success setting
SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) {
this.settings.assume_success_timeout = timeout_seconds;
this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]);
};
// Public: setDebugEnabled changes the debug_enabled setting
SWFUpload.prototype.setDebugEnabled = function (debugEnabled) {
this.settings.debug_enabled = debugEnabled;
this.callFlash("SetDebugEnabled", [debugEnabled]);
};
// Public: setButtonImageURL loads a button image sprite
SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) {
if (buttonImageURL == undefined) {
buttonImageURL = "";
}
this.settings.button_image_url = buttonImageURL;
this.callFlash("SetButtonImageURL", [buttonImageURL]);
};
// Public: setButtonDimensions resizes the Flash Movie and button
SWFUpload.prototype.setButtonDimensions = function (width, height) {
this.settings.button_width = width;
this.settings.button_height = height;
var movie = this.getMovieElement();
if (movie != undefined) {
movie.style.width = width + "px";
movie.style.height = height + "px";
}
this.callFlash("SetButtonDimensions", [width, height]);
};
// Public: setButtonText Changes the text overlaid on the button
SWFUpload.prototype.setButtonText = function (html) {
this.settings.button_text = html;
this.callFlash("SetButtonText", [html]);
};
// Public: setButtonTextPadding changes the top and left padding of the text overlay
SWFUpload.prototype.setButtonTextPadding = function (left, top) {
this.settings.button_text_top_padding = top;
this.settings.button_text_left_padding = left;
this.callFlash("SetButtonTextPadding", [left, top]);
};
// Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button
SWFUpload.prototype.setButtonTextStyle = function (css) {
this.settings.button_text_style = css;
this.callFlash("SetButtonTextStyle", [css]);
};
// Public: setButtonDisabled disables/enables the button
SWFUpload.prototype.setButtonDisabled = function (isDisabled) {
this.settings.button_disabled = isDisabled;
this.callFlash("SetButtonDisabled", [isDisabled]);
};
// Public: setButtonAction sets the action that occurs when the button is clicked
SWFUpload.prototype.setButtonAction = function (buttonAction) {
this.settings.button_action = buttonAction;
this.callFlash("SetButtonAction", [buttonAction]);
};
// Public: setButtonCursor changes the mouse cursor displayed when hovering over the button
SWFUpload.prototype.setButtonCursor = function (cursor) {
this.settings.button_cursor = cursor;
this.callFlash("SetButtonCursor", [cursor]);
};
/* *******************************
Flash Event Interfaces
These functions are used by Flash to trigger the various
events.
All these functions a Private.
Because the ExternalInterface library is buggy the event calls
are added to a queue and the queue then executed by a setTimeout.
This ensures that events are executed in a determinate order and that
the ExternalInterface bugs are avoided.
******************************* */
SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
// Warning: Don't call this.debug inside here or you'll create an infinite loop
if (argumentArray == undefined) {
argumentArray = [];
} else if (!(argumentArray instanceof Array)) {
argumentArray = [argumentArray];
}
var self = this;
if (typeof this.settings[handlerName] === "function") {
// Queue the event
this.eventQueue.push(function () {
this.settings[handlerName].apply(this, argumentArray);
});
// Execute the next queued event
setTimeout(function () {
self.executeNextEvent();
}, 0);
} else if (this.settings[handlerName] !== null) {
throw "Event handler " + handlerName + " is unknown or is not a function";
}
};
// Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout
// we must queue them in order to garentee that they are executed in order.
SWFUpload.prototype.executeNextEvent = function () {
// Warning: Don't call this.debug inside here or you'll create an infinite loop
var f = this.eventQueue ? this.eventQueue.shift() : null;
if (typeof(f) === "function") {
f.apply(this);
}
};
// Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have
// properties that contain characters that are not valid for JavaScript identifiers. To work around this
// the Flash Component escapes the parameter names and we must unescape again before passing them along.
SWFUpload.prototype.unescapeFilePostParams = function (file) {
var reg = /[$]([0-9a-f]{4})/i;
var unescapedPost = {};
var uk;
if (file != undefined) {
for (var k in file.post) {
if (file.post.hasOwnProperty(k)) {
uk = k;
var match;
while ((match = reg.exec(uk)) !== null) {
uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16)));
}
unescapedPost[uk] = file.post[k];
}
}
file.post = unescapedPost;
}
return file;
};
// Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working)
SWFUpload.prototype.testExternalInterface = function () {
try {
return this.callFlash("TestExternalInterface");
} catch (ex) {
return false;
}
};
// Private: This event is called by Flash when it has finished loading. Don't modify this.
// Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded.
SWFUpload.prototype.flashReady = function () {
// Check that the movie element is loaded correctly with its ExternalInterface methods defined
var movieElement = this.getMovieElement();
if (!movieElement) {
this.debug("Flash called back ready but the flash movie can't be found.");
return;
}
this.cleanUp(movieElement);
this.queueEvent("swfupload_loaded_handler");
};
// Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE.
// This function is called by Flash each time the ExternalInterface functions are created.
SWFUpload.prototype.cleanUp = function (movieElement) {
// Pro-actively unhook all the Flash functions
try {
if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
for (var key in movieElement) {
try {
if (typeof(movieElement[key]) === "function") {
movieElement[key] = null;
}
} catch (ex) {
}
}
}
} catch (ex1) {
}
// Fix Flashes own cleanup code so if the SWFMovie was removed from the page
// it doesn't display errors.
window["__flash__removeCallback"] = function (instance, name) {
try {
if (instance) {
instance[name] = null;
}
} catch (flashEx) {
}
};
};
/* This is a chance to do something before the browse window opens */
SWFUpload.prototype.fileDialogStart = function () {
this.queueEvent("file_dialog_start_handler");
};
/* Called when a file is successfully added to the queue. */
SWFUpload.prototype.fileQueued = function (file) {
file = this.unescapeFilePostParams(file);
this.queueEvent("file_queued_handler", file);
};
/* Handle errors that occur when an attempt to queue a file fails. */
SWFUpload.prototype.fileQueueError = function (file, errorCode, message) {
file = this.unescapeFilePostParams(file);
this.queueEvent("file_queue_error_handler", [file, errorCode, message]);
};
/* Called after the file dialog has closed and the selected files have been queued.
You could call startUpload here if you want the queued files to begin uploading immediately. */
SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) {
this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]);
};
SWFUpload.prototype.uploadStart = function (file) {
file = this.unescapeFilePostParams(file);
this.queueEvent("return_upload_start_handler", file);
};
SWFUpload.prototype.returnUploadStart = function (file) {
var returnValue;
if (typeof this.settings.upload_start_handler === "function") {
file = this.unescapeFilePostParams(file);
returnValue = this.settings.upload_start_handler.call(this, file);
} else if (this.settings.upload_start_handler != undefined) {
throw "upload_start_handler must be a function";
}
// Convert undefined to true so if nothing is returned from the upload_start_handler it is
// interpretted as 'true'.
if (returnValue === undefined) {
returnValue = true;
}
returnValue = !!returnValue;
this.callFlash("ReturnUploadStart", [returnValue]);
};
SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) {
file = this.unescapeFilePostParams(file);
this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]);
};
SWFUpload.prototype.uploadError = function (file, errorCode, message) {
file = this.unescapeFilePostParams(file);
this.queueEvent("upload_error_handler", [file, errorCode, message]);
};
SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) {
file = this.unescapeFilePostParams(file);
this.queueEvent("upload_success_handler", [file, serverData, responseReceived]);
};
SWFUpload.prototype.uploadComplete = function (file) {
file = this.unescapeFilePostParams(file);
this.queueEvent("upload_complete_handler", file);
};
/* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the
internal debug console. You can override this event and have messages written where you want. */
SWFUpload.prototype.debug = function (message) {
this.queueEvent("debug_handler", message);
};
/* **********************************
Debug Console
The debug console is a self contained, in page location
for debug message to be sent. The Debug Console adds
itself to the body if necessary.
The console is automatically scrolled as messages appear.
If you are using your own debug handler or when you deploy to production and
have debug disabled you can remove these functions to reduce the file size
and complexity.
********************************** */
// Private: debugMessage is the default debug_handler. If you want to print debug messages
// call the debug() function. When overriding the function your own function should
// check to see if the debug setting is true before outputting debug information.
SWFUpload.prototype.debugMessage = function (message) {
if (this.settings.debug) {
var exceptionMessage, exceptionValues = [];
// Check for an exception object and print it nicely
if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
for (var key in message) {
if (message.hasOwnProperty(key)) {
exceptionValues.push(key + ": " + message[key]);
}
}
exceptionMessage = exceptionValues.join("\n") || "";
exceptionValues = exceptionMessage.split("\n");
exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
SWFUpload.Console.writeLine(exceptionMessage);
} else {
SWFUpload.Console.writeLine(message);
}
}
};
SWFUpload.Console = {};
SWFUpload.Console.writeLine = function (message) {
var console, documentForm;
try {
console = document.getElementById("SWFUpload_Console");
if (!console) {
documentForm = document.createElement("form");
document.getElementsByTagName("body")[0].appendChild(documentForm);
console = document.createElement("textarea");
console.id = "SWFUpload_Console";
console.style.fontFamily = "monospace";
console.setAttribute("wrap", "off");
console.wrap = "off";
console.style.overflow = "auto";
console.style.width = "700px";
console.style.height = "350px";
console.style.margin = "5px";
documentForm.appendChild(console);
}
console.value += message + "\n";
console.scrollTop = console.scrollHeight - console.clientHeight;
} catch (ex) {
alert("Exception: " + ex.name + " Message: " + ex.message);
}
};

View file

@ -1 +0,0 @@
This file is not used in Rhymix.

View file

@ -1,455 +0,0 @@
/**
* @author NAVER (developers@xpressengine.com)
* @version 0.1.1
* @brief 파일 업로드 관련
**/
var uploadedFiles = [];
var uploaderSettings = [];
var loaded_images = [];
var swfUploadObjs = [];
var uploadSettingObj = [];
var uploadAutosaveChecker = false;
/**
* 업로드를 하기 위한 준비 시작
* 함수는 editor.html 에서 파일 업로드 가능할 경우 호출됨
**/
// window.load 이벤트일 경우 && 문서 번호가 가상의 번호가 아니면 기존에 저장되어 있을지도 모르는 파일 목록을 가져옴
(function($){
var defaultHandlers;
function init(cfg, exe) {
var seq = cfg.editorSequence;
if(!is_def(seq)) return;
cfg = $.extend({
sessionName : 'PHPSESSID',
allowedFileSize : 2097152, // byte. 2*1024*1024
allowedFileTypes : '*.*',
allowedFileTypesDescription : 'All Files',
replaceButtonID : 'swfUploadButton'+cfg.editorSequence,
insertedFiles : 0
}, cfg);
uploadSettingObj[seq] = cfg;
$(function(){ start(cfg); });
}
function start(cfg) {
var $button, width, height, $span, seq, id, settings, handlers, name, fn, swfu, $swf;
seq = cfg.editorSequence;
id = cfg.replaceButtonID;
$button = $('#'+id).wrap('<span style="position:relative;display:inline-block" />');
width = $button.width();
height = $button.height();
$span = $('<span id="dummy'+id+'" />').insertAfter($button);
settings = {
flash_url : request_uri + 'modules/editor/tpl/images/SWFUpload.swf',
upload_url : request_uri + 'index.php',
post_params : {
mid : current_mid,
act : 'procFileUpload',
editor_sequence : seq,
uploadTargetSrl : editorRelKeys[seq].primary.value,
_rx_csrf_token : getCSRFToken()
},
http_success : [302],
file_size_limit : Math.floor( (parseInt(cfg.allowedFileSize,10)||1024) / 1024 ),
file_queue_limit : 0,
file_upload_limit : 0,
file_types : cfg.allowedFileTypes,
file_types_description : cfg.allowedFileTypesDescription,
custom_settings : {
progressTarget : null,
cancelButtonId : null
},
debug : false,
// Button settings
button_window_mode : 'transparent',
button_placeholder_id : $span.attr('id'),
button_text : null,
button_image_url : request_uri+'common/img/blank.gif',
button_width : width,
button_height : height,
button_text_style : null,
button_text_left_padding : 0,
button_text_top_padding : 0,
button_cursor : -2,
editorSequence : seq,
uploadTargetSrl : editorRelKeys[seq].primary.value,
fileListAreaID : cfg.fileListAreaID,
previewAreaID : cfg.previewAreaID,
uploaderStatusID : cfg.uploaderStatusID
};
if(typeof(enforce_ssl)!=="undefined" && enforce_ssl)
{
settings.upload_url = request_uri+'index.php';
}
// preview
$('#'+cfg.fileListAreaID).click(previewFiles);
// The event handler functions are defined in handlers.js
handlers = {
file_queued : 'FileQueued',
file_queue_error : 'FileQueueError',
file_dialog_complete : 'FileDialogComplete',
upload_start : 'UploadStart',
upload_progress : 'UploadProgress',
upload_error : 'UploadError',
upload_success : 'UploadSuccess',
upload_complete : 'UploadComplete',
queue_complete : 'QueueComplete'
};
for(name in handlers) {
if(!handlers.hasOwnProperty(name)) continue;
fn = 'on'+handlers[name];
settings[name+'_handler'] = cfg['on'+fn] || defaultHandlers[fn];
}
if(is_def(window.xeVid)) settings.post_params.vid = xeVid;
settings.sessionName = cfg.sessionName;
if(getCookie(cfg.sessionName)) settings.post_params[cfg.sessionName] = getCookie(cfg.sessionName);
uploaderSettings[seq] = settings;
swfu = new SWFUpload(settings);
$swf = $('#'+swfu.movieName);
swfUploadObjs[seq] = swfu.movieName;
if(!$swf.length) return;
$swf.css({
display : 'block',
cursor : 'pointer',
position : 'absolute',
left : 0,
top : 0,
width : width + 'px',
height : height + 'px'
});
if(cfg.insertedFiles || editorRelKeys[seq].primary.value) reloadFileList(cfg);
}
function _true(){ return true; }
defaultHandlers = {
onFileQueued : _true,
onFileQueueError : function(file, errorCode, message) {
try {
switch(errorCode) {
case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED :
alert("You have attempted to queue too many files.\n" + (message === 0 ? "You have reached the upload limit." : "You may select " + (message > 1 ? "up to " + message + " files." : "one file.")));
break;
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
alert("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
break;
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
alert("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
break;
case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
alert("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
break;
default:
alert("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
break;
}
} catch(e) {
this.debug(e);
}
},
onFileDialogComplete : function(numFilesSelected, numFilesQueued) {
try {
if(getCookie(this.settings.sessionName)) this.addPostParam(this.settings.sessionName, getCookie(this.settings.sessionName));
this.startUpload();
} catch (e) {
this.debug(e);
}
},
onUploadStart : _true,
onUploadProgress : function(file, bytesLoaded, bytesTotal) {
if(getCookie(this.settings.sessionName)) this.addPostParam(this.settings.sessionName, getCookie(this.settings.sessionName));
try {
var $list, $lastopt, percent, filename;
$list = $('#'+this.settings.fileListAreaID);
percent = Math.ceil((bytesLoaded / bytesTotal) * 100);
filename = file.name;
$lastopt = $list.find('>option:last');
if(filename.length>20) filename = filename.substr(0,20)+'...';
if(!$lastopt.length || $lastopt.attr('value') != file.id) {
$lastopt = $('<option />').attr('value', file.id).appendTo($list);
}
$lastopt.text(filename + ' (' + percent + '%)');
} catch (e) {
this.debug(e);
}
},
onUploadSuccess : function(file, serveData) {
try {
if(this.getStats().files_queued !== 0) this.startUpload();
} catch (e) {
this.debug(e);
}
},
onUploadError : function(file, errorCode, message) {
try {
switch (errorCode) {
case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
alert("Error Code: HTTP Error, File name: " + file.name + ", Message: " + message);
break;
case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
alert("Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
break;
case SWFUpload.UPLOAD_ERROR.IO_ERROR:
alert("Error Code: IO Error, File name: " + file.name + ", Message: " + message);
break;
case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
alert("Error Code: Security Error, File name: " + file.name + ", Message: " + message);
break;
case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
alert("Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
break;
case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
alert("Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
break;
case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
// If there aren't any files left (they were all cancelled) disable the cancel button
if (this.getStats().files_queued === 0) {
document.getElementById(this.customSettings.cancelButtonId).disabled = true;
}
break;
case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
break;
default:
alert("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
break;
}
} catch (ex) {
this.debug(ex);
}
},
onUploadComplete : function(file) {
try {
var fileListAreaID = this.settings.fileListAreaID;
var uploadTargetSrl = this.settings.uploadTargetSrl;
reloadFileList(this.settings);
} catch(e) {
this.debug(ex);
}
}
};
function reloadFileList(cfg) {
var params = {
mid : current_mid,
file_list_area_id : cfg.fileListAreaID,
editor_sequence : cfg.editorSequence,
upload_target_srl : cfg.uploadTargetSrl
};
function autosave() {
if(typeof(_editorAutoSave) != 'function') return;
uploadAutosaveChecker = true;
_editorAutoSave(true);
}
function on_complete(ret, response_tags) {
var $list, seq, files, target_srl, up_status, remain, items, i, c, itm, file_srl;
seq = ret.editor_sequence;
files = ret.files;
up_status = ret.upload_status;
target_srl = ret.upload_target_srl;
remain = Math.floor((parseInt(ret.left_size,10)||0)/1024);
$list = $('#'+cfg.fileListAreaID).empty();
if(target_srl) {
if(editorRelKeys[seq].primary.value != target_srl) {
editorRelKeys[seq].primary.value = target_srl;
autosave();
}
editorRelKeys[seq].primary.value = target_srl;
cfg.uploadTargetSrl = target_srl;
}
$('#'+cfg.uploaderStatusID).html(up_status);
$('#'+cfg.previewAreaID).empty();
if(files && files.item) {
items = files.item;
if(!$.isArray(items)) items = [items];
for(i=0,c=items.length; i < c; i++) {
itm = items[i];
file_srl = itm.file_srl;
uploadedFiles[file_srl] = itm;
itm.previewAreaID = cfg.previewAreaID;
if(/\.(jpe?g|png|gif)$/i.test(itm.download_url)) {
loaded_images[file_srl] = $('<img />').attr('src', itm.download_url).get(0);
}
$('<option />')
.text(itm.source_filename + ' ('+itm.disp_file_size+' )')
.attr('value', file_srl)
.appendTo($list);
}
if(i) $list.prop('selectedIndex', i-1).click();
}
// 문서 강제 자동저장 1번만 사용 ( 첨부파일 target_srl로 자동 저장문서를 저장하기 위한 용도일 뿐 )
if(!uploadAutosaveChecker) autosave();
}
exec_xml(
'file', // module
'getFileList', // act
params, // parameters
on_complete, // callback
'error,message,files,upload_status,upload_target_srl,editor_sequence,left_size'.split(',') // response_tags
);
}
window.editorUploadInit = init;
window.reloadFileList = reloadFileList;
$(function(){
try { document.execCommand('BackgroundImageCache',false,true); } catch(e) { }
});
})(jQuery);
function previewFiles(event, file_srl) {
var $opt, $select, $preview, fileinfo, filename, match, html, $=jQuery;
if(!file_srl) {
$opt = $(event.target).parent().addBack().filter('select').find('>option:selected');
if(!$opt.length) return;
file_srl = $opt.attr('value');
}
if(!file_srl || !is_def(fileinfo=uploadedFiles[file_srl])) return;
$preview = $('#'+fileinfo.previewAreaID).html('&nbsp;');
if(!$preview.length) return;
filename = fileinfo.download_url || '';
match = filename.match(/\.(?:(flv)|(swf)|(wmv|avi|mpe?g|as[fx]|mp3)|(jpe?g|png|gif))$/i);
if(fileinfo.direct_download != 'Y' || !match) {
html = '<img src="'+request_uri+'modules/editor/tpl/images/files.gif" border="0" width="100%" height="100%" />';
} else if(match[1]) { // flash video file
html = '<embed src="'+request_uri+'common/img/flvplayer.swf?autoStart=false&file='+uploaded_filename+'" width="100%" height="100%" type="application/x-shockwave-flash" />';
} else if(match[2]) { // shockwave flash file
html = '<embed src="'+request_uri+filename+'" width="100%" height="100%" type="application/x-shockwave-flash" />';
} else if(match[3]) { // movie file
html = '<embed src="'+request_uri+filename+'" width="100%" height="100%" autostart="true" showcontrols="0" />';
} else if(match[4]) { // image file
html = '<img src="'+request_uri+filename+'" border="0" width="100%" height="100%" />';
}
if(html) $preview.html(html);
}
function removeUploadedFile(editorSequence) {
var settings = uploaderSettings[editorSequence];
var fileListAreaID = settings.fileListAreaID;
var fileListObj = get_by_id(fileListAreaID);
if(!fileListObj) return;
if(fileListObj.selectedIndex<0) return;
var file_srls = [];
for(var i=0;i<fileListObj.options.length;i++) {
if(!fileListObj.options[i].selected) continue;
var file_srl = fileListObj.options[i].value;
if(!file_srl) continue;
file_srls[file_srls.length] = file_srl;
}
if(file_srls.length<1) return;
var params = {
file_srls : file_srls.join(','),
editor_sequence : editorSequence
};
exec_xml("file","procFileDelete", params, function() { reloadFileList(settings); } );
}
function insertUploadedFile(editorSequence) {
var settings = uploaderSettings[editorSequence];
var fileListAreaID = settings.fileListAreaID;
var fileListObj = get_by_id(fileListAreaID);
if(!fileListObj) return;
var obj;
if(editorMode[editorSequence]=='preview') return;
var text = [];
for(var i=0;i<fileListObj.options.length;i++) {
if(!fileListObj.options[i].selected) continue;
var file_srl = fileListObj.options[i].value;
if(!file_srl) continue;
var file = uploadedFiles[file_srl];
editorFocus(editorSequence);
// 바로 링크 가능한 파일의 경우 (이미지, 플래쉬, 동영상 등..)
if(file.direct_download == 'Y') {
// 이미지 파일의 경우 image_link 컴포넌트 열결
if(/\.(jpg|jpeg|png|gif)$/i.test(file.download_url)) {
if(loaded_images[file_srl]) {
obj = loaded_images[file_srl];
}
else {
obj = new Image();
obj.src = file.download_url;
}
temp_code = '';
temp_code += "<img src=\""+file.download_url+"\" alt=\""+file.source_filename+"\"";
if(obj.complete === true) { temp_code += " width=\""+obj.width+"\" height=\""+obj.height+"\""; }
temp_code += " />\r\n<p><br /></p>\r\n";
text.push(temp_code);
} else {
// 이미지외의 경우는 multimedia_link 컴포넌트 연결
text.push("<img src=\"common/img/blank.gif\" editor_component=\"multimedia_link\" multimedia_src=\""+file.download_url+"\" width=\"400\" height=\"320\" style=\"display:block;width:400px;height:320px;border:2px dotted #4371B9;background:url(./modules/editor/components/multimedia_link/tpl/multimedia_link_component.gif) no-repeat center;\" auto_start=\"false\" alt=\"\" />");
}
} else {
// binary파일의 경우 url_link 컴포넌트 연결
text.push("<a href=\""+file.download_url+"\">"+file.source_filename+"</a>\n");
}
}
// html 모드
if(editorMode[editorSequence]=='html'){
if(text.length>0 && get_by_id('editor_textarea_'+editorSequence))
{
get_by_id('editor_textarea_'+editorSequence).value += text.join('');
}
// 위지윅 모드
}else{
var iframe_obj = editorGetIFrame(editorSequence);
if(!iframe_obj) return;
if(text.length>0) editorReplaceHTML(iframe_obj, text.join(''));
}
}

View file

@ -1 +0,0 @@
This file is not used in Rhymix.