terms: per-term installer visibility toggles + universal delete (v0.3.4)
- _meta.json: customLabels -> terms.{label,showInInstaller,showInInstallerRp}
- Drop builtin protection; any term kind can be deleted/added/toggled
- New public route /manifest/terms/<pack>/index.json for installer term lists
- Installers fetch terms:list dynamically; skip agreement step if list empty
- Term editor: 2 visibility checkboxes (설치기 / 리소스팩 설치기), multi-select
- Migration from old schema preserves custom labels (default: visible in both)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
var dirtyMark = document.getElementById('dirty-mark')
|
||||
var saveBtn = document.getElementById('saveBtn')
|
||||
var tabBtns = document.querySelectorAll('.tabBar .tabBtn')
|
||||
var visInstaller = document.getElementById('visInstaller')
|
||||
var visInstallerRp = document.getElementById('visInstallerRp')
|
||||
|
||||
editor.value = INITIAL || ''
|
||||
var dirty = false
|
||||
@@ -23,6 +25,10 @@
|
||||
dirtyMark.hidden = !v
|
||||
}
|
||||
|
||||
// 토글이 바뀌어도 dirty 표시. 저장 시 함께 전송된다.
|
||||
if (visInstaller) visInstaller.addEventListener('change', function () { setDirty(true) })
|
||||
if (visInstallerRp) visInstallerRp.addEventListener('change', function () { setDirty(true) })
|
||||
|
||||
// ─── markdown 미리 보기용 미니 렌더러 ────────────────────────────────
|
||||
// 정식 markdown 파서는 아니지만, 본 편집기가 만들어 내는 형태(#, ##, ###,
|
||||
// - , 1. , > , ---, ``` , 토글 details) 정도는 충실히 처리한다.
|
||||
@@ -162,10 +168,13 @@
|
||||
function save() {
|
||||
status.classList.remove('error')
|
||||
status.textContent = I18N.saving
|
||||
var payload = { content: editor.value }
|
||||
if (visInstaller) payload.showInInstaller = !!visInstaller.checked
|
||||
if (visInstallerRp) payload.showInInstallerRp = !!visInstallerRp.checked
|
||||
fetch('/op/agreement/' + encodeURIComponent(PACK_KEY) + '/' + encodeURIComponent(TERM_KIND), {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ content: editor.value })
|
||||
body: JSON.stringify(payload)
|
||||
}).then(function (r) {
|
||||
return r.json().then(function (j) { return { ok: r.ok && j && j.ok !== false, body: j } })
|
||||
}).then(function (res) {
|
||||
|
||||
Reference in New Issue
Block a user