mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
This commit is contained in:
parent
e9f7cc0d52
commit
7879c7a72a
2 changed files with 21 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ import {escapeHtml} from "../util/escape";
|
||||||
import {getWorkspaceName} from "../util/noRelyPCFunction";
|
import {getWorkspaceName} from "../util/noRelyPCFunction";
|
||||||
import {needSubscribe} from "../util/needSubscribe";
|
import {needSubscribe} from "../util/needSubscribe";
|
||||||
import {redirectToCheckAuth, setNoteBook} from "../util/pathName";
|
import {redirectToCheckAuth, setNoteBook} from "../util/pathName";
|
||||||
import {getAllModels} from "../layout/getAll";
|
import {getAllEditor, getAllModels} from "../layout/getAll";
|
||||||
import {reloadProtyle} from "../protyle/util/reload";
|
import {reloadProtyle} from "../protyle/util/reload";
|
||||||
import {Tab} from "../layout/Tab";
|
import {Tab} from "../layout/Tab";
|
||||||
import {setEmpty} from "../mobile/util/setEmpty";
|
import {setEmpty} from "../mobile/util/setEmpty";
|
||||||
|
|
@ -144,6 +144,22 @@ export const reloadSync = (
|
||||||
/// #endif
|
/// #endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const setRefDynamicText = (data: {
|
||||||
|
"blockID": string,
|
||||||
|
"defBlockID": string,
|
||||||
|
"refText": string,
|
||||||
|
"rootID": string
|
||||||
|
}) => {
|
||||||
|
getAllEditor().forEach(item => {
|
||||||
|
if (item.protyle.block.rootID === data.rootID) {
|
||||||
|
const refElement = item.protyle.wysiwyg.element.querySelector(`[data-node-id="${data.blockID}"] span[data-type="block-ref"][data-subtype="d"][data-id="${data.defBlockID}"]`);
|
||||||
|
if (refElement) {
|
||||||
|
refElement.innerHTML = data.refText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export const lockScreen = (app: App) => {
|
export const lockScreen = (app: App) => {
|
||||||
if (window.siyuan.config.readonly) {
|
if (window.siyuan.config.readonly) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import {
|
||||||
progressBackgroundTask,
|
progressBackgroundTask,
|
||||||
progressLoading,
|
progressLoading,
|
||||||
progressStatus,
|
progressStatus,
|
||||||
reloadSync,
|
reloadSync, setRefDynamicText,
|
||||||
setTitle,
|
setTitle,
|
||||||
transactionError
|
transactionError
|
||||||
} from "./dialog/processSystem";
|
} from "./dialog/processSystem";
|
||||||
|
|
@ -61,6 +61,9 @@ export class App {
|
||||||
});
|
});
|
||||||
if (data) {
|
if (data) {
|
||||||
switch (data.cmd) {
|
switch (data.cmd) {
|
||||||
|
case "setRefDynamicText":
|
||||||
|
setRefDynamicText(data.data);
|
||||||
|
break;
|
||||||
case "reloadPlugin":
|
case "reloadPlugin":
|
||||||
reloadPlugin(this, data.data);
|
reloadPlugin(this, data.data);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue