efront 4.4.12 → 4.4.14
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/#/345/233/275/351/231/205/345/214/226.yml +885 -66
- package/apps/reptile/encode.js +1 -1
- package/coms/basic/#loader.js +4 -4
- package/coms/basic/BigNumber.js +6 -6
- package/coms/basic/BitTree.js +1 -1
- package/coms/basic/Enum.js +1 -1
- package/coms/basic/Matrix.js +1 -1
- package/coms/basic/analyse_test.js +1 -1
- package/coms/basic/assert.js +1 -1
- package/coms/basic/color.js +1 -1
- package/coms/basic/compile.js +1 -1
- package/coms/basic/cross_.js +2 -2
- package/coms/basic/crypt.js +3 -3
- package/coms/basic/decodePack.js +3 -3
- package/coms/basic/deepEqual.js +1 -1
- package/coms/basic/encodeRange_test.js +1 -1
- package/coms/basic/encodeUTF16.js +2 -2
- package/coms/basic/encodeUTF8.js +1 -1
- package/coms/basic/i18n.md +4 -2
- package/coms/basic/parseYML.js +2 -2
- package/coms/basic/refilm.js +2 -2
- package/coms/basic/repeat.js +1 -1
- package/coms/basic/submit_.js +4 -4
- package/coms/basic_/Array2.js +2 -2
- package/coms/basic_/Promise.js +1 -1
- package/coms/basic_/exec_.js +1 -1
- package/coms/compile/Javascript.js +2 -2
- package/coms/compile/Program.js +1 -1
- package/coms/compile/common.js +27 -4
- package/coms/compile/downLevel.js +5 -5
- package/coms/compile/translate.js +29 -11
- package/coms/compile/translate_test.js +8 -0
- package/coms/compile/unstruct.js +9 -4
- package/coms/compile/unstruct_test.js +2 -1
- package/coms/compile/washcode.js +2 -2
- package/coms/docs/execute.js +1 -1
- package/coms/explorer/Explorer.js +6 -6
- package/coms/explorer/context.js +16 -16
- package/coms/explorer/deepcp.js +2 -2
- package/coms/explorer/edit.html +3 -3
- package/coms/frame/chat.html +2 -2
- package/coms/frame/route.js +1 -1
- package/coms/kugou/parseSongsList.js +1 -1
- package/coms/reptile/colored_console.js +8 -2
- package/coms/reptile/cross.js +1 -1
- package/coms/reptile/decodeHttpResponse.js +1 -1
- package/coms/reptile/detectWithExtension.js +1 -1
- package/coms/zimoli/Enum.js +1 -1
- package/coms/zimoli/api.js +19 -19
- package/coms/zimoli/avatarEditor.js +1 -1
- package/coms/zimoli/care.js +3 -3
- package/coms/zimoli/cast.js +1 -1
- package/coms/zimoli/chooseFile.js +2 -2
- package/coms/zimoli/clock.js +1 -1
- package/coms/zimoli/confirm.js +2 -2
- package/coms/zimoli/createElement.js +2 -2
- package/coms/zimoli/cross.js +3 -3
- package/coms/zimoli/css.js +1 -1
- package/coms/zimoli/downloadmap.js +2 -2
- package/coms/zimoli/filterTime.js +1 -1
- package/coms/zimoli/grid.js +4 -4
- package/coms/zimoli/icon.js +1 -1
- package/coms/zimoli/list.js +1 -1
- package/coms/zimoli/mediaDevices.js +1 -1
- package/coms/zimoli/menu.js +1 -1
- package/coms/zimoli/on.js +3 -3
- package/coms/zimoli/overlap_test.js +1 -1
- package/coms/zimoli/popup.js +2 -2
- package/coms/zimoli/render.js +10 -10
- package/coms/zimoli/table.js +1 -1
- package/coms/zimoli/watch.js +1 -1
- package/coms/zimoli/zimoli.js +3 -3
- package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +12 -4
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/coms/kugou/fxPlayer.js +0 -12474
package/coms/zimoli/grid.js
CHANGED
|
@@ -335,7 +335,7 @@ var createPoints = function (values, direction = "x", result = new Point(0)) {
|
|
|
335
335
|
for (var cx = 0, dx = values.length; cx < dx; cx++) {
|
|
336
336
|
var value = values[cx];
|
|
337
337
|
if (value instanceof Array && value.constructor !== Point) {
|
|
338
|
-
if (!result.length) throw new Error(
|
|
338
|
+
if (!result.length) throw new Error(i18n`数据转换为grid失败!`);
|
|
339
339
|
createPoints(value, direction === "x" ? "y" : "x", result[result.length - 1]);
|
|
340
340
|
} else {
|
|
341
341
|
var breakpoint = new Point(value);
|
|
@@ -401,7 +401,7 @@ var grid_prototype = {
|
|
|
401
401
|
targetX = clientX = left + right >> 1;
|
|
402
402
|
break;
|
|
403
403
|
default:
|
|
404
|
-
throw new Error(
|
|
404
|
+
throw new Error(i18n`参数不支持`, side);
|
|
405
405
|
}
|
|
406
406
|
this.direction = direction;
|
|
407
407
|
var e = resizer.call(this, { clientX, clientY, target: cell });
|
|
@@ -690,7 +690,7 @@ var createPointsFromElements = function (elements, xList, yList) {
|
|
|
690
690
|
var y1 = yList[cx - 1];
|
|
691
691
|
var y2 = yList[cx];
|
|
692
692
|
var temp = elements.filter(e => e[3] >= y1 && e[4] <= y2);
|
|
693
|
-
if (temp.length === elements.length) throw new Error(
|
|
693
|
+
if (temp.length === elements.length) throw new Error(i18n`遇到不规则布局,无法自动处理!`);
|
|
694
694
|
if (temp.length > 1) {
|
|
695
695
|
var children = createPointsFromElements(temp, [xList[0], xList[xList.length - 1]], [y1, y2]);
|
|
696
696
|
if (children.length) {
|
|
@@ -711,7 +711,7 @@ var createPointsFromElements = function (elements, xList, yList) {
|
|
|
711
711
|
var x1 = xList[cx - 1];
|
|
712
712
|
var x2 = xList[cx];
|
|
713
713
|
var temp = elements.filter(e => e[1] >= x1 && e[2] <= x2);
|
|
714
|
-
if (temp.length === elements.length) throw new Error(
|
|
714
|
+
if (temp.length === elements.length) throw new Error(i18n`遇到不规则布局,无法自动处理!`);
|
|
715
715
|
if (temp.length > 1) {
|
|
716
716
|
var children = createPointsFromElements(temp, [x1, x2], [yList[0], yList[yList.length - 1]]);
|
|
717
717
|
if (children.length) xList.splice(cx, 0, children);
|
package/coms/zimoli/icon.js
CHANGED
package/coms/zimoli/list.js
CHANGED
|
@@ -190,7 +190,7 @@ function ylist(container, generator, $Y) {
|
|
|
190
190
|
}
|
|
191
191
|
offsetBottom = bottom_item.offsetTop + bottom_item.offsetHeight;
|
|
192
192
|
ratioTop = top_item.offsetTop + top_item.offsetHeight * ratio;
|
|
193
|
-
if (count++ > 600) throw new Error(
|
|
193
|
+
if (count++ > 600) throw new Error(i18n`多于600个元素需要绘制!`);
|
|
194
194
|
}
|
|
195
195
|
for (var k in childrenMap) {
|
|
196
196
|
remove(childrenMap[k]);
|
package/coms/zimoli/menu.js
CHANGED
package/coms/zimoli/on.js
CHANGED
|
@@ -199,7 +199,7 @@ var parseEventTypes = function (eventtypes) {
|
|
|
199
199
|
types.keyCode = keyCodeMap[t];
|
|
200
200
|
}
|
|
201
201
|
else {
|
|
202
|
-
throw new Error(`绑定事件参数无效${t}`);
|
|
202
|
+
throw new Error(i18n`绑定事件参数无效${t}`);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
}
|
|
@@ -315,7 +315,7 @@ var checkroot = function (element, k) {
|
|
|
315
315
|
if (element === window && k in document) {
|
|
316
316
|
element = document;
|
|
317
317
|
// <!--
|
|
318
|
-
if (!checkroot[k]) checkroot[k] = true, console.warn(
|
|
318
|
+
if (!checkroot[k]) checkroot[k] = true, console.warn(i18n`使用 document 的`, k, "替代 window 的");
|
|
319
319
|
// -->
|
|
320
320
|
}
|
|
321
321
|
}
|
|
@@ -365,7 +365,7 @@ var on = document.efronton = function (k) {
|
|
|
365
365
|
else {
|
|
366
366
|
var _addhandler = function (target, context, handler, firstmost = false) {
|
|
367
367
|
if (eventtypes.capture) {
|
|
368
|
-
console.warn(
|
|
368
|
+
console.warn(i18n`当前运行环境不支持事件capture`);
|
|
369
369
|
firstmost = true;
|
|
370
370
|
}
|
|
371
371
|
target = checkroot(target, k);
|
|
@@ -3,7 +3,7 @@ addClass(sample, "overlap-test");
|
|
|
3
3
|
css(".overlap-test", "position:absolute;z-index:10;");
|
|
4
4
|
var assert = function (a, b) {
|
|
5
5
|
if (a !== b) return console.error(`${a} is not equal ${b}!`), 0;
|
|
6
|
-
else return console.info(
|
|
6
|
+
else return console.info(i18n`验证通过`), 1;
|
|
7
7
|
}
|
|
8
8
|
var getElement = function (left, top, width, height) {
|
|
9
9
|
var element1 = createElement(sample)
|
package/coms/zimoli/popup.js
CHANGED
|
@@ -24,10 +24,10 @@ var popup = function (path) {
|
|
|
24
24
|
if (isNode(path)) {
|
|
25
25
|
return popup_view.apply(null, arguments);
|
|
26
26
|
}
|
|
27
|
-
throw new Error(`参数异常:${path}`);
|
|
27
|
+
throw new Error(i18n`参数异常:${path}`);
|
|
28
28
|
};
|
|
29
29
|
var popup_path = function (path = "", parameters, target) {
|
|
30
|
-
if (!popup.go || !popup.prepare) throw new Error(
|
|
30
|
+
if (!popup.go || !popup.prepare) throw new Error(i18n`当前环境无法使用`);
|
|
31
31
|
// 3 has mask has view control
|
|
32
32
|
var element;
|
|
33
33
|
if (/^[#\+]/.test(path)) {
|
package/coms/zimoli/render.js
CHANGED
|
@@ -209,7 +209,7 @@ var createRepeat = function (search, id = 0) {
|
|
|
209
209
|
// throw new Error("repeat is not supported! use list component instead");
|
|
210
210
|
var expression = search;
|
|
211
211
|
var repeater = parseRepeat(expression);
|
|
212
|
-
if (!repeater) throw new Error(`不能识别循环表达式: ${expression} `);
|
|
212
|
+
if (!repeater) throw new Error(i18n`不能识别循环表达式: ${expression} `);
|
|
213
213
|
var { srcName, trackBy } = repeater;
|
|
214
214
|
// 懒渲染
|
|
215
215
|
var getter = createGetter(this, srcName);
|
|
@@ -227,7 +227,7 @@ var createRepeat = function (search, id = 0) {
|
|
|
227
227
|
var isArrayResult = result instanceof Array;
|
|
228
228
|
var keys = isArrayResult ? result.map((_, i) => i) : Object.keys(result);
|
|
229
229
|
if (keys.length > 600) {
|
|
230
|
-
throw new Error(
|
|
230
|
+
throw new Error(i18n`数据量过大,取消绘制!`);
|
|
231
231
|
}
|
|
232
232
|
var $parentScopes = element.$parentScopes || [];
|
|
233
233
|
var $struct = element.$struct;
|
|
@@ -327,7 +327,7 @@ var createIf = function (search, id = 0) {
|
|
|
327
327
|
var parseIfWithRepeat = function (ifExpression, repeatExpression) {
|
|
328
328
|
var repeater = parseRepeat(repeatExpression);
|
|
329
329
|
if (!repeater) {
|
|
330
|
-
throw new Error(
|
|
330
|
+
throw new Error(i18n`不能识别循环表达式: ${repeat}`);
|
|
331
331
|
}
|
|
332
332
|
var pair = [];
|
|
333
333
|
var rest = [], savedIndex = 0;
|
|
@@ -359,7 +359,7 @@ var parseIfWithRepeat = function (ifExpression, repeatExpression) {
|
|
|
359
359
|
};
|
|
360
360
|
var inc = 0;
|
|
361
361
|
while (reg.lastIndex < ifExpression.length) {
|
|
362
|
-
if (inc++ > 100) throw new Error(
|
|
362
|
+
if (inc++ > 100) throw new Error(i18n`请不要在if表达式中使用太多的条件!`);
|
|
363
363
|
if (reg.lastIndex < savedIndex) break;
|
|
364
364
|
run();
|
|
365
365
|
}
|
|
@@ -423,7 +423,7 @@ var structures = {
|
|
|
423
423
|
if (if_top[cx].parent === this.parentNode) break;
|
|
424
424
|
}
|
|
425
425
|
if (cx < 0) {
|
|
426
|
-
throw new Error(
|
|
426
|
+
throw new Error(i18n`else/elseif前缺少同级if!`);
|
|
427
427
|
}
|
|
428
428
|
initIf(if_top.splice(cx + 1, if_top.length - cx - 1));
|
|
429
429
|
var top = if_top[cx];
|
|
@@ -757,11 +757,11 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
|
|
|
757
757
|
element.$renderid = 0;
|
|
758
758
|
element.$scope = scope;
|
|
759
759
|
if (isHandled(parentScopes) && !isArray(parentScopes)) {
|
|
760
|
-
throw new Error(
|
|
760
|
+
throw new Error(i18n`父级作用域链应以数组的类型传入`);
|
|
761
761
|
}
|
|
762
762
|
if (parentScopes) {
|
|
763
763
|
if (element.$renderid && !element.$parentScopes || element.$parentScopes && element.$parentScopes.length !== parentScopes.length) {
|
|
764
|
-
throw new Error(
|
|
764
|
+
throw new Error(i18n`父作用域链的长度必须相等着`);
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
767
|
element.$parentScopes = parentScopes || [];
|
|
@@ -775,7 +775,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
|
|
|
775
775
|
return element;
|
|
776
776
|
}
|
|
777
777
|
for (var id of element.$struct.ids) {
|
|
778
|
-
if (scope[id] && scope[id] !== element) throw new Error(
|
|
778
|
+
if (scope[id] && scope[id] !== element) throw new Error(i18n`同一个id不能使用两次:` + id);
|
|
779
779
|
scope[id] = element;
|
|
780
780
|
}
|
|
781
781
|
var isFirstRender = !element.$renderid;
|
|
@@ -937,11 +937,11 @@ function createStructure(element) {
|
|
|
937
937
|
if (element.$renderid <= -2) {
|
|
938
938
|
if (/^if$|^else/i.test(key)) {
|
|
939
939
|
if (types.if) {
|
|
940
|
-
throw new Error(`暂不支持在同一元素上使用多次if结构!`);
|
|
940
|
+
throw new Error(i18n`暂不支持在同一元素上使用多次if结构!`);
|
|
941
941
|
}
|
|
942
942
|
} else {
|
|
943
943
|
if (types.repeat) {
|
|
944
|
-
throw new Error(`暂不支持在同一元素上使用多次repeat类型的属性!`);
|
|
944
|
+
throw new Error(i18n`暂不支持在同一元素上使用多次repeat类型的属性!`);
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
947
|
}
|
package/coms/zimoli/table.js
CHANGED
|
@@ -471,7 +471,7 @@ function table(elem) {
|
|
|
471
471
|
else if (src instanceof Array) {
|
|
472
472
|
var [fields, data] = src;
|
|
473
473
|
}
|
|
474
|
-
else throw new Error(
|
|
474
|
+
else throw new Error(i18n`table组件源数据错误!`);
|
|
475
475
|
if (_vbox) _vbox(), _vbox = null;
|
|
476
476
|
watch(table, {
|
|
477
477
|
find(text) {
|
package/coms/zimoli/watch.js
CHANGED
package/coms/zimoli/zimoli.js
CHANGED
|
@@ -96,7 +96,7 @@ var getZimoliParams = function (pagepath) {
|
|
|
96
96
|
try {
|
|
97
97
|
return JSAM.parse(hostoryStorage.getItem(_zimoli_params_key + pagepath)) || {};
|
|
98
98
|
} catch (e) {
|
|
99
|
-
console.warn(
|
|
99
|
+
console.warn(i18n`存储空间被破坏`);
|
|
100
100
|
}
|
|
101
101
|
return {};
|
|
102
102
|
};
|
|
@@ -106,7 +106,7 @@ var setZimoliParams = function (pagepath, args) {
|
|
|
106
106
|
if (stringified_args.length === 2) hostoryStorage.removeItem(_zimoli_params_key + pagepath);
|
|
107
107
|
else hostoryStorage.setItem(_zimoli_params_key + pagepath, stringified_args);
|
|
108
108
|
} catch (e) {
|
|
109
|
-
console.warn(
|
|
109
|
+
console.warn(i18n`写入存储空间失败!`, e);
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
var fullfill_is_dispatched = 0;
|
|
@@ -391,7 +391,7 @@ function create(pagepath, args, from, needroles) {
|
|
|
391
391
|
if (typeof pagepath === 'string') {
|
|
392
392
|
var page_object = page_generators[pagepath];
|
|
393
393
|
if (!page_object) {
|
|
394
|
-
throw new Error(`调用create前请确保prepare执行完毕:${pagepath}`);
|
|
394
|
+
throw new Error(i18n`调用create前请确保prepare执行完毕:${pagepath}`);
|
|
395
395
|
}
|
|
396
396
|
var { pg, "with": _with_elements, state, onback: _pageback_listener, roles } = page_object;
|
|
397
397
|
}
|
|
@@ -340,7 +340,7 @@
|
|
|
340
340
|
return compile$translate.getI18nPrefixed(code);
|
|
341
341
|
}
|
|
342
342
|
catch (e) {
|
|
343
|
-
alert(
|
|
343
|
+
alert(i18n`提取文本时存在异常`, "error");
|
|
344
344
|
console.error(e, f.path);
|
|
345
345
|
return [];
|
|
346
346
|
}
|
|
@@ -356,6 +356,14 @@
|
|
|
356
356
|
key: "filter",
|
|
357
357
|
options: [
|
|
358
358
|
{
|
|
359
|
+
name: i18n`过滤空串`,
|
|
360
|
+
checked: true,
|
|
361
|
+
test(a) {
|
|
362
|
+
return !!a.fanyi || /\S/.test(a.text);
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
disabled: true,
|
|
359
367
|
name: i18n`只看中文`, key: "cnonly", get checked() {
|
|
360
368
|
return true;
|
|
361
369
|
},
|
|
@@ -366,7 +374,7 @@
|
|
|
366
374
|
return !!a.fanyi || /[\u3400-\ufad9\u{20000}-\u{2a6d6}\u{2fa1d}]/u.test(a.text);
|
|
367
375
|
}
|
|
368
376
|
}
|
|
369
|
-
]
|
|
377
|
+
].filter(a => !a.disabled)
|
|
370
378
|
};
|
|
371
379
|
var tableData = [];
|
|
372
380
|
var runFilter = function () {
|
|
@@ -481,7 +489,7 @@
|
|
|
481
489
|
}
|
|
482
490
|
var chooseFolder = async function () {
|
|
483
491
|
var dp = await window.showDirectoryPicker();
|
|
484
|
-
var msg = alert(
|
|
492
|
+
var msg = alert(i18n`正在读取文件列表,请稍候..`, false);
|
|
485
493
|
var rest = [dp];
|
|
486
494
|
var result = [];
|
|
487
495
|
dp.path = "";
|
|
@@ -511,7 +519,7 @@
|
|
|
511
519
|
}
|
|
512
520
|
}
|
|
513
521
|
}
|
|
514
|
-
msg.setText(
|
|
522
|
+
msg.setText(i18n`正在提取字符串..`);
|
|
515
523
|
css(msg.firstElementChild, 'text-align:left');
|
|
516
524
|
var textMap = Object.create(null);
|
|
517
525
|
已找到的字符串.is_loading = true;
|