mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
위지윅에디터의 rewrite mod에 따른 첨부이미지/파일등의 경로가 바뀌는 오류를 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6107 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
13ad615f77
commit
5bf4b345a9
6 changed files with 58 additions and 34 deletions
|
|
@ -344,6 +344,14 @@ function editorSearchComponent(evt) {
|
|||
|
||||
// 에디터 내의 선택된 부분의 html코드를 변경
|
||||
function editorReplaceHTML(iframe_obj, html) {
|
||||
// 이미지 경로 재지정 (rewrite mod)
|
||||
var srcPathRegx = /src=("|\'){1}(\.\/)?(files\/attach|files\/cache|files\/faceOff|files\/member_extra_info|modules|common|widgets|widgetstyle|layouts|addons)\/([^"\']+)\.(jpg|jpeg|png|gif)("|\'){1}/g;
|
||||
html = html.replace(srcPathRegx, 'src="'+request_uri+'$3/$4.$5"');
|
||||
|
||||
// href 경로 재지정 (rewrite mod)
|
||||
var hrefPathRegx = /href=("|\'){1}(\.\/)?\?([^"\']+)("|\'){1}/g;
|
||||
html = html.replace(hrefPathRegx, 'href="'+request_uri+'?$3"');
|
||||
|
||||
// 에디터가 활성화 되어 있는지 확인 후 비활성화시 활성화
|
||||
var editor_sequence = iframe_obj.contentWindow.document.body.getAttribute("editor_sequence");
|
||||
|
||||
|
|
|
|||
|
|
@ -385,13 +385,13 @@ function insertUploadedFile(editorSequence) {
|
|||
obj.src = file.download_url;
|
||||
}
|
||||
temp_code = '';
|
||||
temp_code += "<img src=\""+request_uri+file.download_url+"\" alt=\""+file.source_filename+"\"";
|
||||
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";
|
||||
text.push(temp_code);
|
||||
// 이미지외의 경우는 multimedia_link 컴포넌트 연결
|
||||
} else {
|
||||
text.push("<img src=\""+request_uri+"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 컴포넌트 연결
|
||||
|
|
@ -400,19 +400,14 @@ function insertUploadedFile(editorSequence) {
|
|||
}
|
||||
}
|
||||
|
||||
// html 모드
|
||||
if(editorMode[editorSequence]=='html'){
|
||||
if(text.length>0) xGetElementById('editor_textarea_'+editorSequence).value += text.join('');
|
||||
|
||||
if(jQuery.isFunction(editorRelKeys[editorSequence]['pasteHTML'])){
|
||||
editorRelKeys[editorSequence]['pasteHTML'](text.join(''));
|
||||
// 위지윅 모드
|
||||
}else{
|
||||
// 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(''));
|
||||
}
|
||||
var iframe_obj = editorGetIFrame(editorSequence);
|
||||
if(!iframe_obj) return;
|
||||
if(text.length>0) editorReplaceHTML(iframe_obj, text.join(''));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue