mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
🚨
This commit is contained in:
parent
a18e3a585c
commit
8c19d17946
7 changed files with 15 additions and 16 deletions
|
|
@ -339,7 +339,7 @@ export const bazaar = {
|
||||||
highlightRender(mdElement);
|
highlightRender(mdElement);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
readmeElement.classList.add("config-bazaar__readme--show")
|
readmeElement.classList.add("config-bazaar__readme--show");
|
||||||
},
|
},
|
||||||
bindEvent() {
|
bindEvent() {
|
||||||
fetchPost("/api/bazaar/getBazaarTheme", {}, response => {
|
fetchPost("/api/bazaar/getBazaarTheme", {}, response => {
|
||||||
|
|
@ -377,7 +377,7 @@ export const bazaar = {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
} else if (type === "goBack") {
|
} else if (type === "goBack") {
|
||||||
bazaar.element.querySelector("#configBazaarReadme").classList.remove("config-bazaar__readme--show")
|
bazaar.element.querySelector("#configBazaarReadme").classList.remove("config-bazaar__readme--show");
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ export const genItemPanel = (type: string, containerElement:Element) => {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
export const openSetting = () => {
|
export const openSetting = () => {
|
||||||
const exitDialog = window.siyuan.dialogs.find((item) => {
|
const exitDialog = window.siyuan.dialogs.find((item) => {
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ export const initConfigSearch = (element: HTMLElement) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 右侧面板过滤
|
// 右侧面板过滤
|
||||||
const panelElement = element.querySelector(`.config__tab-container[data-name="${type}"]`)
|
const panelElement = element.querySelector(`.config__tab-container[data-name="${type}"]`);
|
||||||
if (panelElement.innerHTML === "") {
|
if (panelElement.innerHTML === "") {
|
||||||
genItemPanel(type, panelElement);
|
genItemPanel(type, panelElement);
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +126,7 @@ export const initConfigSearch = (element: HTMLElement) => {
|
||||||
} else {
|
} else {
|
||||||
panelElement.querySelectorAll(`.config__tab-container[data-name="${type}"] .b3-label`).forEach((itemElement: HTMLElement) => {
|
panelElement.querySelectorAll(`.config__tab-container[data-name="${type}"] .b3-label`).forEach((itemElement: HTMLElement) => {
|
||||||
if (!itemElement.classList.contains("fn__none")) {
|
if (!itemElement.classList.contains("fn__none")) {
|
||||||
const text = itemElement.textContent.toLowerCase()
|
const text = itemElement.textContent.toLowerCase();
|
||||||
if (text.indexOf(inputValue.toLowerCase()) > -1 || inputValue.toLowerCase().indexOf(text) > -1) {
|
if (text.indexOf(inputValue.toLowerCase()) > -1 || inputValue.toLowerCase().indexOf(text) > -1) {
|
||||||
itemElement.style.display = "";
|
itemElement.style.display = "";
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ import {getLocalStorage} from "./protyle/util/compatibility";
|
||||||
import {updateEditModeElement} from "./layout/topBar";
|
import {updateEditModeElement} from "./layout/topBar";
|
||||||
import {getSearch} from "./util/functions";
|
import {getSearch} from "./util/functions";
|
||||||
import {hideAllElements} from "./protyle/ui/hideElements";
|
import {hideAllElements} from "./protyle/ui/hideElements";
|
||||||
import {initPluginSystem} from 'siyuan-petal';
|
import {initPluginSystem} from "siyuan-petal";
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ export class Outline extends Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateDocTitle(ial?: IObject) {
|
public updateDocTitle(ial?: IObject) {
|
||||||
const docTitleElement = this.headerElement.nextElementSibling as HTMLElement
|
const docTitleElement = this.headerElement.nextElementSibling as HTMLElement;
|
||||||
if (this.type === "pin") {
|
if (this.type === "pin") {
|
||||||
if (ial) {
|
if (ial) {
|
||||||
let iconHTML = `${unicode2Emoji(ial.icon || Constants.SIYUAN_IMAGE_FILE, false, "b3-list-item__graphic", true)}`;
|
let iconHTML = `${unicode2Emoji(ial.icon || Constants.SIYUAN_IMAGE_FILE, false, "b3-list-item__graphic", true)}`;
|
||||||
|
|
@ -186,12 +186,12 @@ export class Outline extends Model {
|
||||||
docTitleElement.innerHTML = `${iconHTML}
|
docTitleElement.innerHTML = `${iconHTML}
|
||||||
<span class="b3-list-item__text">${escapeHtml(ial.title)}</span>`;
|
<span class="b3-list-item__text">${escapeHtml(ial.title)}</span>`;
|
||||||
docTitleElement.setAttribute("title", ial.title);
|
docTitleElement.setAttribute("title", ial.title);
|
||||||
docTitleElement.classList.remove("fn__none")
|
docTitleElement.classList.remove("fn__none");
|
||||||
} else {
|
} else {
|
||||||
docTitleElement.classList.add("fn__none")
|
docTitleElement.classList.add("fn__none");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
docTitleElement.classList.add("fn__none")
|
docTitleElement.classList.add("fn__none");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import {processPasteCode, processRender} from "./processCode";
|
||||||
import {writeText} from "./compatibility";
|
import {writeText} from "./compatibility";
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
import {clipboard} from "electron";
|
import {clipboard} from "electron";
|
||||||
import {getCurrentWindow} from "@electron/remote";
|
|
||||||
/// #endif
|
/// #endif
|
||||||
import {hasClosestBlock} from "./hasClosest";
|
import {hasClosestBlock} from "./hasClosest";
|
||||||
import {focusByWbr, getEditorRange} from "./selection";
|
import {focusByWbr, getEditorRange} from "./selection";
|
||||||
|
|
|
||||||
|
|
@ -10,19 +10,19 @@ import {showMessage} from "../dialog/message";
|
||||||
|
|
||||||
export const isSYProtocol = (url: string) => {
|
export const isSYProtocol = (url: string) => {
|
||||||
return /^siyuan:\/\/blocks\/\d{14}-\w{7}/.test(url);
|
return /^siyuan:\/\/blocks\/\d{14}-\w{7}/.test(url);
|
||||||
}
|
};
|
||||||
|
|
||||||
export const getIdFromSYProtocol = (url: string) => {
|
export const getIdFromSYProtocol = (url: string) => {
|
||||||
return url.substring(16, 16 + 22);
|
return url.substring(16, 16 + 22);
|
||||||
}
|
};
|
||||||
|
|
||||||
/* redirect to auth page */
|
/* redirect to auth page */
|
||||||
export const redirectToCheckAuth = (to: string = window.location.href) => {
|
export const redirectToCheckAuth = (to: string = window.location.href) => {
|
||||||
const url = new URL(window.location.origin);
|
const url = new URL(window.location.origin);
|
||||||
url.pathname = '/check-auth';
|
url.pathname = "/check-auth";
|
||||||
url.searchParams.set('to', to);
|
url.searchParams.set("to", to);
|
||||||
window.location.href = url.href;
|
window.location.href = url.href;
|
||||||
}
|
};
|
||||||
|
|
||||||
export const addBaseURL = () => {
|
export const addBaseURL = () => {
|
||||||
let baseURLElement = document.getElementById("baseURL");
|
let baseURLElement = document.getElementById("baseURL");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue