efront 3.28.1 → 3.29.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.
@@ -1,7 +1,7 @@
1
1
  var fs = require("fs");
2
2
  var path = require("path");
3
- var test_file_reg = /_test\.[tj]sx?$/i;
4
- var comm_file_reg = /\.[tj]sx?$/i;
3
+ var test_file_reg = /_test\.([tj]sx?|xht)$/i;
4
+ var comm_file_reg = /\.([tj]sx?|xht)$/i;
5
5
  var readdir = function (a) {
6
6
  return new Promise(function (ok, oh) {
7
7
  a = path.join(__dirname, "../../coms", a);
@@ -5,6 +5,7 @@
5
5
  top: 0;
6
6
  right: 0;
7
7
  bottom: 0;
8
+ width: 100%;
8
9
  background: inherit;
9
10
  }
10
11
 
@@ -93,6 +93,7 @@ class Table extends Array {
93
93
  this.searched = 0;
94
94
  this.splice(0, this.length);
95
95
  var source = this.sorted ? this.sorted : this.source;
96
+ if (!source) return;
96
97
  var searchid = ++this.searchid;
97
98
  this.complete = false;
98
99
  this.coverCount = 0;
File without changes
@@ -2,7 +2,7 @@
2
2
  var compile = require("./compile");
3
3
  var javascript = function () {
4
4
  "use strict";
5
- var Enum = require("../basic/Enum");
5
+ var Enum = require("./Enum");
6
6
  var Tokens = new Enum;
7
7
  var {
8
8
  SingleLineComment,
@@ -62,9 +62,9 @@ var javascript = function () {
62
62
  entry: ProgramCodeBlock
63
63
  };
64
64
  }();
65
- var fs = require("fs");
66
- var path = require("path");
67
- var assert = require("../basic/assert");
65
+ // var fs = require("fs");
66
+ // var path = require("path");
67
+ var assert = require("./assert");
68
68
 
69
69
 
70
70
 
@@ -35,4 +35,9 @@ function decode(s) {
35
35
  return b;
36
36
  });
37
37
  }
38
- module.exports = { encode, decode };
38
+ function recode(s) {
39
+ s = decode(s);
40
+ s = encode(s);
41
+ return s;
42
+ }
43
+ module.exports = { encode, decode, recode };
@@ -17,7 +17,7 @@ var getPageScope = function (d) {
17
17
  return $scope;
18
18
  };
19
19
  var never = function () { return false };
20
- var popupEdit = function (d) {
20
+ var popupRen = function (d) {
21
21
  var $scope = getPageScope(d);
22
22
  var selected = $scope.selected;
23
23
  var active;
@@ -28,8 +28,14 @@ var popupEdit = function (d) {
28
28
  else {
29
29
  active = d.$scope.d;
30
30
  }
31
- if (d === $scope)
32
- if (d.$scope.pending) return;
31
+ if (d.$scope.pending) return;
32
+ popupEdit($scope, active);
33
+ };
34
+ var popupAdd = function (d) {
35
+ var $scope = getPageScope(d);
36
+ popupEdit($scope, null);
37
+ };
38
+ var popupEdit = function ($scope, active) {
33
39
  var params = {
34
40
  path: $scope.pathlist.join('/'),
35
41
  hasName: $scope.hasName.bind($scope),
@@ -153,7 +159,7 @@ return extend([
153
159
  {
154
160
  name: "新建文件夹(D)",
155
161
  when: notGetActive,
156
- do: popupEdit
162
+ do: popupAdd
157
163
  },
158
164
  {
159
165
  name: "添加文件(F)",
@@ -167,7 +173,7 @@ return extend([
167
173
  hotkey: "F2",
168
174
  name: '重命名(R)',
169
175
  when: getStable,
170
- do: popupEdit
176
+ do: popupRen
171
177
  },
172
178
  {
173
179
  get name() {
@@ -0,0 +1,31 @@
1
+ <img ng-src="user.avatar||'images/avatar.png'" draggable="false"/>
2
+ <style>
3
+ & {
4
+ border-radius: 50%;
5
+ display: inline-block;
6
+ background-repeat: no-repeat;
7
+ background-size: cover;
8
+ background-position: center;
9
+ }
10
+ </style>
11
+ <script>
12
+ function main(elem) {
13
+ if (!isElement(elem)) {
14
+ elem = document.createElement("img");
15
+ }
16
+ if (!/^img$/i.test(elem.tagName)) {
17
+ care(elem, function (src) {
18
+ css(elem, { backgroundImage: `url('${src}')` });
19
+ })
20
+ }
21
+ var size = +elem.getAttribute('size');
22
+ if (size) {
23
+ css(elem, {
24
+ width: fromPixel(size),
25
+ height: fromPixel(size)
26
+ });
27
+ }
28
+ return elem;
29
+ }
30
+ main.toString = template.toString;
31
+ </script>
@@ -0,0 +1,30 @@
1
+ <back onclick="history.back()">
2
+ <i></i><span>返回</span>
3
+ </back>
4
+ <style>
5
+ i:before {
6
+ content: "‹";
7
+ font-size: 28px;
8
+ }
9
+
10
+ i {
11
+ font-style: normal;
12
+ margin-top: -12px;
13
+ }
14
+
15
+ span {
16
+ font-size: 14px;
17
+ margin-left: 10px;
18
+ margin-top: -10px;
19
+ }
20
+
21
+ span,
22
+ i {
23
+ position: absolute;
24
+ left: 10px;
25
+ top: 50%;
26
+ height: 20px;
27
+ line-height: 20px;
28
+ font-style: normal;
29
+ }
30
+ </style>
@@ -0,0 +1,110 @@
1
+ <style>
2
+ /* less */
3
+ strong{
4
+ color: #666;
5
+ }
6
+ div span:before{
7
+ content: '<a>pseudo</a>';
8
+ display: 'inline-block';
9
+ padding: 0 16px;
10
+ color: blue;
11
+ }
12
+ caption,td,th {
13
+ position: relative;
14
+ padding: 10px 16px;
15
+ background: #fff;
16
+ }
17
+
18
+ clone,
19
+ canvas {
20
+ position: absolute !important;
21
+ left: 16px !important;
22
+ top: 10px !important;
23
+ }
24
+ border-collapse: collapse;
25
+
26
+ td,
27
+ th {
28
+ border: 2px solid #ccc;
29
+ }
30
+
31
+ td {
32
+ background: #fff;
33
+ @mask-color1 : rgba(255, 255, 255, .6);
34
+ @mask-color2 : rgba(0, 0, 0, 0);
35
+ @mask-color3 : rgba(0, 0, 0, .1);
36
+ background:
37
+ linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
38
+ linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
39
+ linear-gradient(45deg, @mask-color3, 25%, @mask-color3, 25%, @mask-color2, 75%, @mask-color3, 75%, @mask-color3),
40
+ linear-gradient(45deg, @mask-color3, 25%, @mask-color3, 25%, @mask-color2, 75%, @mask-color3, 75%, @mask-color3);
41
+ background-size: 20px 20px;
42
+ background-position: 0 0, 10px 10px, 10px 0, 0 10px;
43
+ background-repeat: repeat;
44
+ background-clip: border-box;
45
+
46
+ }
47
+ </style>
48
+ <table onmounted="update()">
49
+
50
+ <caption><strong>cloneVisible</strong>&nbsp;&nbsp;<i>vs.</i>&nbsp;&nbsp;<strong>html2canvas</strong></caption>
51
+ <thead>
52
+ <tr>
53
+ <th>原图</th>
54
+ <th>cloneVisible</th>
55
+ <th>html2canvas</th>
56
+ </tr>
57
+ </thead>
58
+ <tbody>
59
+ <tr #row>
60
+ <td>
61
+ <div
62
+ style="width:100px;height:100px;position:relative;background-color:#223223;overflow:hidden;border-radius:100px;">
63
+ <div
64
+ style="border:5px dashed;line-height:40px;text-align:center;text-shadow:1px 3px 0 red;color:#ff3;text-indent:20px">
65
+ abc
66
+ <span class='cl-c'>cl-c</span>
67
+ <input style="width:10px;height:10px;-webkit-appearance:none" />
68
+ <span style="writing-mode:vertical-rl;letter-spacing:12px">
69
+ 书生<br />意气
70
+ </span>
71
+ </div>
72
+ <style>
73
+ .cl-c {
74
+ display: block;
75
+ float: right;
76
+ }
77
+ </style>
78
+
79
+ </div>
80
+ </td>
81
+ <td></td>
82
+ <td></td>
83
+ </tr>
84
+ </tbody>
85
+ </table>
86
+ <script>
87
+ function update() {
88
+ var [td1, td2, td3] = this.row.children;
89
+ var ele = td1.children[0]
90
+ setTimeout(function () {
91
+ var clone = cloneVisible(ele);
92
+ appendChild(td2, clone);
93
+ console.log(ele)
94
+ ele.with ? ele.with.push(clone) : ele.with = [clone];
95
+ var e1 = window.e1 = ele.querySelector("input");
96
+ var e2 = window.e2 = clone.querySelector("input");
97
+ var s1 = window.s1 = getComputedStyle(e1);
98
+ var s2 = window.s2 = getComputedStyle(e2);
99
+ for (var k in s1) {
100
+ if (s1[k] !== s2[k] && !/cssText/.test(k)) {
101
+ console.warn(k, 'src:', s1[k], 'dst:', s2[k]);
102
+ }
103
+ }
104
+
105
+ html2canvas(ele, { backgroundColor: "rgba(0,0,0,0)" }).then(function (e) {
106
+ appendChild(td3, e);
107
+ });
108
+ });
109
+ }
110
+ </script>
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.28.1",
3
+ "version": "3.29.1",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {