fix(ui): 补齐 generator.html 和 listmanager.html 的问号剥离兜底
- generator.html: 新增 ds() 钩子,在 renderList / batch 预览 / showToast 三个渲染点统一问号剥离 - listmanager.html: 新增 ds() 钩子,在 renderList / renderSequence / 自定义 select 选项 / showToast 四个点统一问号剥离 - APP_VERSION_TEXT bump 到 v1.0.107
This commit is contained in:
@@ -452,6 +452,14 @@
|
||||
<div class="toast-container" id="toast-container"></div>
|
||||
|
||||
<script>
|
||||
function ds(x) {
|
||||
let v = String(x == null ? '' : x)
|
||||
.replace(/[?¿?]+/g, '')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim();
|
||||
return v === '' ? '-' : v;
|
||||
}
|
||||
|
||||
const ICONS = {
|
||||
up: `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="18 15 12 9 6 15"></polyline></svg>`,
|
||||
down: `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg>`,
|
||||
@@ -471,8 +479,8 @@
|
||||
toast.className = 'toast';
|
||||
toast.innerHTML = `
|
||||
<div>
|
||||
<div style="font-weight:600; font-size:0.9rem; margin-bottom:2px">${title}</div>
|
||||
<div style="font-size:0.8rem; color:var(--text-muted)">${message}</div>
|
||||
<div style="font-weight:600; font-size:0.9rem; margin-bottom:2px">${ds(title)}</div>
|
||||
<div style="font-size:0.8rem; color:var(--text-muted)">${ds(message)}</div>
|
||||
</div>
|
||||
`;
|
||||
container.appendChild(toast);
|
||||
@@ -539,7 +547,8 @@
|
||||
let html = `<div class="custom-select-option ${selectedFileValue === '' ? 'selected' : ''}" data-value="" onclick="selectCustomOption('', '-- Select an audio file --')">-- Select an audio file --</div>`;
|
||||
availableFiles.forEach(f => {
|
||||
const isSelected = selectedFileValue === f ? 'selected' : '';
|
||||
html += `<div class="custom-select-option ${isSelected}" data-value="${f}" onclick="selectCustomOption('${f}', '${f}')">${f}</div>`;
|
||||
const dsF = ds(f);
|
||||
html += `<div class="custom-select-option ${isSelected}" data-value="${f}" onclick="selectCustomOption('${f}', '${dsF}')">${dsF}</div>`;
|
||||
});
|
||||
optionsContainer.innerHTML = html;
|
||||
}
|
||||
@@ -576,9 +585,10 @@
|
||||
const div = document.createElement('div');
|
||||
div.className = 'list-item';
|
||||
|
||||
const tagsHtml = (item.files || []).map(f => `<span class="tag">${f}</span>`).join(' ');
|
||||
const dsCode = ds(item.code);
|
||||
const tagsHtml = (item.files || []).map(f => `<span class="tag">${ds(f)}</span>`).join(' ');
|
||||
div.innerHTML = `
|
||||
<div class="code">${item.code}</div>
|
||||
<div class="code">${dsCode}</div>
|
||||
<div>${tagsHtml || '<span style="color:var(--text-muted); font-style: italic;">No files</span>'}</div>
|
||||
<div style="display:flex; gap:6px;">
|
||||
<button class="btn-icon" onclick="openEditModal(${index})" aria-label="Edit">${ICONS.edit}</button>
|
||||
@@ -636,7 +646,7 @@
|
||||
const div = document.createElement('div');
|
||||
div.className = 'edit-file-item';
|
||||
div.innerHTML = `
|
||||
<div class="edit-file-name">${file}</div>
|
||||
<div class="edit-file-name">${ds(file)}</div>
|
||||
<div class="edit-file-actions">
|
||||
<button class="btn-icon" onclick="moveFile(${idx}, -1)" ${idx === 0 ? 'disabled style="opacity:0.35"' : ''} aria-label="Up">${ICONS.up}</button>
|
||||
<button class="btn-icon" onclick="moveFile(${idx}, 1)" ${idx === currentSequence.length - 1 ? 'disabled style="opacity:0.35"' : ''} aria-label="Down">${ICONS.down}</button>
|
||||
|
||||
Reference in New Issue
Block a user