mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-20 19:59:54 +09:00
파일첨부가 허용된 에디터 출력시 이미 등록된 첨부파일의 수를 count하여 첨부된 파일이 없으면 파일 목록을 구해오지 않도록 하여 쓸데없는 페이지 호출 및 서버 작업/ 클라이언트 부하를 없앰
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3749 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
27d176f9ec
commit
1dbe0daede
5 changed files with 18 additions and 9 deletions
|
|
@ -18,8 +18,8 @@ var uploaded_files = new Array();
|
|||
* 이 함수는 editor.html 에서 파일 업로드 가능할 경우 호출됨
|
||||
**/
|
||||
// window.load 이벤트일 경우 && 문서 번호가 가상의 번호가 아니면 기존에 저장되어 있을지도 모르는 파일 목록을 가져옴
|
||||
function editor_upload_init(editor_sequence, el) {
|
||||
xAddEventListener(window,'load',function() { editor_upload_start(editor_sequence, el);} );
|
||||
function editor_upload_init(editor_sequence, el, inserted_files_count) {
|
||||
xAddEventListener(window,'load',function() { editor_upload_start(editor_sequence, el, inserted_files_count);} );
|
||||
}
|
||||
|
||||
function editor_upload_get_target_srl(editor_sequence) {
|
||||
|
|
@ -32,7 +32,10 @@ function editor_upload_get_uploader_name(editor_sequence) {
|
|||
}
|
||||
|
||||
// 파일 업로드를 위한 기본 준비를 함
|
||||
function editor_upload_start(editor_sequence, fo_obj) {
|
||||
function editor_upload_start(editor_sequence, fo_obj, inserted_files_count) {
|
||||
if(typeof(inserted_files_count)=='undefined' || !inserted_files_count) inserted_files_count = 0;
|
||||
else inserted_files_count = parseInt(inserted_files_count, 10);
|
||||
|
||||
// 캐시 삭제
|
||||
try { document.execCommand('BackgroundImageCache',false,true); } catch(e) { }
|
||||
|
||||
|
|
@ -58,8 +61,7 @@ function editor_upload_start(editor_sequence, fo_obj) {
|
|||
if(!field_obj) return;
|
||||
|
||||
// 에디터를 감싸는 form을 구해 submit target을 임시 iframe으로 변경
|
||||
if(!fo_obj)
|
||||
fo_obj = editorGetForm(editor_sequence);
|
||||
if(!fo_obj) fo_obj = editorGetForm(editor_sequence);
|
||||
fo_obj.target = 'tmp_upload_iframe';
|
||||
|
||||
// SWF uploader 생성
|
||||
|
|
@ -101,7 +103,7 @@ function editor_upload_start(editor_sequence, fo_obj) {
|
|||
* upload_target_srl값이 실제 문서 번호일 경우 이미 등록되 있을지도 모르는 첨부파일 목록을 로드
|
||||
* procDeleteFile에 file_srl을 보내주지 않으면 삭제시도는 없이 목록만 갱신할 수 있음
|
||||
**/
|
||||
editor_display_uploaded_file(editor_sequence);
|
||||
if(inserted_files_count>0) editor_display_uploaded_file(editor_sequence);
|
||||
}
|
||||
|
||||
// 파일 업로드 에러 핸들링
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue