efront 4.22.3 → 4.22.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/pivot/api.yml +2 -2
- package/apps/pivot/main.js +3 -1
- package/apps/pivot/task/list.js +1 -1
- package/coms/basic/#loader.js +1 -1
- package/coms/basic/cross_.js +20 -4
- package/coms/basic/refilm_decode.js +49 -21
- package/coms/basic/refilm_decode_test.js +1 -0
- package/coms/compile/translate.js +3 -3
- package/coms/pivot/checkGeo.js +7 -2
- package/coms/zimoli/XMLHttpRequest.js +1 -0
- package/coms/zimoli/api.js +1 -1
- package/coms/zimoli/button.js +1 -1
- package/coms/zimoli/model.js +26 -11
- package/coms/zimoli/model.less +20 -1
- package/coms/zimoli/render.js +2 -3
- package/coms/zimoli/table.less +18 -0
- package/coms/zimoli/transition.js +4 -1
- package/coms/zimoli/zimoli.js +152 -106
- package/coms//350/214/250/350/217/260//347/274/226/350/276/221/346/241/206.xht +3 -7
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/zimoli/zimoli.js
CHANGED
|
@@ -14,57 +14,36 @@ var pagehash_reg = /#([\/\w\:@\.\_\(\)\+\-\*\$@!~_'\?,&~%]+)$/;
|
|
|
14
14
|
var locationInitHash = location.hash;
|
|
15
15
|
var isFirstTimeLoad = sessionInitHash === null;
|
|
16
16
|
var isSimpleRefresh = sessionInitHash === locationInitHash;
|
|
17
|
-
var isWithHashLoad = !!location.hash;
|
|
18
17
|
var preventNextHashChange = false;
|
|
19
18
|
window_history.scrollRestoration = 'manual';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
onselectstart(body, function (e) {
|
|
33
|
-
return e.preventDefault();
|
|
34
|
-
});
|
|
35
|
-
var frame = document.createElement("iframe");
|
|
36
|
-
css(frame, "display:none");
|
|
37
|
-
appendChild.insert(body, frame);
|
|
38
|
-
var doc = frame.contentWindow.document;
|
|
39
|
-
var backman = function (isloaded) {
|
|
40
|
-
doc.open();
|
|
41
|
-
doc.write(isloaded !== false ? "" : "<script>result=parent.onhistorychange();onload=function(){history.forward()}</script>");
|
|
42
|
-
doc.close();
|
|
43
|
-
};
|
|
44
|
-
backman(false);
|
|
45
|
-
backman();
|
|
46
|
-
} else {
|
|
47
|
-
onhashchange(window, function (event) {
|
|
48
|
-
if (fixurl.ing) return;
|
|
49
|
-
// 如果是返回事件,一定不是第一次改变hash
|
|
50
|
-
// 这里刚好可以屏蔽首次手动改变url可能产生的hashchange事件
|
|
51
|
-
var targetHash = location.hash;
|
|
52
|
-
sessionStorage.setItem(sessionSavedHashKey, targetHash);
|
|
53
|
-
if (pagehash_reg.test(targetHash)) {
|
|
54
|
-
var currentHash = getCurrentHash();
|
|
55
|
-
if (currentHash && currentHash === targetHash) return;
|
|
56
|
-
var targetHashIndex = targetHash.indexOf("#" + current_history);
|
|
57
|
-
if (targetHashIndex < 0) return;
|
|
58
|
-
var targetpath = targetHash.slice(targetHashIndex + current_history.replace(/\/$/, '').length + 1);
|
|
59
|
-
targetpath = decodeURI(targetpath);
|
|
60
|
-
go(targetpath);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (preventNextHashChange) return preventNextHashChange = false;
|
|
64
|
-
event.preventDefault();
|
|
65
|
-
onback();
|
|
66
|
-
});
|
|
19
|
+
var pathFromHash = function (targetHash) {
|
|
20
|
+
var targetHashIndex = targetHash.indexOf("#" + current_history);
|
|
21
|
+
if (targetHashIndex < 0) return;
|
|
22
|
+
var targetpath = targetHash.slice(targetHashIndex + current_history.replace(/\/$/, '').length + 1);
|
|
23
|
+
if (targetpath === '/') {
|
|
24
|
+
preventNextHashChange = true;
|
|
25
|
+
window_history.go(-1);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
targetpath = decodeURI(targetpath);
|
|
29
|
+
return targetpath;
|
|
67
30
|
}
|
|
31
|
+
onhashchange(window, function (event) {
|
|
32
|
+
if (preventNextHashChange) return preventNextHashChange = false;
|
|
33
|
+
// 如果是返回事件,一定不是第一次改变hash
|
|
34
|
+
// 这里刚好可以屏蔽首次手动改变url可能产生的hashchange事件
|
|
35
|
+
var targetHash = location.hash;
|
|
36
|
+
sessionStorage.setItem(sessionSavedHashKey, targetHash);
|
|
37
|
+
if (pagehash_reg.test(targetHash)) {
|
|
38
|
+
var currentHash = getCurrentHash();
|
|
39
|
+
if (currentHash && currentHash === targetHash) return;
|
|
40
|
+
var targetpath = pathFromHash(targetHash);
|
|
41
|
+
forward(targetpath);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
backward();
|
|
46
|
+
});
|
|
68
47
|
// body
|
|
69
48
|
var location_pathname = location.pathname;
|
|
70
49
|
var _zimoli_params_key = `_zimoli_parameters:${location_pathname}#`;
|
|
@@ -113,8 +92,8 @@ function go(pagepath, args, history_name, oldpagepath) {
|
|
|
113
92
|
if (isNumber(pagepath)) {
|
|
114
93
|
if (isString(history_name)) {
|
|
115
94
|
var _history = history[history_name] || [];
|
|
116
|
-
pagepath = _history[pagepath <
|
|
117
|
-
oldpagepath = _history[_history.
|
|
95
|
+
pagepath = _history[pagepath < 2 ? _history.index + pagepath : pagepath];
|
|
96
|
+
oldpagepath = _history[_history.index];
|
|
118
97
|
if (arguments.length === 1) {
|
|
119
98
|
args = getZimoliParams(pagepath).data;
|
|
120
99
|
}
|
|
@@ -171,7 +150,7 @@ function go(pagepath, args, history_name, oldpagepath) {
|
|
|
171
150
|
addGlobal(_page, history_name, isRecover);
|
|
172
151
|
page_object.prepares.splice(0, page_object.prepares.length).forEach(function (url) {
|
|
173
152
|
if (isNumber(url)) {
|
|
174
|
-
url = _history[url <
|
|
153
|
+
url = _history[url < 2 ? _history.index + url : url];
|
|
175
154
|
}
|
|
176
155
|
if (isString(url)) prepare(url);
|
|
177
156
|
});
|
|
@@ -427,15 +406,24 @@ function create(pagepath, args, from, needroles) {
|
|
|
427
406
|
return _page;
|
|
428
407
|
|
|
429
408
|
}
|
|
430
|
-
|
|
409
|
+
var createEmptyHistory = function (emptyState) {
|
|
410
|
+
var h = [emptyState];
|
|
411
|
+
h.index = 0;
|
|
412
|
+
return h;
|
|
413
|
+
}
|
|
431
414
|
var zimoliid = 0, zimoliad = 0;
|
|
432
415
|
function zimoli(pagepath, args, history_name, oldpagepath) {
|
|
433
416
|
if (arguments.length === 0) {
|
|
434
417
|
if (zimoliid !== zimoliad) return;
|
|
435
418
|
history_name = current_history;
|
|
436
|
-
var _history = history[history_name] ||
|
|
437
|
-
root_path = _history[0]
|
|
438
|
-
pagepath =
|
|
419
|
+
var _history = history[history_name] || createEmptyHistory('/main');
|
|
420
|
+
root_path = _history[0];
|
|
421
|
+
pagepath = location.hash;
|
|
422
|
+
if (pagepath) {
|
|
423
|
+
if (_history.index > 0) pagepath = pathFromHash(pagepath);
|
|
424
|
+
else pagepath = '';
|
|
425
|
+
}
|
|
426
|
+
if (!pagepath) pagepath = _history[_history.index];
|
|
439
427
|
try {
|
|
440
428
|
var saveddata = JSAM.parse(hostoryStorage.getItem(_zimoli_params_key + pagepath)) || {};
|
|
441
429
|
} catch (e) {
|
|
@@ -448,8 +436,6 @@ function zimoli(pagepath, args, history_name, oldpagepath) {
|
|
|
448
436
|
if (isNode(history_name))
|
|
449
437
|
var zid = history_name.zimoliid = (history_name.zimoliid | 0) + 1;
|
|
450
438
|
else var zid = arguments.length ? ++zimoliid : zimoliid;
|
|
451
|
-
|
|
452
|
-
if (page_generators[pagepath]) return go(pagepath, args, history_name, oldpagepath);
|
|
453
439
|
return prepare(pagepath, function () {
|
|
454
440
|
if (isNode(history_name)) {
|
|
455
441
|
if (history_name.zimoliid !== zid) return;
|
|
@@ -460,7 +446,7 @@ function zimoli(pagepath, args, history_name, oldpagepath) {
|
|
|
460
446
|
var global = {};
|
|
461
447
|
var history = {};
|
|
462
448
|
var current_history, default_history = current_history = "";
|
|
463
|
-
history[current_history] =
|
|
449
|
+
history[current_history] = createEmptyHistory('/main');
|
|
464
450
|
var history_session_object_key = `_zimoli_history_key:${location_pathname}`;
|
|
465
451
|
try {
|
|
466
452
|
history = JSAM.parse(hostoryStorage.getItem(history_session_object_key)) || history;
|
|
@@ -474,18 +460,25 @@ var pushstate = function (path_name, history_name) {
|
|
|
474
460
|
}
|
|
475
461
|
if (!isString(history_name)) return;
|
|
476
462
|
if (!history[history_name]) {
|
|
477
|
-
history[history_name] =
|
|
463
|
+
history[history_name] = createEmptyHistory(path_name);
|
|
478
464
|
} else {
|
|
479
465
|
var _history = history[history_name];
|
|
480
|
-
|
|
466
|
+
var prevIndex = _history.index;
|
|
467
|
+
for (var cx = 0, dx = _history.index + 1; cx < dx; cx++) {
|
|
481
468
|
if (_history[cx] === path_name) {
|
|
482
|
-
_history.
|
|
469
|
+
_history.index = cx;
|
|
483
470
|
isBack = cx < dx - 1;
|
|
484
471
|
break;
|
|
485
472
|
}
|
|
486
473
|
}
|
|
487
|
-
_history.
|
|
488
|
-
|
|
474
|
+
if (_history.index !== cx) {
|
|
475
|
+
_history.index++;
|
|
476
|
+
}
|
|
477
|
+
if (_history[_history.index] !== path_name) {
|
|
478
|
+
_history.splice(_history.index, _history.length - _history.index);
|
|
479
|
+
_history[_history.index] = path_name;
|
|
480
|
+
}
|
|
481
|
+
if (_history.index >= 0) fixurl(_history.index - prevIndex);
|
|
489
482
|
}
|
|
490
483
|
hostoryStorage.setItem(history_session_object_key, JSAM.stringify(history) || null);
|
|
491
484
|
return isBack;
|
|
@@ -495,38 +488,47 @@ var popstate = function (path_name, history_name) {
|
|
|
495
488
|
if (!isString(history_name)) return;
|
|
496
489
|
if (!history[history_name]) return;
|
|
497
490
|
var _history = history[history_name];
|
|
498
|
-
for (var cx = 0, dx = _history.
|
|
491
|
+
for (var cx = 0, dx = _history.index; cx < dx; cx++) {
|
|
499
492
|
if (_history[cx] === path_name) {
|
|
500
|
-
_history.
|
|
493
|
+
_history.index = cx;
|
|
501
494
|
break;
|
|
502
495
|
}
|
|
503
496
|
}
|
|
504
497
|
};
|
|
505
498
|
var getCurrentHash = function () {
|
|
506
|
-
var _historylist = history[current_history] || [];
|
|
507
499
|
var history_name = current_history.replace(/\/$/, '');
|
|
508
500
|
if (rootElements.length) {
|
|
509
501
|
return `#${history_name}/`;
|
|
510
502
|
}
|
|
511
|
-
|
|
512
|
-
|
|
503
|
+
var _historylist = history[current_history];
|
|
504
|
+
if (!_historylist || _historylist.index < 1) return "";
|
|
505
|
+
var targeturl = `#${history_name}${_historylist.length ? _historylist[_historylist.index] : ""}`;
|
|
513
506
|
return encodeURI(targeturl);
|
|
514
507
|
};
|
|
515
508
|
|
|
516
|
-
var fixurl = function () {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
if (pagehash_reg.test(
|
|
522
|
-
|
|
523
|
-
if (
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
509
|
+
var fixurl = function (historyDelta) {
|
|
510
|
+
preventNextHashChange = false;
|
|
511
|
+
var hash = getCurrentHash();
|
|
512
|
+
if (pagehash_reg.test(hash)) {
|
|
513
|
+
hash = location.href.replace(/\#[\s\S]*$/, '') + hash;
|
|
514
|
+
if (!pagehash_reg.test(location.href)) location.href = hash;
|
|
515
|
+
else if (location.href !== hash) {
|
|
516
|
+
if (historyDelta) {
|
|
517
|
+
preventNextHashChange = true;
|
|
518
|
+
window_history.go(historyDelta);
|
|
519
|
+
preventNextHashChange = false;
|
|
520
|
+
if (location.href !== hash) {
|
|
521
|
+
location.href = hash;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
else location.replace(hash);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
else if (pagehash_reg.test(location.hash)) {
|
|
528
|
+
preventNextHashChange = true;
|
|
529
|
+
window_history.go(-1);
|
|
530
|
+
preventNextHashChange = false;
|
|
531
|
+
}
|
|
530
532
|
};
|
|
531
533
|
var checkonback = function (elements) {
|
|
532
534
|
for (var cx = 0, dx = elements.length; cx < dx; cx++) {
|
|
@@ -545,8 +547,16 @@ var checkonback = function (elements) {
|
|
|
545
547
|
put(":empty", function () {
|
|
546
548
|
return null;
|
|
547
549
|
});
|
|
548
|
-
|
|
549
|
-
var
|
|
550
|
+
var forward = function (pgpath) {
|
|
551
|
+
var hty = history[current_history];
|
|
552
|
+
if (hty[hty.index + 1] === pgpath) {
|
|
553
|
+
go(1);
|
|
554
|
+
}
|
|
555
|
+
else if (hty[hty.index - 1] === pgpath) {
|
|
556
|
+
go(-1);
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
var backward = function () {
|
|
550
560
|
if (rootElements.length) {
|
|
551
561
|
var onback = checkonback(rootElements.slice(rootElements.length - 1));
|
|
552
562
|
fixurl();
|
|
@@ -632,7 +642,7 @@ var _switch = zimoli.switch = function (history_name = default_history, target_b
|
|
|
632
642
|
}
|
|
633
643
|
if (target_body) body = target_body;
|
|
634
644
|
}
|
|
635
|
-
if (emptyState !== false && !history[current_history]) root_path = (history[current_history] =
|
|
645
|
+
if (emptyState !== false && !history[current_history]) root_path = (history[current_history] = createEmptyHistory(emptyState))[0];
|
|
636
646
|
};
|
|
637
647
|
popup.global = zimoli.global = addGlobal;
|
|
638
648
|
popup.go = zimoli.go = go;
|
|
@@ -666,7 +676,7 @@ zimoli.setStorage = function (storage) {
|
|
|
666
676
|
};
|
|
667
677
|
zimoli.register = function (pathlike) {
|
|
668
678
|
var params = [];
|
|
669
|
-
pathlike = pathlike.replace(/\/\:(
|
|
679
|
+
pathlike = pathlike.replace(/\/\:([^\/\:\-]+)/g, function (_, id) {
|
|
670
680
|
params.push(id);
|
|
671
681
|
return '';
|
|
672
682
|
});
|
|
@@ -677,64 +687,100 @@ zimoli.clearHistory = function () {
|
|
|
677
687
|
history = {};
|
|
678
688
|
};
|
|
679
689
|
zimoli.getCurrentHistory = function () {
|
|
680
|
-
if (!history[current_history]) history[current_history] =
|
|
690
|
+
if (!history[current_history]) history[current_history] = createEmptyHistory();
|
|
681
691
|
return history[current_history];
|
|
682
692
|
};
|
|
683
693
|
zimoli.inithash = locationInitHash;
|
|
684
694
|
zimoli.createState = createState;
|
|
695
|
+
var touchEnabled = false;
|
|
685
696
|
zimoli.enableTouchBack = function () {
|
|
686
|
-
|
|
697
|
+
if (touchEnabled) return;
|
|
698
|
+
touchEnabled = true;
|
|
699
|
+
var backwardTarget, forwardTarget, currentTarget, history_name, historyList;
|
|
687
700
|
var touchId = 0;
|
|
688
701
|
var ratio = 0;
|
|
689
702
|
var deltaX = 0;
|
|
690
703
|
bindtouch(body, {
|
|
691
704
|
start(event) {
|
|
692
705
|
event.preventDefault();
|
|
706
|
+
touchId++;
|
|
693
707
|
ratio = null;
|
|
694
708
|
},
|
|
695
709
|
move(a, event) {
|
|
696
710
|
event.preventDefault();
|
|
697
711
|
if (a !== null) {
|
|
712
|
+
ratio = a.x / body.clientWidth;
|
|
713
|
+
if (ratio <= -1) ratio = -0.999;
|
|
714
|
+
if (ratio >= 1) ratio = 0.999;
|
|
698
715
|
if (!currentTarget) {
|
|
699
|
-
var id = ++touchId;
|
|
700
716
|
history_name = current_history;
|
|
701
717
|
historyList = history[history_name];
|
|
702
718
|
if (historyList.length < 2) return;
|
|
703
|
-
var path1 = historyList[historyList.length - 1];
|
|
704
|
-
var path0 = historyList[historyList.length - 2];
|
|
705
719
|
currentTarget = global[history_name];
|
|
720
|
+
}
|
|
721
|
+
if (ratio > 0) a: {
|
|
722
|
+
if (backwardTarget) break a;
|
|
723
|
+
var id = ++touchId;
|
|
724
|
+
if (historyList.index < 1) return;
|
|
725
|
+
var path1 = historyList[historyList.index];
|
|
726
|
+
var path0 = historyList[historyList.index - 1];
|
|
706
727
|
prepare(path0, function () {
|
|
707
728
|
if (id !== touchId) return;
|
|
708
729
|
var args = getZimoliParams(path0).data;
|
|
709
|
-
|
|
710
|
-
setWithStyle(
|
|
711
|
-
appendChild.insert(body,
|
|
730
|
+
backwardTarget = create(path0, args, path1);
|
|
731
|
+
setWithStyle(backwardTarget, true);
|
|
732
|
+
appendChild.insert(body, backwardTarget);
|
|
712
733
|
});
|
|
734
|
+
if (forwardTarget) remove(forwardTarget, false), forwardTarget = null;
|
|
735
|
+
}
|
|
736
|
+
else if (ratio < 0) a: {
|
|
737
|
+
if (forwardTarget) break a;
|
|
738
|
+
var id = ++touchId;
|
|
739
|
+
if (historyList.index >= historyList.length - 1) return;
|
|
740
|
+
var path2 = historyList[historyList.index + 1];
|
|
741
|
+
prepare(path2, function () {
|
|
742
|
+
if (id !== touchId) return;
|
|
743
|
+
var args = getZimoliParams(path2).data;
|
|
744
|
+
forwardTarget = create(path2, args, path1);
|
|
745
|
+
setWithStyle(forwardTarget, false);
|
|
746
|
+
appendChild.insert(body, forwardTarget);
|
|
747
|
+
});
|
|
748
|
+
if (backwardTarget) remove(backwardTarget, false), backwardTarget = null;
|
|
713
749
|
}
|
|
714
|
-
ratio = a.x / body.clientWidth;
|
|
715
|
-
if (ratio <= 0) ratio = 0.001;
|
|
716
|
-
if (ratio >= 1) ratio = 0.999;
|
|
717
750
|
deltaX = a.deltax;
|
|
718
751
|
transition(currentTarget, ratio);
|
|
719
|
-
transition(
|
|
752
|
+
if (backwardTarget) transition(backwardTarget, ratio - 1);
|
|
753
|
+
if (forwardTarget) transition(forwardTarget, ratio + 1);
|
|
720
754
|
}
|
|
721
755
|
return { x: ratio * body.clientWidth };
|
|
722
756
|
},
|
|
723
757
|
end() {
|
|
724
|
-
if (ratio === null
|
|
725
|
-
if (deltaX > 0 && ratio > .1 || deltaX < 0 && ratio > .9 || deltaX === 0 && ratio > .4) {
|
|
726
|
-
|
|
758
|
+
if (ratio === null) return;
|
|
759
|
+
if (historyList.index >= 1 && (deltaX > 0 && ratio > .1 || deltaX < 0 && ratio > .9 || deltaX === 0 && ratio > .4)) {
|
|
760
|
+
setWithStyle(currentTarget, true);
|
|
761
|
+
pushstate(historyList[historyList.index - 1], history_name);
|
|
762
|
+
remove(currentTarget);
|
|
763
|
+
remove(forwardTarget, false);
|
|
764
|
+
transition(backwardTarget, 1);
|
|
765
|
+
global[history_name] = backwardTarget;
|
|
766
|
+
}
|
|
767
|
+
else if (historyList.index < historyList.length - 1 && (deltaX < 0 && ratio < -.1 || deltaX > 0 && ratio < -.9 || deltaX === 0 && ratio < -.4)) {
|
|
768
|
+
pushstate(historyList[historyList.index + 1], history_name);
|
|
769
|
+
setWithStyle(currentTarget, false);
|
|
727
770
|
remove(currentTarget);
|
|
728
|
-
|
|
729
|
-
|
|
771
|
+
remove(backwardTarget, false);
|
|
772
|
+
transition(forwardTarget, 1);
|
|
773
|
+
global[history_name] = forwardTarget;
|
|
730
774
|
}
|
|
731
775
|
else {
|
|
732
|
-
setWithStyle(
|
|
733
|
-
remove(
|
|
776
|
+
if (backwardTarget) setWithStyle(backwardTarget, false), remove(backwardTarget);
|
|
777
|
+
if (forwardTarget) setWithStyle(forwardTarget, true), remove(forwardTarget);
|
|
734
778
|
transition(currentTarget, 1);
|
|
735
779
|
}
|
|
736
780
|
currentTarget = null;
|
|
737
|
-
|
|
781
|
+
backwardTarget = null;
|
|
782
|
+
historyList = null;
|
|
783
|
+
forwardTarget = null;
|
|
738
784
|
ratio = null;
|
|
739
785
|
}
|
|
740
786
|
}, 'x')
|
|
@@ -221,7 +221,8 @@
|
|
|
221
221
|
}
|
|
222
222
|
if (anchorOffset >= anchorNode.nodeValue.length) {
|
|
223
223
|
followChar = anchorNode.nextSibling || anchorNode.parentNode.nextSibling;
|
|
224
|
-
if (followChar
|
|
224
|
+
if (!followChar) followChar = '';
|
|
225
|
+
else if (followChar.nodeType === 1) {
|
|
225
226
|
beforeText = /^text$/i.test(followChar.tagName);
|
|
226
227
|
followChar = followChar.innerText.charAt(0);
|
|
227
228
|
}
|
|
@@ -263,7 +264,6 @@
|
|
|
263
264
|
var { data, inputType } = event;
|
|
264
265
|
coderid++;
|
|
265
266
|
var patchAfter = '';
|
|
266
|
-
console.log("follow-char", followChar, 'data', data, 'anchor-char', anchorChar);
|
|
267
267
|
switch (inputType) {
|
|
268
268
|
case "insertText":
|
|
269
269
|
if (data === ' ') return;
|
|
@@ -289,10 +289,7 @@
|
|
|
289
289
|
if (anchorChar in pairsmap && followChar === pairsmap[anchorChar]) {
|
|
290
290
|
document.execCommand('forwardDelete');
|
|
291
291
|
}
|
|
292
|
-
|
|
293
|
-
updatechar();
|
|
294
|
-
if (inText) return;
|
|
295
|
-
break;
|
|
292
|
+
return;
|
|
296
293
|
|
|
297
294
|
}
|
|
298
295
|
markAnchorOffset(光标 + patchAfter);
|
|
@@ -307,7 +304,6 @@
|
|
|
307
304
|
markedText = await 上色.text(coder.type, markedText);
|
|
308
305
|
if (coderid !== id) return;
|
|
309
306
|
更新(markedText);
|
|
310
|
-
dispatch(coder, 'change');
|
|
311
307
|
return;
|
|
312
308
|
}, -60);
|
|
313
309
|
var keytab = function (direction) {
|