mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
editor default skin 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4830 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
53f53f6a18
commit
e103fa10c2
9 changed files with 116 additions and 65 deletions
|
|
@ -8,6 +8,8 @@
|
|||
<action name="dispEditorAdminIndex" type="view" standalone="true" admin_index="true" />
|
||||
<action name="dispEditorAdminSetupComponent" type="view" standalone="true" />
|
||||
<action name="dispEditorAdminSkinColorset" type="view" standalone="true" />
|
||||
<action name="dispEditorPreview" type="view" />
|
||||
|
||||
|
||||
<action name="procEditorSaveDoc" type="controller" standalone="true" />
|
||||
<action name="procEditorRemoveSavedDoc" type="controller" standalone="true" />
|
||||
|
|
|
|||
|
|
@ -100,5 +100,17 @@
|
|||
}
|
||||
|
||||
|
||||
function dispEditorPreview(){
|
||||
/*
|
||||
Context::setResponseMethod();
|
||||
$content = Context::get('content');
|
||||
$oContext = Context::getInstance();
|
||||
$content = $oContext->transContent($content);
|
||||
Context::setResponseMethod('XMLRPC');
|
||||
Context::set('content',$content);
|
||||
*/
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('preview');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -177,7 +177,7 @@
|
|||
<div class="editorMargin" >
|
||||
<iframe id="editor_iframe_{$editor_sequence}" class="richEditor" frameborder="0" height="{$editor_height}" title="Rich Text Editor"></iframe>
|
||||
<textarea id="editor_textarea_{$editor_sequence}" class="htmlEditor" style="height:{$editor_height}" rows="5" cols="20" title="HTML Editor"></textarea>
|
||||
<div id="editor_preview_{$editor_sequence}" class="previewEditor"></div>
|
||||
<iframe id="editor_preview_{$editor_sequence}" name="editor_preview_{$editor_sequence}" frameborder="0" height="{$editor_height}" style="display:none;border:0;"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -209,7 +209,7 @@
|
|||
);
|
||||
//]]></script>
|
||||
<!-- 파일 업로드 영역 -->
|
||||
<div class="fileUploader">
|
||||
<div id="fileUploader_{$editor_sequence}" class="fileUploader">
|
||||
<div class="preview" id="preview_uploaded_{$editor_sequence}"></div>
|
||||
<div class="fileListArea">
|
||||
<select id="uploaded_file_list_{$editor_sequence}" multiple="multiple" class="fileList" title="Attached File List"><option></option></select>
|
||||
|
|
|
|||
|
|
@ -409,16 +409,21 @@ function editorChangeMode(mode, editor_sequence) {
|
|||
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 = xInnerHtml(preview_obj);
|
||||
html = textarea_obj.value;
|
||||
} 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';
|
||||
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));
|
||||
|
|
@ -432,7 +437,21 @@ function editorChangeMode(mode, editor_sequence) {
|
|||
}
|
||||
// 미리보기
|
||||
} else if(mode == 'preview' && preview_obj) {
|
||||
xInnerHtml(preview_obj, html);
|
||||
preview_obj.style.display='';
|
||||
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.action = request_uri;
|
||||
fo_obj.target = "editor_preview_"+editor_sequence;
|
||||
xInnerHtml(fo_obj,'<input type="hidden" name="module" value="editor" /><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';
|
||||
|
||||
|
|
@ -444,6 +463,8 @@ function editorChangeMode(mode, editor_sequence) {
|
|||
}
|
||||
// 위지윅 모드 사용시
|
||||
} else {
|
||||
preview_obj.style.display='none';
|
||||
xGetElementById('fileUploader_'+editor_sequence).style.display='block';
|
||||
contentDocument.body.innerHTML = html;
|
||||
editorMode[editor_sequence] = null;
|
||||
|
||||
|
|
@ -495,3 +516,9 @@ function showEditorExtension(e,editor_sequence){
|
|||
}
|
||||
}
|
||||
|
||||
function showPreviewContent(ret_obj,response_tags, params, fo_obj) {
|
||||
var preview_obj = editorGetPreviewArea(params.editor_sequence);
|
||||
xGetElementById('fileUploader_'+params.editor_sequence).style.display='none';
|
||||
// alert(ret_obj.content);
|
||||
xInnerHtml(preview_obj, ret_obj.content);
|
||||
}
|
||||
|
|
@ -146,10 +146,12 @@ function editorDragMove(evt) {
|
|||
|
||||
var iframe_obj = editorGetIFrame(editorDragObj.id);
|
||||
var textarea_obj = editorGetTextarea(editorDragObj.id);
|
||||
var height = xHeight(iframe_obj) || xHeight(textarea_obj);
|
||||
var preview_obj = xGetElementById('editor_preview_'+editorDragObj.id);
|
||||
var height = xHeight(iframe_obj) || xHeight(textarea_obj) || xHeight(preview_obj);
|
||||
height += h;
|
||||
xHeight(iframe_obj, height);
|
||||
xHeight(textarea_obj, height);
|
||||
xHeight(preview_obj, height);
|
||||
// xHeight(iframe_obj.parentNode, height+200);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,39 +167,39 @@ function uploadSuccess(file, serverData) {
|
|||
}
|
||||
|
||||
function uploadError(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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -332,41 +332,48 @@ function removeUploadedFile(editorSequence) {
|
|||
}
|
||||
|
||||
function insertUploadedFile(editorSequence) {
|
||||
|
||||
var settings = uploaderSettings[editorSequence];
|
||||
var fileListAreaID = settings["fileListAreaID"];
|
||||
var fileListObj = xGetElementById(fileListAreaID);
|
||||
if(!fileListObj) return;
|
||||
|
||||
if(typeof(editorMode)!='undefined' && editorMode[editorSequence]=='html') return;
|
||||
|
||||
var iframe_obj = editorGetIFrame(editorSequence);
|
||||
if(!iframe_obj) return;
|
||||
if(editorMode[editorSequence]=='preview') return;
|
||||
|
||||
var text = new Array();
|
||||
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);
|
||||
|
||||
var text = "";
|
||||
|
||||
// 바로 링크 가능한 파일의 경우 (이미지, 플래쉬, 동영상 등..)
|
||||
if(file.direct_download == 'Y') {
|
||||
// 이미지 파일의 경우 image_link 컴포넌트 열결
|
||||
if(/\.(jpg|jpeg|png|gif)$/i.test(file.download_url)) {
|
||||
var text = "<img editor_component=\"image_link\" src=\""+file.download_url+"\" alt=\""+file.source_filename+"\" />";
|
||||
text.push("<img editor_component=\"image_link\" src=\""+file.download_url+"\" alt=\""+file.source_filename+"\" />");
|
||||
// 이미지외의 경우는 multimedia_link 컴포넌트 연결
|
||||
} else {
|
||||
var text = "<img src=\"./common/tpl/images/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=\"\" />";
|
||||
text.push("<img src=\"./common/tpl/images/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=\"\" />");
|
||||
}
|
||||
|
||||
// binary파일의 경우 url_link 컴포넌트 연결
|
||||
} else {
|
||||
var text = "<a href=\""+file.download_url+"\">"+file.source_filename+"</a>\n";
|
||||
text.push("<a href=\""+file.download_url+"\">"+file.source_filename+"</a>\n");
|
||||
}
|
||||
if(text) editorReplaceHTML(iframe_obj, text);
|
||||
}
|
||||
|
||||
|
||||
// html 모드
|
||||
if(editorMode[editorSequence]=='html'){
|
||||
if(text.length>0) xGetElementById('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(''));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1
modules/editor/tpl/preview.html
Normal file
1
modules/editor/tpl/preview.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{$content}
|
||||
Loading…
Add table
Add a link
Reference in a new issue