efront 3.35.14 → 3.36.0
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/blank/index.html +1 -21
- package/apps/blank/main.js +1 -1
- package/apps/kugou/singer/keywords.less +1 -0
- package/apps/sciters/main.js +31 -0
- package/coms/basic/#loader.js +3 -4
- package/coms/basic/i18n.js +25 -0
- package/coms/basic/i18n.md +10 -0
- package/coms/basic/parseYML.js +1 -0
- package/coms/basic/refilm_decode.js +2 -1
- package/coms/basic/strings.js +3 -3
- package/coms/compile/Javascript.js +1 -20
- package/coms/compile/autoi18n.js +17 -0
- package/coms/compile/autoi18n_test.js +6 -0
- package/coms/compile/common.js +22 -0
- package/coms/compile/translate.js +131 -0
- package/coms/compile/wraphtml.js +3 -0
- package/coms/docs/md5.js +174 -0
- package/coms/frame/route.js +1 -1
- package/coms/zimoli/XMLHttpRequest.js +33 -1
- package/coms/zimoli/alert.js +1 -1
- package/coms/zimoli/appendChild.js +2 -1
- package/coms/zimoli/button.less +1 -0
- package/coms/zimoli/createEvent.js +8 -3
- package/coms/zimoli/cross.js +1 -1
- package/coms/zimoli/cross_test.js +8 -2
- package/coms/zimoli/forceUpdate.js +2 -6
- package/coms/zimoli/list.js +1 -1
- package/coms/zimoli/on.js +4 -2
- package/coms/zimoli/render.js +5 -2
- package/coms/zimoli/transition.js +4 -5
- package/coms/zimoli/tree.js +5 -3
- package/coms/zimoli/zimoli.js +3 -3
- package/docs/index.html +1 -12
- package/docs/main.xht +2 -1
- package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +578 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/readme.md +1 -1
- package/coms/zimoli/i18n.js +0 -192
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 创建自定义事件
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
if ("createEvent" in document) var createEvent = function createEvent(eventName, canBubble = false, cancelable = true) {
|
|
5
5
|
var event = document.createEvent("Event");
|
|
6
6
|
event.initEvent(eventName, canBubble, cancelable);
|
|
7
7
|
return event;
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
|
+
else if ("createEventObject" in document) var createEvent = function createEventObject(eventName) {
|
|
9
10
|
var event = document.createEventObject();
|
|
10
11
|
event.type = eventName;
|
|
11
12
|
return event;
|
|
12
|
-
}
|
|
13
|
+
}
|
|
14
|
+
else var Event = window.Event, createEvent = function (eventName) {
|
|
15
|
+
var event = new Event(eventName);
|
|
16
|
+
return event;
|
|
17
|
+
}
|
package/coms/zimoli/cross.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
function main() {
|
|
1
|
+
async function main() {
|
|
2
2
|
cross.addDirect('//baidu.com/');
|
|
3
|
-
|
|
3
|
+
try{
|
|
4
|
+
var xhr = await cross("fpost", 'http://baidu.com');
|
|
5
|
+
console.log(xhr.responseText);
|
|
6
|
+
}
|
|
7
|
+
catch(e){
|
|
8
|
+
console.error(String(e));
|
|
9
|
+
}
|
|
4
10
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
var { window, location, preventCache = true, parseInt, navigator, Date } = this;
|
|
2
2
|
var start_time = +new Date / 1000 | 0;
|
|
3
|
-
|
|
4
|
-
if (!preventCache) {
|
|
5
|
-
break;
|
|
6
|
-
}
|
|
3
|
+
if (preventCache && navigator) {
|
|
7
4
|
|
|
8
5
|
var page_time = location.search.replace(/^.*?[\?&]\=([^&]+).*?$/i, "$1");
|
|
9
6
|
page_time = parseInt(page_time, 36) || 0;
|
|
@@ -21,7 +18,6 @@ while (true) {
|
|
|
21
18
|
} else {
|
|
22
19
|
search = "=" + mark_time.toString(36);
|
|
23
20
|
}
|
|
24
|
-
if (!/Safari|Firefox/.test(navigator.userAgent)) location.replace(location.pathname + "?" + search);
|
|
21
|
+
if (!/Safari|Firefox|Sciter/.test(navigator.userAgent)) location.replace(location.pathname + "?" + search);
|
|
25
22
|
}
|
|
26
|
-
break;
|
|
27
23
|
}
|
package/coms/zimoli/list.js
CHANGED
|
@@ -618,7 +618,7 @@ function list() {
|
|
|
618
618
|
}
|
|
619
619
|
var savedSrc = [];
|
|
620
620
|
if (bindSrc === true) care(container, function (src, old) {
|
|
621
|
-
if (container.
|
|
621
|
+
if (container.src !== src) return;
|
|
622
622
|
var index = container.index();
|
|
623
623
|
if (src !== old) container.clean(), index = 0;
|
|
624
624
|
else container.clean(src, savedSrc);
|
package/coms/zimoli/on.js
CHANGED
|
@@ -268,7 +268,7 @@ var remove = function (k, hk, [eventtypes, handler, context]) {
|
|
|
268
268
|
}
|
|
269
269
|
if (!hs.length && hs.h) {
|
|
270
270
|
element[hk] = null;
|
|
271
|
-
if (
|
|
271
|
+
if (element.removeEventListener) {
|
|
272
272
|
element.removeEventListener(k, hs.h, getListenerOption(eventtypes, k));
|
|
273
273
|
} else {
|
|
274
274
|
if (element["on" + k] === hs.h) element["on" + k] = null;
|
|
@@ -354,7 +354,9 @@ var on = document.efronton = function (k) {
|
|
|
354
354
|
var h = broadcast.bind(target, k, hk);
|
|
355
355
|
target[hk] = [];
|
|
356
356
|
target[hk].h = h;
|
|
357
|
-
target.addEventListener
|
|
357
|
+
if (target.addEventListener)
|
|
358
|
+
target.addEventListener(k, h, getListenerOption(eventtypes, k));
|
|
359
|
+
else target[on_event_path] = h;
|
|
358
360
|
}
|
|
359
361
|
var listener = [eventtypes, handler, context];
|
|
360
362
|
append.call(target, k, hk, listener, firstmost);
|
package/coms/zimoli/render.js
CHANGED
|
@@ -753,7 +753,6 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
|
|
|
753
753
|
}
|
|
754
754
|
element.$parentScopes = parentScopes || [];
|
|
755
755
|
var s = createStructure(element);
|
|
756
|
-
|
|
757
756
|
if (isEmpty(s.once)) s.once = once;
|
|
758
757
|
element.$eval = $eval;
|
|
759
758
|
}
|
|
@@ -888,7 +887,11 @@ function createStructure(element) {
|
|
|
888
887
|
if (isArrayLike(element)) return Array.prototype.map.call(element, createStructure);
|
|
889
888
|
if (element.$struct) return element.$struct;
|
|
890
889
|
// 处理结构流
|
|
891
|
-
var
|
|
890
|
+
var attributes = element.attributes;
|
|
891
|
+
var attrs = Array.apply(null, attributes);
|
|
892
|
+
if (attributes.length && !attributes[0]) {
|
|
893
|
+
for (var cx = 0, dx = attributes.length; cx < dx; cx++) attrs[cx] = attributes.item(cx);
|
|
894
|
+
}
|
|
892
895
|
var types = {};
|
|
893
896
|
var emiter_reg = /^(?:(v|ng|on|once)?\-|v\-on\:|@|once|on)/i;
|
|
894
897
|
var ons = [];
|
|
@@ -97,12 +97,11 @@ function 帧样式(style, captureStyle, point) {
|
|
|
97
97
|
function InnerStyle(o) {
|
|
98
98
|
for (var k in o) {
|
|
99
99
|
var v = o[k];
|
|
100
|
-
this[css.transformNodeKey(k)] = css.transformValue(v);
|
|
100
|
+
this[css.transformNodeKey(k)] = css.transformValue(v, k);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
var transitionKey = css.transformNodeKey("transition");
|
|
105
|
-
|
|
106
105
|
function transition(target, _isLeave, _initialStyle) {
|
|
107
106
|
if (!target) return;
|
|
108
107
|
if ((isObject(_isLeave) || typeof _isLeave === "string") && (isFinite(_initialStyle) || !_initialStyle)) {
|
|
@@ -140,13 +139,13 @@ function transition(target, _isLeave, _initialStyle) {
|
|
|
140
139
|
clearTimeout(transitionTimerEnd);
|
|
141
140
|
var transitionDuration = 100;
|
|
142
141
|
if (!initialStyle[transitionKey]) {
|
|
143
|
-
initialStyle[transitionKey] = "
|
|
142
|
+
initialStyle[transitionKey] = Object.keys(initialStyle).map(k => k.replace(/[A-Z]/g, a => "-" + a.toLowerCase()) + " .3s ease").join(",");
|
|
144
143
|
transitionDuration = 300;
|
|
145
144
|
}
|
|
146
|
-
String(initialStyle[transitionKey]).replace(/([\.\d]+)(m?)s/gi, function (m, d, t) {
|
|
145
|
+
initialStyle[transitionKey] = String(initialStyle[transitionKey]).replace(/([\.\d]+)(m?)s/gi, function (m, d, t) {
|
|
147
146
|
if (t) transitionDuration = Math.max(+d, transitionDuration);
|
|
148
147
|
else transitionDuration = Math.max(d * 1000, transitionDuration);
|
|
149
|
-
return
|
|
148
|
+
return transitionDuration + "ms";
|
|
150
149
|
});
|
|
151
150
|
transitionDuration = transitionDuration || 260;
|
|
152
151
|
if (!recoverStyle) recoverStyle = {};
|
package/coms/zimoli/tree.js
CHANGED
|
@@ -48,6 +48,11 @@ function tree() {
|
|
|
48
48
|
clearTimeout(timer);
|
|
49
49
|
timer = setTimeout(call, time);
|
|
50
50
|
};
|
|
51
|
+
care(element, function () {
|
|
52
|
+
banner.setData(this.src);
|
|
53
|
+
this.src = root;
|
|
54
|
+
});
|
|
55
|
+
|
|
51
56
|
var banner = list(element, function (index) {
|
|
52
57
|
var coms = dom;
|
|
53
58
|
if (index >= coms.length) return;
|
|
@@ -233,9 +238,6 @@ function tree() {
|
|
|
233
238
|
root = new Tree(src);
|
|
234
239
|
refresh();
|
|
235
240
|
};
|
|
236
|
-
care(banner, function () {
|
|
237
|
-
this.setData(this.src);
|
|
238
|
-
});
|
|
239
241
|
banner.addData = function (data, parent = root) {
|
|
240
242
|
appendTo(parent, data);
|
|
241
243
|
refresh();
|
package/coms/zimoli/zimoli.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
//main
|
|
6
6
|
var body = document.body;
|
|
7
7
|
var onbacks = [];
|
|
8
|
-
var window_history = window.history;
|
|
8
|
+
var window_history = window.history || { length: 0, go() { }, back() { } };
|
|
9
9
|
var window_history_length = window_history.length;
|
|
10
10
|
var sessionSavedHashKey = "__zimoli_session_init_hash" + location.pathname;
|
|
11
11
|
var sessionInitHash = sessionStorage.getItem(sessionSavedHashKey);
|
|
@@ -168,7 +168,7 @@ function go(pagepath, args, history_name, oldpagepath) {
|
|
|
168
168
|
id,
|
|
169
169
|
options
|
|
170
170
|
};
|
|
171
|
-
dispatch(
|
|
171
|
+
dispatch(document, event);
|
|
172
172
|
fullfill_is_dispatched = 0;
|
|
173
173
|
}
|
|
174
174
|
addGlobal(_page, history_name, isDestroy);
|
|
@@ -411,7 +411,7 @@ function create(pagepath, args, from, needroles) {
|
|
|
411
411
|
if (!user.isLogin && user.loginPath) {
|
|
412
412
|
return create(user.loginPath);
|
|
413
413
|
}
|
|
414
|
-
return alert(i18n
|
|
414
|
+
return alert(i18n`没有权限!`, 0);
|
|
415
415
|
}
|
|
416
416
|
_with_elements = [].concat(_with_elements);
|
|
417
417
|
state.with = function (element) {
|
package/docs/index.html
CHANGED
|
@@ -33,18 +33,7 @@
|
|
|
33
33
|
box-sizing: border-box;
|
|
34
34
|
}
|
|
35
35
|
</style>
|
|
36
|
-
<script deleteoncompile>
|
|
37
|
-
-function (body, window) {
|
|
38
|
-
body.removeChild(body.getElementsByTagName("script")[0]);
|
|
39
|
-
var xhr = new (window.XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP');
|
|
40
|
-
xhr.onreadystatechange = function () {
|
|
41
|
-
if (xhr.readyState === 4) {
|
|
42
|
-
new Function(xhr.responseText).call(window);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
xhr.open('POST', 'comm/main');
|
|
46
|
-
xhr.send("step into my sight..");
|
|
47
|
-
}.call(this, document.documentElement.children[0], this);
|
|
36
|
+
<script efrontloader deleteoncompile>
|
|
48
37
|
</script>
|
|
49
38
|
</head>
|
|
50
39
|
|