Spaces:
Running
Running
Upload 2 files
Browse files- static/app.js +3 -2
- static/style.css +4 -7
static/app.js
CHANGED
|
@@ -2002,8 +2002,9 @@ function proofreadHTMLV2(item) {
|
|
| 2002 |
const tags = Array.isArray(article.tags) ? article.tags : [];
|
| 2003 |
const metadata = `<fieldset><legend>文章元数据</legend><label class="proofread-field"><span>标题</span><input data-meta-title value="${escapeHTML(article.title || item.title || "")}"></label><label class="proofread-field"><span>作者</span>${listEditorHTML("authors", article.authors || item.authors || [], [{ key: "value", label: "作者" }])}</label><label class="proofread-field"><span>日期</span>${listEditorHTML("dates", article.dates || [], [{ key: "year", label: "年", type: "number" }, { key: "month", label: "月", type: "number" }, { key: "day", label: "日", type: "number" }])}</label><label class="proofread-field"><span>标签</span>${listEditorHTML("tags", tags, [{ key: "name", label: "名称" }, { key: "type", label: "类型", options: TAG_TYPES }])}</label></fieldset>`;
|
| 2004 |
const sourceMetadata = `<fieldset><legend>来源元数据</legend><label class="proofread-field"><span>来源名称</span><input data-source-name value="${escapeHTML(item.publication_name || "")}"></label><label class="proofread-field"><span>来源作者</span><input data-source-author value="${escapeHTML(item.publication_author || "")}"></label><label class="proofread-field"><span>来源类型</span><input data-source-type value="${escapeHTML(item.publication_type || "")}"></label><label class="proofread-field"><span>来源文件</span>${listEditorHTML("files", sourceFiles.map((file) => file.url), [{ key: "value", label: "URL" }])}</label></fieldset>`;
|
| 2005 |
-
const
|
| 2006 |
-
|
|
|
|
| 2007 |
}
|
| 2008 |
|
| 2009 |
function proofreadHTML(item) {
|
|
|
|
| 2002 |
const tags = Array.isArray(article.tags) ? article.tags : [];
|
| 2003 |
const metadata = `<fieldset><legend>文章元数据</legend><label class="proofread-field"><span>标题</span><input data-meta-title value="${escapeHTML(article.title || item.title || "")}"></label><label class="proofread-field"><span>作者</span>${listEditorHTML("authors", article.authors || item.authors || [], [{ key: "value", label: "作者" }])}</label><label class="proofread-field"><span>日期</span>${listEditorHTML("dates", article.dates || [], [{ key: "year", label: "年", type: "number" }, { key: "month", label: "月", type: "number" }, { key: "day", label: "日", type: "number" }])}</label><label class="proofread-field"><span>标签</span>${listEditorHTML("tags", tags, [{ key: "name", label: "名称" }, { key: "type", label: "类型", options: TAG_TYPES }])}</label></fieldset>`;
|
| 2004 |
const sourceMetadata = `<fieldset><legend>来源元数据</legend><label class="proofread-field"><span>来源名称</span><input data-source-name value="${escapeHTML(item.publication_name || "")}"></label><label class="proofread-field"><span>来源作者</span><input data-source-author value="${escapeHTML(item.publication_author || "")}"></label><label class="proofread-field"><span>来源类型</span><input data-source-type value="${escapeHTML(item.publication_type || "")}"></label><label class="proofread-field"><span>来源文件</span>${listEditorHTML("files", sourceFiles.map((file) => file.url), [{ key: "value", label: "URL" }])}</label></fieldset>`;
|
| 2005 |
+
const mobileModeLabel = STATE.isMobile ? "切换到电脑模式" : "切换到手机模式";
|
| 2006 |
+
const actions = `<div class="preview-tools proofread-tools"><button type="button" class="icon-btn-sm" data-close-preview aria-label="关闭预览" title="关闭预览">×</button><button type="button" class="icon-btn-sm proofread-mode-btn" data-preview-mobile aria-label="${mobileModeLabel}" title="${mobileModeLabel}"><span class="ui-icon ${STATE.isMobile ? "ui-icon-phone" : "ui-icon-desktop"}" aria-hidden="true"></span></button><button type="button" class="icon-btn-sm preview-theme-btn" data-preview-theme aria-label="切换到白天模式" title="白天模式">${THEME_ICON[STATE.isDark ? "dark" : "light"]}</button></div>`;
|
| 2007 |
+
return `<div class="preview-header"><div class="preview-heading">${previewTitleHTML(item)}<div class="preview-compare-note"><span>对比原文件并校对</span><button type="button" class="text-btn-sm proofread-back-btn" data-proofread-back>返回预览</button></div></div><div class="preview-actions">${actions}</div></div><div class="proofread-grid"><section class="proofread-source"><div class="proofread-pane-header"><span>原文件</span>${sourcePicker}</div>${sourceViewer}</section><form class="proofread-editor" data-proofread-form><div class="proofread-pane-header"><span>校订内容</span><button type="submit" class="result-action-btn primary">提交校订</button></div>${metadata}${sourceMetadata}<fieldset><legend>正文</legend><div class="proofread-form-actions"><button type="button" class="text-btn-sm" data-fulltext-toggle>全文编辑</button><button type="button" class="text-btn-sm" data-part-editor-toggle>段落编辑</button></div><div data-fulltext-box hidden><textarea data-fulltext-input>${escapeHTML((article.parts || []).map((_part, index) => partTextWithPivots(article, index)).join("\n"))}</textarea><button type="button" class="text-btn-sm" data-fulltext-apply>应用到段落</button></div><div data-part-editor hidden>${parts}${comments}</div><label class="proofread-field"><span>正文说明</span><textarea data-proofread-description>${escapeHTML(article.description || "")}</textarea></label></fieldset><label class="proofread-field"><span>校订备注</span><textarea data-proofread-note></textarea></label></form></div>`;
|
| 2008 |
}
|
| 2009 |
|
| 2010 |
function proofreadHTML(item) {
|
static/style.css
CHANGED
|
@@ -553,6 +553,9 @@ ul, li {
|
|
| 553 |
margin-top: 4px;
|
| 554 |
font-size: 12px;
|
| 555 |
color: var(--primary);
|
|
|
|
|
|
|
|
|
|
| 556 |
}
|
| 557 |
|
| 558 |
.preview-compare-grid {
|
|
@@ -1146,7 +1149,7 @@ body.mobile.preview-open .preview-tools {
|
|
| 1146 |
|
| 1147 |
body.mobile.preview-open .proofread-tools {
|
| 1148 |
display: grid;
|
| 1149 |
-
grid-template-columns:
|
| 1150 |
align-items: start;
|
| 1151 |
justify-items: start;
|
| 1152 |
}
|
|
@@ -1155,12 +1158,6 @@ body.mobile.preview-open .proofread-mode-btn {
|
|
| 1155 |
display: flex;
|
| 1156 |
}
|
| 1157 |
|
| 1158 |
-
body.mobile.preview-open .proofread-tools .proofread-back-btn {
|
| 1159 |
-
grid-column: 1;
|
| 1160 |
-
grid-row: 2;
|
| 1161 |
-
justify-content: center;
|
| 1162 |
-
}
|
| 1163 |
-
|
| 1164 |
body.mobile.preview-open .proofread-tools .preview-theme-btn {
|
| 1165 |
grid-column: 2;
|
| 1166 |
grid-row: 2;
|
|
|
|
| 553 |
margin-top: 4px;
|
| 554 |
font-size: 12px;
|
| 555 |
color: var(--primary);
|
| 556 |
+
display: flex;
|
| 557 |
+
align-items: center;
|
| 558 |
+
gap: 8px;
|
| 559 |
}
|
| 560 |
|
| 561 |
.preview-compare-grid {
|
|
|
|
| 1149 |
|
| 1150 |
body.mobile.preview-open .proofread-tools {
|
| 1151 |
display: grid;
|
| 1152 |
+
grid-template-columns: 28px 28px;
|
| 1153 |
align-items: start;
|
| 1154 |
justify-items: start;
|
| 1155 |
}
|
|
|
|
| 1158 |
display: flex;
|
| 1159 |
}
|
| 1160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1161 |
body.mobile.preview-open .proofread-tools .preview-theme-btn {
|
| 1162 |
grid-column: 2;
|
| 1163 |
grid-row: 2;
|