efront 3.4.0 → 3.4.4

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.
Files changed (41) hide show
  1. package/apps/pivot/auth/login.js +2 -1
  2. package/apps/pivot/home/short.html +1 -0
  3. package/apps/pivot/home/short.js +5 -0
  4. package/apps/pivot/home/short.less +1 -0
  5. package/apps/pivot/home/{main.html → welcome.html} +1 -0
  6. package/apps/pivot/home/{main.js → welcome.js} +3 -1
  7. package/apps/pivot/home/{main.less → welcome.less} +0 -0
  8. package/apps/pivot/index.html +1 -1
  9. package/apps/pivot/main.js +11 -6
  10. package/apps/pivot/menu.yml +3 -0
  11. package/apps/zimoli/book/main.js +1 -1
  12. package/apps/zimoli/broadcast/main.js +1 -1
  13. package/apps/zimoli/index.html +1 -0
  14. package/apps/zimoli/main.js +1 -1
  15. package/apps/zimoli/nearby/main.js +1 -1
  16. package/apps/zimoli/yuanfen/main.js +1 -1
  17. package/coms/basic/crypt.js +1 -1
  18. package/coms/compile/scanner2.js +1 -1
  19. package/coms/frame/left.html +11 -6
  20. package/coms/frame/left.js +6 -3
  21. package/coms/frame/left.less +38 -36
  22. package/coms/frame/main.js +1 -1
  23. package/coms/frame/route.js +52 -4
  24. package/coms/frame/top.less +12 -13
  25. package/coms/kugou/buildList.js +1 -0
  26. package/coms/kugou/player.js +3 -0
  27. package/coms/layer/glance.less +4 -2
  28. package/coms/zimoli/avatar.js +0 -1
  29. package/coms/zimoli/checker.html +1 -1
  30. package/coms/zimoli/checker.less +8 -13
  31. package/coms/zimoli/getTreeFromData.js +9 -3
  32. package/coms/zimoli/menu.js +11 -1
  33. package/coms/zimoli/menu.less +1 -1
  34. package/coms/zimoli/menuItem.js +4 -1
  35. package/coms/zimoli/radio.html +1 -3
  36. package/coms/zimoli/radio.less +10 -22
  37. package/coms/zimoli/tree.js +4 -4
  38. package/coms/zimoli/zimoli.js +11 -9
  39. package/data/mime.json +3 -0
  40. package/package.json +1 -1
  41. package/public/efront.js +1 -1
@@ -20,7 +20,8 @@ function main() {
20
20
  }).loading_promise;
21
21
  info = encode62.timeupdate(info);
22
22
  data.setSource({ authorization: info });
23
- go('/home/main')
23
+ user.login({})
24
+ go('/main')
24
25
  } catch {
25
26
  }
26
27
  this.$scope.pending = false;
@@ -0,0 +1 @@
1
+ <div>短链接管理,敬请期待</div>
@@ -0,0 +1,5 @@
1
+ function main() {
2
+ var page = div();
3
+ page.innerHTML = template;
4
+ return page;
5
+ }
@@ -0,0 +1 @@
1
+ &{}
@@ -1,3 +1,4 @@
1
+
1
2
  <div>
2
3
  已登录到服务器,您可以进行如下操作
3
4
  </div>
@@ -15,8 +15,10 @@ function main() {
15
15
  },
16
16
  logout() {
17
17
  data.setSource('authorization', null);
18
- go('/auth/login');
18
+ user.logout();
19
+ location.reload();
19
20
  }
20
21
  });
22
+ console.log(page)
21
23
  return page;
22
24
  }
File without changes
@@ -36,6 +36,6 @@
36
36
  </style>
37
37
  </head>
38
38
 
39
- <body scroll=no max-render=1440 main-path="/main"></body>
39
+ <body scroll=no menu="menu.yml"></body>
40
40
 
41
41
  </html>
@@ -1,13 +1,18 @@
1
- if (data.getSource('authorization')) {
2
- zimoli("/home/main");
3
- }
4
- else {
5
- zimoli("/auth/login");
6
- }
7
1
  data.loadConfig("api.yml");
2
+ user.loginPath = '/auth/login';
3
+ // user.token = data.getSource('authorization');
8
4
  setInterval(function () {
9
5
  var auth = data.getSource('authorization');
10
6
  if (!auth) return;
11
7
  var auth1 = encode62.timeupdate(auth);
12
8
  if (auth1 !== auth) data.setSource("authorization", auth1);
9
+ user.token = auth1;
13
10
  }, 2000);
11
+ login();
12
+ var layer = layer$glance({
13
+ left: "frame$left",
14
+ top: 'frame$top'
15
+ });
16
+ function main() {
17
+ return layer;
18
+ }
@@ -0,0 +1,3 @@
1
+ 首页: /home/welcome
2
+ 工作台: /home/short
3
+ # 用户列表: /user/list
@@ -1,6 +1,6 @@
1
1
  // 中文编码 utf-8
2
2
  var tbar = titlebar("预订", null, false);
3
- var page = createElement(div, beian, tbar);
3
+ var page = createElement(div, tbar);
4
4
  css(page, "font-size:40px;color:#fff;");
5
5
 
6
6
  function main() {
@@ -1,6 +1,6 @@
1
1
  // 中文编码 utf-8
2
2
  var tbar = titlebar("大厅", null, false);
3
- var page = createElement(div, beian, tbar);
3
+ var page = createElement(div, tbar);
4
4
  css(page, "font-size:40px;color:#fff;");
5
5
 
6
6
  function main() {
@@ -34,6 +34,7 @@
34
34
  overflow: hidden;
35
35
  }
36
36
  </style>
37
+ <script>window.e=0</script>
37
38
  </head>
38
39
 
39
40
  <body scroll=no max-render=1440></body>
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  var menu = div();
4
4
  var config = require("./config");
5
- appendChild(menu, kugou$menu, kugou$page, beian);
5
+ appendChild(menu, kugou$menu, kugou$page);
6
6
  i18n.loadSource({
7
7
  zh: {
8
8
  "name": "用户名"
@@ -1,6 +1,6 @@
1
1
  // 中文编码 utf-8
2
2
  var tbar = titlebar("附近", null, false);
3
- var page = createElement(div, beian, tbar);
3
+ var page = createElement(div, tbar);
4
4
  css(page, "font-size:40px;color:#fff;");
5
5
 
6
6
  function main() {
@@ -8,7 +8,7 @@ css(qq_icon, "width:28px;height:28px;margin:-14px;top:50%;left:50%;position:abso
8
8
  css(loginBtn, "display:inline-block;position:absolute;right:0;top:0;height:100%;width:60px;background-color:transparent");
9
9
  var tbar = titlebar("EFRONT.cc", [loginBtn], false);
10
10
  css(tbar,"text-align:left;padding-left:20px;")
11
- var page = createElement(div, beian, tbar, slider());
11
+ var page = createElement(div, tbar, slider());
12
12
  css(page, "font-size:40px;color:#fff;padding-top:50px;");
13
13
 
14
14
  var group_sample = createElement(div);
@@ -58,6 +58,6 @@ module.exports = {
58
58
  checksign: function (data, mask) {
59
59
  var sign = data.sign;
60
60
  delete data.sign;
61
- return sign = signonly(data, mask);
61
+ return sign === signonly(data, mask);
62
62
  }
63
63
  };
@@ -152,7 +152,7 @@ var detour = function (o, ie) {
152
152
  class Program extends Array {
153
153
  COMMENT = COMMENT
154
154
  SPACE = SPACE
155
- STAMP = STRAP
155
+ STRAP = STRAP
156
156
  STAMP = STAMP
157
157
  VALUE = VALUE
158
158
  QUOTED = QUOTED
@@ -1,8 +1,13 @@
1
- <div class="navbar-header">
2
- <span class="fa fa-area-chart"></span>
3
- GRINCH
4
- <span class="dashboard_text">efront.cc</span>
1
+ <div ng-if="!user.isLogin" class="navbar-header">
2
+ <!-- <avatar></avatar> -->
3
+ <a @click="popup('#/user/login')" class="dashboard_text">请登录</a>
4
+ </div>
5
+ <div -else class="navbar-header">
6
+ <span class="dashboard_text" @click="go('/user/profile')">
7
+ <avatar ng-src="user.avatar" size=30></avatar>
8
+ <span ng-bind="user.name"></span>
9
+ <span ng-bind="user.roles"></span>
10
+ </span>
5
11
  </div>
6
12
  <ylist mode=inline ng-src="menu in menus" class="sidebar-menu" ng-active="menus.open(event.value)">
7
- </ylist>
8
- <btn class="setting" ng-click="go('/user/setting')"><i class="fa fa-gear"></i>设置</btn>
13
+ </ylist>
@@ -1,12 +1,15 @@
1
- var page = div();
1
+ var page = document.createElement("都说我负天下人_可你们天下人_又何曾善待过我");
2
2
  page.innerHTML = left;
3
- var route = frame$route;
3
+ if (!user.avatar) user.avatar = "user/avatar.png";
4
+ frame$route.fetch('menu.yml')
4
5
  render(page, {
5
6
  ylist: menu,
6
7
  btn: button,
7
8
  go,
8
9
  user,
9
- menus: route,
10
+ avatar,
11
+ popup,
12
+ menus: frame$route,
10
13
  });
11
14
  function main() {
12
15
  return page;
@@ -1,43 +1,45 @@
1
1
  & {
2
- padding : 50px 0 0 0;
2
+ padding: 50px 0 0 0;
3
3
  position: relative;
4
4
  }
5
5
 
6
6
  .navbar-header {
7
- height : 50px;
8
- padding : 10px 15px 10px 25px;
9
- font-size : 25px;
10
- line-height : 25px;
7
+ height: 50px;
8
+ padding: 10px 15px 10px 25px;
9
+ font-size: 25px;
10
+ line-height: 25px;
11
11
  text-transform: uppercase;
12
- color : #b8c7ce;
13
- margin-top : -50px;
12
+ color: #b8c7ce;
13
+ margin-top: -50px;
14
14
  }
15
15
 
16
16
  .dashboard_text {
17
- font-size : 12px;
17
+ font-size: 12px;
18
18
  text-transform: capitalize;
19
- display : block;
19
+ display: block;
20
20
  letter-spacing: 1px;
21
- padding-left : 35px;
22
- display : none;
21
+ padding-left: 35px;
22
+ display: none;
23
23
  }
24
24
 
25
-
25
+ ylist {
26
+ width: 100%;
27
+ }
26
28
 
27
29
  .sidebar-menu {
28
- height : 100%;
30
+ height: 100%;
29
31
  box-shadow: none;
30
32
  }
31
33
 
32
34
  .label {
33
35
  border-radius: 4px;
34
- height : 18px;
35
- line-height : 18px;
36
- margin : 12px 2px;
37
- float : right;
38
- top : 50%;
39
- padding : 0 8px;
40
- color : #fff;
36
+ height: 18px;
37
+ line-height: 18px;
38
+ margin: 12px 2px;
39
+ float: right;
40
+ top: 50%;
41
+ padding: 0 8px;
42
+ color: #fff;
41
43
 
42
44
  &.label-primary {
43
45
  background-color: #cd3213;
@@ -57,9 +59,9 @@
57
59
  }
58
60
 
59
61
  .fa-angle-left {
60
- width : auto;
61
- height : auto;
62
- padding : 0;
62
+ width: auto;
63
+ height: auto;
64
+ padding: 0;
63
65
  line-height: inherit;
64
66
  }
65
67
 
@@ -72,10 +74,10 @@
72
74
  }
73
75
 
74
76
  .tab1.header {
75
- font-size : 12px;
76
- color : #4b646f;
77
- background : #1a2226;
78
- height : 32px;
77
+ font-size: 12px;
78
+ color: #4b646f;
79
+ background: #1a2226;
80
+ height: 32px;
79
81
  line-height: 32px;
80
82
 
81
83
  &:hover {
@@ -84,18 +86,18 @@
84
86
  }
85
87
 
86
88
  &>.setting {
87
- position : absolute;
88
- bottom : 0;
89
- right : 0;
90
- left : 0;
91
- background : transparent;
92
- text-align : left;
89
+ position: absolute;
90
+ bottom: 0;
91
+ right: 0;
92
+ left: 0;
93
+ background: transparent;
94
+ text-align: left;
93
95
  line-height: 40px;
94
- height : 40px;
96
+ height: 40px;
95
97
 
96
98
  i {
97
- height : 40px;
98
- opacity : .9;
99
+ height: 40px;
100
+ opacity: .9;
99
101
  margin-right: 10px;
100
102
  line-height: inherit;
101
103
  }
@@ -2,7 +2,7 @@ function main(mainpath) {
2
2
  var page = layer$glance({
3
3
  left: 'frame$left',
4
4
  top: 'frame$top',
5
- main: mainpath || 'page$grinch'
5
+ main: mainpath
6
6
  });
7
7
  return page;
8
8
  }
@@ -1,4 +1,4 @@
1
- (document.body.hasAttribute("config-path") ? data.fromURL(document.body.getAttribute('config-path') || 'config/menus.json').loading_promise : Promise.resolve([])).then(function (items) {
1
+ (document.body.hasAttribute('menu-path') || document.body.hasAttribute("menu") || document.body.hasAttribute("config-path") ? data.fromURL(document.body.getAttribute('menu-path') || document.body.getAttribute('menu') || document.body.getAttribute('config-path') || 'menu.yml').loading_promise : Promise.resolve([])).then(function (items) {
2
2
  var result = [];
3
3
  var menuid = 0;
4
4
  var savedChildren = Object.create(null);
@@ -10,6 +10,9 @@
10
10
  if (!savedMenus[menu.id]) {
11
11
  savedMenus[menu.id] = menu;
12
12
  }
13
+ if (!menu.name) {
14
+ menu.name = Object.keys(menu)[0];
15
+ }
13
16
  if (!(menu.id in savedChildren)) {
14
17
  savedChildren[menu.id] = menu.children;
15
18
  if (menu.children instanceof Array) {
@@ -28,8 +31,46 @@
28
31
  }
29
32
  }
30
33
  };
31
- items.map(getChildren);
32
- result.update = function () {
34
+ var parseMenuList = function (items) {
35
+ if (items instanceof Array) {
36
+ console.log(items)
37
+ return items;
38
+ }
39
+ if (items instanceof Object) {
40
+ var keys = Object.keys(items);
41
+ items = keys.map(k => {
42
+ var c = items[k];
43
+ var item = {};
44
+ if (c instanceof Object) {
45
+ item.children = parseMenuList(c);
46
+ }
47
+ else if (typeof c === 'string') {
48
+ var [path, data] = c.split(/\?/);
49
+ }
50
+ var [icon] = k.split(/\s+/);
51
+ if (icon.length < k.length) {
52
+ item.icon = icon;
53
+ var name = k.slice(icon.length).trim();
54
+ } else name = k;
55
+ if (/,/.test(name)) {
56
+ var [name, ...roles] = name.split(',');
57
+ }
58
+ item.name = name;
59
+ if (roles) item.roles = roles;
60
+ if (path) item.path = path;
61
+ if (data) item.params = parseKV(data);
62
+ if (/,/.test(name)) {
63
+
64
+ }
65
+ return item;
66
+ });
67
+ return items;
68
+ }
69
+ return [];
70
+ };
71
+ result.update = function (items) {
72
+ items = parseMenuList(items);
73
+ items.map(getChildren);
33
74
  var opened = data.getInstance("menu-opened");
34
75
  var historys = zimoli.getCurrentHistory();
35
76
  var map = {}, mmap = {};
@@ -62,6 +103,7 @@
62
103
  result.open(result[0]);
63
104
  }
64
105
  }
106
+ return result;
65
107
  };
66
108
  var setActive = function (p, active) {
67
109
  while (p) {
@@ -71,6 +113,7 @@
71
113
  };
72
114
  result.load = function (menu) {
73
115
  zimoli.go(menu);
116
+ return result;
74
117
  };
75
118
  on("zimoli")(window, function (event) {
76
119
  var { zimoli } = event;
@@ -127,8 +170,13 @@
127
170
  };
128
171
  result.reload = function () {
129
172
  result.load(result.active);
173
+ return result;
174
+ };
175
+ result.fetch = function (url) {
176
+ data.from(url).loading_promise.then(result.update);
177
+ return result;
130
178
  };
131
- result.update();
179
+ if (items.length) result.update(items);
132
180
 
133
181
  return result;
134
182
  });
@@ -1,12 +1,10 @@
1
- @import "../config.less";
2
-
3
1
  & {
4
2
  // background-color : #fff;
5
3
  user-select: none;
6
4
  position: relative;
7
5
  z-index: 1;
8
- line-height: 44px;
9
- height: 44px;
6
+ padding: 4px 0;
7
+ line-height: 0;
10
8
  -webkit-backdrop-filter: saturate(180%) blur(20px);
11
9
  backdrop-filter: saturate(180%) blur(20px);
12
10
  background: rgba(255, 255, 255, .7);
@@ -87,6 +85,7 @@
87
85
  line-height: 24px;
88
86
  text-align: center;
89
87
  color: #666;
88
+ z-index: 2;
90
89
 
91
90
  &:hover {
92
91
  color: #f24;
@@ -102,17 +101,17 @@
102
101
  border-radius: 10px;
103
102
  }
104
103
 
105
- &:nth-child(2)>span {
106
- background-color: @primary-dot-color;
107
- }
104
+ // &:nth-child(2)>span {
105
+ // background-color: @primary-dot-color;
106
+ // }
108
107
 
109
- &:nth-child(3)>span {
110
- background-color: @extra-dot-color1;
111
- }
108
+ // &:nth-child(3)>span {
109
+ // background-color: @extra-dot-color1;
110
+ // }
112
111
 
113
- &:nth-child(4)>span {
114
- background-color: @extra-dot-color2;
115
- }
112
+ // &:nth-child(4)>span {
113
+ // background-color: @extra-dot-color2;
114
+ // }
116
115
  }
117
116
 
118
117
  .option-items {
@@ -6,6 +6,7 @@ function main(dataid, datapath) {
6
6
  padding,
7
7
  song,
8
8
  loading,
9
+ musicList,
9
10
  run(s) {
10
11
  if (s.hash) {
11
12
  kugou$player.play(s.hash);
@@ -85,6 +85,9 @@ var $scope = {
85
85
  effect: false,
86
86
  playing: null,
87
87
  page: false,
88
+ currentProcess: null,
89
+ currentRotate: 0,
90
+ totalTime: 0,
88
91
  canvas: kugou$dance,
89
92
  activeList: playList,
90
93
  index: 0,
@@ -3,14 +3,12 @@
3
3
  width: 100%;
4
4
  height: 100%;
5
5
  max-width: 100%;
6
- // margin : 0 auto;
7
6
  position: relative;
8
7
  border-radius: 3px;
9
8
  overflow: hidden;
10
9
  border-left: @left-width solid transparent;
11
10
  box-sizing: border-box;
12
11
  overflow: visible;
13
- border-top: 44px solid transparent;
14
12
  transition: border-left-width 0.2s ease-out, margin-left .2s ease-out, left .2s ease-out;
15
13
  }
16
14
 
@@ -36,6 +34,10 @@
36
34
  border-bottom: 1px solid rgba(0, 0, 0, .16);
37
35
  }
38
36
 
37
+ >[layer=main] {
38
+ padding: 50px 10px 20px 10px;
39
+ }
40
+
39
41
  &.close {
40
42
  border-left-width: 0 !important;
41
43
  }
@@ -4,7 +4,6 @@ function main(elem) {
4
4
  }
5
5
  if (!/^img$/i.test(elem.tagName)) {
6
6
  care(elem, function (src) {
7
- console.log(elem);
8
7
  css(elem, { backgroundImage: `url('${src}')` });
9
8
  })
10
9
  }
@@ -1 +1 @@
1
- <s>✓</s>
1
+ ▢<s>✓</s>
@@ -1,32 +1,27 @@
1
1
  & {
2
- display: inline-block;
3
2
  height: 1em;
4
3
  width: 1em;
5
- border-radius: 2px;
6
- border: .1em solid;
7
4
  position: relative;
8
- vertical-align: middle;
9
5
  margin-right: 4px;
6
+ font-family: sans-serif;
7
+ display: inline-block;
8
+ line-height: 1;
9
+ text-align: center;
10
10
 
11
11
  >s {
12
12
  display: none;
13
- border-radius: 50%;
14
- width: 1em;
15
- height: 1em;
16
- line-height: 1;
17
13
  text-decoration: none;
18
- text-align: center;
19
14
  position: absolute;
20
- margin: -.5em;
21
15
  font-weight: bold;
22
- top: 50%;
23
- left: 50%;
16
+ left: 0;
17
+ right: 0;
18
+ top: -.15em;
24
19
  }
25
20
  }
26
21
 
27
22
 
28
23
  &.checked {
29
24
  >s {
30
- display: block;
25
+ display: inline;
31
26
  }
32
27
  }
@@ -29,15 +29,21 @@ function getTreeFromData(array) {
29
29
  var tab = 0;
30
30
  var run = function (item, parent) {
31
31
  item.tab = tab;
32
- var total = 0;
32
+ var count = 0, total = 0;
33
33
  item.parent = parent;
34
34
  item.root = root;
35
35
  if (item.length) {
36
36
  tab++;
37
- item.forEach(item => total += run(item, parent));
37
+ for (var cx = 0, dx = item.length; cx < dx; cx++) {
38
+ var i = item[cx];
39
+ run(i, parent);
40
+ count += i.count || 1;
41
+ total += i.total;
42
+ }
38
43
  tab--;
39
44
  }
40
- return item.total = total || 1;
45
+ item.total = total + item.length;
46
+ return item.count = count;
41
47
  };
42
48
  run(root);
43
49
  return root;
@@ -101,6 +101,14 @@ function main(elem, mode) {
101
101
  // }
102
102
  // elem.setAttribute('browser', os);
103
103
  var mode = elem.getAttribute('mode') || elem.getAttribute('type');
104
+ if (!mode) {
105
+ if (/^[xyhvtci]/i.test(elem.tagName)) {
106
+ mode = elem.tagName.slice(0, 1);
107
+ }
108
+ else if (/[xyhvtci]$/i.test(elem.tagName)) {
109
+ mode = elem.tagName.slice(0, 1);
110
+ }
111
+ }
104
112
  mode = mode ? mode.toLowerCase() : "horizonal";
105
113
  var src = elem.getAttribute("src") || elem.getAttribute("ng-src") || elem.getAttribute("v-src");
106
114
  if (src) {
@@ -133,12 +141,14 @@ function main(elem, mode) {
133
141
  });
134
142
  elem.renders.push(function () {
135
143
  var src = this.src;
144
+ var hasIcon = false;
136
145
  for (var cx = 0, dx = src; cx < dx; cx++) {
137
146
  if (src[cx].icon) {
147
+ hasIcon = true;
138
148
  break;
139
149
  }
140
150
  }
141
- elem.useIcon = true;
151
+ elem.useIcon = hasIcon;
142
152
  });
143
153
  } else {
144
154
  var nodes = getTreeNodes(elem);
@@ -160,7 +160,7 @@ body:active & {
160
160
  background: #1e282c;
161
161
 
162
162
  & s:after {
163
- top: -10px;
163
+ top: -9.2px;
164
164
  }
165
165
  }
166
166
 
@@ -2,7 +2,10 @@ function main(elem, scope, hasIcon) {
2
2
  var item = elem || document.createElement('menu-item');
3
3
  item.innerHTML = menuItem;
4
4
  if (isObject(scope) && scope !== elem.$scope) {
5
- render(item, { menu: scope, useIcon: hasIcon })
5
+ render(item, { menu: scope, useIcon: hasIcon, hasIcon })
6
+ }
7
+ else {
8
+ extendIfNeeded(elem.$scope, { useIcon: false, hasIcon: false })
6
9
  }
7
10
  return item;
8
11
  }
@@ -1,6 +1,4 @@
1
1
  <a ng-repeat="o in options" ng-click="select(o)" ng-class="{activate:o===options.active}">
2
- <r>
3
- <s></s>
4
- </r>
2
+ <r>◯<s>●</s></r>
5
3
  <span ng-bind=o.name||o></span>
6
4
  </a>