|
@@ -14,7 +14,7 @@ import {escapeHtml} from "../util/escape";
|
|
|
import {getWorkspaceName} from "../util/noRelyPCFunction";
|
|
|
import {needSubscribe} from "../util/needSubscribe";
|
|
|
import {redirectToCheckAuth, setNoteBook} from "../util/pathName";
|
|
|
-import {getAllModels} from "../layout/getAll";
|
|
|
+import {getAllEditor, getAllModels} from "../layout/getAll";
|
|
|
import {reloadProtyle} from "../protyle/util/reload";
|
|
|
import {Tab} from "../layout/Tab";
|
|
|
import {setEmpty} from "../mobile/util/setEmpty";
|
|
@@ -144,6 +144,22 @@ export const reloadSync = (
|
|
|
/// #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) => {
|
|
|
if (window.siyuan.config.readonly) {
|
|
|
return;
|