웹마스터 팁
page_full_width">
이미지 삽입시 아래에 한줄 띄우고 클릭가능하게 하여 편히 입력하게 만들자~
2010.10.13 00:20
파일 자체를 덮어씌우려면 uploader.js 을 받으세요.
./modules/editor/tpl/js/uploader.js 을 열으세요.
insertUploadedFile 을 찾습니다.
function insertUploadedFile~ 에서 가장 끝부분 까지를 블록을 씌운후 아래의 코드로 덮어씌워서 저장하시면 됩니다.
function insertUploadedFile(editorSequence) { var settings = uploaderSettings[editorSequence]; var fileListAreaID = settings[ "fileListAreaID" ]; var fileListObj = xGetElementById(fileListAreaID); if (!fileListObj) 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); // 바로 링크 가능한 파일의 경우 (이미지, 플래쉬, 동영상 등..) if (file.direct_download == 'Y' ) { // 이미지 파일의 경우 image_link 컴포넌트 열결 if (/\.(jpg|jpeg|png|gif|bmp)$/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 = '' ; 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 += " /><p> </p>\r\n"; /* 이미지 삽입시 아래에 한줄 띄우기와 타이핑 바로 입력가능하게 하기 - XEMALL(www.xemall.net) */ text.push(temp_code); // 이미지외의 경우는 multimedia_link 컴포넌트 연결 } else { 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 { text.push( "<a href=" \ "+file.download_url+" \ ">" +file.source_filename+ "</a>\n" ); } } // 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( '' )); } } |
댓글 8
-
xemall
2010.10.13 15:25
직접 개작할 줄 알구요, 무슨 남의 팁을 배껴서 한번더 올렸다는 식으로 비꼬는것 같은데 절대 아닙니다.
-
비꼬는것같이 들리셨다면 죄송합니다. 해당 댓글 삭제하였습니다.
-
avalone
2010.10.13 12:00
저는 수정하니 아예파일 업로드 버튼이 작동을 안하네요. 크롬입니다. ^^;
-
xemall
2010.10.13 15:26
엇 그렇습니까?
제가 IE6,7,8,FF, Opera, Safari 만 테스트를 하고 Crom은 안보거든요.
새로 php 파일을 첨부해보겠습니다. 덮어씌워서 작동해보시고 다시 리플부탁드립니다.
-
xemall
2010.10.13 15:32
첨부한 파일을 덮어씌워서 한번 테스트해주신후 안된다면 아래의 내용을 좀 적어주시면 감사드리겠습니다.
- 브라우저 버전과 이름 :
- 운영체제 :
- 게시판 프로그램 : (Board, 확장Board , PXE 등)
-
이거 수정하니까 갑자기 특정 게시판에서
에디터가 먹통이되서 글자체가 안올라가더군여
xe 설치파일로 다시 롤백했습니다
-
xemall
2010.10.13 15:29
허걱; 바람의매님 죄송합니다. ㅠ.ㅠ;;
첨부한 파일을 덮어씌워서 한번 테스트해주신후 안된다면 아래의 내용을 좀 적어주시면 감사드리겠습니다.
- 브라우저 버전과 이름 :
- 운영체제 :
- 게시판 프로그램 : (Board, 확장Board , PXE 등)
좋은 팁 감사드립니다.