파일 이름 변경 내용에 접미사 추가

This commit is contained in:
2026-05-22 08:02:51 +09:00
parent f3193672c6
commit 77bc2815a3
7 changed files with 23 additions and 9 deletions
+5 -1
View File
@@ -27,6 +27,7 @@ const btnSortDate = document.getElementById('btn-sort-date');
const btnRename = document.getElementById('btn-rename');
const inputPrefix = document.getElementById('input-prefix');
const inputDigits = document.getElementById('input-digits');
const inputPostfix = document.getElementById('input-postfix');
const previewName = document.getElementById('preview-name');
const dirPath = document.getElementById('dir-path');
const rubberBand = document.getElementById('rubber-band');
@@ -113,6 +114,7 @@ window.api.onFullscreenChange((isFullscreen) => {
// ── 버튼 / 키보드 이벤트 ─────────────────────────
inputPrefix.addEventListener('input', updatePreview);
inputDigits.addEventListener('input', updatePreview);
inputPostfix.addEventListener('input', updatePreview);
btnOpen.addEventListener('click', () => {
log('ui', 'open button clicked');
folderController.openFolder();
@@ -146,7 +148,9 @@ initKeyboardShortcuts({
function updatePreview() {
const prefix = inputPrefix.value.trim() || 'photo';
const digits = clampDigits(inputDigits.value);
const postfix = inputPostfix.value.trim();
const ext = state.files.length ? getExtension(state.files[0].name) : 'jpg';
previewName.textContent = `${prefix}_${'1'.padStart(digits, '0')}.${ext}`;
const suffix = postfix ? `_${postfix}` : '';
previewName.textContent = `${prefix}_${'1'.padStart(digits, '0')}${suffix}.${ext}`;
updateNewNameLabels();
}