dsh-plugin-image-workbench 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/static/index.html +11 -7
package/package.json
CHANGED
package/server/static/index.html
CHANGED
|
@@ -4597,12 +4597,16 @@ async function openDrafts(){
|
|
|
4597
4597
|
d.items.forEach(it=>{
|
|
4598
4598
|
const row = document.createElement('div');
|
|
4599
4599
|
row.className = 'draft-row';
|
|
4600
|
-
/*
|
|
4601
|
-
|
|
4602
|
-
const
|
|
4600
|
+
/* 名字优先用标题:标题才是这篇东西叫什么,选题只是「想写什么」的一句话,
|
|
4601
|
+
以前选题优先,标题写好了却看到草稿叫「33333」 */
|
|
4602
|
+
const draftLabel = () => safeText(it.name || it.title || it.topic || '(无标题)');
|
|
4603
|
+
/* 小字只留「N 条分镜 · 跟主名不同的那条信息」:主名已经是标题了,
|
|
4604
|
+
再拼一遍标题等于占地方;选题也跟主名一样就跳过,试下第一条分镜标题 */
|
|
4605
|
+
const brief = [safeText(it.topic),
|
|
4606
|
+
safeText((it.titles || []).find(Boolean) || '')]
|
|
4607
|
+
.find(t => t && t !== draftLabel()) || '';
|
|
4603
4608
|
const sub = clipText([it.count ? it.count + ' 条分镜' : '无分镜',
|
|
4604
4609
|
brief ? clipText(brief, 12) : ''].filter(Boolean).join(' · '), 30);
|
|
4605
|
-
const draftLabel = () => safeText(it.name || it.topic || it.title || '(无选题)');
|
|
4606
4610
|
row.innerHTML = `<span class="dc"><b data-role="label">${esc(draftLabel())}</b>`
|
|
4607
4611
|
+ `<input class="rn-input" data-role="rn" type="text" maxlength="60" placeholder="输入草稿名称,留空恢复默认" style="display:none">`
|
|
4608
4612
|
+ `<span class="ds">${esc(fmtTime(it.updated))} · ${esc(sub)}</span></span>`
|
|
@@ -4615,8 +4619,8 @@ async function openDrafts(){
|
|
|
4615
4619
|
const labelEl = row.querySelector('[data-role="label"]');
|
|
4616
4620
|
const rnEl = row.querySelector('[data-role="rn"]');
|
|
4617
4621
|
/* 回显「当前这个名字」:自定义名优先,没有自定义名就回显它现在显示的默认名
|
|
4618
|
-
|
|
4619
|
-
const defaultName = () => safeText(it.
|
|
4622
|
+
(标题 / 选题),用户在现有名字上改,而不是对着一个空框重想 */
|
|
4623
|
+
const defaultName = () => safeText(it.title || it.topic || '');
|
|
4620
4624
|
const currentName = () => safeText(it.name || '') || defaultName();
|
|
4621
4625
|
rnEl.value = currentName();
|
|
4622
4626
|
row.querySelector('[data-act="rename"]').onclick = ()=>{
|
|
@@ -4634,7 +4638,7 @@ async function openDrafts(){
|
|
|
4634
4638
|
labelEl.style.display = 'block';
|
|
4635
4639
|
if (!save) { rnEl.value = currentName(); return; }
|
|
4636
4640
|
const val = Array.from(safeText(rnEl.value.trim())).slice(0, 60).join('');
|
|
4637
|
-
/*
|
|
4641
|
+
/* 改完正好等于默认名(标题 / 选题)就存空串,让名字继续跟着标题走,
|
|
4638
4642
|
免得把它写死成一份静态名称 */
|
|
4639
4643
|
const nextName = val === defaultName() ? '' : val;
|
|
4640
4644
|
if (nextName === (it.name || '')) { rnEl.value = currentName(); return; }
|