efront 4.19.7 → 4.20.1
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/kugou/singer/keywords.less +5 -1
- package/apps/kugou/song/list.jsp +14 -0
- package/apps/kugou/song//347/233/227/345/260/206/350/241/214 - /350/212/261/347/262/245,/351/251/254/351/233/250/351/230/263.krc +0 -0
- package/coms/basic/Table.js +4 -3
- package/coms/basic/data.js +19 -7
- package/coms/basic/isSubpath.js +33 -0
- package/coms/basic/mark.js +47 -14
- package/coms/basic/mark_test.js +8 -0
- package/coms/basic/spaces.js +8 -0
- package/coms/compile/Html.js +28 -1
- package/coms/compile/Html_test.js +3 -1
- package/coms/compile/common.js +8 -3
- package/coms/compile/downLevel_test.js +2 -2
- package/coms/compile/unstruct.js +1 -0
- package/coms/compile/unstruct_test.js +4 -1
- package/coms/explorer/edit.js +1 -1
- package/coms/kugou/bg.less +2 -2
- package/coms/kugou/dance.js +1 -1
- package/coms/kugou/krc.js +61 -34
- package/coms/kugou/krc.less +1 -0
- package/coms/kugou/krc_parse.js +56 -0
- package/coms/kugou/krc_stringify.js +16 -0
- package/coms/kugou/musicList.js +1 -1
- package/coms/kugou/parseSongsList.js +1 -1
- package/coms/kugou/playList.html +3 -2
- package/coms/kugou/playList.less +5 -0
- package/coms/kugou/player.html +1 -0
- package/coms/kugou/player.js +40 -32
- package/coms/kugou/player.less +125 -34
- package/coms/kugou/song.html +4 -4
- package/coms/kugou/song.js +1 -0
- package/coms/kugou/song.less +77 -26
- package/coms/kugou/titlebar.less +3 -0
- package/coms/kugou//346/255/214/350/257/215/347/274/226/350/276/221/345/231/250.xht +153 -0
- package/coms/zimoli/button.js +3 -76
- package/coms/zimoli/button.less +1 -3
- package/coms/zimoli/confirm.js +4 -3
- package/coms/zimoli/img.less +1 -0
- package/coms/zimoli/menu.less +0 -4
- package/coms/zimoli/menuItem.html +1 -1
- package/coms/zimoli/patchHover.js +74 -0
- package/coms/zimoli/popup.js +16 -0
- package/coms/zimoli/prompt.js +8 -2
- package/coms/zimoli/textarea.less +1 -0
- package/coms/zimoli/touchList.js +1 -0
- package/coms/zimoli/view.js +0 -6
- package/coms/zimoli/vscroll.js +2 -1
- package/coms/zimoli/zimoli.js +11 -10
- package/package.json +1 -1
- package/public/efront.js +1 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
& {
|
|
3
|
+
position: absolute;
|
|
4
|
+
left: 0;
|
|
5
|
+
top: 0;
|
|
6
|
+
height: auto;
|
|
7
|
+
width: auto;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
right: 0;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[insert] {
|
|
14
|
+
height: 12px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
w {
|
|
18
|
+
margin-right: 2px;
|
|
19
|
+
background: #fce;
|
|
20
|
+
display: inline-block;
|
|
21
|
+
padding: 2px;
|
|
22
|
+
line-height: 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[line] {
|
|
26
|
+
display: inline-block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[row] {
|
|
30
|
+
margin-top: 12px;
|
|
31
|
+
line-height: 1.6;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[editing] {
|
|
35
|
+
outline: 1px solid #0009;
|
|
36
|
+
background: #0002;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[dark] {
|
|
40
|
+
color: red;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[foot] {
|
|
44
|
+
>a.button {
|
|
45
|
+
float: left;
|
|
46
|
+
margin: 0 16px 0 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
50
|
+
<xmenu head -src="menuitems"></xmenu>
|
|
51
|
+
<list body# @click="editTime(null)" -src="row in krc">
|
|
52
|
+
<div row @click.stop="editTime(row)" editing_="row.editing">
|
|
53
|
+
<span -bind="toOffsetTime(row.startTime)" dark_="row.startTime!==row.value"></span>
|
|
54
|
+
|
|
55
|
+
<span line>
|
|
56
|
+
<w -repeat="w in row.words" -bind="w.label"></w>
|
|
57
|
+
</span>
|
|
58
|
+
</div>
|
|
59
|
+
</list>
|
|
60
|
+
<div foot>
|
|
61
|
+
<a -if="currentRow" @click="对齐">对齐</a>
|
|
62
|
+
<a -if="currentRow" @click="编辑">编辑</a>
|
|
63
|
+
<!-- <a -if="currentRow">试听</a> -->
|
|
64
|
+
<button @click="保存">保存</button>
|
|
65
|
+
</div>
|
|
66
|
+
<script>
|
|
67
|
+
var a = button;
|
|
68
|
+
var xmenu = zimoli$menu;
|
|
69
|
+
var menuitems = [{
|
|
70
|
+
name: "歌词",
|
|
71
|
+
actived: true,
|
|
72
|
+
do() {
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
name: "属性",
|
|
77
|
+
do() { }
|
|
78
|
+
}];
|
|
79
|
+
var timeEditor = '增加延时节点';
|
|
80
|
+
var 对齐 = async function () {
|
|
81
|
+
var time = await prompt("输入对齐差值(毫秒)", function (a) {
|
|
82
|
+
if (!isFinite(a)) return false;
|
|
83
|
+
a = +a;
|
|
84
|
+
if (a !== (a | 0)) return false;
|
|
85
|
+
});
|
|
86
|
+
var i = krc.indexOf(currentRow);
|
|
87
|
+
for (var cx = i, dx = krc.length; cx < dx; cx++) {
|
|
88
|
+
var r = krc[cx];
|
|
89
|
+
r.startTime = r.startTime + +time;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
var 编辑 = async function () {
|
|
93
|
+
var time = await prompt('修改当前节点的启始时间', { value: toOffsetTime(currentRow.startTime) },
|
|
94
|
+
/^(\d+\:)*\d+(\.\d+)?$/);
|
|
95
|
+
currentRow.startTime = fromOffsetTime(time) | 0;
|
|
96
|
+
};
|
|
97
|
+
var 保存 = async function () {
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
var currentRow = null;
|
|
101
|
+
var editTime = function (row) {
|
|
102
|
+
if (currentRow === row) return;
|
|
103
|
+
if (currentRow) currentRow.editing = false;
|
|
104
|
+
if (row) row.editing = true;
|
|
105
|
+
currentRow = row;
|
|
106
|
+
}
|
|
107
|
+
var fromOffsetTime = function (t) {
|
|
108
|
+
var mili = /\d+\.\d+$/.exec(t);
|
|
109
|
+
if (mili) {
|
|
110
|
+
t = t.slice(mili[0].length);
|
|
111
|
+
mili = mili[0] * 1000;
|
|
112
|
+
}
|
|
113
|
+
var sum = 0;
|
|
114
|
+
t = t.split(':').reverse();
|
|
115
|
+
while (t.length) {
|
|
116
|
+
sum *= 60;
|
|
117
|
+
sum += +t.pop();
|
|
118
|
+
}
|
|
119
|
+
if (mili) sum += mili;
|
|
120
|
+
if (extra.offset) sum -= extra.offset;
|
|
121
|
+
return sum;
|
|
122
|
+
}
|
|
123
|
+
var toOffsetTime = function (a) {
|
|
124
|
+
if (extra.offset) a += extra.offset;
|
|
125
|
+
var d = [a % 1000];
|
|
126
|
+
a /= 1000;
|
|
127
|
+
a |= 0;
|
|
128
|
+
while (a) {
|
|
129
|
+
d.push(a % 60);
|
|
130
|
+
a /= 60;
|
|
131
|
+
a |= 0;
|
|
132
|
+
}
|
|
133
|
+
while (d.length < offsetLength) d.push(0);
|
|
134
|
+
d.reverse();
|
|
135
|
+
var time = d.slice(0, d.length - 1).map(a => a < 10 ? '0' + a : a).join(':');
|
|
136
|
+
d = d[d.length - 1];
|
|
137
|
+
if (d < 10) d = "00" + d;
|
|
138
|
+
else if (d < 100) d = '0' + d;
|
|
139
|
+
time += '.' + d;
|
|
140
|
+
return time;
|
|
141
|
+
}
|
|
142
|
+
view(this);
|
|
143
|
+
var [{ krc_text }] = arguments;
|
|
144
|
+
var krc = krc_parse(krc_text);
|
|
145
|
+
var extra = krc.extra;
|
|
146
|
+
var offsetLength = 3;
|
|
147
|
+
if (extra.total) {
|
|
148
|
+
offsetLength = Math.ceil(Math.log(extra.total) / Math.log(60));
|
|
149
|
+
if (offsetLength < 3) offsetLength = 3;
|
|
150
|
+
}
|
|
151
|
+
function 歌词编辑器() {
|
|
152
|
+
}
|
|
153
|
+
</script>
|
package/coms/zimoli/button.js
CHANGED
|
@@ -1,77 +1,10 @@
|
|
|
1
1
|
var _label = document.createElement("span");
|
|
2
2
|
var track = document.createElement("div");
|
|
3
|
-
var onmouseenter = on("mouseenter");
|
|
4
3
|
track.className = "track";
|
|
5
4
|
_label.className = "label";
|
|
6
5
|
|
|
7
6
|
var btn = document.createElement("button");
|
|
8
7
|
btn.tabIndex = 0;
|
|
9
|
-
var __addClass = function () {
|
|
10
|
-
if (firedTime + 60 > +new Date) return;
|
|
11
|
-
addClass.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var hover = function () {
|
|
14
|
-
__addClass(this, "hover");
|
|
15
|
-
};
|
|
16
|
-
var active = function () {
|
|
17
|
-
__addClass(this, "hover active");
|
|
18
|
-
};
|
|
19
|
-
var checkclick = function () {
|
|
20
|
-
if (this.hasAttribute("disabled") || this.disabled || this.hasAttribute("loading") || this.loading || this.hasAttribute("pending") || this.pending) {
|
|
21
|
-
onclick.preventClick = true;
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (this.hasAttribute("confirm") || this.confirm) {
|
|
25
|
-
if (!this.confirm_sign) {
|
|
26
|
-
addClass(this, 'confirm');
|
|
27
|
-
var that = this;
|
|
28
|
-
that.confirm_sign = true;
|
|
29
|
-
setTimeout(function () {
|
|
30
|
-
removeClass(that, "confirm");
|
|
31
|
-
delete that.confirm_sign;
|
|
32
|
-
}, 2000);
|
|
33
|
-
onclick.preventClick = true;
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
delete this.confirm_sign;
|
|
37
|
-
removeClass(this, "confirm");
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var resetactive = function () {
|
|
41
|
-
removeClass(this, "active");
|
|
42
|
-
};
|
|
43
|
-
var resetall = function () {
|
|
44
|
-
removeClass(this, "active hover");
|
|
45
|
-
};
|
|
46
|
-
var mousedown = function () {
|
|
47
|
-
var that = this;
|
|
48
|
-
var cancelmouseup = onmouseup(window, function () {
|
|
49
|
-
cancelmouseup();
|
|
50
|
-
resetactive.call(that);
|
|
51
|
-
checkclick.call(that);
|
|
52
|
-
});
|
|
53
|
-
active.call(this);
|
|
54
|
-
};
|
|
55
|
-
var mouseleave = function (event) {
|
|
56
|
-
removeClass(this, "hover");
|
|
57
|
-
};
|
|
58
|
-
var mousemove = function (event) {
|
|
59
|
-
if (onclick.preventClick && event.which) resetall.call(this);
|
|
60
|
-
};
|
|
61
|
-
var firedTime = +new Date;
|
|
62
|
-
var touchstart = function () {
|
|
63
|
-
var that = this;
|
|
64
|
-
var cancel = function () {
|
|
65
|
-
firedTime = +new Date;
|
|
66
|
-
canceltouchcancel();
|
|
67
|
-
canceltouchend();
|
|
68
|
-
resetall.call(that);
|
|
69
|
-
checkclick.call(that);
|
|
70
|
-
};
|
|
71
|
-
var canceltouchcancel = ontouchcancel(this, cancel);
|
|
72
|
-
var canceltouchend = ontouchend(this, cancel);
|
|
73
|
-
active.call(this);
|
|
74
|
-
};
|
|
75
8
|
function button(texter, type) {
|
|
76
9
|
var tracker = track.cloneNode();
|
|
77
10
|
var _texter;
|
|
@@ -110,16 +43,10 @@ function button(texter, type) {
|
|
|
110
43
|
appendChild(button, tracker, _texter);
|
|
111
44
|
}
|
|
112
45
|
bindAccesskey(button);
|
|
113
|
-
|
|
114
|
-
onmouseenter(button, hover);
|
|
115
|
-
onmouseleave(button, mouseleave);
|
|
116
|
-
onmousemove(button, mousemove);
|
|
117
|
-
onmousedown(button, mousedown);
|
|
118
|
-
ontouchmove(button, resetall);
|
|
119
|
-
ontouchstart(button, touchstart);
|
|
46
|
+
patchHover(button);
|
|
120
47
|
button.setText = function (_text) {
|
|
121
48
|
if (_text && _text.length === 2) {
|
|
122
|
-
|
|
49
|
+
addClass(button, "space");
|
|
123
50
|
} else {
|
|
124
51
|
removeClass(button, "space");
|
|
125
52
|
}
|
|
@@ -130,7 +57,7 @@ function button(texter, type) {
|
|
|
130
57
|
return html(_texter);
|
|
131
58
|
};
|
|
132
59
|
if (texter && texter.length === 2) {
|
|
133
|
-
|
|
60
|
+
addClass(button, "space");
|
|
134
61
|
} else {
|
|
135
62
|
removeClass(button, "space");
|
|
136
63
|
}
|
package/coms/zimoli/button.less
CHANGED
|
@@ -254,8 +254,7 @@ a&,
|
|
|
254
254
|
.clear();
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
&.active
|
|
258
|
-
&:active {
|
|
257
|
+
&.active {
|
|
259
258
|
color: darken(@default-color, 10%);
|
|
260
259
|
.clear();
|
|
261
260
|
}
|
|
@@ -286,7 +285,6 @@ a&,
|
|
|
286
285
|
color: @hover;
|
|
287
286
|
}
|
|
288
287
|
|
|
289
|
-
&:active,
|
|
290
288
|
&.active {
|
|
291
289
|
color: darken(@color, 10%);
|
|
292
290
|
}
|
package/coms/zimoli/confirm.js
CHANGED
|
@@ -97,7 +97,7 @@ function confirm() {
|
|
|
97
97
|
element.removeAttribute('locked');
|
|
98
98
|
this.removeAttribute('loading');
|
|
99
99
|
if (res === false) return;
|
|
100
|
-
element.result = res;
|
|
100
|
+
if (!("result" in element)) element.result = res;
|
|
101
101
|
remove(element);
|
|
102
102
|
}, () => {
|
|
103
103
|
this.removeAttribute('loading');
|
|
@@ -105,7 +105,7 @@ function confirm() {
|
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
else {
|
|
108
|
-
element.result = res;
|
|
108
|
+
if (!('result' in element)) element.result = res;
|
|
109
109
|
remove(element);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -115,7 +115,8 @@ function confirm() {
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
on('remove')(element, function () {
|
|
118
|
-
this.
|
|
118
|
+
if (this.errored || !("result" in element)) this.onerror(this.errored);
|
|
119
|
+
else this.onload();
|
|
119
120
|
});
|
|
120
121
|
var buttons = options.map(function (label, index, options) {
|
|
121
122
|
if (isNode(label)) {
|
package/coms/zimoli/img.less
CHANGED
package/coms/zimoli/menu.less
CHANGED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var onmouseenter = on("mouseenter");
|
|
2
|
+
|
|
3
|
+
var hover = function () {
|
|
4
|
+
addClass(this, "hover");
|
|
5
|
+
};
|
|
6
|
+
var active = function () {
|
|
7
|
+
addClass(this, "hover active");
|
|
8
|
+
};
|
|
9
|
+
var checkclick = function () {
|
|
10
|
+
if (this.hasAttribute("disabled") || this.disabled || this.hasAttribute("loading") || this.loading || this.hasAttribute("pending") || this.pending) {
|
|
11
|
+
onclick.preventClick = true;
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (this.hasAttribute("confirm") || this.confirm) {
|
|
15
|
+
if (!this.confirm_sign) {
|
|
16
|
+
addClass(this, 'confirm');
|
|
17
|
+
var that = this;
|
|
18
|
+
that.confirm_sign = true;
|
|
19
|
+
setTimeout(function () {
|
|
20
|
+
removeClass(that, "confirm");
|
|
21
|
+
delete that.confirm_sign;
|
|
22
|
+
}, 2000);
|
|
23
|
+
onclick.preventClick = true;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
delete this.confirm_sign;
|
|
27
|
+
removeClass(this, "confirm");
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var resetactive = function () {
|
|
31
|
+
removeClass(this, "active");
|
|
32
|
+
};
|
|
33
|
+
var resetall = function () {
|
|
34
|
+
removeClass(this, "active hover");
|
|
35
|
+
};
|
|
36
|
+
var mousedown = function () {
|
|
37
|
+
var that = this;
|
|
38
|
+
var cancelmouseup = onmouseup(window, function () {
|
|
39
|
+
cancelmouseup();
|
|
40
|
+
resetactive.call(that);
|
|
41
|
+
checkclick.call(that);
|
|
42
|
+
});
|
|
43
|
+
active.call(this);
|
|
44
|
+
};
|
|
45
|
+
var mouseleave = function (event) {
|
|
46
|
+
removeClass(this, "hover");
|
|
47
|
+
};
|
|
48
|
+
var mousemove = function (event) {
|
|
49
|
+
if (onclick.preventClick && event.which) resetall.call(this);
|
|
50
|
+
};
|
|
51
|
+
var firedTime = +new Date;
|
|
52
|
+
var touchstart = function () {
|
|
53
|
+
var that = this;
|
|
54
|
+
var cancel = function () {
|
|
55
|
+
firedTime = +new Date;
|
|
56
|
+
canceltouchcancel();
|
|
57
|
+
canceltouchend();
|
|
58
|
+
resetall.call(that);
|
|
59
|
+
checkclick.call(that);
|
|
60
|
+
};
|
|
61
|
+
var canceltouchcancel = ontouchcancel(this, cancel);
|
|
62
|
+
var canceltouchend = ontouchend(this, cancel);
|
|
63
|
+
active.call(this);
|
|
64
|
+
};
|
|
65
|
+
function patchHover(button) {
|
|
66
|
+
onremove(button, resetall);
|
|
67
|
+
onmouseenter(button, hover);
|
|
68
|
+
onmouseleave(button, mouseleave);
|
|
69
|
+
onmousemove(button, mousemove);
|
|
70
|
+
onmousedown(button, mousedown);
|
|
71
|
+
ontouchmove(button, resetall);
|
|
72
|
+
ontouchstart(button, touchstart);
|
|
73
|
+
return button;
|
|
74
|
+
};
|
package/coms/zimoli/popup.js
CHANGED
|
@@ -354,7 +354,23 @@ var popup_fixup = function (element, x, y) {
|
|
|
354
354
|
css(element, {
|
|
355
355
|
position: 'absolute',
|
|
356
356
|
});
|
|
357
|
+
css(element, {
|
|
358
|
+
position: 'fixed'
|
|
359
|
+
});
|
|
360
|
+
var body = document.body;
|
|
357
361
|
popup_as_single(element);
|
|
362
|
+
if (getComputedStyle(element).position !== 'fixed') {
|
|
363
|
+
var clientTop = body.clientTop;
|
|
364
|
+
var clientBottom = clientTop + body.clientHeight;
|
|
365
|
+
var clientLeft = body.clientLeft;
|
|
366
|
+
var clientRight = clientLeft + body.clientWidth;
|
|
367
|
+
css(element, {
|
|
368
|
+
marginTop: -clientTop,
|
|
369
|
+
marginLeft: -clientLeft,
|
|
370
|
+
marginRight: clientRight - window.innerWidth,
|
|
371
|
+
marginBottom: clientBottom - window.innerHeight
|
|
372
|
+
})
|
|
373
|
+
}
|
|
358
374
|
var left = "left", top = 'top';
|
|
359
375
|
if (y + element.offsetHeight > window.innerHeight && y << 1 > window.innerHeight) {
|
|
360
376
|
top = "bottom";
|
package/coms/zimoli/prompt.js
CHANGED
|
@@ -8,7 +8,7 @@ var settip = function (tip, res) {
|
|
|
8
8
|
}
|
|
9
9
|
var validate = function (text, checker, tip) {
|
|
10
10
|
var valid;
|
|
11
|
-
if (checker
|
|
11
|
+
if (isFunction(checker.test)) {
|
|
12
12
|
valid = checker.test(text);
|
|
13
13
|
}
|
|
14
14
|
if (isFunction(checker)) {
|
|
@@ -22,6 +22,7 @@ function prompt() {
|
|
|
22
22
|
var opts = [];
|
|
23
23
|
var submit = null;
|
|
24
24
|
var wrap = false;
|
|
25
|
+
var value = '';
|
|
25
26
|
for (var arg of arguments) {
|
|
26
27
|
if (isNode(arg)) ipt = arg;
|
|
27
28
|
else if (typeof arg === 'string') msg = arg;
|
|
@@ -31,6 +32,7 @@ function prompt() {
|
|
|
31
32
|
if (isFunction(arg.test)) check = arg;
|
|
32
33
|
if (isFunction(arg.submit)) submit = arg;
|
|
33
34
|
if (isString(arg.msg || arg.title)) msg = arg.msg || arg.title;
|
|
35
|
+
if (isHandled(arg.value)) value = arg.value;
|
|
34
36
|
if (arg.multiple || arg.wrap) wrap = true;
|
|
35
37
|
}
|
|
36
38
|
}
|
|
@@ -41,6 +43,7 @@ function prompt() {
|
|
|
41
43
|
ipt.contentEditable = true;
|
|
42
44
|
}
|
|
43
45
|
else ipt = input();
|
|
46
|
+
ipt.value = value;
|
|
44
47
|
}
|
|
45
48
|
else {
|
|
46
49
|
ipt.setAttribute('textarea', '');
|
|
@@ -48,7 +51,7 @@ function prompt() {
|
|
|
48
51
|
var tip = document.createElement("tip");
|
|
49
52
|
var buttons = [isNode(opts[0]) ? opts[0] : button(opts[0] || i18n`确认`), isNode(opts[1]) ? opts[1] : button(opts[1] || i18n`取消`, 'white')];
|
|
50
53
|
var getValue = () => isFunction(ipt.getValue) ? ipt.getValue() : ipt.value;
|
|
51
|
-
if (
|
|
54
|
+
if (check || wrap) {
|
|
52
55
|
var setDisable = function (event) {
|
|
53
56
|
var bd = c.body;
|
|
54
57
|
if (wrap && bd) {
|
|
@@ -95,6 +98,9 @@ function prompt() {
|
|
|
95
98
|
var res = await submit.submit(value);
|
|
96
99
|
if (!settip(tip, res)) return false;
|
|
97
100
|
}
|
|
101
|
+
c.result = value;
|
|
102
|
+
} else {
|
|
103
|
+
c.errored = true;
|
|
98
104
|
}
|
|
99
105
|
});
|
|
100
106
|
on('mounted')(ipt, function () {
|
package/coms/zimoli/touchList.js
CHANGED
|
@@ -98,6 +98,7 @@ var scrollToRight = function () {
|
|
|
98
98
|
scrollTo.call(this, 0);
|
|
99
99
|
};
|
|
100
100
|
var touchend = function () {
|
|
101
|
+
if (!currentTarget) return;
|
|
101
102
|
var marginLeft = -parseInt(currentTarget.scrollLeft) || 0;
|
|
102
103
|
moving = false;
|
|
103
104
|
if (direction < 0 && marginLeft < -7) {
|
package/coms/zimoli/view.js
CHANGED
|
@@ -122,12 +122,6 @@ var resize2 = function () {
|
|
|
122
122
|
marginTop: fromOffset(-height)
|
|
123
123
|
})
|
|
124
124
|
}
|
|
125
|
-
if (changed) {
|
|
126
|
-
css(body, { height: '' });
|
|
127
|
-
if (body.scrollHeight + body.offsetTop > this.clientHeight + 1) {
|
|
128
|
-
css(body, { height: fromOffset(this.clientHeight) });
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
125
|
};
|
|
132
126
|
function view(element) {
|
|
133
127
|
var w = isNode(element) ? element : document.createElement("form");
|
package/coms/zimoli/vscroll.js
CHANGED
|
@@ -26,7 +26,8 @@ var scroll = function () {
|
|
|
26
26
|
if (!offsetParent) return deltay;
|
|
27
27
|
var _boxPosition = getScreenPosition(_box);
|
|
28
28
|
var _parentPosition = getScreenPosition(offsetParent);
|
|
29
|
-
if (
|
|
29
|
+
if (!/^(auto|scroll)$/.test(getComputedStyle(offsetParent).overflowY) && !offsetParent.YScrollBoxId);
|
|
30
|
+
else if (_boxPosition.bottom - 1 >= _parentPosition.bottom && deltay > 0) {
|
|
30
31
|
var deltaScroll = _boxPosition.bottom - _parentPosition.bottom;
|
|
31
32
|
deltaScroll = min(deltay, deltaScroll);
|
|
32
33
|
scrollY.call(offsetParent, deltaScroll, false);
|
package/coms/zimoli/zimoli.js
CHANGED
|
@@ -147,7 +147,7 @@ function go(pagepath, args, history_name, oldpagepath) {
|
|
|
147
147
|
var fullfill = function () {
|
|
148
148
|
zimoliad = zimoliid;
|
|
149
149
|
var _page = create(pgpath, args, oldpagepath);
|
|
150
|
-
var
|
|
150
|
+
var isRecover = pushstate(pagepath, history_name, oldpagepath);
|
|
151
151
|
if (isNode(history_name)) {
|
|
152
152
|
if (history_name.activate === pagepath && history_name.activateNode === _page) return fullfill_is_dispatched--;
|
|
153
153
|
else remove(history_name.activateNode);
|
|
@@ -170,7 +170,8 @@ function go(pagepath, args, history_name, oldpagepath) {
|
|
|
170
170
|
dispatch(document, event);
|
|
171
171
|
fullfill_is_dispatched = 0;
|
|
172
172
|
}
|
|
173
|
-
|
|
173
|
+
if (isRecover) setWithStyle(_page, false);
|
|
174
|
+
addGlobal(_page, history_name, isRecover);
|
|
174
175
|
page_object.prepares.splice(0, page_object.prepares.length).forEach(function (url) {
|
|
175
176
|
if (isNumber(url)) {
|
|
176
177
|
url = _history[url < 1 ? _history.length + url - 1 : url];
|
|
@@ -478,7 +479,7 @@ try {
|
|
|
478
479
|
}
|
|
479
480
|
var root_path;
|
|
480
481
|
var pushstate = function (path_name, history_name) {
|
|
481
|
-
var
|
|
482
|
+
var isBack = false;
|
|
482
483
|
if (history_name === undefined) {
|
|
483
484
|
history_name = current_history;
|
|
484
485
|
}
|
|
@@ -490,7 +491,7 @@ var pushstate = function (path_name, history_name) {
|
|
|
490
491
|
for (var cx = 0, dx = _history.length; cx < dx; cx++) {
|
|
491
492
|
if (_history[cx] === path_name) {
|
|
492
493
|
_history.splice(cx, dx - cx);
|
|
493
|
-
|
|
494
|
+
isBack = cx < dx - 1;
|
|
494
495
|
break;
|
|
495
496
|
}
|
|
496
497
|
}
|
|
@@ -498,7 +499,7 @@ var pushstate = function (path_name, history_name) {
|
|
|
498
499
|
if (_history.length) fixurl();
|
|
499
500
|
}
|
|
500
501
|
hostoryStorage.setItem(history_session_object_key, JSAM.stringify(history) || null);
|
|
501
|
-
return
|
|
502
|
+
return isBack;
|
|
502
503
|
};
|
|
503
504
|
var popstate = function (path_name, history_name) {
|
|
504
505
|
if (history_name === undefined) history_name = current_history;
|
|
@@ -592,17 +593,17 @@ function setWithStyle(target, isDestroy) {
|
|
|
592
593
|
}
|
|
593
594
|
|
|
594
595
|
}
|
|
595
|
-
function addGlobal(element, name = null,
|
|
596
|
+
function addGlobal(element, name = null, isBack) {
|
|
596
597
|
if (isString(name)) {
|
|
597
598
|
if (global[name] === element) return;
|
|
598
599
|
var oldElement = global[name];
|
|
599
600
|
if (oldElement) {
|
|
600
|
-
setWithStyle(oldElement,
|
|
601
|
+
setWithStyle(oldElement, isBack);
|
|
601
602
|
}
|
|
602
603
|
if (isFunction(body.layer)) {
|
|
603
604
|
body.layer(element, oldElement, history);
|
|
604
605
|
} else if (body !== element) {
|
|
605
|
-
if (
|
|
606
|
+
if (isBack || !oldElement) appendChild.insert(body, element);
|
|
606
607
|
else appendChild.after(oldElement, element);
|
|
607
608
|
remove(oldElement);
|
|
608
609
|
}
|
|
@@ -613,7 +614,7 @@ function addGlobal(element, name = null, isDestroy) {
|
|
|
613
614
|
appendChild.after(name, element);
|
|
614
615
|
name.with = [element];
|
|
615
616
|
}
|
|
616
|
-
else if (
|
|
617
|
+
else if (isBack) appendChild.insert(name, element);
|
|
617
618
|
else appendChild(name, element);
|
|
618
619
|
} else if (isFunction(name)) {
|
|
619
620
|
name(element);
|
|
@@ -621,7 +622,7 @@ function addGlobal(element, name = null, isDestroy) {
|
|
|
621
622
|
if (isFunction(body.layer)) {
|
|
622
623
|
body.layer(element);
|
|
623
624
|
} else {
|
|
624
|
-
if (
|
|
625
|
+
if (isBack) appendChild.insert(body, element);
|
|
625
626
|
else appendChild(body, element);
|
|
626
627
|
}
|
|
627
628
|
rootElements.push(element);
|