mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-27 15:19:57 +09:00
#1087 CKEditor 기본 콘텐츠 스타일 추가
This commit is contained in:
parent
d2d092a7eb
commit
571ebc37d3
9 changed files with 143 additions and 2 deletions
41
modules/editor/skins/ckeditor/js/default.js
Executable file
41
modules/editor/skins/ckeditor/js/default.js
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
//Insert uploaded file to editor
|
||||
function ckInsertUploadedFile(editorSequence){
|
||||
var temp_code='';
|
||||
|
||||
var settings = uploaderSettings[editorSequence];
|
||||
var fileListAreaID = settings["fileListAreaID"];
|
||||
var fileListObj = get_by_id(fileListAreaID);
|
||||
if(!fileListObj) return;
|
||||
|
||||
if(editorMode[editorSequence]=='preview') return;
|
||||
|
||||
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];
|
||||
|
||||
if(file.direct_download == 'Y') {
|
||||
if(/\.(jpg|jpeg|png|gif)$/i.test(file.download_url)) {
|
||||
if(loaded_images[file_srl]) {
|
||||
var obj = loaded_images[file_srl];
|
||||
}
|
||||
else {
|
||||
var obj = new Image();
|
||||
obj.src = file.download_url;
|
||||
}
|
||||
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";
|
||||
} else {
|
||||
temp_code="<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 {
|
||||
temp_code="<a href=\""+file.download_url+"\">"+file.source_filename+"</a>\n";
|
||||
}
|
||||
}
|
||||
cked_instance = 'ckeditor_instance_'+editorSequence;
|
||||
CKEDITOR.instances[cked_instance].insertHtml(temp_code);
|
||||
}
|
||||
41
modules/editor/skins/ckeditor/js/xe_textarea.js
Executable file
41
modules/editor/skins/ckeditor/js/xe_textarea.js
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
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(/</g, "<");
|
||||
content = content.replace(/>/g, ">");
|
||||
content = content.replace(/"/g, '"');
|
||||
content = content.replace(/&/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, "&");
|
||||
content = content.replace(/</g, "<");
|
||||
content = content.replace(/>/g, ">");
|
||||
content = content.replace(/\"/g, """);
|
||||
}
|
||||
content = content.replace(/(\r\n|\n)/g, "<br />");
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue