리펙토링 - 전체 프로젝트 코드 (Codex)
This commit is contained in:
@@ -2,6 +2,7 @@ import { state } from './state.js';
|
||||
import * as dragDrop from './handlers/drag-drop.js';
|
||||
import * as hoverPreview from './handlers/image-preview.js';
|
||||
import * as selection from './handlers/selection.js';
|
||||
import { buildSequentialName, getNameFormat } from './utils/file-names.js';
|
||||
|
||||
const grid = document.getElementById('grid');
|
||||
const emptyState = document.getElementById('empty-state');
|
||||
@@ -110,14 +111,12 @@ export function updateNumberBadges() {
|
||||
}
|
||||
|
||||
export function updateNewNameLabels() {
|
||||
const prefix = inputPrefix.value.trim() || 'photo';
|
||||
const digits = Math.max(1, Math.min(6, parseInt(inputDigits.value) || 3));
|
||||
const format = getNameFormat(inputPrefix, inputDigits);
|
||||
Array.from(grid.children).forEach((card, i) => {
|
||||
const el = card.querySelector('.card-new-name');
|
||||
const file = state.files[i];
|
||||
if (!el || !file) return;
|
||||
const ext = file.name.split('.').pop().toLowerCase();
|
||||
el.textContent = `→ ${prefix}_${String(i + 1).padStart(digits, '0')}.${ext}`;
|
||||
el.textContent = `→ ${buildSequentialName(file.name, i, format)}`;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user