Parcourir la source

:rotating_light:

Vanessa il y a 2 ans
Parent
commit
4ede229dd0

+ 5 - 5
app/src/editor/util.ts

@@ -102,14 +102,14 @@ const openFile = (options: IOpenFileOptions) => {
             if (initData) {
             if (initData) {
                 const initObj = JSON.parse(initData);
                 const initObj = JSON.parse(initData);
                 if (initObj.rootId === options.rootID || initObj.blockId === options.rootID) {
                 if (initObj.rootId === options.rootID || initObj.blockId === options.rootID) {
-                    initObj.blockId = options.id
-                    initObj.mode = options.mode
+                    initObj.blockId = options.id;
+                    initObj.mode = options.mode;
                     if (options.zoomIn) {
                     if (options.zoomIn) {
-                        initObj.action = [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS]
+                        initObj.action = [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS];
                     } else {
                     } else {
-                        initObj.action = options.action
+                        initObj.action = options.action;
                     }
                     }
-                    delete initObj.scrollAttr
+                    delete initObj.scrollAttr;
                     item.headElement.setAttribute("data-initdata", JSON.stringify(initObj));
                     item.headElement.setAttribute("data-initdata", JSON.stringify(initObj));
                     item.parent.switchTab(item.headElement);
                     item.parent.switchTab(item.headElement);
                     return true;
                     return true;

+ 3 - 3
app/src/menus/tab.ts

@@ -163,12 +163,12 @@ export const initTabMenu = (tab: Tab) => {
     const model = tab.model;
     const model = tab.model;
     let rootId;
     let rootId;
     if ((model && model instanceof Editor)) {
     if ((model && model instanceof Editor)) {
-        rootId = model.editor.protyle.block.rootID
+        rootId = model.editor.protyle.block.rootID;
     } else {
     } else {
-        const initData = tab.headElement.getAttribute("data-initdata")
+        const initData = tab.headElement.getAttribute("data-initdata");
         if (initData) {
         if (initData) {
             const initDataObj = JSON.parse(initData);
             const initDataObj = JSON.parse(initData);
-            rootId = initDataObj.rootId || initDataObj.blockId
+            rootId = initDataObj.rootId || initDataObj.blockId;
         }
         }
     }
     }
     if (rootId) {
     if (rootId) {

+ 1 - 1
app/src/protyle/util/onGet.ts

@@ -120,7 +120,7 @@ export const onGet = (data: IWebSocketData, protyle: IProtyle, action: string[]
         if (scrollObj && protyle.options.mode !== "preview") {
         if (scrollObj && protyle.options.mode !== "preview") {
             restoreScroll(protyle, scrollObj);
             restoreScroll(protyle, scrollObj);
         }
         }
-        removeLoading(protyle)
+        removeLoading(protyle);
     });
     });
 };
 };
 
 

+ 8 - 8
app/src/protyle/wysiwyg/keydown.ts

@@ -1068,7 +1068,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                 protyle,
                 protyle,
                 nodeElement,
                 nodeElement,
                 type: "Blocks2Ps",
                 type: "Blocks2Ps",
-            })
+            });
             event.preventDefault();
             event.preventDefault();
             event.stopPropagation();
             event.stopPropagation();
             return true;
             return true;
@@ -1079,7 +1079,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                 nodeElement,
                 nodeElement,
                 type: "Blocks2Hs",
                 type: "Blocks2Hs",
                 level: 1
                 level: 1
-            })
+            });
             event.preventDefault();
             event.preventDefault();
             event.stopPropagation();
             event.stopPropagation();
             return true;
             return true;
@@ -1090,7 +1090,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                 nodeElement,
                 nodeElement,
                 type: "Blocks2Hs",
                 type: "Blocks2Hs",
                 level: 2
                 level: 2
-            })
+            });
             event.preventDefault();
             event.preventDefault();
             event.stopPropagation();
             event.stopPropagation();
             return true;
             return true;
@@ -1101,7 +1101,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                 nodeElement,
                 nodeElement,
                 type: "Blocks2Hs",
                 type: "Blocks2Hs",
                 level: 3
                 level: 3
-            })
+            });
             event.preventDefault();
             event.preventDefault();
             event.stopPropagation();
             event.stopPropagation();
             return true;
             return true;
@@ -1112,7 +1112,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                 nodeElement,
                 nodeElement,
                 type: "Blocks2Hs",
                 type: "Blocks2Hs",
                 level: 4
                 level: 4
-            })
+            });
             event.preventDefault();
             event.preventDefault();
             event.stopPropagation();
             event.stopPropagation();
             return true;
             return true;
@@ -1123,7 +1123,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                 nodeElement,
                 nodeElement,
                 type: "Blocks2Hs",
                 type: "Blocks2Hs",
                 level: 5
                 level: 5
-            })
+            });
             event.preventDefault();
             event.preventDefault();
             event.stopPropagation();
             event.stopPropagation();
             return true;
             return true;
@@ -1134,7 +1134,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                 nodeElement,
                 nodeElement,
                 type: "Blocks2Hs",
                 type: "Blocks2Hs",
                 level: 6
                 level: 6
-            })
+            });
             event.preventDefault();
             event.preventDefault();
             event.stopPropagation();
             event.stopPropagation();
             return true;
             return true;
@@ -1482,7 +1482,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
                 const selectsElement: HTMLElement[] = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
                 const selectsElement: HTMLElement[] = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
                 let html = "";
                 let html = "";
                 if (selectsElement.length === 0) {
                 if (selectsElement.length === 0) {
-                    selectsElement.push(nodeElement)
+                    selectsElement.push(nodeElement);
                 }
                 }
                 selectsElement.forEach(item => {
                 selectsElement.forEach(item => {
                     item.querySelectorAll('[contenteditable="true"]').forEach(editItem => {
                     item.querySelectorAll('[contenteditable="true"]').forEach(editItem => {

+ 2 - 2
app/src/protyle/wysiwyg/transaction.ts

@@ -1,6 +1,6 @@
-import {fetchPost, fetchSyncPost} from "../../util/fetch";
+import {fetchPost} from "../../util/fetch";
 import {focusBlock, focusByRange, focusByWbr, focusSideBlock, getEditorRange} from "../util/selection";
 import {focusBlock, focusByRange, focusByWbr, focusSideBlock, getEditorRange} from "../util/selection";
-import {getContenteditableElement, getTopAloneElement} from "./getBlock";
+import {getTopAloneElement} from "./getBlock";
 import {Constants} from "../../constants";
 import {Constants} from "../../constants";
 import {blockRender} from "../markdown/blockRender";
 import {blockRender} from "../markdown/blockRender";
 import {processRender} from "../util/processCode";
 import {processRender} from "../util/processCode";