This commit is contained in:
Vanessa 2023-06-01 21:04:58 +08:00
parent 6806392b41
commit 51b4b26426
11 changed files with 7 additions and 43981 deletions

File diff suppressed because one or more lines are too long

View file

@ -693,8 +693,6 @@
"appearance1": "Code Block Theme",
"appearance10": "Close button settings",
"appearance11": "shrink to the tray after clicking the close button",
"appearance14": "Doc icon uses the system native Emoji",
"appearance15": "The desktop uses Twitter Emoji by default, and the native Emoji font in the system will be used after it is turned on",
"appearance16": "Hide bottom status bar",
"appearance17": "Hide the status bar at the bottom of the desktop when enabled",
"min": "Min",

View file

@ -693,8 +693,6 @@
"appearance1": "Tema del bloque de código",
"appearance10": "Configuración del botón de cierre",
"appearance11": "encoger a la bandeja después de hacer clic en el botón de cierre",
"appearance14": "El icono del doctor utiliza el Emoji nativo del sistema",
"appearance15": "El escritorio utiliza Emojis de Twitter por defecto, y la fuente nativa de Emoji en el sistema se utilizará después de que se seleccione",
"appearance16": "Ocultar la barra de estado inferior",
"appearance17": "Ocultar la barra de estado en la parte inferior del escritorio cuando está activada",
"min": "Minimizar",

View file

@ -693,8 +693,6 @@
"appearance1": "Thème du bloc de codes",
"appearance10": "Close button settings",
"appearance11": "shrink to the tray after clicking the close button",
"appearance14": "L'icône Doc utilise l'Emoji natif du système",
"appearance15": "Le bureau utilise Twitter Emoji par défaut, et la police Emoji native du système sera utilisée après son activation",
"appearance16": "Masquer la barre d'état inférieure",
"appearance17": "Masquer la barre d'état en bas du bureau lorsqu'elle est activée",
"min": "Min",

View file

@ -693,8 +693,6 @@
"appearance1": "代碼塊主題",
"appearance10": "關閉按鈕設置",
"appearance11": "點擊關閉按鈕後縮小到託盤中",
"appearance14": "文檔圖示使用系統原生 Emoji",
"appearance15": "桌面端預設使用 Twitter Emoji啟用後將使用系統原生的 Emoji",
"appearance16": "隱藏底部狀態欄",
"appearance17": "啟用後將隱藏桌面端底部狀態欄",
"min": "最小化",

View file

@ -693,8 +693,6 @@
"appearance1": "代码块主题",
"appearance10": "关闭按钮设置",
"appearance11": "点击关闭按钮后缩小到托盘中",
"appearance14": "文档图标使用系统原生 Emoji",
"appearance15": "桌面端默认使用 Twitter Emoji启用后将使用系统原生的 Emoji",
"appearance16": "隐藏底部状态栏",
"appearance17": "启用后将隐藏桌面端底部状态栏",
"min": "最小化",

View file

@ -126,14 +126,6 @@ export const appearance = {
<svg><use xlink:href="#iconSettings"></use></svg>${window.siyuan.languages.config}
</button>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.appearance14}
<div class="b3-label__text">${window.siyuan.languages.appearance15}</div>
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="nativeEmoji" type="checkbox"${window.siyuan.config.appearance.nativeEmoji ? " checked" : ""}>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.appearance16}
@ -168,7 +160,6 @@ export const appearance = {
icons: window.siyuan.config.appearance.icons,
lang: (appearance.element.querySelector("#lang") as HTMLSelectElement).value,
closeButtonBehavior: (appearance.element.querySelector("#closeButtonBehavior") as HTMLInputElement).checked ? 1 : 0,
nativeEmoji: (appearance.element.querySelector("#nativeEmoji") as HTMLInputElement).checked,
hideStatusBar: (appearance.element.querySelector("#hideStatusBar") as HTMLInputElement).checked,
}, response => {
if (window.siyuan.config.appearance.themeJS) {
@ -242,7 +233,7 @@ export const appearance = {
});
},
onSetappearance(data: IAppearance) {
if (data.lang !== window.siyuan.config.appearance.lang || data.nativeEmoji !== window.siyuan.config.appearance.nativeEmoji) {
if (data.lang !== window.siyuan.config.appearance.lang) {
exportLayout({
reload: true,
onlyData: false,

View file

@ -47,11 +47,9 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
"export23", "export24"]),
// 外观
getLang(["language", "language1", "appearance", "appearance1", "appearance2",
"appearance3", "appearance4",
"appearance5", "appearance6", "appearance8", "appearance9", "appearance10", "appearance11",
"appearance14", "appearance15", "appearance16", "appearance17",
"resetLayout", "reset", "icon", "themeLight", "themeDark", "close", "themeOS", "theme",
getLang(["language", "language1", "appearance", "appearance1", "appearance2", "appearance3", "appearance4",
"appearance5", "appearance6", "appearance8", "appearance9", "appearance10", "appearance11", "appearance16",
"appearance17", "resetLayout", "reset", "icon", "themeLight", "themeDark", "close", "themeOS", "theme",
"theme2", "theme11", "theme12", "customEmoji", "customEmojiTip", "refresh"]),
// 集市

View file

@ -24,7 +24,7 @@ export const unicode2Emoji = (unicode: string, assic = false, className = "", ne
let emoji = "";
if (unicode.indexOf(".") > -1) {
emoji = `<img class="${className}" ${lazy ? "data-" : ""}src="/emojis/${unicode}"/>`;
} else if (isMobile() || window.siyuan.config.appearance.nativeEmoji || assic) {
} else {
try {
unicode.split("-").forEach(item => {
if (item.length < 5) {
@ -40,8 +40,6 @@ export const unicode2Emoji = (unicode: string, assic = false, className = "", ne
// 自定义表情搜索报错 https://github.com/siyuan-note/siyuan/issues/5883
// 这里忽略错误不做处理
}
} else {
emoji = `<svg class="${className || "custom-icon"}"><use xlink:href="#icon-${unicode}"></use></svg>`;
}
return emoji;
};

View file

@ -434,7 +434,6 @@ declare interface IWebSocketData {
declare interface IAppearance {
modeOS: boolean,
hideStatusBar: boolean,
nativeEmoji: boolean,
themeJS: boolean,
mode: number, // 1 暗黑0 明亮
icon: string,

View file

@ -105,7 +105,7 @@ export const loadAssets = (data: IAppearance) => {
while (svgElement.tagName === "svg") {
const currentSvgElement = svgElement;
svgElement = svgElement.nextElementSibling;
if (currentSvgElement.id !== "emojiScriptSvg" && !currentSvgElement.getAttribute("data-name")) {
if (!currentSvgElement.getAttribute("data-name")) {
currentSvgElement.remove();
}
}
@ -116,15 +116,8 @@ export const loadAssets = (data: IAppearance) => {
};
export const initAssets = () => {
const emojiElement = document.getElementById("emojiScript");
const loadingElement = document.getElementById("loading");
if (!emojiElement && !window.siyuan.config.appearance.nativeEmoji && !isMobile()) {
addScript("/appearance/emojis/twitter-emoji.js?v=1.0.1", "emojiScript").then(() => {
if (loadingElement) {
loadingElement.remove();
}
});
} else if (loadingElement) {
if (loadingElement) {
setTimeout(() => {
loadingElement.remove();
}, 160);