Vanessa 2025-03-04 21:55:18 +08:00
parent 2d2420794c
commit dcc1e32a30
14 changed files with 73 additions and 33 deletions

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "نظام الملفات المحلي", "relativeFontSize": "نسبة إلى حجم خط المحرر",
"localFileSystem": "نظام الملفات المحلي",
"deviceNotSupport": "الجهاز الحالي غير مدعوم", "deviceNotSupport": "الجهاز الحالي غير مدعوم",
"second": "ثانية", "second": "ثانية",
"syncInterval": "الفاصل الزمني للمزامنة", "syncInterval": "الفاصل الزمني للمزامنة",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "Lokales Dateisystem", "relativeFontSize": "relativ zur Schriftgröße des Editors",
"localFileSystem": "Lokales Dateisystem",
"deviceNotSupport": "Das aktuelle Gerät wird nicht unterstützt", "deviceNotSupport": "Das aktuelle Gerät wird nicht unterstützt",
"second": "Sekunde", "second": "Sekunde",
"syncInterval": "Synchronisierungsintervall", "syncInterval": "Synchronisierungsintervall",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "Local file system", "relativeFontSize": "relative to the editor font size",
"localFileSystem": "Local file system",
"deviceNotSupport": "The current device is not supported", "deviceNotSupport": "The current device is not supported",
"second": "second", "second": "second",
"syncInterval": "sync interval", "syncInterval": "sync interval",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "Sistema de archivos local", "relativeFontSize": "en relación con el tamaño de fuente del editor",
"localFileSystem": "Sistema de archivos local",
"deviceNotSupport": "El dispositivo actual no es compatible", "deviceNotSupport": "El dispositivo actual no es compatible",
"second": "segundo", "second": "segundo",
"syncInterval": "intervalo de sincronización", "syncInterval": "intervalo de sincronización",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "Système de fichiers local", "relativeFontSize": "par rapport à la taille de la police de l'éditeur",
"localFileSystem": "Système de fichiers local",
"deviceNotSupport": "L'appareil actuel n'est pas pris en charge", "deviceNotSupport": "L'appareil actuel n'est pas pris en charge",
"second": "seconde", "second": "seconde",
"syncInterval": "intervalle de synchronisation", "syncInterval": "intervalle de synchronisation",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "מערכת קבצים מקומית", "relativeFontSize": "יחסית לגודל הגופן של העורך",
"localFileSystem": "מערכת קבצים מקומית",
"deviceNotSupport": "המכשיר הנוכחי אינו נתמך", "deviceNotSupport": "המכשיר הנוכחי אינו נתמך",
"second": "שנייה", "second": "שנייה",
"syncInterval": "מרווח סנכרון", "syncInterval": "מרווח סנכרון",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "File system locale", "relativeFontSize": "rispetto alla dimensione del carattere dell'editor",
"localFileSystem": "File system locale",
"deviceNotSupport": "Il dispositivo corrente non è supportato", "deviceNotSupport": "Il dispositivo corrente non è supportato",
"second": "secondo", "second": "secondo",
"syncInterval": "intervallo di sincronizzazione", "syncInterval": "intervallo di sincronizzazione",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "ローカルファイルシステム", "relativeFontSize": "エディターのフォントサイズに対して",
"localFileSystem": "ローカルファイルシステム",
"deviceNotSupport": "現在のデバイスはサポートされていません", "deviceNotSupport": "現在のデバイスはサポートされていません",
"second": "秒", "second": "秒",
"syncInterval": "同期間隔", "syncInterval": "同期間隔",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "Lokalny system plików", "relativeFontSize": "względem rozmiaru czcionki edytora",
"localFileSystem": "Lokalny system plików",
"deviceNotSupport": "Bieżące urządzenie nie jest obsługiwane", "deviceNotSupport": "Bieżące urządzenie nie jest obsługiwane",
"second": "sekunda", "second": "sekunda",
"syncInterval": "interwał synchronizacji", "syncInterval": "interwał synchronizacji",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "Локальная файловая система", "relativeFontSize": "относительно размера шрифта редактора",
"localFileSystem": "Локальная файловая система",
"deviceNotSupport": "Текущее устройство не поддерживается", "deviceNotSupport": "Текущее устройство не поддерживается",
"second": "секунда", "second": "секунда",
"syncInterval": "интервал синхронизации", "syncInterval": "интервал синхронизации",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "本地檔案系統", "relativeFontSize": "相對於編輯器字號",
"localFileSystem": "本地檔案系統",
"deviceNotSupport": "當前設備不支援", "deviceNotSupport": "當前設備不支援",
"second": "秒", "second": "秒",
"syncInterval": "同步間隔", "syncInterval": "同步間隔",

View File

@ -1,5 +1,6 @@
{ {
"localFlieSystem": "本地文件系统", "relativeFontSize": "相对于编辑器字号",
"localFileSystem": "本地文件系统",
"deviceNotSupport": "当前设备不支持", "deviceNotSupport": "当前设备不支持",
"second": "秒", "second": "秒",
"syncInterval": "同步间隔", "syncInterval": "同步间隔",

View File

@ -424,7 +424,7 @@ export const repos = {
<option value="0" ${window.siyuan.config.sync.provider === 0 ? "selected" : ""}>SiYuan</option> <option value="0" ${window.siyuan.config.sync.provider === 0 ? "selected" : ""}>SiYuan</option>
<option value="2" ${window.siyuan.config.sync.provider === 2 ? "selected" : ""}>S3</option> <option value="2" ${window.siyuan.config.sync.provider === 2 ? "selected" : ""}>S3</option>
<option value="3" ${window.siyuan.config.sync.provider === 3 ? "selected" : ""}>WebDAV</option> <option value="3" ${window.siyuan.config.sync.provider === 3 ? "selected" : ""}>WebDAV</option>
<option value="4" ${window.siyuan.config.sync.provider === 4 ? "selected" : ""}>${window.siyuan.languages.localFlieSystem}</option> <option value="4" ${window.siyuan.config.sync.provider === 4 ? "selected" : ""}>${window.siyuan.languages.localFileSystem}</option>
</select> </select>
</div> </div>
<div id="syncProviderPanel" class="b3-label"> <div id="syncProviderPanel" class="b3-label">

View File

@ -139,25 +139,23 @@ export const appearanceMenu = (protyle: IProtyle, nodeElements?: Element[]) => {
<button data-type="style4" class="protyle-font__style" style="text-shadow: 1px 1px var(--b3-theme-surface-lighter), 2px 2px var(--b3-theme-surface-lighter), 3px 3px var(--b3-theme-surface-lighter), 4px 4px var(--b3-theme-surface-lighter)">${window.siyuan.languages.shadow}</button> <button data-type="style4" class="protyle-font__style" style="text-shadow: 1px 1px var(--b3-theme-surface-lighter), 2px 2px var(--b3-theme-surface-lighter), 3px 3px var(--b3-theme-surface-lighter), 4px 4px var(--b3-theme-surface-lighter)">${window.siyuan.languages.shadow}</button>
</div> </div>
<div class="fn__hr${disableFont ? " fn__none" : ""}"></div> <div class="fn__hr${disableFont ? " fn__none" : ""}"></div>
<div class="${disableFont ? " fn__none" : ""}">${window.siyuan.languages.fontSize}</div>
<div class="fn__hr--small${disableFont ? " fn__none" : ""}"></div>
<div class="fn__flex${disableFont ? " fn__none" : ""}"> <div class="fn__flex${disableFont ? " fn__none" : ""}">
<div class="fn__space--small"></div> ${window.siyuan.languages.fontSize}
<select class="b3-select fn__block"> <span class="fn__flex-1"></span>
<option ${fontSize === "12px" ? "selected" : ""} value="12px">12px</option> <label class="fn__flex">
<option ${fontSize === "13px" ? "selected" : ""} value="13px">13px</option>
<option ${fontSize === "14px" ? "selected" : ""} value="14px">14px</option> <span class="fn__space"></span>
<option ${fontSize === "15px" ? "selected" : ""} value="15px">15px</option> <input class="b3-switch fn__flex-center" ${fontSize.endsWith("em") ? "checked" : ""} type="checkbox">
<option ${fontSize === "16px" ? "selected" : ""} value="16px">16px</option> </label>
<option ${fontSize === "19px" ? "selected" : ""} value="19px">19px</option> </div>
<option ${fontSize === "22px" ? "selected" : ""} value="22px">22px</option> <div class="${disableFont ? " fn__none" : ""}">
<option ${fontSize === "24px" ? "selected" : ""} value="24px">24px</option> <div class="fn__hr"></div>
<option ${fontSize === "29px" ? "selected" : ""} value="29px">29px</option> <div class="b3-tooltips b3-tooltips__n fn__flex${fontSize.endsWith("em") ? " fn__none" : ""}" aria-label="${fontSize}">
<option ${fontSize === "32px" ? "selected" : ""} value="32px">32px</option> <input class="b3-slider fn__block" id="fontSizePX" max="72" min="9" step="1" type="range" value="${parseInt(fontSize)}">
<option ${fontSize === "40px" ? "selected" : ""} value="40px">40px</option> </div>
<option ${fontSize === "48px" ? "selected" : ""} value="48px">48px</option> <div class="b3-tooltips b3-tooltips__n fn__flex${fontSize.endsWith("em") ? "" : " fn__none"}" aria-label="${parseInt(fontSize) * 100}%">
</select> <input class="b3-slider fn__block" id="fontSizeEM" max="4.5" min="0.56" step="0.01" type="range" value="${parseInt(fontSize)}">
<div class="fn__space--small"></div> </div>
</div> </div>
<div class="fn__hr--b"></div> <div class="fn__hr--b"></div>
<div class="fn__flex"> <div class="fn__flex">
@ -188,8 +186,38 @@ export const appearanceMenu = (protyle: IProtyle, nodeElements?: Element[]) => {
target = target.parentElement; target = target.parentElement;
} }
}); });
element.querySelector("select").addEventListener("change", function (event: Event) { const switchElement = element.querySelector(".b3-switch") as HTMLInputElement;
fontEvent(protyle, nodeElements, "fontSize", (event.target as HTMLSelectElement).value); const fontSizePXElement = element.querySelector("#fontSizePX") as HTMLInputElement;
const fontSizeEMElement = element.querySelector("#fontSizeEM") as HTMLInputElement;
switchElement.addEventListener("change", function () {
if (switchElement.checked) {
// px -> em
const em = parseFloat((parseInt(fontSizePXElement.value) / 16).toFixed(2));
fontSizeEMElement.parentElement.setAttribute("aria-label", (em * 100).toString() + "%");
fontSizeEMElement.value = em.toString();
fontSizePXElement.parentElement.classList.add("fn__none");
fontSizeEMElement.parentElement.classList.remove("fn__none");
} else {
const px = Math.round(parseInt(fontSizeEMElement.value) * 16);
fontSizePXElement.parentElement.setAttribute("aria-label", px + "px");
fontSizePXElement.value = px.toString();
fontSizePXElement.parentElement.classList.remove("fn__none");
fontSizeEMElement.parentElement.classList.add("fn__none");
}
});
fontSizePXElement.addEventListener("change", function () {
fontEvent(protyle, nodeElements, "fontSize", fontSizePXElement.value + "px");
});
fontSizeEMElement.addEventListener("change", function () {
fontEvent(protyle, nodeElements, "fontSize", fontSizeEMElement.value + "em");
});
fontSizePXElement.addEventListener("input", function () {
fontSizePXElement.parentElement.setAttribute("aria-label", fontSizePXElement.value + "px");
});
fontSizeEMElement.addEventListener("input", function () {
fontSizeEMElement.parentElement.setAttribute("aria-label", (parseFloat(fontSizeEMElement.value) * 100).toFixed(0) + "%")
}); });
return element; return element;
}; };