- Gradle 실행 설정 추가 (clean, compileJava)
- API 편집기 닫기 전 변경사항 알림/확인 로직 추가 - 저장 성공/초기 로드 시점 기준 스냅샷 로직 및 UI 처리를 반영
This commit is contained in:
@@ -29,6 +29,14 @@
|
||||
// (enricher 는 oauth·api_key 를 모두 apiKey-in-header 로 모델링하므로 scheme.type 만으로 구분 불가)
|
||||
var djbAuthType = '';
|
||||
|
||||
// 마지막 저장(또는 최초 로드) 시점의 state.data 스냅샷 — 닫기 전 미저장 변경 여부 판별용.
|
||||
var savedSnapshot = null;
|
||||
function isDirty() { return savedSnapshot !== null && JSON.stringify(state.data) !== savedSnapshot; }
|
||||
function closeEditor() {
|
||||
if (isDirty() && !window.confirm('저장하지 않은 변경사항이 있습니다. 저장하지 않고 닫으시겠습니까?')) return;
|
||||
window.close();
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// 2. 유틸
|
||||
// ============================================================
|
||||
@@ -1703,7 +1711,7 @@
|
||||
|
||||
var bSave = $('#btn-save'); if (bSave) bSave.addEventListener('click', () => saveSpec(false));
|
||||
var bRegen = $('#btn-regen'); if (bRegen) bRegen.addEventListener('click', regenerate);
|
||||
var bClose = $('#btn-close'); if (bClose) bClose.addEventListener('click', () => window.close());
|
||||
var bClose = $('#btn-close'); if (bClose) bClose.addEventListener('click', closeEditor);
|
||||
|
||||
// Cmd/Ctrl + S → 저장 (브라우저 기본 저장 대화상자 차단)
|
||||
document.addEventListener('keydown', function (e) {
|
||||
@@ -2066,6 +2074,7 @@
|
||||
.then(function (res) {
|
||||
if (res && res.status === 'success') {
|
||||
toast(temp ? '임시저장되었습니다' : '저장되었습니다');
|
||||
savedSnapshot = JSON.stringify(state.data); // 저장 성공 시점을 새 저장 기준선으로 갱신
|
||||
var badge = $('#hdr-source'); if (badge) { badge.textContent = '저장본'; badge.className = 'ml-1 px-2 py-0.5 text-[11px] rounded-full bg-emerald-50 text-emerald-700 border border-emerald-200'; badge.classList.remove('hidden'); }
|
||||
} else toast('저장 실패: ' + (res && res.errorMsg || ''), 'error');
|
||||
})
|
||||
@@ -2102,6 +2111,7 @@
|
||||
// ============================================================
|
||||
function init() {
|
||||
loadInitialData().then(function () {
|
||||
savedSnapshot = JSON.stringify(state.data); // 초기 로드(자동생성 포함) 완료 시점을 저장 기준선으로 설정
|
||||
renderStepper();
|
||||
renderForm();
|
||||
bindGlobalEvents();
|
||||
|
||||
Reference in New Issue
Block a user