Ryu Sato 8 лет назад
Родитель
Сommit
d0dc0e96ae

+ 4 - 0
resource/js/components/PageEditor/Editor.js

@@ -182,13 +182,17 @@ export default class Editor extends React.Component {
     };
     };
 
 
     const interceptorManager = this.interceptorManager;
     const interceptorManager = this.interceptorManager;
+    console.log(performance.now() + ': interceptorManager.process is started');
     interceptorManager.process('preHandleEnter', context)
     interceptorManager.process('preHandleEnter', context)
       .then(() => {
       .then(() => {
         if (context.handlers.length == 0) {
         if (context.handlers.length == 0) {
           console.log('codemirror.commands.newlineAndIndentContinueMarkdownList(editor)');
           console.log('codemirror.commands.newlineAndIndentContinueMarkdownList(editor)');
+          console.log(performance.now() + ': codemirror.commands.newlineAndIndentContinueMarkdownList is started');
           codemirror.commands.newlineAndIndentContinueMarkdownList(editor);
           codemirror.commands.newlineAndIndentContinueMarkdownList(editor);
+          console.log(performance.now() + ': codemirror.commands.newlineAndIndentContinueMarkdownList is finished');
         }
         }
       });
       });
+    console.log(performance.now() + ': interceptorManager.process is finished');
   }
   }
 
 
   onScrollCursorIntoView(editor, event) {
   onScrollCursorIntoView(editor, event) {

+ 8 - 3
resource/js/util/interceptor/AbortContinueMarkdownListInterceptor.js

@@ -45,14 +45,17 @@ export default class AbortContinueMarkdownListInterceptor extends BasicIntercept
    * @inheritdoc
    * @inheritdoc
    */
    */
   process(contextName, ...args) {
   process(contextName, ...args) {
-    const context = Object.assign(args[0]);   // clone
-    const editor = context.editor;
+    console.log(performance.now() + ': AbortContinueMarkdownListInterceptor.process is started');
+    const orgContext = args[0];
+    const editor = orgContext.editor;
 
 
     console.log('AbortContinueMarkdownListInterceptor.process');
     console.log('AbortContinueMarkdownListInterceptor.process');
 
 
     // get strings from current position to EOL(end of line) before break the line
     // get strings from current position to EOL(end of line) before break the line
     const strToEol = this.getStrToEol(editor);
     const strToEol = this.getStrToEol(editor);
     if (this.indentAndMarkRE.test(strToEol)) {
     if (this.indentAndMarkRE.test(strToEol)) {
+      const context = Object.assign(args[0]);   // clone
+
       console.log('AbortContinueMarkdownListInterceptor.newlineAndIndentContinueMarkdownList: abort auto indent');
       console.log('AbortContinueMarkdownListInterceptor.newlineAndIndentContinueMarkdownList: abort auto indent');
       codemirror.commands.newlineAndIndent(editor);
       codemirror.commands.newlineAndIndent(editor);
       // replace the line with strToEol (abort auto indent)
       // replace the line with strToEol (abort auto indent)
@@ -62,8 +65,10 @@ export default class AbortContinueMarkdownListInterceptor extends BasicIntercept
       context.handlers.push(this.className);
       context.handlers.push(this.className);
     }
     }
 
 
+    console.log(performance.now() + ': AbortContinueMarkdownListInterceptor.process is finished');
+
     // resolve
     // resolve
-    return Promise.resolve(context);
+    return Promise.resolve(orgContext);
   }
   }
 
 
   /**
   /**

+ 11 - 4
resource/js/util/interceptor/ReformMarkdownTableInterceptor.js

@@ -46,15 +46,19 @@ export default class ReformMarkdownTableInterceptor extends BasicInterceptor {
    * @inheritdoc
    * @inheritdoc
    */
    */
   process(contextName, ...args) {
   process(contextName, ...args) {
-    const context = Object.assign(args[0]);   // clone
-    const editor = context.editor;
+    console.log(performance.now() + ': ReformMarkdownTableInterceptor.process is started');
 
 
-    console.log('MarkdownTableHelper.process');
+    const orgContext = args[0];
+    const editor = orgContext.editor;
 
 
     // get strings from BOL(beginning of line) to current position
     // get strings from BOL(beginning of line) to current position
     const strFromBol = this.getStrFromBol(editor);
     const strFromBol = this.getStrFromBol(editor);
 
 
     if (this.linePartOfTableRE.test(strFromBol)) {
     if (this.linePartOfTableRE.test(strFromBol)) {
+      const context = Object.assign(args[0]);   // clone
+      const editor = context.editor;
+
+      console.log('MarkdownTableHelper.process');
 
 
       // get lines all of table from current position to beginning of table
       // get lines all of table from current position to beginning of table
       const strTableLines = this.getStrFromBot(editor);
       const strTableLines = this.getStrFromBot(editor);
@@ -73,8 +77,11 @@ export default class ReformMarkdownTableInterceptor extends BasicInterceptor {
       context.handlers.push(this.className);
       context.handlers.push(this.className);
     }
     }
 
 
+    console.log(performance.now() + ': ReformMarkdownTableInterceptor.process is finished');
+
     // resolve
     // resolve
-    return Promise.resolve(context);
+    // return Promise.resolve(context);
+    return Promise.resolve(orgContext);
   }
   }
 
 
   /**
   /**