mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
자동 저장시 콜백 기능 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7888 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5d1ba17f9c
commit
37d945e64f
1 changed files with 11 additions and 4 deletions
|
|
@ -31,12 +31,16 @@ function editorFocus(editor_sequence) {
|
||||||
* 자동 저장 기능
|
* 자동 저장 기능
|
||||||
**/
|
**/
|
||||||
// 자동 저장 활성화 시키는 함수 (50초마다 자동저장)
|
// 자동 저장 활성화 시키는 함수 (50초마다 자동저장)
|
||||||
function editorEnableAutoSave(fo_obj, editor_sequence) {
|
function editorEnableAutoSave(fo_obj, editor_sequence, callback) {
|
||||||
var title = fo_obj.title.value;
|
var title = fo_obj.title.value;
|
||||||
var content = editorRelKeys[editor_sequence]['content'].value;
|
var content = editorRelKeys[editor_sequence]['content'].value;
|
||||||
|
|
||||||
editorAutoSaveObj = {"fo_obj":fo_obj, "editor_sequence":editor_sequence, "title":title, "content":content, locked:false};
|
editorAutoSaveObj = {"fo_obj":fo_obj, "editor_sequence":editor_sequence, "title":title, "content":content, locked:false};
|
||||||
setTimeout('_editorAutoSave()', 50000);
|
|
||||||
|
clearTimeout(editorEnableAutoSave.timer);
|
||||||
|
editorEnableAutoSave.timer = setTimeout(function(){_editorAutoSave(false, callback)}, 5000);
|
||||||
}
|
}
|
||||||
|
editorEnableAutoSave.timer = null;
|
||||||
|
|
||||||
// ajax를 이용하여 editor.procEditorSaveDoc 호출하여 자동 저장시킴 exe는 강제 코드
|
// ajax를 이용하여 editor.procEditorSaveDoc 호출하여 자동 저장시킴 exe는 강제 코드
|
||||||
function _editorAutoSave(exe, callback) {
|
function _editorAutoSave(exe, callback) {
|
||||||
|
|
@ -44,7 +48,10 @@ function _editorAutoSave(exe, callback) {
|
||||||
var editor_sequence = editorAutoSaveObj.editor_sequence;
|
var editor_sequence = editorAutoSaveObj.editor_sequence;
|
||||||
|
|
||||||
// 50초마다 동기화를 시킴 강제 실행은 제외
|
// 50초마다 동기화를 시킴 강제 실행은 제외
|
||||||
if(!exe) setTimeout('_editorAutoSave()', 50000);
|
if(!exe) {
|
||||||
|
clearTimeout(editorEnableAutoSave.timer);
|
||||||
|
editorEnableAutoSave.timer = setTimeout(function(){ _editorAutoSave(exe, callback) }, 50000);
|
||||||
|
}
|
||||||
|
|
||||||
// 현재 자동저장중이면 중지
|
// 현재 자동저장중이면 중지
|
||||||
if(editorAutoSaveObj.locked == true) return;
|
if(editorAutoSaveObj.locked == true) return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue