mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
1 parent
6d782de471
commit
f5463b9479
17 files changed
+72
-50
No files matched your search
@@ -227,19 +227,19 @@
|
||||
<details id="objectGradientFields" hidden>
|
||||
<summary>渐变</summary>
|
||||
<div class="form-pair">
|
||||
<div class="form-row"><label for="gradientTarget">作用</label><select id="gradientTarget"><option value="fill">填充</option><option value="stroke">描边</option></select></div>
|
||||
<div class="form-row"><label for="gradientTarget">应用</label><select id="gradientTarget"><option value="fill">填充</option><option value="stroke">描边</option></select></div>
|
||||
<div class="form-row"><label for="gradientKind">类型</label><select id="gradientKind"><option value="keep">保持</option><option value="linear">线性</option><option value="radial">径向</option></select></div>
|
||||
</div>
|
||||
<div id="gradientControls" hidden>
|
||||
<div class="form-row"><label for="gradientAngle">角度</label><div class="form-unit"><input id="gradientAngle" type="number" step="any" value="0"><span>°</span></div></div>
|
||||
<div class="gradient-stop-row gradient-stop-head"><span>颜色</span><span>位置%</span><span>透明%</span><span></span></div>
|
||||
<div id="gradientStops"></div>
|
||||
<button id="gradientAdd" class="small-button" type="button" title="添加色标" aria-label="添加色标">+</button>
|
||||
<button id="gradientAdd" class="icon-button" type="button" title="添加色标" aria-label="添加色标">+</button>
|
||||
</div>
|
||||
</details>
|
||||
<details id="objectPatternFields" hidden>
|
||||
<summary>图案</summary>
|
||||
<div class="form-row"><label for="patternTarget">作用</label><select id="patternTarget"><option value="fill">填充</option><option value="stroke">描边</option></select></div>
|
||||
<div class="form-row"><label for="patternTarget">应用</label><select id="patternTarget"><option value="fill">填充</option><option value="stroke">描边</option></select></div>
|
||||
<div class="form-pair">
|
||||
<div class="form-row"><label for="patternWidth">宽度</label><div class="form-unit"><input id="patternWidth" type="number" min="0" step="any"><span>mm</span></div></div>
|
||||
<div class="form-row"><label for="patternHeight">高度</label><div class="form-unit"><input id="patternHeight" type="number" min="0" step="any"><span>mm</span></div></div>
|
||||
@@ -437,7 +437,7 @@
|
||||
<label class="form-row"><span>标题</span><input id="infoTitle" type="text" autofocus></label>
|
||||
<label class="form-row"><span>主题</span><input id="infoSubject" type="text"></label>
|
||||
<label class="form-row"><span>作者</span><input id="infoAuthor" type="text"></label>
|
||||
<details class="info-custom"><summary>扩展</summary><div id="infoCustomRows"></div><button id="infoCustomAdd" class="small-button" type="button" title="添加字段" aria-label="添加字段">+</button></details>
|
||||
<details class="info-custom"><summary>扩展</summary><div id="infoCustomRows"></div><button id="infoCustomAdd" class="icon-button" type="button" title="添加字段" aria-label="添加字段">+</button></details>
|
||||
<div class="form-actions"><div id="infoStatus" class="form-status" role="status"></div><button id="infoCancel" class="button" type="button">取消</button><button class="button" type="submit">确定</button></div>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -559,8 +559,8 @@
|
||||
<div class="form-row"><span>预览</span><div class="seal-position-options"><button id="signPick" class="button" type="button">定位</button><label><input id="signKeepRatio" type="checkbox" checked>等比</label></div></div>
|
||||
<div class="form-row"><label for="signPlacement">位置</label><select id="signPlacement"><option value="normal">页面</option><option value="seam">骑缝</option></select></div>
|
||||
<div class="form-row"><label for="signPages">页码</label><input id="signPages" type="text" autocomplete="off" spellcheck="false"></div>
|
||||
<div class="form-row"><label for="signX">横坐标</label><div class="form-unit"><input id="signX" type="number" min="0" step="any" value="10" aria-label="横坐标(毫米)"><span>mm</span></div></div>
|
||||
<div class="form-row"><label for="signY">纵坐标</label><div class="form-unit"><input id="signY" type="number" min="0" step="any" value="10" aria-label="纵坐标(毫米)"><span>mm</span></div></div>
|
||||
<div class="form-row"><label for="signX">横向</label><div class="form-unit"><input id="signX" type="number" min="0" step="any" value="10" aria-label="横坐标(毫米)"><span>mm</span></div></div>
|
||||
<div class="form-row"><label for="signY">纵向</label><div class="form-unit"><input id="signY" type="number" min="0" step="any" value="10" aria-label="纵坐标(毫米)"><span>mm</span></div></div>
|
||||
<div class="form-row"><label for="signWidth">宽度</label><div class="form-unit"><input id="signWidth" type="number" min="0.01" step="any" value="40" aria-label="宽度(毫米)"><span>mm</span></div></div>
|
||||
<div class="form-row"><label for="signHeight">高度</label><div class="form-unit"><input id="signHeight" type="number" min="0.01" step="any" value="40" aria-label="高度(毫米)"><span>mm</span></div></div>
|
||||
</div>
|
||||
@@ -788,7 +788,7 @@
|
||||
</section>
|
||||
<section class="doc-font-panel" aria-labelledby="docFontPanelTitle">
|
||||
<div class="panel-row">
|
||||
<div id="docFontPanelTitle" class="panel-title compact">OFD 字体</div>
|
||||
<div id="docFontPanelTitle" class="panel-title compact">文档字体</div>
|
||||
<span id="docFontSummary" class="count-pill">0</span>
|
||||
</div>
|
||||
<div id="docFontList" class="doc-font-list"></div>
|
||||
|
||||
+24
-6
@@ -1214,7 +1214,7 @@ button:not(:disabled):hover {
|
||||
}
|
||||
|
||||
.info-custom-row input,
|
||||
.gradient-stop-row input,
|
||||
.gradient-stop-row input[type="number"],
|
||||
.structure-attribute > input,
|
||||
.form-row input[type="text"],
|
||||
.form-row input[type="password"],
|
||||
@@ -1260,8 +1260,8 @@ button:not(:disabled):hover {
|
||||
.info-custom-row {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) var(--control-height);
|
||||
gap: 6px;
|
||||
margin: 6px 0;
|
||||
gap: 8px;
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
#infoCustomRows > :first-child {
|
||||
@@ -1271,8 +1271,8 @@ button:not(:disabled):hover {
|
||||
.gradient-stop-row {
|
||||
display: grid;
|
||||
grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) var(--control-height);
|
||||
gap: 6px;
|
||||
margin: 6px 0;
|
||||
gap: 8px;
|
||||
margin: 8px 0;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@@ -1280,9 +1280,27 @@ button:not(:disabled):hover {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.gradient-stop-head,
|
||||
#gradientStops {
|
||||
overflow-y: auto;
|
||||
scrollbar-gutter: stable;
|
||||
}
|
||||
|
||||
#gradientStops {
|
||||
max-height: 180px;
|
||||
overflow-y: auto;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
#gradientStops > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#gradientStops > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.gradient-stop-row .color-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#infoCustomRows :focus-visible,
|
||||
|
||||
+13
-11
@@ -887,7 +887,7 @@ function addCustomDataRow(field = {Name: "", Value: ""}, sourceIndex) {
|
||||
}
|
||||
const remove = document.createElement("button");
|
||||
remove.type = "button";
|
||||
remove.className = "small-button";
|
||||
remove.className = "icon-button";
|
||||
remove.textContent = "×";
|
||||
remove.title = "删除字段";
|
||||
remove.setAttribute("aria-label", "删除字段");
|
||||
@@ -2045,6 +2045,7 @@ function addGradientStop(position, color, transparency, source) {
|
||||
for (const [type, value, label] of [["color", color, "色标颜色"], ["number", position, "色标位置"], ["number", transparency, "色标透明度"]]) {
|
||||
const input = document.createElement("input");
|
||||
input.type = type;
|
||||
if (type === "color") input.className = "color-input";
|
||||
input.value = value;
|
||||
input.disabled = el.gradientKind.value === "keep";
|
||||
input.setAttribute("aria-label", label);
|
||||
@@ -2054,7 +2055,7 @@ function addGradientStop(position, color, transparency, source) {
|
||||
}
|
||||
const remove = document.createElement("button");
|
||||
remove.type = "button";
|
||||
remove.className = "small-button";
|
||||
remove.className = "icon-button";
|
||||
remove.textContent = "×";
|
||||
remove.title = "删除色标";
|
||||
remove.setAttribute("aria-label", "删除色标");
|
||||
@@ -5619,8 +5620,8 @@ function renderStyleResourceSettings(kind) {
|
||||
}
|
||||
settingsField(content, "斜体", "Italic", value.Italic, "checkbox");
|
||||
settingsSelect(content, "端点", "Cap", [["", "继承"], ["Butt", "平头"], ["Round", "圆头"], ["Square", "方头"]], value.Cap || "");
|
||||
settingsSelect(content, "连接", "Join", [["", "继承"], ["Miter", "尖角"], ["Round", "圆角"], ["Bevel", "斜角"]], value.Join || "");
|
||||
settingsField(content, "虚线", "DashPattern", value.DashPattern || "");
|
||||
settingsSelect(content, "转角", "Join", [["", "继承"], ["Miter", "尖角"], ["Round", "圆角"], ["Bevel", "斜角"]], value.Join || "");
|
||||
settingsField(content, "间隔", "DashPattern", value.DashPattern || "").title = "虚线间隔";
|
||||
settingsField(content, "偏移", "DashOffset", value.DashOffset ?? "", "number", "mm");
|
||||
for (const [key, label] of [["FillColor", "填充"], ["StrokeColor", "描边"]]) {
|
||||
settingsSelect(content, label, key + "Mode", [["keep", "原有"], ["inherit", "继承"], ["solid", "颜色"]], "keep");
|
||||
@@ -5641,7 +5642,7 @@ function renderStyleResourceSettings(kind) {
|
||||
if (kind === "ColorSpace") {
|
||||
settingsSelect(binding, "应用", "PaintTarget", [["fill", "填充"], ["stroke", "描边"]], "fill");
|
||||
settingsSelect(binding, "方式", "PaintMode", [["value", "分量"], ["index", "索引"]], "value");
|
||||
settingsField(binding, "颜色值", "PaintValue", value.Type === "CMYK" ? `0 0 0 ${2 ** (value.BitsPerComponent || 8) - 1}` : value.Type === "GRAY" ? "0" : "0 0 0");
|
||||
settingsField(binding, "色值", "PaintValue", value.Type === "CMYK" ? `0 0 0 ${2 ** (value.BitsPerComponent || 8) - 1}` : value.Type === "GRAY" ? "0" : "0 0 0");
|
||||
}
|
||||
const apply = settingsButton("应用", () => applyStyleResource(kind), !objects.value, "Apply", group.actions);
|
||||
const unbind = kind === "DrawParam" ? settingsButton("解绑", () => applyStyleResource(kind, true), !objects.value, "Unbind", group.actions) : null;
|
||||
@@ -5784,7 +5785,8 @@ function renderTemplateSettings() {
|
||||
settingsElements.Content.append(source);
|
||||
}
|
||||
settingsPages(source, "SourcePage", settings.page);
|
||||
document.querySelector("#settingsSourcePage").closest("label").firstElementChild.textContent = "来源页";
|
||||
document.querySelector("#settingsSourcePage").closest("label").firstElementChild.textContent = "来源";
|
||||
document.querySelector("#settingsSourcePage").setAttribute("aria-label", "来源页");
|
||||
const write = async (operation, order = 0) => {
|
||||
if (operation === "replace" && !window.confirm("替换模板内容?当前文档中引用此模板的页面将同步更新。")) return;
|
||||
const selected = settings.selected;
|
||||
@@ -6626,7 +6628,7 @@ function updateSignPlacement() {
|
||||
input.disabled = !stamp;
|
||||
input.required = stamp;
|
||||
}
|
||||
document.querySelector('label[for="signX"]').textContent = el.signPlacement.value === "seam" ? "右侧内缩" : "横坐标";
|
||||
document.querySelector('label[for="signX"]').textContent = el.signPlacement.value === "seam" ? "右侧内缩" : "横向";
|
||||
el.signX.setAttribute("aria-label", el.signPlacement.value === "seam" ? "右侧内缩(毫米)" : "横坐标(毫米)");
|
||||
}
|
||||
|
||||
@@ -7354,7 +7356,7 @@ function createFlowShell(page) {
|
||||
surface.className = "page-surface";
|
||||
const placeholder = document.createElement("div");
|
||||
placeholder.className = "page-placeholder";
|
||||
placeholder.textContent = `第 ${page.index + 1} 页`;
|
||||
placeholder.textContent = `第${page.index + 1}页`;
|
||||
shell.append(surface, placeholder);
|
||||
layoutPageShell(shell, page);
|
||||
return shell;
|
||||
@@ -8728,7 +8730,7 @@ function renderSearchResults() {
|
||||
button.dataset.matchIndex = String(i);
|
||||
const page = document.createElement("span");
|
||||
page.className = "search-page";
|
||||
page.textContent = `第 ${match.page + 1} 页`;
|
||||
page.textContent = `第${match.page + 1}页`;
|
||||
const text = document.createElement("span");
|
||||
const mark = document.createElement("mark");
|
||||
mark.textContent = match.text;
|
||||
@@ -8922,7 +8924,7 @@ function createOutlineList(outlines, path = []) {
|
||||
const page = document.createElement("span");
|
||||
page.className = "outline-page";
|
||||
page.textContent = String(outline.page);
|
||||
page.setAttribute("aria-label", `第 ${outline.page} 页`);
|
||||
page.setAttribute("aria-label", `第${outline.page}页`);
|
||||
link.append(page);
|
||||
}
|
||||
if (outline.actionCount || outline.page || state.editing) {
|
||||
@@ -9168,7 +9170,7 @@ function createThumbnail(page) {
|
||||
|
||||
const label = document.createElement("span");
|
||||
label.className = "thumb-label";
|
||||
label.textContent = `第 ${page.index + 1} 页`;
|
||||
label.textContent = `第${page.index + 1}页`;
|
||||
|
||||
const size = document.createElement("span");
|
||||
size.className = "thumb-size";
|
||||
|
||||
Reference in new issue
Block a user