efront 3.29.1 → 3.29.3
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/coms/basic/analyse.js +4 -5
- package/coms/layer/leftCenter.js +1 -1
- package/coms/zimoli/back.xht +4 -1
- package/coms/zimoli/gallery.js +1 -2
- package/coms/zimoli/lattice.js +1 -1
- package/coms/zimoli/list.js +5 -2
- package/coms/zimoli/list.less +2 -2
- package/coms/zimoli/onresize.js +2 -1
- package/coms/zimoli/render.js +3 -2
- package/coms/zimoli/resizingList.js +8 -3
- package/coms/zimoli/slider.js +1 -1
- package/coms/zimoli/table.js +1 -2
- package/coms/zimoli/view.less +5 -4
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/readme.md +1 -0
package/coms/basic/analyse.js
CHANGED
|
@@ -96,9 +96,9 @@ class Word {
|
|
|
96
96
|
return this.rate * Math.pow(this.mask, powertime - this.time);
|
|
97
97
|
}
|
|
98
98
|
update() {
|
|
99
|
-
var p = this
|
|
99
|
+
var p = this;
|
|
100
100
|
if (this.rate) {
|
|
101
|
-
var i = getIndexFromOrderedArray(wordslike,
|
|
101
|
+
var i = getIndexFromOrderedArray(wordslike, p, comparepower);
|
|
102
102
|
var w = wordslike[i];
|
|
103
103
|
if (w && w.power() === p) {
|
|
104
104
|
if (p < 1e-306) {
|
|
@@ -106,7 +106,7 @@ class Word {
|
|
|
106
106
|
} else {
|
|
107
107
|
p = p - p / 0x1fffffffffffff;
|
|
108
108
|
}
|
|
109
|
-
for (var dx = i + 1, cx = getIndexFromOrderedArray(wordslike,
|
|
109
|
+
for (var dx = i + 1, cx = getIndexFromOrderedArray(wordslike, p, comparepower); cx < dx; cx++) {
|
|
110
110
|
if (wordslike[cx] == this) {
|
|
111
111
|
wordslike.splice(cx, 1);
|
|
112
112
|
break;
|
|
@@ -149,7 +149,7 @@ function format() {
|
|
|
149
149
|
for (var cx = like.length - 1; cx >= 0; cx--) {
|
|
150
150
|
var m = like[cx];
|
|
151
151
|
var p = Math.sqrt(m.power() / 10) * 10;
|
|
152
|
-
for (var cy = 0, dy = getIndexFromOrderedArray(wordslike,
|
|
152
|
+
for (var cy = 0, dy = getIndexFromOrderedArray(wordslike, { power() { return p } }, comparepower); cy < dy; cy++) {
|
|
153
153
|
var n = wordslike[cy];
|
|
154
154
|
if (n.name.indexOf(m.name) >= 0) {
|
|
155
155
|
wordslike.splice(cy, 1);
|
|
@@ -307,7 +307,6 @@ function main(text) {
|
|
|
307
307
|
getWord(result[cx]).update();
|
|
308
308
|
}
|
|
309
309
|
format();
|
|
310
|
-
console.log(result)
|
|
311
310
|
return result;
|
|
312
311
|
}
|
|
313
312
|
window.wordslike = wordslike;
|
package/coms/layer/leftCenter.js
CHANGED
|
@@ -13,7 +13,7 @@ appendChild(layer, leftLayer, centerLayer);
|
|
|
13
13
|
onappend(centerLayer, function () {
|
|
14
14
|
zimoli.switch("layer-left-center", layer);
|
|
15
15
|
zimoli();
|
|
16
|
-
var cancel_resize =
|
|
16
|
+
var cancel_resize = on("resize")(window, reshape);
|
|
17
17
|
once("remove")(centerLayer, cancel_resize);
|
|
18
18
|
});
|
|
19
19
|
function reshape() {
|
package/coms/zimoli/back.xht
CHANGED
package/coms/zimoli/gallery.js
CHANGED
|
@@ -47,7 +47,6 @@ function gallery(element, minWidth, generator) {
|
|
|
47
47
|
maxWidth: fromPixel(maxWidth),
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
-
resizingList.set(element);
|
|
51
50
|
var createColumn = function (id) {
|
|
52
51
|
var _box = list(function (index) {
|
|
53
52
|
var realindex = index * boxCount + id;
|
|
@@ -95,7 +94,7 @@ function gallery(element, minWidth, generator) {
|
|
|
95
94
|
this.clean();
|
|
96
95
|
this.go(index || 0);
|
|
97
96
|
});
|
|
98
|
-
|
|
97
|
+
resizingList.set(element, element.resize);
|
|
99
98
|
return element;
|
|
100
99
|
}
|
|
101
100
|
function main() {
|
package/coms/zimoli/lattice.js
CHANGED
package/coms/zimoli/list.js
CHANGED
|
@@ -218,12 +218,15 @@ function ylist(container, generator, $Y) {
|
|
|
218
218
|
var rebuild = function () {
|
|
219
219
|
runbuild();
|
|
220
220
|
};
|
|
221
|
+
var topinsert = null;
|
|
221
222
|
oncemount(list, function () {
|
|
222
223
|
if (!/^(?:auto|scroll)$/i.test(getComputedStyle(list).overflowY)) return;
|
|
223
224
|
on("scroll")(list, rebuild);
|
|
225
|
+
if (!topinsert) {
|
|
226
|
+
topinsert = document.createElement('insertY');
|
|
227
|
+
list.insertBefore(topinsert, list.firstChild);
|
|
228
|
+
}
|
|
224
229
|
});
|
|
225
|
-
var topinsert = document.createElement('ylist-insert');
|
|
226
|
-
list.insertBefore(topinsert, list.firstChild);
|
|
227
230
|
//计算当前高度
|
|
228
231
|
var currentY = function () {
|
|
229
232
|
var firstElement = getFirstElement();
|
package/coms/zimoli/list.less
CHANGED
package/coms/zimoli/onresize.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
console.warn(`%c onresize(...) %c方法将在未来的版本中移除!使用%c on("resize")(window, handler) %c 或 %c resizingList.set(element, handler) %c 代替`,
|
|
2
|
+
"color:red","color:#333","color:blue","color:#333","color:blue","color:#333"), on("resize");
|
package/coms/zimoli/render.js
CHANGED
|
@@ -797,6 +797,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
|
|
|
797
797
|
}
|
|
798
798
|
if (!isFirstRender) return element;
|
|
799
799
|
renderRest(element, element.$struct, replacer);
|
|
800
|
+
var restons = element.$struct.ons;
|
|
800
801
|
if (replacer) {
|
|
801
802
|
if (!replacer.renders) replacer.renders = [];
|
|
802
803
|
if (isElement(replacer)) createStructure(replacer);
|
|
@@ -810,7 +811,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
|
|
|
810
811
|
}
|
|
811
812
|
element = replacer;
|
|
812
813
|
}
|
|
813
|
-
|
|
814
|
+
restons.forEach(([on, key, value]) => on.call(element, element, key, value));
|
|
814
815
|
if (element.renders.length) {
|
|
815
816
|
if (element.renderid !== 9) {
|
|
816
817
|
onmounted(element, addRenderElement);
|
|
@@ -897,7 +898,7 @@ function createStructure(element) {
|
|
|
897
898
|
value = name.slice(1).replace(/\./g, ' ')
|
|
898
899
|
name = 'class';
|
|
899
900
|
copys.push({ name, value });
|
|
900
|
-
element
|
|
901
|
+
addClass(element, value);
|
|
901
902
|
continue;
|
|
902
903
|
}
|
|
903
904
|
if (/^(?:class|style|src|\:|placeholder)$/i.test(name)) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var onresize = on("resize");
|
|
1
2
|
onresize(window, function () {
|
|
2
3
|
for (var r of resizingList) {
|
|
3
4
|
dispatch(r, 'resize');
|
|
@@ -11,9 +12,13 @@ var unmount = function () {
|
|
|
11
12
|
removeFromList(resizingList, this);
|
|
12
13
|
};
|
|
13
14
|
var resizingList = [];
|
|
14
|
-
resizingList.set = function (e) {
|
|
15
|
-
|
|
16
|
-
on("remove")(e, unmount);
|
|
15
|
+
resizingList.set = function (e, h) {
|
|
16
|
+
var off1 = onmounted(e, mount);
|
|
17
|
+
var off2 = on("remove")(e, unmount);
|
|
18
|
+
if (isFunction(h)) var off3 = onresize(e, h);
|
|
19
|
+
var offs = [off1, off2];
|
|
20
|
+
if (off3) offs.push(off3);
|
|
21
|
+
return function (offs) { for (var off of offs) off() };
|
|
17
22
|
};
|
|
18
23
|
resizingList.hit = function (e) {
|
|
19
24
|
for (var a of this) {
|
package/coms/zimoli/slider.js
CHANGED
|
@@ -323,7 +323,7 @@ function slider(autoplay, circle = true) {
|
|
|
323
323
|
var cancel_resize;
|
|
324
324
|
onappend(outter, function () {
|
|
325
325
|
cancel_resize && cancel_resize();
|
|
326
|
-
cancel_resize =
|
|
326
|
+
cancel_resize = on("resize")(window, function () {
|
|
327
327
|
switchBy(0);
|
|
328
328
|
});
|
|
329
329
|
if (isFinite(outter.index)) switchBy(0);
|
package/coms/zimoli/table.js
CHANGED
package/coms/zimoli/view.less
CHANGED
|
@@ -3,6 +3,7 @@ body>& {
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
& {
|
|
6
|
+
display: block;
|
|
6
7
|
max-width: 100%;
|
|
7
8
|
width: 360px;
|
|
8
9
|
height: auto;
|
|
@@ -22,7 +23,7 @@ body>& {
|
|
|
22
23
|
position: absolute;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
>.body,
|
|
26
27
|
>[body] {
|
|
27
28
|
padding: 6px 20px 6px 6px;
|
|
28
29
|
margin-right: -20px;
|
|
@@ -45,7 +46,7 @@ body>& {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
>.head,
|
|
49
50
|
>[head] {
|
|
50
51
|
top: 0;
|
|
51
52
|
z-index: 2;
|
|
@@ -94,13 +95,13 @@ body>& {
|
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
|
|
98
|
+
>.foot,
|
|
98
99
|
>[foot] {
|
|
99
100
|
white-space: nowrap;
|
|
100
101
|
overflow: auto;
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
|
|
104
|
+
>.foot,
|
|
104
105
|
>[foot] {
|
|
105
106
|
z-index: 1;
|
|
106
107
|
text-align: right;
|