diff --git a/modules/editor/skins/xquared/css/default.css b/modules/editor/skins/xquared/css/default.css
index bd9c47182..02a39d0d8 100644
--- a/modules/editor/skins/xquared/css/default.css
+++ b/modules/editor/skins/xquared/css/default.css
@@ -1,4 +1,5 @@
@charset "utf-8";
+.xeEditor .editor_info .editor_autosaved_message { color:#888888; text-align:right; }
.xeEditor .fileAttach { position:relative; top:20px; padding:0 1em .5em 1em;}
.xeEditor .fileAttach .preview { padding:5px; width:110px; height:110px; border:1px solid #e1e1dd; background:#fbfbfb; float:left; margin-right:.5em;}
diff --git a/modules/editor/skins/xquared/editor.html b/modules/editor/skins/xquared/editor.html
index f0f705a09..b502a89e3 100644
--- a/modules/editor/skins/xquared/editor.html
+++ b/modules/editor/skins/xquared/editor.html
@@ -32,12 +32,9 @@
-
+
diff --git a/modules/editor/skins/xquared/js/xe_interface.js b/modules/editor/skins/xquared/js/xe_interface.js
index 005fc5294..2079b42ea 100644
--- a/modules/editor/skins/xquared/js/xe_interface.js
+++ b/modules/editor/skins/xquared/js/xe_interface.js
@@ -37,14 +37,34 @@ function editorStart_xq(editor, element, editor_sequence, content_key, editor_he
editorMode[editor_sequence] = null;
var fo_obj = editorGetForm_xq(element);
fo_obj.setAttribute('editor_sequence', editor_sequence);
- editor.setStaticContent(fo_obj[content_key].value);
editorRelKeys[editor_sequence]['content'] = fo_obj[content_key];
editorRelKeys[editor_sequence]['primary'] = fo_obj[primary_key];
+
+ // saved document(자동저장 문서)에 대한 확인
+ if(typeof(fo_obj._saved_doc_title)!="undefined" ) { ///<< _saved_doc_title field가 없으면 자동저장 하지 않음
+
+ var saved_title = fo_obj._saved_doc_title.value;
+ var saved_content = fo_obj._saved_doc_content.value;
+
+ if(saved_title || saved_content) {
+ // 자동저장된 문서 활용여부를 물은 후 사용하지 않는다면 자동저장된 문서 삭제
+ if(confirm(fo_obj._saved_doc_message.value)) {
+ if(typeof(fo_obj.title)!='undefined') fo_obj.title.value = saved_title;
+ editorRelKeys[editor_sequence]['content'].value = saved_content;
+ } else {
+ editorRemoveSavedDoc();
+ }
+ }
+ }
+
+ editor.setStaticContent(fo_obj[content_key].value);
editor.setEditMode('wysiwyg');
editor.loadStylesheet(request_uri+editor_path+"/examples/css/xq_contents.css");
editor.getFrame().style.width = "100%";
editor.getFrame().parentNode.style.height = editor_height;
editor.addAutocompletions(getAdditionalAutocompletions());
+
+ if(typeof(fo_obj._saved_doc_title)!="undefined" ) editorEnableAutoSave(fo_obj, editor_sequence);
}
xq.Editor.prototype.insertHTML = function (html) {
diff --git a/modules/editor/tpl/js/editor.js b/modules/editor/tpl/js/editor.js
index aada9f499..f3cd33efd 100755
--- a/modules/editor/tpl/js/editor.js
+++ b/modules/editor/tpl/js/editor.js
@@ -195,66 +195,6 @@ function editorStart(editor_sequence, primary_key, content_key, editor_height) {
if(typeof(fo_obj._saved_doc_title)!="undefined" ) editorEnableAutoSave(fo_obj, editor_sequence);
}
-/**
- * 자동 저장 기능
- **/
-// 자동 저장 활성화 시키는 함수 (10초마다 자동저장)
-function editorEnableAutoSave(fo_obj, editor_sequence) {
- var title = fo_obj.title.value;
- var content = editorRelKeys[editor_sequence]['content'].value;
- editorAutoSaveObj = {"fo_obj":fo_obj, "editor_sequence":editor_sequence, "title":title, "content":content, locked:false};
- setTimeout(_editorAutoSave, 10000);
-}
-
-// ajax를 이용하여 editor.procEditorSaveDoc 호출하여 자동 저장시킴
-function _editorAutoSave() {
- var fo_obj = editorAutoSaveObj.fo_obj;
- var editor_sequence = editorAutoSaveObj.editor_sequence;
-
- // 현재 자동저장중이면 중지
- if(editorAutoSaveObj.locked == true) return;
-
- // 대상이 없으면 자동저장 시키는 기능 자체를 중지
- if(!fo_obj || typeof(fo_obj.title)=='undefined' || !editor_sequence) return;
-
- // 자동저장을 위한 준비
- var title = fo_obj.title.value;
- var content = editorGetContent(editor_sequence);
-
- // 내용이 이전에 저장하였던 것과 다르면 자동 저장을 함
- if(title != editorAutoSaveObj.title || content != editorAutoSaveObj.content ) {
- var params = new Array();
-
- params["title"] = title;
- params["content"] = content;
- params["document_srl"] = editorRelKeys[editor_sequence]['primary'].value;
-
- editorAutoSaveObj.title = title;
- editorAutoSaveObj.content = content;
-
- var obj = xGetElementById("editor_autosaved_message_"+editor_sequence);
- var oDate = new Date();
- html = oDate.getHours()+':'+oDate.getMinutes()+' '+auto_saved_msg;
- xInnerHtml(obj, html);
- obj.style.display = "block";
-
- // 현재 자동저장중임을 설정
- editorAutoSaveObj.locked = true;
-
- // 서버 호출 (서버와 교신중이라는 메세지를 보이지 않도록 함)
- show_waiting_message = false;
- exec_xml("editor","procEditorSaveDoc", params, function() { editorAutoSaveObj.locked = false; } );
- show_waiting_message = true;
- }
-
- // 10초마다 동기화를 시킴
- setTimeout(_editorAutoSave, 10000);
-}
-
-// 자동저장된 모든 메세지를 삭제하는 루틴
-function editorRemoveSavedDoc() {
- exec_xml("editor","procEditorRemoveSavedDoc");
-}
/**
* 에디터의 세부 설정과 데이터 핸들링을 정의한 함수들
diff --git a/modules/editor/tpl/js/editor_common.js b/modules/editor/tpl/js/editor_common.js
index 6e9eb7cb4..d4e55c264 100644
--- a/modules/editor/tpl/js/editor_common.js
+++ b/modules/editor/tpl/js/editor_common.js
@@ -10,3 +10,63 @@ function editorGetContent(editor_sequence) {
return editorRelKeys[editor_sequence]["func"](editor_sequence);
}
+/**
+ * 자동 저장 기능
+ **/
+// 자동 저장 활성화 시키는 함수 (10초마다 자동저장)
+function editorEnableAutoSave(fo_obj, editor_sequence) {
+ var title = fo_obj.title.value;
+ var content = editorRelKeys[editor_sequence]['content'].value;
+ editorAutoSaveObj = {"fo_obj":fo_obj, "editor_sequence":editor_sequence, "title":title, "content":content, locked:false};
+ setTimeout(_editorAutoSave, 10000);
+}
+
+// ajax를 이용하여 editor.procEditorSaveDoc 호출하여 자동 저장시킴
+function _editorAutoSave() {
+ var fo_obj = editorAutoSaveObj.fo_obj;
+ var editor_sequence = editorAutoSaveObj.editor_sequence;
+
+ // 현재 자동저장중이면 중지
+ if(editorAutoSaveObj.locked == true) return;
+
+ // 대상이 없으면 자동저장 시키는 기능 자체를 중지
+ if(!fo_obj || typeof(fo_obj.title)=='undefined' || !editor_sequence) return;
+
+ // 자동저장을 위한 준비
+ var title = fo_obj.title.value;
+ var content = editorGetContent(editor_sequence);
+
+ // 내용이 이전에 저장하였던 것과 다르면 자동 저장을 함
+ if(title != editorAutoSaveObj.title || content != editorAutoSaveObj.content ) {
+ var params = new Array();
+
+ params["title"] = title;
+ params["content"] = content;
+ params["document_srl"] = editorRelKeys[editor_sequence]['primary'].value;
+
+ editorAutoSaveObj.title = title;
+ editorAutoSaveObj.content = content;
+
+ var obj = xGetElementById("editor_autosaved_message_"+editor_sequence);
+ var oDate = new Date();
+ html = oDate.getHours()+':'+oDate.getMinutes()+' '+auto_saved_msg;
+ xInnerHtml(obj, html);
+ obj.style.display = "block";
+
+ // 현재 자동저장중임을 설정
+ editorAutoSaveObj.locked = true;
+
+ // 서버 호출 (서버와 교신중이라는 메세지를 보이지 않도록 함)
+ show_waiting_message = false;
+ exec_xml("editor","procEditorSaveDoc", params, function() { editorAutoSaveObj.locked = false; } );
+ show_waiting_message = true;
+ }
+
+ // 10초마다 동기화를 시킴
+ setTimeout(_editorAutoSave, 10000);
+}
+
+// 자동저장된 모든 메세지를 삭제하는 루틴
+function editorRemoveSavedDoc() {
+ exec_xml("editor","procEditorRemoveSavedDoc");
+}