mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-24 21:59:55 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@739 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
32a9c0d347
commit
ab975f48b1
15 changed files with 242 additions and 38 deletions
|
|
@ -148,3 +148,14 @@ div.editor_drag_down_area {
|
|||
.about_component_icon {
|
||||
vertical-align:middle;
|
||||
}
|
||||
|
||||
div.editor_autosaved_message {
|
||||
padding:5px;
|
||||
margin:5px 0px 5px 0px;
|
||||
border:1px solid #f8be74;
|
||||
font-size:9pt;
|
||||
font-weight:bold;
|
||||
color:#d79619;
|
||||
background-color:#feffc4;
|
||||
display:none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
editorInit("{$upload_target_srl}");
|
||||
</script>
|
||||
|
||||
<!-- 자동저장용 폼 -->
|
||||
<!--@if($enable_autosave)-->
|
||||
<input type="hidden" name="_saved_doc_title" value="{htmlspecialchars($saved_doc->title)}" />
|
||||
<input type="hidden" name="_saved_doc_content" value="{htmlspecialchars($saved_doc->content)}" />
|
||||
<input type="hidden" name="_saved_doc_message" value="{$lang->msg_load_saved_doc}" />
|
||||
<!--@end-->
|
||||
|
||||
<!-- 에디터 -->
|
||||
<div class="editor_content">
|
||||
|
||||
|
|
@ -80,31 +87,33 @@
|
|||
|
||||
<!-- iframe -->
|
||||
<div class="editor_iframe_box"><iframe id="editor_iframe_{$upload_target_srl}" frameBorder="0" style="border:0px;width:99%;height:300px;margin:0px;"></iframe><div class="editor_drag_down_area" id="editor_drag_bar_{$upload_target_srl}"></div></div>
|
||||
<div class="editor_autosaved_message" id="editor_autosaved_message">{$lang->msg_auto_saved}</div>
|
||||
</div>
|
||||
|
||||
<!--@if($allow_fileupload)-->
|
||||
<!--%import("./js/uploader.js")-->
|
||||
<script type="text/javascript">
|
||||
editor_upload_init("{$upload_target_srl}");
|
||||
</script>
|
||||
<!-- 첨부파일 영역 -->
|
||||
<!--%import("./js/uploader.js")-->
|
||||
<script type="text/javascript">
|
||||
editor_upload_init("{$upload_target_srl}");
|
||||
</script>
|
||||
|
||||
<div class="editor_uploader_box">
|
||||
<div class="editor_uploader_box">
|
||||
|
||||
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
|
||||
<input type="hidden" name="act" value="procUploadFile" />
|
||||
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
|
||||
<input type="hidden" name="act" value="procUploadFile" />
|
||||
|
||||
<!-- 미리보기 -->
|
||||
<div class="editor_preview_uploaded" id="preview_uploaded_{$upload_target_srl}"><img src="./images/blank.gif" width="100" height="100" alt="preview" /></div>
|
||||
<!-- 미리보기 -->
|
||||
<div class="editor_preview_uploaded" id="preview_uploaded_{$upload_target_srl}"><img src="./images/blank.gif" width="100" height="100" alt="preview" /></div>
|
||||
|
||||
<!-- 파일 업로드 영역 -->
|
||||
<div class="editor_uploader">
|
||||
<select id='uploaded_file_list_{$upload_target_srl}' size='9' class="uploaded_file_list" onclick="editor_preview(this, '{$upload_target_srl}')"></select>
|
||||
</div>
|
||||
<div class="editor_uploader_input_area">
|
||||
<input type="button" value="{$lang->edit->upload_file}" class="editor_uploader_input" onclick="editor_remove_file('{$upload_target_srl}');return false;" />
|
||||
<input type="button" value="{$lang->edit->delete_selected}" class="editor_uploader_input" onclick="editor_remove_file('{$upload_target_srl}');return false;" />
|
||||
<input type="button" value="{$lang->edit->link_file}" class="editor_uploader_input" onclick="editor_insert_file('{$upload_target_srl}');return false;" />
|
||||
<input type="file" size="1" name="file" id="file_uploader_{$upload_target_srl}" class="editor_uploader_file_input" onchange="editor_file_upload(this, '{$upload_target_srl}')" value="{$lang->edit->upload}" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 파일 업로드 영역 -->
|
||||
<div class="editor_uploader">
|
||||
<select id='uploaded_file_list_{$upload_target_srl}' size='9' class="uploaded_file_list" onclick="editor_preview(this, '{$upload_target_srl}')"></select>
|
||||
</div>
|
||||
<div class="editor_uploader_input_area">
|
||||
<input type="button" value="{$lang->edit->upload_file}" class="editor_uploader_input" onclick="editor_remove_file('{$upload_target_srl}');return false;" />
|
||||
<input type="button" value="{$lang->edit->delete_selected}" class="editor_uploader_input" onclick="editor_remove_file('{$upload_target_srl}');return false;" />
|
||||
<input type="button" value="{$lang->edit->link_file}" class="editor_uploader_input" onclick="editor_insert_file('{$upload_target_srl}');return false;" />
|
||||
<input type="file" size="1" name="file" id="file_uploader_{$upload_target_srl}" class="editor_uploader_file_input" onchange="editor_file_upload(this, '{$upload_target_srl}')" value="{$lang->edit->upload}" />
|
||||
</div>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ function editorInit(upload_target_srl) {
|
|||
|
||||
// editor 시작 (upload_target_srl로 iframe객체를 얻어서 쓰기 모드로 전환)
|
||||
function editorStart(upload_target_srl) {
|
||||
|
||||
// iframe obj를 찾음
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
if(!iframe_obj) return;
|
||||
|
|
@ -31,6 +32,15 @@ function editorStart(upload_target_srl) {
|
|||
// 현 에디터를 감싸고 있는 form문을 찾아서 content object를 찾아서 내용 sync
|
||||
var fo_obj = iframe_obj.parentNode;
|
||||
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
|
||||
// saved document에 대한 체크
|
||||
if(typeof(fo_obj._saved_doc_title)!="undefined" ) {
|
||||
if(fo_obj._saved_doc_title.value || fo_obj._saved_doc_content.value) {
|
||||
if(confirm(fo_obj._saved_doc_message.value)) {
|
||||
fo_obj.title.value = fo_obj._saved_doc_title.value;
|
||||
fo_obj.content.value = fo_obj._saved_doc_content.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 구해진 form 객체를 저장
|
||||
editor_form_list[upload_target_srl] = fo_obj;
|
||||
|
|
@ -82,6 +92,8 @@ function editorStart(upload_target_srl) {
|
|||
|
||||
// 에디터의 내용을 지속적으로 fo_obj.content.value에 입력
|
||||
editorSyncContent(fo_obj.content, upload_target_srl);
|
||||
|
||||
if(typeof(fo_obj._saved_doc_title)!="undefined" ) editorEnableAutoSave(fo_obj, upload_target_srl);
|
||||
}
|
||||
|
||||
// 여러개의 편집기를 예상하여 전역 배열 변수에 form, iframe의 정보를 넣음
|
||||
|
|
@ -103,6 +115,47 @@ function _editorSync() {
|
|||
}
|
||||
xAddEventListener(window, 'load', _editorSync);
|
||||
|
||||
// 자동 저장 기능
|
||||
var _autoSaveObj = {fo_obj:null, upload_target_srl:0, title:'', content:''}
|
||||
function editorEnableAutoSave(fo_obj, upload_target_srl) {
|
||||
var title = fo_obj.title.value;
|
||||
var content = fo_obj.content.value;
|
||||
_autoSaveObj = {"fo_obj":fo_obj, "upload_target_srl":upload_target_srl, "title":title, "content":content};
|
||||
setTimeout(_editorAutoSave, 5000);
|
||||
}
|
||||
|
||||
function _editorAutoSave() {
|
||||
var fo_obj = _autoSaveObj.fo_obj;
|
||||
var upload_target_srl = _autoSaveObj.upload_target_srl;
|
||||
|
||||
if(fo_obj && upload_target_srl) {
|
||||
var title = fo_obj.title.value;
|
||||
var content = editorGetContent(upload_target_srl);
|
||||
if(title.trim() != _autoSaveObj.title.trim() || content.trim() != _autoSaveObj.content.trim()) {
|
||||
var params = new Array();
|
||||
params["document_srl"] = upload_target_srl;
|
||||
params["title"] = title;
|
||||
params["content"] = content;
|
||||
|
||||
_autoSaveObj.title = title;
|
||||
_autoSaveObj.content = content;
|
||||
|
||||
xGetElementById("editor_autosaved_message").style.display = "block";
|
||||
setTimeout(function() {xGetElementById("editor_autosaved_message").style.display = "none";}, 3000);
|
||||
show_waiting_message = false;
|
||||
exec_xml("editor","procSaveDoc", params, _editorAutoSaved);
|
||||
show_waiting_message = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(_editorAutoSave, 3000);
|
||||
}
|
||||
|
||||
function _editorAutoSaved(ret_obj) {
|
||||
setTimeout(_editorAutoSave, 7000);
|
||||
}
|
||||
|
||||
// 에디터의 전체 내용 return
|
||||
function editorGetContent(upload_target_srl) {
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue