mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
f9f2252946
commit
41a7c5d63f
5 changed files with 15 additions and 18 deletions
|
|
@ -18,6 +18,14 @@ export const editor = {
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
<input class="b3-switch fn__flex-center" id="fullWidth" type="checkbox"${window.siyuan.config.editor.fullWidth ? " checked" : ""}/>
|
<input class="b3-switch fn__flex-center" id="fullWidth" type="checkbox"${window.siyuan.config.editor.fullWidth ? " checked" : ""}/>
|
||||||
</label>
|
</label>
|
||||||
|
<label class="fn__flex b3-label">
|
||||||
|
<div class="fn__flex-1">
|
||||||
|
${window.siyuan.languages.editReadonly}
|
||||||
|
<div class="b3-label__text">${window.siyuan.languages.editReadonlyTip}</div>
|
||||||
|
</div>
|
||||||
|
<span class="fn__space"></span>
|
||||||
|
<input class="b3-switch fn__flex-center" id="readOnly" type="checkbox"${window.siyuan.config.editor.readOnly ? " checked" : ""}/>
|
||||||
|
</label>
|
||||||
<label class="fn__flex b3-label">
|
<label class="fn__flex b3-label">
|
||||||
<div class="fn__flex-1">
|
<div class="fn__flex-1">
|
||||||
${window.siyuan.languages.md12}
|
${window.siyuan.languages.md12}
|
||||||
|
|
@ -162,6 +170,7 @@ export const editor = {
|
||||||
const setEditor = () => {
|
const setEditor = () => {
|
||||||
fetchPost("/api/setting/setEditor", {
|
fetchPost("/api/setting/setEditor", {
|
||||||
fullWidth: (editor.element.querySelector("#fullWidth") as HTMLInputElement).checked,
|
fullWidth: (editor.element.querySelector("#fullWidth") as HTMLInputElement).checked,
|
||||||
|
readOnly: (editor.element.querySelector("#readOnly") as HTMLInputElement).checked,
|
||||||
displayBookmarkIcon: (editor.element.querySelector("#displayBookmarkIcon") as HTMLInputElement).checked,
|
displayBookmarkIcon: (editor.element.querySelector("#displayBookmarkIcon") as HTMLInputElement).checked,
|
||||||
displayNetImgMark: (editor.element.querySelector("#displayNetImgMark") as HTMLInputElement).checked,
|
displayNetImgMark: (editor.element.querySelector("#displayNetImgMark") as HTMLInputElement).checked,
|
||||||
codeSyntaxHighlightLineNum: (editor.element.querySelector("#codeSyntaxHighlightLineNum") as HTMLInputElement).checked,
|
codeSyntaxHighlightLineNum: (editor.element.querySelector("#codeSyntaxHighlightLineNum") as HTMLInputElement).checked,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ export const initConfigSearch = (element: HTMLElement) => {
|
||||||
getLang(["config", "fullWidth",
|
getLang(["config", "fullWidth",
|
||||||
"editor", "md2", "md3", "md12", "md16", "md27", "md28", "md29", "md30", "md31", "md32", "md33", "md34",
|
"editor", "md2", "md3", "md12", "md16", "md27", "md28", "md29", "md30", "md31", "md32", "md33", "md34",
|
||||||
"md39", "md40", "fontSizeTip", "fontSize", "font", "font1", "generateHistory", "generateHistoryInterval",
|
"md39", "md40", "fontSizeTip", "fontSize", "font", "font1", "generateHistory", "generateHistoryInterval",
|
||||||
"historyRetentionDays", "historyRetentionDaysTip", "clearHistory", "katexMacros", "katexMacrosTip"
|
"historyRetentionDays", "historyRetentionDaysTip", "clearHistory", "katexMacros", "katexMacrosTip",
|
||||||
|
"editReadonly", "editReadonlyTip"
|
||||||
]),
|
]),
|
||||||
|
|
||||||
// 文档树
|
// 文档树
|
||||||
|
|
|
||||||
|
|
@ -53,22 +53,8 @@ export const initAppearance = (modelElement: HTMLElement, modelMainElement: HTML
|
||||||
</div>`;
|
</div>`;
|
||||||
modelMainElement.querySelector(".b3-slider").addEventListener("input", (event: InputEvent & { target: HTMLInputElement }) => {
|
modelMainElement.querySelector(".b3-slider").addEventListener("input", (event: InputEvent & { target: HTMLInputElement }) => {
|
||||||
modelMainElement.querySelector("#fontSize").textContent = event.target.value + "px";
|
modelMainElement.querySelector("#fontSize").textContent = event.target.value + "px";
|
||||||
fetchPost("/api/setting/setEditor", {
|
window.siyuan.config.editor.fontSize = parseInt(event.target.value);
|
||||||
displayBookmarkIcon: window.siyuan.config.editor.displayBookmarkIcon,
|
fetchPost("/api/setting/setEditor", window.siyuan.config.editor, (response) => {
|
||||||
displayNetImgMark: window.siyuan.config.editor.displayNetImgMark,
|
|
||||||
codeLineWrap: window.siyuan.config.editor.codeLineWrap,
|
|
||||||
codeSyntaxHighlightLineNum: window.siyuan.config.editor.codeSyntaxHighlightLineNum,
|
|
||||||
virtualBlockRef: window.siyuan.config.editor.virtualBlockRef,
|
|
||||||
virtualBlockRefExclude: window.siyuan.config.editor.virtualBlockRefExclude,
|
|
||||||
blockRefDynamicAnchorTextMaxLen: window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen,
|
|
||||||
fontSize: parseInt((modelMainElement.querySelector(".b3-slider") as HTMLInputElement).value),
|
|
||||||
codeLigatures: window.siyuan.config.editor.codeLigatures,
|
|
||||||
codeTabSpaces: window.siyuan.config.editor.codeTabSpaces,
|
|
||||||
generateHistoryInterval: window.siyuan.config.editor.generateHistoryInterval,
|
|
||||||
historyRetentionDays: window.siyuan.config.editor.historyRetentionDays,
|
|
||||||
fontFamily: window.siyuan.config.editor.fontFamily,
|
|
||||||
emoji: window.siyuan.config.editor.emoji
|
|
||||||
}, (response) => {
|
|
||||||
window.siyuan.config.editor = response.data;
|
window.siyuan.config.editor = response.data;
|
||||||
reloadProtyle(window.siyuan.mobileEditor.protyle);
|
reloadProtyle(window.siyuan.mobileEditor.protyle);
|
||||||
setInlineStyle();
|
setInlineStyle();
|
||||||
|
|
|
||||||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -230,6 +230,7 @@ declare interface IExport {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare interface IEditor {
|
declare interface IEditor {
|
||||||
|
readOnly: boolean;
|
||||||
katexMacros: string;
|
katexMacros: string;
|
||||||
fullWidth: boolean;
|
fullWidth: boolean;
|
||||||
fontSize: number;
|
fontSize: number;
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ const initBar = () => {
|
||||||
</div>
|
</div>
|
||||||
<div id="barHistory" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.dataHistory} ${updateHotkeyTip(window.siyuan.config.keymap.general.dataHistory.custom)}">
|
<div id="barHistory" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.dataHistory} ${updateHotkeyTip(window.siyuan.config.keymap.general.dataHistory.custom)}">
|
||||||
<svg>
|
<svg>
|
||||||
<use xlink:href="#iconVideo"></use>
|
<use xlink:href="#iconTrashcan"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div id="barSetting" class="toolbar__item b3-tooltips b3-tooltips__se${window.siyuan.config.readonly ? " fn__none" : ""}" aria-label="${window.siyuan.languages.config} ${updateHotkeyTip(window.siyuan.config.keymap.general.config.custom)}">
|
<div id="barSetting" class="toolbar__item b3-tooltips b3-tooltips__se${window.siyuan.config.readonly ? " fn__none" : ""}" aria-label="${window.siyuan.languages.config} ${updateHotkeyTip(window.siyuan.config.keymap.general.config.custom)}">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue