efront 2.46.1 → 2.47.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/api.js +1 -1
- package/apps/kugou/index.html +4 -1
- package/coms/basic/parseURL.js +2 -2
- package/coms/basic/parseURL_test.js +7 -0
- package/coms/basic/refilm_decode.js +32 -11
- package/coms/crypt/encode62.js +38 -29
- package/coms/crypt/encode62_test.js +2 -1
- package/coms/zimoli/action.js +1 -2
- package/coms/zimoli/autodragchildren.js +3 -3
- package/coms/zimoli/button.less +1 -2
- package/coms/zimoli/contextmenu.js +13 -8
- package/coms/zimoli/cross.js +3 -3
- package/coms/zimoli/data.js +24 -10
- package/coms/zimoli/dispatch.js +13 -6
- package/coms/zimoli/encode62.js +3 -2
- package/coms/zimoli/field.js +1 -1
- package/coms/zimoli/input.js +0 -6
- package/coms/zimoli/input.less +6 -6
- package/coms/zimoli/menuList.html +3 -2
- package/coms/zimoli/menuList.less +29 -25
- package/coms/zimoli/model.js +43 -6
- package/coms/zimoli/popup.js +15 -10
- package/coms/zimoli/prompt.js +40 -0
- package/coms/zimoli/render.js +23 -13
- package/coms/zimoli/rootElements.js +1 -0
- package/coms/zimoli/search.js +15 -0
- package/coms/zimoli/select.js +26 -12
- package/coms/zimoli/selectList.js +68 -8
- package/coms/zimoli/selectList.less +15 -2
- package/coms/zimoli/selectListEdit.html +15 -0
- package/coms/zimoli/selectListEdit.js +68 -0
- package/coms/zimoli/selectListEdit.less +21 -0
- package/coms/zimoli/swap.less +1 -1
- package/coms/zimoli/table.html +6 -4
- package/coms/zimoli/table.js +62 -10
- package/coms/zimoli/table.less +3 -1
- package/coms/zimoli/textarea.less +0 -1
- package/coms/zimoli/zimoli.js +34 -6
- package/debug.log +3 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/apps/kugou/api.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"singer-list": "get:[].singer-img-list>li singer/list/:id#href=a!href&=a!href\\singer-info&imgurl=img!_src&name=p|innerText",
|
|
13
13
|
"singer-info": "mget:[].singer-songs-list>li singer/info/:id#hash=!id&singer=.singer-name|innerText&name=.song-name|innerText&data=em/innerText"
|
|
14
14
|
},
|
|
15
|
-
"
|
|
15
|
+
"http://mobilecdn.kugou.com/": {
|
|
16
16
|
"search?keyword": "get:data.info api/v3/search/song?format=json&page=1&pagesize=30&showtype=1"
|
|
17
17
|
}
|
|
18
18
|
})
|
package/apps/kugou/index.html
CHANGED
|
@@ -12,11 +12,14 @@
|
|
|
12
12
|
<meta name="viewport" content="initial-scale=1,maximum-scale=1,width=device-width" />
|
|
13
13
|
<title>酷狗尊享版</title>
|
|
14
14
|
<script deleteoncompile efrontloader>
|
|
15
|
-
// 若要在开发环境使用内置组件,请保留此script
|
|
15
|
+
// 若要在开发环境使用内置组件,请保留此script标签中的代码,在编译发布时,这里的代码会自动删除
|
|
16
16
|
</script>
|
|
17
17
|
<script>
|
|
18
18
|
cross_host = 'efront.cc';
|
|
19
19
|
</script>
|
|
20
|
+
<script deleteoncompile>
|
|
21
|
+
cross_host = '';
|
|
22
|
+
</script>
|
|
20
23
|
<style>
|
|
21
24
|
*,
|
|
22
25
|
::before,
|
package/coms/basic/parseURL.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// -------/// ---------------1-------------//////////////2---3--------//////// ----4----2/////5-----------------------6
|
|
2
|
-
var reg = /^([
|
|
1
|
+
// -------/// ---------------1-------------//////////////2---3--------//////// ----4----2/////5-----------------------6-----------------------//////////////-7--5///8----9----//10--11---10///--12-----8//
|
|
2
|
+
var reg = /^([^\:\/\?#\[]+\:(?![^\:\/\?\#]*@))?(?:\/\/)?(?:(([^\:\/\?#]+)?(?:\:([^\/\?#]+))?)@)?(([^\/@\:\?\#]*(?:[^\d\@\:\/\?#]|\.)[^\/@\?\#]*?)?(?:(?:\:|^)(\d+))?)((\/[^\?#]*)?(\?([^#]*))?(#[\s\S]*)?)$/;
|
|
3
3
|
function parseURL(url) {
|
|
4
4
|
if (url === undefined || url === null) url = '';
|
|
5
5
|
var [__, protocol, auth, username, password, host, hostname, port, path, pathname, search, query, hash] = reg.exec(url);
|
|
@@ -30,3 +30,10 @@ test('?80', 'path', '?80')
|
|
|
30
30
|
test('?80', 'search', '?80')
|
|
31
31
|
test('?80', 'query', '80')
|
|
32
32
|
test('#?80', 'hash', '#?80')
|
|
33
|
+
test("http://[fe80::caa:a647:ef1d:b4db]/", "host", "[fe80::caa:a647:ef1d:b4db]")
|
|
34
|
+
test("http://[::1]/", "host", "[::1]")
|
|
35
|
+
test("http://[::]/", "host", "[::]")
|
|
36
|
+
test("http://[::%12]/", "host", "[::%12]")
|
|
37
|
+
test("http://[::]:80/", "hostname", "[::]")
|
|
38
|
+
test("[::]:80/", "hostname", "[::]")
|
|
39
|
+
test("[fd64:f52:f52:f52:f52:f52:f52:97]", "hostname", "[fd64:f52:f52:f52:f52:f52:f52:97]")
|
|
@@ -260,16 +260,31 @@ function parse(piece) {
|
|
|
260
260
|
}
|
|
261
261
|
var [name, type, options] = piece, key, repeat;
|
|
262
262
|
if (piece.length === 1 && isObject(name)) {
|
|
263
|
-
var {
|
|
263
|
+
var {
|
|
264
|
+
name, type, key, value, comment, options,
|
|
265
|
+
size, unit, ratio,
|
|
266
|
+
needs, checks, repeat, endwith,
|
|
267
|
+
required, inlist, hidden, readonly,
|
|
268
|
+
delete_onempty, delete_onsubmit,
|
|
269
|
+
} = name;
|
|
264
270
|
} else {
|
|
265
|
-
var
|
|
266
|
-
if (
|
|
267
|
-
|
|
268
|
-
return a.replace(/^\*|\*$/, '');
|
|
271
|
+
var test = (reg,a) => {
|
|
272
|
+
if (reg.test(a)) {
|
|
273
|
+
return true;
|
|
269
274
|
}
|
|
270
|
-
return a;
|
|
271
275
|
};
|
|
272
|
-
|
|
276
|
+
var is = function (a) {
|
|
277
|
+
var reg = /^[\*\+\-\!\-\$&\?\~]|[\*\+\-\!\-\$&\?\~]$/;
|
|
278
|
+
if (!reg.test(a)) return a;
|
|
279
|
+
required = test(/^\*|\*$/, a);
|
|
280
|
+
inlist = test(/^[\+\!]|[\+\!]$/, a);
|
|
281
|
+
hidden = test(/^\-|\-$/, a);
|
|
282
|
+
readonly = test(/^[\$&]|[\$&]$/, a);
|
|
283
|
+
delete_onempty = test(/^\?|\?$/, a);
|
|
284
|
+
delete_onsubmit = test(/^\~|\~$/, a);
|
|
285
|
+
return a.replace(reg, '');
|
|
286
|
+
};
|
|
287
|
+
type = is(type);
|
|
273
288
|
if (typeof name === 'string') {
|
|
274
289
|
if (!isContainer) {
|
|
275
290
|
if (!type) {
|
|
@@ -370,17 +385,23 @@ function parse(piece) {
|
|
|
370
385
|
type = type.slice(1);
|
|
371
386
|
}
|
|
372
387
|
if (typeof options === "string") {
|
|
373
|
-
options =
|
|
388
|
+
options = is(options);
|
|
374
389
|
var needUnfold = /^\[|\]$/.test(options);
|
|
375
390
|
options = options.replace(/^\[|\]$/g, '');
|
|
376
391
|
if (/,/.test(options)) options = scanSlant(options, ',');
|
|
377
392
|
else options = scanSlant(options, "");
|
|
378
393
|
if (needUnfold) unfoldOptions(size, options);
|
|
379
394
|
}
|
|
380
|
-
name =
|
|
381
|
-
key =
|
|
395
|
+
name = is(name);
|
|
396
|
+
key = is(key);
|
|
382
397
|
}
|
|
383
|
-
var field = {
|
|
398
|
+
var field = {
|
|
399
|
+
name, type, key, value, comment, options,
|
|
400
|
+
size, unit, ratio,
|
|
401
|
+
needs, checks, repeat, endwith,
|
|
402
|
+
required, inlist, hidden, readonly,
|
|
403
|
+
delete_onempty, delete_onsubmit,
|
|
404
|
+
};
|
|
384
405
|
var parent = piecepath[piecepath.length - 1];
|
|
385
406
|
if (parent) {
|
|
386
407
|
field.parent = parent;
|
package/coms/crypt/encode62.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
module.exports = encode62;
|
|
3
|
+
var encodeUTF8 = require("../basic/encodeUTF8");
|
|
4
|
+
var decodeUTF8 = require("../basic/decodeUTF8");
|
|
3
5
|
var src = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
4
6
|
var map = {};
|
|
5
7
|
src.split("").forEach((s, i) => map[s] = i);
|
|
@@ -7,7 +9,7 @@ src.split("").forEach((s, i) => map[s] = i);
|
|
|
7
9
|
function encode62(string) {
|
|
8
10
|
string = String(string)
|
|
9
11
|
string = string.length + string + "2017-08-19";
|
|
10
|
-
var buff =
|
|
12
|
+
var buff = src.split('');
|
|
11
13
|
for (var cx = 0, dx = buff.length + src.length, sl = string.length, cl = buff.length; cx < dx; cx++) {
|
|
12
14
|
var s1 = string.charCodeAt(cx % sl) % cl;
|
|
13
15
|
var s2 = cx % cl;
|
|
@@ -15,7 +17,7 @@ function encode62(string) {
|
|
|
15
17
|
buff[s1] = buff[s2];
|
|
16
18
|
buff[s2] = btemp;
|
|
17
19
|
}
|
|
18
|
-
return buff.
|
|
20
|
+
return buff.join('');
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
|
|
@@ -31,13 +33,29 @@ Object.assign(encode62, {
|
|
|
31
33
|
var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
|
|
32
34
|
var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
|
|
33
35
|
var time_stamp = time_start + parseInt(time_rest, 36);
|
|
34
|
-
|
|
36
|
+
string = this.decode62(string.slice(0, string.length - time_delta.toString(36).length), time_stamp.toString(36)).replace(/\.\.?/g, a => a === '.' ? "%" : ".");
|
|
37
|
+
return decodeURIComponent(string);
|
|
35
38
|
},
|
|
36
39
|
timeencode(string) {
|
|
37
40
|
var { time_delta } = this;
|
|
38
|
-
var
|
|
41
|
+
var time_free = time_delta / 6 | 0;
|
|
42
|
+
var time_stamp = +new Date() - time_free;
|
|
39
43
|
var time_rest = time_stamp % time_delta;
|
|
40
|
-
|
|
44
|
+
var time_rest_str = time_rest.toString(36);
|
|
45
|
+
var time_delta_str = time_delta.toString(36);
|
|
46
|
+
string = encodeURIComponent(string).replace(/\./g, '..').replace(/%/g, '.');
|
|
47
|
+
return this.encode62(string, time_stamp.toString(36)) + repeat("0", time_delta_str.length - time_rest_str.length) + time_rest_str;
|
|
48
|
+
},
|
|
49
|
+
timeupdate(string) {
|
|
50
|
+
var { time_delta } = this;
|
|
51
|
+
var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
|
|
52
|
+
var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
|
|
53
|
+
var time_stamp = time_start + parseInt(time_rest, 36);
|
|
54
|
+
if (time_stamp + (time_delta >> 1) > +new Date()) {
|
|
55
|
+
return string;
|
|
56
|
+
} else {
|
|
57
|
+
return this.timeencode(this.timedecode(string));
|
|
58
|
+
}
|
|
41
59
|
},
|
|
42
60
|
encode62(data, sign) {
|
|
43
61
|
if (!sign) return data;
|
|
@@ -53,14 +71,19 @@ Object.assign(encode62, {
|
|
|
53
71
|
});
|
|
54
72
|
return result;
|
|
55
73
|
},
|
|
56
|
-
|
|
74
|
+
encodestr(data, sign) {
|
|
57
75
|
if (!sign) return data;
|
|
58
|
-
var result =
|
|
76
|
+
var result = encodeUTF8(data);
|
|
59
77
|
sign = Buffer.from(sign);
|
|
78
|
+
var delta = 0, c = 0;
|
|
60
79
|
for (var cx = 0, dx = data.length; cx < dx; cx++) {
|
|
61
|
-
result[cx] = result[cx] ^ sign[cx % sign.length];
|
|
80
|
+
if (result[cx] < 128) result[cx] = result[cx] ^ sign[cx % sign.length];
|
|
81
|
+
else if (result[cx] < 192) {
|
|
82
|
+
var c = c << 8 | sign[(delta += 6) / 8 % sign.length | 0];
|
|
83
|
+
result[cx] = result[cx] ^ (c >> 8 - delta % 8 & 0x3f);
|
|
84
|
+
}
|
|
62
85
|
}
|
|
63
|
-
return result;
|
|
86
|
+
return decodeUTF8(result);
|
|
64
87
|
},
|
|
65
88
|
decode(data, sign) {
|
|
66
89
|
if (!sign) return data;
|
|
@@ -75,7 +98,7 @@ Object.assign(encode62, {
|
|
|
75
98
|
return encode62(string);
|
|
76
99
|
},
|
|
77
100
|
genb() {
|
|
78
|
-
return encode62(Date.now() + "" + Math.random());
|
|
101
|
+
return encode62(Date.now() * Math.random() + "" + Math.random().toString(36) + Math.random().toString(36).toUpperCase());
|
|
79
102
|
},
|
|
80
103
|
huan(x, y) {
|
|
81
104
|
return x.split("").map(s => y[map[s]]).join("");
|
|
@@ -90,24 +113,10 @@ Object.assign(encode62, {
|
|
|
90
113
|
y.split("").forEach((a, j) => y_map[a] = j);
|
|
91
114
|
return z.split("").map(c => src[y_map[c]]).join("");
|
|
92
115
|
},
|
|
93
|
-
ab2c(a, b) {
|
|
94
|
-
return this.huan(a, b);
|
|
95
|
-
},
|
|
96
|
-
ba2d(a, b) {
|
|
97
|
-
return this.huan(b, a);
|
|
98
|
-
},
|
|
99
|
-
ca2b(c, a) {
|
|
100
|
-
return this.yuan(c, a);
|
|
101
|
-
},
|
|
102
|
-
cb2a(c, b) {
|
|
103
|
-
return this.suan(c, b);
|
|
104
|
-
},
|
|
105
|
-
da2b(d, a) {
|
|
106
|
-
return this.suan(d, a);
|
|
107
|
-
},
|
|
108
|
-
db2a(d, b) {
|
|
109
|
-
return this.yuan(d, b);
|
|
110
|
-
}
|
|
111
116
|
});
|
|
112
|
-
|
|
117
|
+
encode62.ab2c = encode62.ba2d = encode62.huan;
|
|
118
|
+
encode62.db2a = encode62.ca2b = encode62.yuan;
|
|
119
|
+
encode62.da2b = encode62.cb2a = encode62.suan;
|
|
120
|
+
encode62.decodestr = encode62.encodestr;
|
|
121
|
+
encode62.encode = encode62.decode;
|
|
113
122
|
encode62.decode62 = encode62.encode62;
|
package/coms/zimoli/action.js
CHANGED
|
@@ -3,8 +3,7 @@ function main(config, item, params) {
|
|
|
3
3
|
if (!config) return ok();
|
|
4
4
|
if (isObject(config)) {
|
|
5
5
|
if (config.do instanceof Function) {
|
|
6
|
-
config.do();
|
|
7
|
-
return;
|
|
6
|
+
return ok(config.do(item, params));
|
|
8
7
|
}
|
|
9
8
|
if (config.modal) {
|
|
10
9
|
var path = isString(config.modal) ? config.modal : config.modal.path;
|
|
@@ -152,7 +152,7 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
|
|
|
152
152
|
saved_opacity = targetBox.style.opacity;
|
|
153
153
|
rebuildTargets = function () { };
|
|
154
154
|
[moveMargin, moveChildren, scroll] = getMoveFuncs(targetChild);
|
|
155
|
-
moveChildren = moveChildren.bind(null,
|
|
155
|
+
moveChildren = moveChildren.bind(null, that, previousElements, followedElements, moveMargin, recover);
|
|
156
156
|
} else {
|
|
157
157
|
previousElements = [];
|
|
158
158
|
followedElements = [];
|
|
@@ -176,7 +176,7 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
|
|
|
176
176
|
previousElements = [].slice.call(targetBox.children, 0).reverse();
|
|
177
177
|
followedElements = [];
|
|
178
178
|
[moveMargin, moveChildren, scroll] = getMoveFuncs(previousElements[0]);
|
|
179
|
-
moveChildren = moveChildren.bind(null,
|
|
179
|
+
moveChildren = moveChildren.bind(null, that, previousElements, followedElements, moveMargin, recover);
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
182
|
};
|
|
@@ -337,7 +337,7 @@ function addhook() {
|
|
|
337
337
|
}
|
|
338
338
|
if (!mousedownEvent) return;
|
|
339
339
|
var target = targetElement || mousedownEvent.currentTarget;
|
|
340
|
-
hooka(function (target) {
|
|
340
|
+
hooka.call(targetElement, function (target) {
|
|
341
341
|
var res = [].filter.call(allowdrops || (matcher ? matcher(target) : document.querySelectorAll("[allowdrop]")), function (child) {
|
|
342
342
|
return target && overlap(child, target);
|
|
343
343
|
}).filter(e => {
|
package/coms/zimoli/button.less
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
display: inline-block;
|
|
15
15
|
white-space: nowrap;
|
|
16
16
|
text-align: center;
|
|
17
|
-
// cursor: default;
|
|
18
17
|
overflow: hidden;
|
|
19
18
|
outline: none;
|
|
19
|
+
user-select: none;
|
|
20
20
|
}
|
|
21
21
|
>.label{
|
|
22
22
|
position: relative;
|
|
@@ -177,7 +177,6 @@
|
|
|
177
177
|
|
|
178
178
|
a&,
|
|
179
179
|
&[type$=anchor] {
|
|
180
|
-
padding: 0;
|
|
181
180
|
box-shadow: none;
|
|
182
181
|
text-shadow: none;
|
|
183
182
|
background: none;
|
|
@@ -3,23 +3,28 @@ var createMenu = function (event, items) {
|
|
|
3
3
|
var menulist = sampleElement.cloneNode();
|
|
4
4
|
menulist.setAttribute("mode", "v");
|
|
5
5
|
menulist.tabIndex = 0;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (
|
|
6
|
+
items = items.filter(item => {
|
|
7
|
+
if (!item.when) return true;
|
|
8
|
+
if (!item.when(event)) return false;
|
|
9
|
+
return true;
|
|
10
|
+
});
|
|
11
|
+
var elem = menuList(menulist, items, async function (item) {
|
|
12
|
+
if (await action.call(this, item, event.target) !== false) {
|
|
9
13
|
remove(elem);
|
|
10
14
|
}
|
|
11
15
|
});
|
|
12
16
|
|
|
13
17
|
return elem;
|
|
14
18
|
}
|
|
15
|
-
function contextmenu(target,
|
|
19
|
+
function contextmenu(target, menuItems) {
|
|
16
20
|
on("contextmenu")(target, function (event) {
|
|
17
21
|
event.preventDefault();
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
var menu;
|
|
23
|
+
if (menuItems instanceof Function) {
|
|
24
|
+
menu = menuItems.call(this, event);
|
|
20
25
|
}
|
|
21
|
-
if (
|
|
22
|
-
menu = createMenu.call(this, event,
|
|
26
|
+
if (menuItems instanceof Array) {
|
|
27
|
+
menu = createMenu.call(this, event, menuItems);
|
|
23
28
|
}
|
|
24
29
|
if (!menu) return;
|
|
25
30
|
css(menu, {
|
package/coms/zimoli/cross.js
CHANGED
|
@@ -175,8 +175,8 @@ function cross(method, url, headers) {
|
|
|
175
175
|
onerror({ status: "网络断开" });
|
|
176
176
|
break;
|
|
177
177
|
}
|
|
178
|
-
if (!
|
|
179
|
-
onerror({ status: "
|
|
178
|
+
if (!xhr.response) {
|
|
179
|
+
onerror({ status: "无法访问服务器" });
|
|
180
180
|
break;
|
|
181
181
|
}
|
|
182
182
|
case 200:
|
|
@@ -268,7 +268,7 @@ function cross(method, url, headers) {
|
|
|
268
268
|
var then = xhr.then;
|
|
269
269
|
delete xhr.then;
|
|
270
270
|
if (loaded) onloads.splice(0, onloads.length).map(e => e instanceof Function && e(xhr));
|
|
271
|
-
if (errored) onerrors.splice(0, onerrors.length).map(e => e instanceof Function && e(
|
|
271
|
+
if (errored) onerrors.splice(0, onerrors.length).map(e => e instanceof Function && e(errored));
|
|
272
272
|
xhr.then = then;
|
|
273
273
|
};
|
|
274
274
|
var onloads = [], onerrors = [];
|
package/coms/zimoli/data.js
CHANGED
|
@@ -155,6 +155,7 @@ function getUrlParamsForApi(api, url) {
|
|
|
155
155
|
cap.push(a.slice(1));
|
|
156
156
|
return r;
|
|
157
157
|
});
|
|
158
|
+
if (api.base) base = api.base + base;
|
|
158
159
|
var params = {};
|
|
159
160
|
url = url.replace(/[\?#]*$/g, function (match) {
|
|
160
161
|
match.split(/[&#\?]+/).forEach(function (s) {
|
|
@@ -333,25 +334,23 @@ function fixApi(api, href) {
|
|
|
333
334
|
}
|
|
334
335
|
api.base = href;
|
|
335
336
|
api.path = api.url;
|
|
336
|
-
if (/^\.([\?\#][\s\S]*)?$/.test(api.
|
|
337
|
-
api.
|
|
338
|
-
} else {
|
|
339
|
-
api.url = href + api.url;
|
|
337
|
+
if (/^\.([\?\#][\s\S]*)?$/.test(api.path)) {
|
|
338
|
+
api.path = api.path.replace(/^\./, "");
|
|
340
339
|
}
|
|
341
340
|
if (extraSearch || extraHash) {
|
|
342
341
|
if (/[\?#]/.test(api.url)) {
|
|
343
342
|
var [, search, hash] = paramReg.exec(api.url);
|
|
344
343
|
}
|
|
345
|
-
var
|
|
344
|
+
var path = api.path.replace(paramReg, '');
|
|
346
345
|
if (extraSearch) {
|
|
347
346
|
search = search ? extraSearch + '&' + search : extraSearch;
|
|
348
347
|
}
|
|
349
348
|
if (extraHash) {
|
|
350
349
|
hash = hash ? extraHash + '&' + hash : extraHash;
|
|
351
350
|
}
|
|
352
|
-
if (search)
|
|
353
|
-
if (hash)
|
|
354
|
-
api.
|
|
351
|
+
if (search) path += '?' + search;
|
|
352
|
+
if (hash) path += "#" + hash;
|
|
353
|
+
api.path = path;
|
|
355
354
|
}
|
|
356
355
|
}
|
|
357
356
|
}
|
|
@@ -404,6 +403,12 @@ function createApiMap(data) {
|
|
|
404
403
|
}
|
|
405
404
|
var _configfileurl;
|
|
406
405
|
var configPormise;
|
|
406
|
+
function LoadingArray_then(ok, oh) {
|
|
407
|
+
if (this.loading_promise) this.loading_promise.then(ok, oh);
|
|
408
|
+
else if (this.is_errored) oh(this.error_message);
|
|
409
|
+
else ok();
|
|
410
|
+
}
|
|
411
|
+
|
|
407
412
|
var privates = {
|
|
408
413
|
loadAfterConfig(serviceId, params) {
|
|
409
414
|
var promise = this.getApi(serviceId).then((api) => {
|
|
@@ -434,7 +439,8 @@ var privates = {
|
|
|
434
439
|
},
|
|
435
440
|
fromApi(api, params) {
|
|
436
441
|
let url = api.url;
|
|
437
|
-
|
|
442
|
+
var base = api.base;
|
|
443
|
+
if (base) url = base + api.path;
|
|
438
444
|
if (this.validApi(api, params)) {
|
|
439
445
|
params = this.repare(api, params);
|
|
440
446
|
return this.loadIgnoreConfig(api.method, url, params, api);
|
|
@@ -623,6 +629,7 @@ var data = {
|
|
|
623
629
|
if (isObject(response)) {
|
|
624
630
|
response.is_loaded = true;
|
|
625
631
|
response.is_loading = false;
|
|
632
|
+
if (response.then === LoadingArray_then) delete response.then;
|
|
626
633
|
}
|
|
627
634
|
this.loading_count--;
|
|
628
635
|
},
|
|
@@ -631,6 +638,7 @@ var data = {
|
|
|
631
638
|
if (isObject(response)) {
|
|
632
639
|
response.is_loaded = false;
|
|
633
640
|
response.is_loading = true;
|
|
641
|
+
response.then = LoadingArray_then;
|
|
634
642
|
}
|
|
635
643
|
this.loading_count++;
|
|
636
644
|
},
|
|
@@ -657,6 +665,9 @@ var data = {
|
|
|
657
665
|
data = this.parseConfig(data);
|
|
658
666
|
configPormise = Promise.resolve(data);
|
|
659
667
|
},
|
|
668
|
+
getConfig() {
|
|
669
|
+
return privates.getConfigPromise();
|
|
670
|
+
},
|
|
660
671
|
parseConfig(o) {
|
|
661
672
|
if (o instanceof Promise) {
|
|
662
673
|
return o.then(createApiMap);
|
|
@@ -834,7 +845,10 @@ var data = {
|
|
|
834
845
|
this.responseLoading(instance);
|
|
835
846
|
var params = privates.pack(sid, params1);
|
|
836
847
|
if (!privates.validApi(api, params)) throw aborted;
|
|
837
|
-
|
|
848
|
+
let url = api.url;
|
|
849
|
+
var base = api.base;
|
|
850
|
+
if (base) url = base + api.path;
|
|
851
|
+
var { method, uri, params, selector } = privates.prepare(api.method, url, params);
|
|
838
852
|
var promise = new Promise(function (ok, oh) {
|
|
839
853
|
var headers = api.headers;
|
|
840
854
|
if (headers) {
|
package/coms/zimoli/dispatch.js
CHANGED
|
@@ -9,15 +9,22 @@ var dispatch = "dispatchEvent" in document ? function dispatchEvent(target, even
|
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
function main() {
|
|
12
|
-
var target, event;
|
|
12
|
+
var target, event, value;
|
|
13
13
|
for (var cx = 0, dx = arguments.length; cx < dx; cx++) {
|
|
14
14
|
var arg = arguments[cx];
|
|
15
|
-
if (
|
|
16
|
-
event = createEvent(arg);
|
|
17
|
-
} else if (isNode(arg) || arg === window || arg === document) {
|
|
15
|
+
if (isNode(arg) || arg === window || arg === document) {
|
|
18
16
|
target = arg;
|
|
19
|
-
}
|
|
20
|
-
|
|
17
|
+
}
|
|
18
|
+
else if (!event) {
|
|
19
|
+
if (isString(arg)) {
|
|
20
|
+
event = createEvent(arg);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
event = arg;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
event.value = arg;
|
|
21
28
|
}
|
|
22
29
|
}
|
|
23
30
|
if (dispatch(target || window, event)) {
|
package/coms/zimoli/encode62.js
CHANGED
|
@@ -23,8 +23,8 @@ var encode62 = {
|
|
|
23
23
|
var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
|
|
24
24
|
var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
|
|
25
25
|
var time_stamp = time_start + parseInt(time_rest, 36);
|
|
26
|
-
|
|
27
|
-
return
|
|
26
|
+
string = this.encode(string.slice(0, string.length - time_delta.toString(36).length), time_stamp.toString(36)).replace(/\.\.?/g, a => a === '.' ? "%" : ".");
|
|
27
|
+
return decodeURIComponent(string);
|
|
28
28
|
},
|
|
29
29
|
timeencode(string) {
|
|
30
30
|
var { time_delta } = this;
|
|
@@ -33,6 +33,7 @@ var encode62 = {
|
|
|
33
33
|
var time_rest = time_stamp % time_delta;
|
|
34
34
|
var time_rest_str = time_rest.toString(36);
|
|
35
35
|
var time_delta_str = time_delta.toString(36);
|
|
36
|
+
string = encodeURIComponent(string).replace(/\./g, '..').replace(/%/g, '.');
|
|
36
37
|
return this.encode(string, time_stamp.toString(36)) + repeat("0", time_delta_str.length - time_rest_str.length) + time_rest_str;
|
|
37
38
|
},
|
|
38
39
|
timeupdate(string) {
|
package/coms/zimoli/field.js
CHANGED
package/coms/zimoli/input.js
CHANGED
|
@@ -66,12 +66,6 @@ function input(element) {
|
|
|
66
66
|
on("keydown")(element, number);
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
|
-
if (format) {
|
|
70
|
-
var picker = selectDate(format, input.value);
|
|
71
|
-
on("change")(element, picker.update);
|
|
72
|
-
select(element, picker);
|
|
73
|
-
element.readonly = "readonly";
|
|
74
|
-
}
|
|
75
69
|
}
|
|
76
70
|
return element;
|
|
77
71
|
}
|
package/coms/zimoli/input.less
CHANGED
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
display: none;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
&::-webkit-calendar-picker-indicator {
|
|
34
|
-
|
|
35
|
-
}
|
|
33
|
+
// &::-webkit-calendar-picker-indicator {
|
|
34
|
+
// display: none;
|
|
35
|
+
// }
|
|
36
36
|
|
|
37
|
-
&::-webkit-calendar-picker-indicator:hover {
|
|
38
|
-
|
|
39
|
-
}
|
|
37
|
+
// &::-webkit-calendar-picker-indicator:hover {
|
|
38
|
+
// display: none;
|
|
39
|
+
// }
|
|
40
40
|
|
|
41
41
|
&::-webkit-clear-button {
|
|
42
42
|
display: none;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
<menu-item ng-repeat="menu in menus" ng-
|
|
2
|
-
ng-mouseenter="popTimer=popMenu(menu,event)"
|
|
1
|
+
<menu-item ng-repeat="menu in menus" ng-if="!menu.hidden" ng-click="open(menu,event)"
|
|
2
|
+
ng-mouseleave="clearTimeout(popTimer)" ng-mouseenter="popTimer=popMenu(menu,event)"
|
|
3
|
+
ng-class="{'has-children':menu.children&&menu.children.length,'warn':menu.type==='danger'||menu.type==='warn'||menu.type==='red'}">
|
|
3
4
|
</menu-item>
|
|
@@ -1,38 +1,42 @@
|
|
|
1
1
|
& {
|
|
2
|
-
display
|
|
3
|
-
width
|
|
4
|
-
height
|
|
2
|
+
display: inline-block;
|
|
3
|
+
width: auto;
|
|
4
|
+
height: auto;
|
|
5
5
|
background-color: #fff;
|
|
6
|
-
box-shadow
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
box-shadow: 0 0 20px -6px rgba(0, 0, 0, .1);
|
|
7
|
+
border: 1px solid #0003;
|
|
8
|
+
line-height: 28px;
|
|
9
|
+
padding: 6px 0;
|
|
9
10
|
|
|
10
11
|
>menu-item {
|
|
11
|
-
display
|
|
12
|
-
position
|
|
13
|
-
padding
|
|
14
|
-
border-radius
|
|
12
|
+
display: block;
|
|
13
|
+
position: relative;
|
|
14
|
+
padding: 0 16px;
|
|
15
|
+
border-radius: 0;
|
|
15
16
|
background-color: inherit;
|
|
16
|
-
color
|
|
17
|
-
box-shadow
|
|
18
|
-
text-align
|
|
17
|
+
color: inherit;
|
|
18
|
+
box-shadow: none;
|
|
19
|
+
text-align: inherit;
|
|
20
|
+
&.warn{
|
|
21
|
+
color: #c28;
|
|
22
|
+
}
|
|
19
23
|
|
|
20
24
|
&.has-children {
|
|
21
25
|
padding: 0 24px 0 16px;
|
|
22
26
|
|
|
23
27
|
&:after {
|
|
24
|
-
content
|
|
25
|
-
display
|
|
26
|
-
width
|
|
27
|
-
height
|
|
28
|
+
content: ">";
|
|
29
|
+
display: block;
|
|
30
|
+
width: 20px;
|
|
31
|
+
height: 20px;
|
|
28
32
|
line-height: 20px;
|
|
29
|
-
font-size
|
|
30
|
-
transform
|
|
31
|
-
position
|
|
32
|
-
right
|
|
33
|
-
top
|
|
34
|
-
margin-top
|
|
35
|
-
text-align
|
|
33
|
+
font-size: 18px;
|
|
34
|
+
transform: scaleX(.56);
|
|
35
|
+
position: absolute;
|
|
36
|
+
right: 6px;
|
|
37
|
+
top: 50%;
|
|
38
|
+
margin-top: -10px;
|
|
39
|
+
text-align: right;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
|
|
@@ -41,5 +45,5 @@
|
|
|
41
45
|
|
|
42
46
|
i {
|
|
43
47
|
display: inline-block;
|
|
44
|
-
width
|
|
48
|
+
width: 20px;
|
|
45
49
|
}
|