efront 3.3.6 → 3.4.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/pivot/api.yml +3 -0
- package/apps/pivot/auth/login.html +9 -0
- package/apps/pivot/auth/login.js +30 -0
- package/apps/pivot/auth/login.less +11 -0
- package/apps/pivot/home/short.html +1 -0
- package/apps/pivot/home/short.js +5 -0
- package/apps/pivot/home/short.less +1 -0
- package/apps/pivot/home/welcome.html +14 -0
- package/apps/pivot/home/welcome.js +24 -0
- package/apps/pivot/home/welcome.less +8 -0
- package/apps/pivot/index.html +41 -0
- package/apps/pivot/main.js +18 -0
- package/apps/pivot/menu.yml +3 -0
- package/apps/zimoli/book/main.js +1 -1
- package/apps/zimoli/broadcast/main.js +1 -1
- package/apps/zimoli/index.html +1 -0
- package/apps/zimoli/main.js +1 -1
- package/apps/zimoli/nearby/main.js +1 -1
- package/apps/zimoli/yuanfen/main.js +1 -1
- package/coms/basic/crypt.js +1 -1
- package/coms/basic/loader.js +1 -1
- package/coms/basic/refilm_decode.js +13 -2
- package/coms/basic/valid.js +10 -0
- package/coms/compile/common.js +451 -0
- package/coms/compile/scanner2.js +8 -405
- package/coms/crypt/encode62.js +23 -33
- package/coms/crypt/encode62_test.js +2 -1
- package/coms/frame/left.html +11 -6
- package/coms/frame/left.js +6 -3
- package/coms/frame/left.less +38 -36
- package/coms/frame/main.js +1 -1
- package/coms/frame/route.js +52 -4
- package/coms/frame/top.less +12 -13
- package/coms/kugou/buildList.js +1 -0
- package/coms/kugou/player.js +3 -0
- package/coms/layer/glance.less +4 -2
- package/coms/zimoli/alert.js +8 -4
- package/coms/zimoli/avatar.js +0 -1
- package/coms/zimoli/checker.html +1 -1
- package/coms/zimoli/checker.less +8 -13
- package/coms/zimoli/cross.js +1 -1
- package/coms/zimoli/css.js +1 -0
- package/coms/zimoli/data.js +8 -3
- package/coms/zimoli/encode62.js +13 -0
- package/coms/zimoli/field.html +2 -0
- package/coms/zimoli/field.js +41 -17
- package/coms/zimoli/field.less +19 -0
- package/coms/zimoli/form.js +8 -0
- package/coms/zimoli/menu.js +11 -1
- package/coms/zimoli/menu.less +1 -1
- package/coms/zimoli/menuItem.js +4 -1
- package/coms/zimoli/model.js +1 -0
- package/coms/zimoli/radio.html +1 -3
- package/coms/zimoli/radio.less +10 -22
- package/coms/zimoli/render.js +34 -63
- package/coms/zimoli/renderDefaults.js +1 -0
- package/coms/zimoli/submit.js +41 -0
- package/coms/zimoli/view.js +0 -5
- package/coms/zimoli/view.less +17 -11
- package/coms/zimoli/zimoli.js +11 -9
- package/data/mime.json +3 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/coms/zimoli/beian.html +0 -1
- package/coms/zimoli/beian.js +0 -5
- package/coms/zimoli/beian.less +0 -13
package/coms/zimoli/radio.less
CHANGED
|
@@ -1,43 +1,31 @@
|
|
|
1
|
-
& {
|
|
2
|
-
vertical-align: top;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
>a {
|
|
6
2
|
line-height: inherit;
|
|
7
3
|
margin-right: 10px;
|
|
8
|
-
vertical-align: top;
|
|
9
4
|
|
|
10
5
|
>r {
|
|
6
|
+
font-family: sans-serif;
|
|
11
7
|
display: inline-block;
|
|
12
|
-
height: 1em;
|
|
13
|
-
width: 1em;
|
|
14
|
-
border-radius: 50%;
|
|
15
|
-
border: .1em solid;
|
|
16
8
|
position: relative;
|
|
17
|
-
vertical-align: middle;
|
|
18
9
|
margin-right: 4px;
|
|
19
|
-
|
|
10
|
+
line-height: 1;
|
|
11
|
+
text-align: center;
|
|
12
|
+
|
|
20
13
|
>s {
|
|
21
14
|
display: none;
|
|
22
|
-
border-radius: 50%;
|
|
23
|
-
border: .2em solid;
|
|
24
|
-
width: .4em;
|
|
25
|
-
height: .4em;
|
|
26
15
|
position: absolute;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
text-decoration: none;
|
|
17
|
+
left: 0;
|
|
18
|
+
right: 0;
|
|
19
|
+
top: 0;
|
|
20
|
+
bottom: 0;
|
|
30
21
|
}
|
|
31
22
|
}
|
|
32
23
|
|
|
33
|
-
>span {
|
|
34
|
-
vertical-align: middle;
|
|
35
|
-
}
|
|
36
24
|
|
|
37
25
|
&.activate {
|
|
38
26
|
>r {
|
|
39
27
|
>s {
|
|
40
|
-
display:
|
|
28
|
+
display: inline;
|
|
41
29
|
}
|
|
42
30
|
}
|
|
43
31
|
}
|
package/coms/zimoli/render.js
CHANGED
|
@@ -71,7 +71,7 @@ var createGetter = function (search, isprop = true) {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
if (isprop) {
|
|
74
|
-
return new Function('event',
|
|
74
|
+
return new Function('event', `${withContext}with(this.$scope){${ret}${searchContext}}`);
|
|
75
75
|
}
|
|
76
76
|
return new Function("event", `${withContext}with(this.$scope){${/([\=\(\+\-])/.test(searchContext) ? ret + searchContext : `${ret}${searchContext}.call(this.$scope,event)`}}`);
|
|
77
77
|
};
|
|
@@ -346,13 +346,42 @@ var structures = {
|
|
|
346
346
|
};
|
|
347
347
|
structures["else-if"] = structures.elseif = structures.else;
|
|
348
348
|
structures["for-each"] = structures.foreach = structures.for = structures.each = structures.repeat;
|
|
349
|
-
var
|
|
350
|
-
|
|
351
|
-
|
|
349
|
+
var createBinder = function (binder) {
|
|
350
|
+
return function (search) {
|
|
351
|
+
var getter = createGetter(search).bind(this);
|
|
352
|
+
var oldValue;
|
|
353
|
+
this.renders.push(function () {
|
|
354
|
+
var value = getter();
|
|
355
|
+
if (deepEqual.shallow(value, oldValue)) return;
|
|
356
|
+
oldValue = value;
|
|
357
|
+
if (isNode(value) || isArray(value)) {
|
|
358
|
+
if (value !== this.firstChild) {
|
|
359
|
+
remove(this.childNodes);
|
|
360
|
+
appendChild(this, value);
|
|
361
|
+
}
|
|
362
|
+
} else {
|
|
363
|
+
if (isEmpty(value)) value = '';
|
|
364
|
+
if (binder(this) !== value) binder(this, value);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
}
|
|
369
|
+
}
|
|
352
370
|
var directives = {
|
|
371
|
+
bind: createBinder(text),
|
|
372
|
+
html: createBinder(html),
|
|
373
|
+
hide: createBinder(function (elem, value) {
|
|
374
|
+
if (arguments.length === 1) return elem.style.display === 'none';
|
|
375
|
+
elem.style.display = value ? 'none' : '';
|
|
376
|
+
}),
|
|
377
|
+
show: createBinder(function (elem, value) {
|
|
378
|
+
if (arguments.length === 1) return elem.style.display !== 'none';
|
|
379
|
+
elem.style.display = value ? '' : 'none';
|
|
380
|
+
}),
|
|
381
|
+
style: createBinder(css),
|
|
353
382
|
src(search) {
|
|
354
383
|
var getter = createGetter(search).bind(this);
|
|
355
|
-
var savedValue,
|
|
384
|
+
var savedValue, pending;
|
|
356
385
|
var refresh = function () {
|
|
357
386
|
that.src = savedValue;
|
|
358
387
|
removeClass(that, "pending");
|
|
@@ -372,10 +401,8 @@ var directives = {
|
|
|
372
401
|
}
|
|
373
402
|
var changes = getChanges(temp, savedValue);
|
|
374
403
|
if (!changes) return;
|
|
375
|
-
savedOrigin = origin;
|
|
376
404
|
savedValue = temp;
|
|
377
405
|
if (/^img$/i.test(this.tagName)) {
|
|
378
|
-
// this.setAttribute("src", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=");
|
|
379
406
|
if (!isString(origin)) {
|
|
380
407
|
return;
|
|
381
408
|
}
|
|
@@ -394,23 +421,6 @@ var directives = {
|
|
|
394
421
|
}
|
|
395
422
|
});
|
|
396
423
|
},
|
|
397
|
-
bind(search) {
|
|
398
|
-
var getter = createGetter(search).bind(this);
|
|
399
|
-
var oldValue;
|
|
400
|
-
this.renders.push(function () {
|
|
401
|
-
var value = getter();
|
|
402
|
-
if (deepEqual(value, oldValue)) return;
|
|
403
|
-
oldValue = value;
|
|
404
|
-
if (isNode(value) || isArray(value)) {
|
|
405
|
-
if (value !== this.firstChild) {
|
|
406
|
-
remove(this.childNodes);
|
|
407
|
-
appendChild(this, value);
|
|
408
|
-
}
|
|
409
|
-
} else {
|
|
410
|
-
if (text(this) !== value) text(this, value);
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
},
|
|
414
424
|
model(search) {
|
|
415
425
|
var getter = createGetter(search).bind(this);
|
|
416
426
|
var oldValue;
|
|
@@ -462,35 +472,6 @@ var directives = {
|
|
|
462
472
|
}
|
|
463
473
|
var onchange = change;
|
|
464
474
|
eventsHandlers.map(on => on(this, onchange));
|
|
465
|
-
eventsHandlers.map(on => on(this, changed));
|
|
466
|
-
},
|
|
467
|
-
hide(search) {
|
|
468
|
-
var getter = createGetter(search).bind(this);
|
|
469
|
-
var oldValue;
|
|
470
|
-
this.renders.push(function () {
|
|
471
|
-
var value = !!getter();
|
|
472
|
-
if (deepEqual(oldValue, value)) return;
|
|
473
|
-
oldValue = value;
|
|
474
|
-
if (value) {
|
|
475
|
-
this.style.display = "none";
|
|
476
|
-
} else {
|
|
477
|
-
this.style.display = "";
|
|
478
|
-
}
|
|
479
|
-
});
|
|
480
|
-
},
|
|
481
|
-
show(search) {
|
|
482
|
-
var getter = createGetter(search).bind(this);
|
|
483
|
-
var oldValue;
|
|
484
|
-
this.renders.push(function () {
|
|
485
|
-
var value = !!getter();
|
|
486
|
-
if (deepEqual(oldValue, value)) return;
|
|
487
|
-
oldValue = value;
|
|
488
|
-
if (value) {
|
|
489
|
-
this.style.display = "";
|
|
490
|
-
} else {
|
|
491
|
-
this.style.display = "none";
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
475
|
},
|
|
495
476
|
|
|
496
477
|
"class"(search) {
|
|
@@ -528,16 +509,6 @@ var directives = {
|
|
|
528
509
|
}
|
|
529
510
|
});
|
|
530
511
|
},
|
|
531
|
-
style(search) {
|
|
532
|
-
var getter = createGetter(search).bind(this);
|
|
533
|
-
var oldValue;
|
|
534
|
-
this.renders.push(function () {
|
|
535
|
-
var stylesheet = getter();
|
|
536
|
-
if (deepEqual(oldValue, stylesheet)) return;
|
|
537
|
-
oldValue = stylesheet;
|
|
538
|
-
css(this, stylesheet);
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
512
|
};
|
|
542
513
|
// property binder
|
|
543
514
|
var binders = {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function submit(fields, data) {
|
|
2
|
+
var params = {};
|
|
3
|
+
var inputs = [];
|
|
4
|
+
var select = [];
|
|
5
|
+
var checks = [];
|
|
6
|
+
var id = 0;
|
|
7
|
+
for (var f of fields) {
|
|
8
|
+
var error = valid(f, data);
|
|
9
|
+
if (error === "empty") {
|
|
10
|
+
if (f.options || /date|time|range|switch|swap|radio/i.test(f.type)) {
|
|
11
|
+
if (!select.id) select.id = ++id;
|
|
12
|
+
select.push(f);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
if (!inputs.id) inputs.id = ++id;
|
|
16
|
+
inputs.push(f);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
else if (error) {
|
|
20
|
+
checks.push(f);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
params[f.key] = data[f.key];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (checks.length + select.length + inputs.length) {
|
|
27
|
+
var errors = [];
|
|
28
|
+
if (inputs.length) errors.push("请输入" + inputs.map(f => f.name).join("、"));
|
|
29
|
+
if (select.length) errors.push("请选择" + select.map(f => f.name).join("、"));
|
|
30
|
+
if (select.id < inputs.id) {
|
|
31
|
+
errors = errors.reverse();
|
|
32
|
+
}
|
|
33
|
+
if (checks.length) {
|
|
34
|
+
errors.push(checks.map(f => f.name).join("、") + "格式错误");
|
|
35
|
+
}
|
|
36
|
+
errors = errors.join(",") + "!";
|
|
37
|
+
alert(errors, 'error');
|
|
38
|
+
throw new Error(errors);
|
|
39
|
+
}
|
|
40
|
+
return params;
|
|
41
|
+
}
|
package/coms/zimoli/view.js
CHANGED
|
@@ -94,11 +94,6 @@ var init = function () {
|
|
|
94
94
|
function view(element) {
|
|
95
95
|
var window = isNode(element) ? element : document.createElement("form");
|
|
96
96
|
init();
|
|
97
|
-
if (/form/i.test(window.tagName)) {
|
|
98
|
-
on("submit")(window, function (event) {
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
97
|
extend(window, prototype);
|
|
103
98
|
if (window !== element) {
|
|
104
99
|
extend(window, element);
|
package/coms/zimoli/view.less
CHANGED
|
@@ -13,13 +13,15 @@ body>& {
|
|
|
13
13
|
-ms-user-select: none;
|
|
14
14
|
-moz-user-select: none;
|
|
15
15
|
-webkit-user-select: none;
|
|
16
|
+
border: 1px solid #0006;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
&[dragable] {
|
|
19
20
|
position: absolute;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
&>.body
|
|
23
|
+
&>.body,
|
|
24
|
+
>[body] {
|
|
23
25
|
padding: 6px 0;
|
|
24
26
|
background: #f2f4f6;
|
|
25
27
|
display: block;
|
|
@@ -42,7 +44,8 @@ body>& {
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
|
|
45
|
-
&>.head
|
|
47
|
+
&>.head,
|
|
48
|
+
>[head] {
|
|
46
49
|
z-index: 2;
|
|
47
50
|
background: #fffc;
|
|
48
51
|
position: relative;
|
|
@@ -83,12 +86,14 @@ body>& {
|
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
|
|
86
|
-
&>.foot
|
|
89
|
+
&>.foot,
|
|
90
|
+
>[foot] {
|
|
87
91
|
white-space: nowrap;
|
|
88
92
|
overflow: auto;
|
|
89
93
|
}
|
|
90
94
|
|
|
91
|
-
&>.foot
|
|
95
|
+
&>.foot,
|
|
96
|
+
>[foot] {
|
|
92
97
|
z-index: 1;
|
|
93
98
|
text-align: right;
|
|
94
99
|
line-height: 1;
|
|
@@ -101,13 +106,14 @@ body>& {
|
|
|
101
106
|
bottom: 0;
|
|
102
107
|
margin-top: -42px;
|
|
103
108
|
|
|
104
|
-
|
|
105
|
-
padding: 0 20px;
|
|
106
|
-
min-width: 60px;
|
|
107
|
-
vertical-align: middle;
|
|
109
|
+
}
|
|
108
110
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
.button {
|
|
112
|
+
padding: 0 20px;
|
|
113
|
+
min-width: 60px;
|
|
114
|
+
vertical-align: middle;
|
|
115
|
+
|
|
116
|
+
&+.button {
|
|
117
|
+
margin-left: 10px;
|
|
112
118
|
}
|
|
113
119
|
}
|
package/coms/zimoli/zimoli.js
CHANGED
|
@@ -58,7 +58,7 @@ if (/MSIE\s*[2-7]/.test(navigator.userAgent)) {
|
|
|
58
58
|
if (currentHash && currentHash === targetHash) return;
|
|
59
59
|
var targetHashIndex = targetHash.indexOf("#" + current_history);
|
|
60
60
|
if (targetHashIndex < 0) return;
|
|
61
|
-
var targetpath = targetHash.slice(targetHashIndex + current_history.length
|
|
61
|
+
var targetpath = targetHash.slice(targetHashIndex + current_history.length);
|
|
62
62
|
go(targetpath);
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
@@ -110,7 +110,7 @@ var setZimoliParams = function (pagepath, args) {
|
|
|
110
110
|
};
|
|
111
111
|
var fullfill_is_dispatched = 0;
|
|
112
112
|
function go(pagepath, args, history_name, oldpagepath) {
|
|
113
|
-
if (
|
|
113
|
+
if (history_name === undefined)
|
|
114
114
|
history_name = current_history;
|
|
115
115
|
if (isNumber(pagepath)) {
|
|
116
116
|
if (isString(history_name)) {
|
|
@@ -297,7 +297,7 @@ function prepare(pgpath, ok) {
|
|
|
297
297
|
// rolesA中的role1,role2,...等所有身份都必须具备才可以确定一种访问权限
|
|
298
298
|
// 符合rolesA,rolesB,rolesC任意一种权限都可以访问
|
|
299
299
|
if (!roles) roles = [];
|
|
300
|
-
for (var cx = 0, dx = arguments.length; cx < dx; cx++) {
|
|
300
|
+
if (arguments.length) for (var cx = 0, dx = arguments.length; cx < dx; cx++) {
|
|
301
301
|
roles.push(arguments[cx]);
|
|
302
302
|
}
|
|
303
303
|
};
|
|
@@ -408,6 +408,7 @@ function zimoli(pagepath, args, history_name, oldpagepath) {
|
|
|
408
408
|
args = data;
|
|
409
409
|
oldpagepath = from;
|
|
410
410
|
}
|
|
411
|
+
|
|
411
412
|
if (page_generators[pagepath]) return go(pagepath, args, history_name, oldpagepath);
|
|
412
413
|
return prepare(pagepath, function () {
|
|
413
414
|
if (isNode(history_name)) {
|
|
@@ -418,7 +419,7 @@ function zimoli(pagepath, args, history_name, oldpagepath) {
|
|
|
418
419
|
}
|
|
419
420
|
var global = {};
|
|
420
421
|
var history = {};
|
|
421
|
-
var current_history, default_history = current_history = "
|
|
422
|
+
var current_history, default_history = current_history = "";
|
|
422
423
|
history[current_history] = [];
|
|
423
424
|
var history_session_object_key = `_zimoli_history_key:${location_pathname}`;
|
|
424
425
|
try {
|
|
@@ -428,7 +429,7 @@ try {
|
|
|
428
429
|
var root_path;
|
|
429
430
|
var pushstate = function (path_name, history_name, oldpagepath) {
|
|
430
431
|
var isDestroy = false;
|
|
431
|
-
if (
|
|
432
|
+
if (history_name === undefined) {
|
|
432
433
|
history_name = current_history;
|
|
433
434
|
}
|
|
434
435
|
if (!isString(history_name)) return;
|
|
@@ -454,7 +455,7 @@ var pushstate = function (path_name, history_name, oldpagepath) {
|
|
|
454
455
|
return isDestroy;
|
|
455
456
|
};
|
|
456
457
|
var popstate = function (path_name, history_name) {
|
|
457
|
-
if (
|
|
458
|
+
if (history_name === undefined) history_name = current_history;
|
|
458
459
|
if (!isString(history_name)) return;
|
|
459
460
|
if (!history[history_name]) return;
|
|
460
461
|
var _history = history[history_name];
|
|
@@ -467,11 +468,12 @@ var popstate = function (path_name, history_name) {
|
|
|
467
468
|
};
|
|
468
469
|
var getCurrentHash = function () {
|
|
469
470
|
var _historylist = history[current_history];
|
|
471
|
+
var history_name = current_history.replace(/\/$/, '');
|
|
470
472
|
if (rootElements.length) {
|
|
471
|
-
return `#${
|
|
473
|
+
return `#${history_name}/`;
|
|
472
474
|
}
|
|
473
475
|
if (_historylist.length < 2) return "";
|
|
474
|
-
var targeturl = `#${
|
|
476
|
+
var targeturl = `#${history_name}${_historylist.length ? _historylist[_historylist.length - 1] : ""}`;
|
|
475
477
|
return targeturl;
|
|
476
478
|
};
|
|
477
479
|
|
|
@@ -575,7 +577,7 @@ function addGlobal(element, name = null, isDestroy) {
|
|
|
575
577
|
}
|
|
576
578
|
var _switch = zimoli.switch = function (history_name = default_history, target_body = document.body, emptyState) {
|
|
577
579
|
if (isString(history_name))
|
|
578
|
-
current_history = history_name;
|
|
580
|
+
current_history = history_name = history_name.replace(/\/$/, '') + "/";
|
|
579
581
|
if (target_body)
|
|
580
582
|
body = target_body;
|
|
581
583
|
if (emptyState !== false && !history[history_name]) root_path = (history[history_name] = [].concat(emptyState || ":empty"))[0];
|
package/data/mime.json
CHANGED