@@ -132,7 +132,7 @@ function getTextFromRange(
132
132
output [ "mouseoverText" ] = util . extractTextFromRange ( wordRange ) ;
133
133
output [ "mouseoverRange" ] = wordRange ;
134
134
}
135
- console . log ( output [ "mouseoverText" ] )
135
+ // console.log(output["mouseoverText"])
136
136
return output ;
137
137
}
138
138
@@ -149,10 +149,10 @@ function expandRange(range, type, useSegmentation, x, y) {
149
149
150
150
151
151
152
- console . time ( "expandRangeWithSeg" ) ;
152
+ // console.time("expandRangeWithSeg");
153
153
range = expandRangeWithSeg ( range , type , x , y ) ;
154
154
155
- console . timeEnd ( "expandRangeWithSeg" ) ;
155
+ // console.timeEnd("expandRangeWithSeg");
156
156
157
157
} else {
158
158
// for chrome, use range expand
@@ -344,7 +344,7 @@ function expandRangeWithSeg(rangeOri, type = "word", x, y) {
344
344
345
345
346
346
347
- console . time ( "expandRangeWithSeginit" ) ;
347
+ // console.time("expandRangeWithSeginit");
348
348
var range = rangeOri . cloneRange ( ) ;
349
349
var rangeContainer = expandRange ( range , "container" ) ;
350
350
const textNode = rangeContainer . commonAncestorContainer ;
@@ -358,37 +358,37 @@ function expandRangeWithSeg(rangeOri, type = "word", x, y) {
358
358
359
359
360
360
361
- console . log ( '==========================================================' ) ;
362
- var wholeText = textNode . innerText ;
363
- var wordSliceInfo = getWordSegmentInfo ( wholeText , type ) ;
361
+ // console.log('==========================================================');
362
+ // var wholeText = textNode.innerText;
363
+ // var wordSliceInfo = getWordSegmentInfo(wholeText, type);
364
364
365
- console . log ( "wholeText:" , wholeText ) ;
366
- var textLength = wholeText . length ;
367
- var newLineCount = ( wholeText . match ( / \n / g) || [ ] ) . length ;
365
+ // console.log("wholeText:", wholeText);
366
+ // var textLength = wholeText.length;
367
+ // var newLineCount = (wholeText.match(/\n/g) || []).length;
368
368
369
- console . log ( "Text Length:" , textLength ) ;
370
- console . log ( "New Line Count:" , newLineCount ) ;
369
+ // console.log("Text Length:", textLength);
370
+ // console.log("New Line Count:", newLineCount);
371
371
372
- console . log ( "wordSliceInfo:" , wordSliceInfo ) ;
372
+ // console.log("wordSliceInfo:", wordSliceInfo);
373
373
374
- console . log ( '==========================================================2' ) ;
374
+ // console.log('==========================================================2');
375
375
var wholeText = getNodeText ( textNode ) ;
376
376
377
377
var wordSliceInfo = getWordSegmentInfo ( wholeText , type ) ;
378
- console . log ( "wholeText:" , wholeText ) ;
379
- var textLength = wholeText . length ;
380
- var newLineCount = ( wholeText . match ( / \n / g) || [ ] ) . length ;
378
+ // console.log("wholeText:", wholeText);
379
+ // var textLength = wholeText.length;
380
+ // var newLineCount = (wholeText.match(/\n/g) || []).length;
381
381
382
- console . log ( "Text Length:" , textLength ) ;
383
- console . log ( "New Line Count:" , newLineCount ) ;
384
- console . log ( "wordSliceInfo:" , wordSliceInfo ) ;
382
+ // console.log("Text Length:", textLength);
383
+ // console.log("New Line Count:", newLineCount);
384
+ // console.log("wordSliceInfo:", wordSliceInfo);
385
385
386
386
387
387
// get all word range by segment
388
- console . time ( "findWordRange" ) ;
388
+ // console.time("findWordRange");
389
389
const currentWordNode = findWordRange ( wordSliceInfo , textNode , x , y ) ;
390
- console . timeEnd ( "findWordRange" ) ;
391
- console . log ( "Current Word Node:" , currentWordNode ) ;
390
+ // console.timeEnd("findWordRange");
391
+ // console.log("Current Word Node:", currentWordNode);
392
392
return currentWordNode ;
393
393
}
394
394
@@ -416,15 +416,15 @@ function getWordSegmentInfo(text, type) {
416
416
function findWordRange ( wordSegInfo , textNode , x , y ) {
417
417
var newLineCount = 0 ;
418
418
419
- console . log ( wordSegInfo )
420
- console . log ( textNode )
419
+ // console.log(wordSegInfo)
420
+ // console.log(textNode)
421
421
422
422
// console.time("wordSegInfoExtract");
423
423
var wordSegInfoExtract = wordSegInfo
424
424
. map ( ( wordMeta ) => {
425
425
var word = wordMeta . segment ;
426
426
var index = wordMeta . index ;
427
- // var newLine=0
427
+ var newLine = 0
428
428
// if (word.includes("\n")) {
429
429
// var newLine = (word.match(/\n/g) || []).length; // count new line
430
430
// word = word.replace(/\n/g, "");
0 commit comments