Quellcode durchsuchen

remove debug codes.

Ryu Sato vor 8 Jahren
Ursprung
Commit
989ccb425c

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

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

+ 4 - 12
resource/js/components/PageEditor/MarkdownListHelper.js

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

+ 5 - 24
resource/js/components/PageEditor/MarkdownTableHelper.js

@@ -38,50 +38,34 @@ export default class MarkdownTableUtil extends BasicInterceptor {
    * @inheritdoc
    */
   process(contextName, ...args) {
-    console.log(performance.now() + ': ReformMarkdownTableInterceptor.process is started');
-
-    const orgContext = args[0];
-    const editor = orgContext.editor;
+    const context = Object.assign(args[0]);   // clone
+    const editor = context.editor;
 
     const curPos = editor.getCursor();
     const isEndOfLine = (curPos.ch == editor.getDoc().getLine(curPos.line).length);
-    console.log(performance.now() + ': curPos.ch=' + curPos.ch + ', curPos.line=' + curPos.line);
 
     // get strings from BOL(beginning of line) to current position
     const strFromBol = mtu.getStrFromBol(editor);
 
     if (isEndOfLine && 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
       const strTableLines = mtu.getStrFromBot(editor);
-      console.log('strTableLines: ' + strTableLines);
 
       const table = mtu.parseFromTableStringToJSON(editor, mtu.getBot(editor), editor.getCursor());
-      console.log('table: ' + JSON.stringify(table));
 
       let newRow = [];
-      table.table[0].forEach(() => { newRow.push(' ') });
-      console.log('empty: ' + JSON.stringify(newRow));
+      table.table[0].forEach(() => { newRow.push('') });
       table.table.push(newRow);
-      console.log('table: ' + JSON.stringify(table));
 
       const curPos = editor.getCursor();
       const nextLineHead = { line: curPos.line + 1, ch: 0 };
       const tableBottom = mtu.parseFromTableStringToJSON(editor, nextLineHead, mtu.getEot(editor));
-      console.log('tableBottom: ' + JSON.stringify(tableBottom));
       if (tableBottom.table.length > 0) {
         table.table = table.table.concat(tableBottom.table);
       }
-      console.log('table: ' + JSON.stringify(table));
 
+      // replace the lines to strTableLinesFormated
       const strTableLinesFormated = markdownTable(table.table, { align: table.align });
-      console.log('strTableLinesFormated: ' + strTableLinesFormated);
-
-      // replace the lines to strFormatedTableLines
       editor.getDoc().replaceRange(strTableLinesFormated, mtu.getBot(editor), mtu.getEot(editor));
       editor.getDoc().setCursor(curPos.line + 1, 2);
 
@@ -89,10 +73,7 @@ export default class MarkdownTableUtil extends BasicInterceptor {
       context.handlers.push(this.className);
     }
 
-    console.log(performance.now() + ': ReformMarkdownTableInterceptor.process is finished');
-
     // resolve
-    // return Promise.resolve(context);
-    return Promise.resolve(orgContext);
+    return Promise.resolve(context);
   }
 }

+ 0 - 6
resource/js/util/interceptor/MarkdownTableUtil.js

@@ -96,12 +96,10 @@ class MarkdownTableUtil {
    * @param {string} lines all of table
    */
   parseFromTableStringToJSON(editor, posBeg, posEnd) {
-    console.log("parseFromTableStringToJSON: posBeg.line: " + posBeg.line + ", posEnd.line: " + posEnd.line);
     let contents = [];
     let aligns = [];
     for (let pos = posBeg; pos.line <= posEnd.line; pos.line++) {
       const line = editor.getDoc().getLine(pos.line);
-      console.log("line#" + pos.line + ": " + line);
 
       if (this.tableAlignmentLineRE.test(line) && !this.tableAlignmentLineNegRE.test(line)) {
         // parse line which described alignment
@@ -117,19 +115,15 @@ class MarkdownTableUtil {
           const rule = alignRuleRE.find(rule => col.match(rule.regex));
           return (rule != undefined) ? rule.align : '';
         });
-        console.log('align: ' + aligns);
       } else {
         // parse line whether header or body
         let lineText = "";
         lineText = line.replace(/\s*\|\s*/g, '|');
         lineText = lineText.replace(/^\||\|$/g, ''); // strip off pipe charactor which is placed head of line and last of line.
         const row = lineText.split(/\|/);
-        console.log('row: ' + JSON.stringify(row));
         contents.push(row);
       }
     }
-    console.log('contents: ' + JSON.stringify(contents));
-    console.log('aligns: ' + JSON.stringify(aligns));
     return { table: contents, align: aligns };
   }
 }