efront 4.0.11 → 4.0.13
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/#/345/233/275/351/231/205/345/214/226.yml +64 -46
- package/{docs → apps}/drequest/index.html +1 -1
- package/{docs → apps}/drequest/main.js +5 -5
- package/coms/compile/Javascript.js +4 -2
- package/coms/compile/Program.js +0 -2
- package/coms/compile/unstruct.js +63 -41
- package/coms/compile/unstruct_test.js +4 -2
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/_envs/setup.bat +0 -10
- package/apis/zimoli/file/checkPermission.js +0 -10
- package/apis/zimoli/file/info.js +0 -68
- package/apis/zimoli/file/root.js +0 -2
- package/apis/zimoli/server/count.js +0 -4
- package/apis/zimoli/user/login.js +0 -12
- package/apis/zimoli/yuanfen/suggest.js +0 -8
- package/coms/zimoli/editor.js +0 -85
- package/coms/zimoli/editor.less +0 -64
- package/data/i18n/zh-cn.json +0 -21
- package/docs/canvas/main.js +0 -5
- package/docs/compare/index.html +0 -14
- package/docs/compare/main.js +0 -7
- package/docs/editor/index.html +0 -30
- package/docs/editor/main.js +0 -5
- package/docs/editor/main.less +0 -0
- /package/{docs → apps}/sample/mycolor.html +0 -0
package/_envs/setup.bat
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
chcp 936
|
|
2
|
-
rem Ĭ��Ӧ��
|
|
3
|
-
@REM if not defined app set APP=zimoli
|
|
4
|
-
REM set HTTPS_PORT=444
|
|
5
|
-
|
|
6
|
-
rem https֤��·��
|
|
7
|
-
rem ������ֵд��.\cert\private.bat ����ֹ�ύ
|
|
8
|
-
REM set PATH.SSL_PFX=%~DP0cert\efront.cc.pfx
|
|
9
|
-
REM set PASSWORD.SSL_PFX=%ssl֤������%
|
|
10
|
-
@if exist "%~dp0cert\private.bat" @call "%~dp0cert\private"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var path = require("path");
|
|
2
|
-
var rootDirectorys = require("./root");
|
|
3
|
-
var checkPermission = function (fullpath) {
|
|
4
|
-
for (var cx = 0, dx = rootDirectorys.length; cx < dx; cx++) {
|
|
5
|
-
var relpath = path.relative(fullpath, rootDirectorys[cx]);;
|
|
6
|
-
if (/^\.\.?[\/\\]|^$|/.test(relpath)) return true;
|
|
7
|
-
}
|
|
8
|
-
return false;
|
|
9
|
-
};
|
|
10
|
-
module.exports = checkPermission;
|
package/apis/zimoli/file/info.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
var fs = require("fs");
|
|
2
|
-
var path = require("path");
|
|
3
|
-
var rootDirectorys = require("./root");
|
|
4
|
-
var checkPermission = require("./checkPermission");
|
|
5
|
-
function infos({ files = rootDirectorys, folder = "." }) {
|
|
6
|
-
return new Promise(function (ok, oh) {
|
|
7
|
-
if (!files.length) return ok([]);
|
|
8
|
-
var results = [];
|
|
9
|
-
var result_count = 0;
|
|
10
|
-
function resolve(fileInfo, cx) {
|
|
11
|
-
results[cx] = fileInfo;
|
|
12
|
-
result_count++;
|
|
13
|
-
if (result_count >= files.length) {
|
|
14
|
-
ok(results);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
files.map(function (pathname, cx) {
|
|
18
|
-
var name = pathname;
|
|
19
|
-
pathname = path.join(folder, pathname);
|
|
20
|
-
if (!checkPermission(pathname)) {
|
|
21
|
-
return resolve({
|
|
22
|
-
name,
|
|
23
|
-
pathname,
|
|
24
|
-
access: false
|
|
25
|
-
}, cx);
|
|
26
|
-
}
|
|
27
|
-
fs.exists(pathname, function (exists) {
|
|
28
|
-
if (!exists) {
|
|
29
|
-
return resolve({
|
|
30
|
-
name,
|
|
31
|
-
pathname,
|
|
32
|
-
exists
|
|
33
|
-
}, cx);
|
|
34
|
-
}
|
|
35
|
-
fs.stat(pathname, function (error, stats) {
|
|
36
|
-
if (error) {
|
|
37
|
-
resolve({
|
|
38
|
-
name,
|
|
39
|
-
pathname,
|
|
40
|
-
error
|
|
41
|
-
}, cx);
|
|
42
|
-
} else {
|
|
43
|
-
var result = {
|
|
44
|
-
name,
|
|
45
|
-
pathname,
|
|
46
|
-
atimeMs: stats.atimeMs,
|
|
47
|
-
ctimeMs: stats.ctimeMs,
|
|
48
|
-
mtimeMs: stats.ctimeMs,
|
|
49
|
-
birthtimeMs: stats.birthtimeMs,
|
|
50
|
-
isFolder: stats.isDirectory(),
|
|
51
|
-
isFile: stats.isFile(),
|
|
52
|
-
size: stats.size
|
|
53
|
-
};
|
|
54
|
-
if (result.isFolder) {
|
|
55
|
-
fs.readdir(pathname, function (error, children) {
|
|
56
|
-
result.children = error || children;
|
|
57
|
-
resolve(result, cx);
|
|
58
|
-
});
|
|
59
|
-
} else {
|
|
60
|
-
resolve(result, cx);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
module.exports = infos;
|
package/apis/zimoli/file/root.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var message = require("../../coms/message");
|
|
2
|
-
function userLogin({ path }) {
|
|
3
|
-
return new Promise(function (ok, oh) {
|
|
4
|
-
message.count({
|
|
5
|
-
path: path || "/",
|
|
6
|
-
isupdate: false
|
|
7
|
-
}, function (count) {
|
|
8
|
-
ok(count);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
module.exports = userLogin;
|
package/coms/zimoli/editor.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
var _editor = document.createElement("div");
|
|
2
|
-
var template = `
|
|
3
|
-
<div class=input></div>
|
|
4
|
-
<textarea class=insert></textarea>
|
|
5
|
-
<div class=flager tabindex=0><div></div></div>
|
|
6
|
-
`;
|
|
7
|
-
/**
|
|
8
|
-
* 加粗
|
|
9
|
-
*/
|
|
10
|
-
function bold() {
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* 斜体
|
|
14
|
-
*/
|
|
15
|
-
function italic() {
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* 居中
|
|
19
|
-
*/
|
|
20
|
-
var browserClass = /(QQ|Safari|CriOS|Chrome)/i.exec(navigator.userAgent);
|
|
21
|
-
if (browserClass) {
|
|
22
|
-
browserClass = browserClass[1].toLowerCase() + " " + String(navigator.platform).replace(/[^\w]/g, a => "-" + a.charCodeAt(0).toString(36));
|
|
23
|
-
} else {
|
|
24
|
-
browserClass = "";
|
|
25
|
-
}
|
|
26
|
-
var isIOS = /iPhone|iPad|iOS|iPod/.test(browserClass);
|
|
27
|
-
var isSafari = isIOS && /safari/i.test(browserClass);
|
|
28
|
-
var getScrollTops = function (element) {
|
|
29
|
-
var result = [];
|
|
30
|
-
while (element) {
|
|
31
|
-
result.push(element.scrollTop);
|
|
32
|
-
element = element.offsetParent;
|
|
33
|
-
}
|
|
34
|
-
return result;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function editor() {
|
|
38
|
-
var edit = _editor.cloneNode();
|
|
39
|
-
browserClass && addClass(edit, browserClass);
|
|
40
|
-
var focusClass = "focus";
|
|
41
|
-
edit.innerHTML = template;
|
|
42
|
-
var [input, insert, flager] = edit.children;
|
|
43
|
-
var inner_flager = flager.children[0];
|
|
44
|
-
onfocus(flager, function () {
|
|
45
|
-
insert.focus();
|
|
46
|
-
});
|
|
47
|
-
var timer = 0;
|
|
48
|
-
var reshaper = function () {
|
|
49
|
-
if (!isSafari || document.activeElement !== insert) return;
|
|
50
|
-
timer = setTimeout(reshaper, 500);
|
|
51
|
-
|
|
52
|
-
once("scroll")(window, function () {
|
|
53
|
-
alert('reshape' + [flager.scrollTop, window.innerHeight]);
|
|
54
|
-
flager.scrollTop = 0;
|
|
55
|
-
});
|
|
56
|
-
flager.scrollTop = 0;
|
|
57
|
-
// inner_flager.scrollIntoView();
|
|
58
|
-
;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
onfocus(insert, function () {
|
|
62
|
-
clearTimeout(timer);
|
|
63
|
-
isSafari && inner_flager.scrollIntoView();
|
|
64
|
-
timer = setTimeout(function () {
|
|
65
|
-
!isSafari && inner_flager.scrollIntoView();
|
|
66
|
-
timer = setTimeout(function () {
|
|
67
|
-
addClass(edit, focusClass);
|
|
68
|
-
reshaper();
|
|
69
|
-
}, 10);
|
|
70
|
-
}, 0);
|
|
71
|
-
});
|
|
72
|
-
var build = lazy(function () {
|
|
73
|
-
input.innerText = insert.value;
|
|
74
|
-
});
|
|
75
|
-
on("input")(insert, build);
|
|
76
|
-
on("keypress")(insert, build);
|
|
77
|
-
onblur(insert, function () {
|
|
78
|
-
clearTimeout(timer);
|
|
79
|
-
removeClass(edit, focusClass);
|
|
80
|
-
flager.scrollIntoView(false);
|
|
81
|
-
});
|
|
82
|
-
edit.bold = bold;
|
|
83
|
-
edit.italic = italic;
|
|
84
|
-
return edit;
|
|
85
|
-
}
|
package/coms/zimoli/editor.less
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
& {
|
|
2
|
-
&.focus {
|
|
3
|
-
// overflow: visible;
|
|
4
|
-
>.input {
|
|
5
|
-
height: 50px;
|
|
6
|
-
}
|
|
7
|
-
>.flager {
|
|
8
|
-
// height: 0;
|
|
9
|
-
border: none;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
&.iPhone,
|
|
13
|
-
&.iPad,
|
|
14
|
-
&.iPod,
|
|
15
|
-
&.iOS {
|
|
16
|
-
&.focus>.flager {}
|
|
17
|
-
&.safari>.input {
|
|
18
|
-
bottom: -44px;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
position: absolute; // position: fixed;
|
|
22
|
-
top: 0;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
bottom: 0;
|
|
25
|
-
right: 0;
|
|
26
|
-
left: 0;
|
|
27
|
-
height: auto;
|
|
28
|
-
>.input {
|
|
29
|
-
position: absolute;
|
|
30
|
-
bottom: 0;
|
|
31
|
-
left: 0;
|
|
32
|
-
height: 6px;
|
|
33
|
-
line-height: 50px;
|
|
34
|
-
font-size: 16px;
|
|
35
|
-
right: 0;
|
|
36
|
-
width: 100%;
|
|
37
|
-
background: #fff;
|
|
38
|
-
display: block;
|
|
39
|
-
}
|
|
40
|
-
>.flager {
|
|
41
|
-
border: 1px solid #ccc;
|
|
42
|
-
background: rgba(0, 0, 0, .1);
|
|
43
|
-
height: 50px;
|
|
44
|
-
position: absolute;
|
|
45
|
-
left: 0;
|
|
46
|
-
right: 0;
|
|
47
|
-
bottom: 0;
|
|
48
|
-
overflow: hidden;
|
|
49
|
-
>div {
|
|
50
|
-
height: 50px;
|
|
51
|
-
position: absolute;
|
|
52
|
-
top: 44px;
|
|
53
|
-
left: 0;
|
|
54
|
-
right: 0;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
>.insert {
|
|
58
|
-
position: absolute;
|
|
59
|
-
bottom: 0;
|
|
60
|
-
width: 0;
|
|
61
|
-
height: 0;
|
|
62
|
-
opacity: 0;
|
|
63
|
-
}
|
|
64
|
-
}
|
package/data/i18n/zh-cn.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
//单词
|
|
3
|
-
"password": "密码",
|
|
4
|
-
"username": "用户名",
|
|
5
|
-
//提交的数据量不能超出
|
|
6
|
-
"server_side_error": "服务器走神了!%1",
|
|
7
|
-
"posted_data_too_large": "提交的数据量过大!",
|
|
8
|
-
"The request was stopped by server!": "请求被服务器终止!",
|
|
9
|
-
"The request was canceled by server!": "请求被服务器取消!",
|
|
10
|
-
"the_data_you_send_should_be_less_than": "提交的数据不能超过%1!",
|
|
11
|
-
"the_data_you_send_can_not_be_parsed_as_json": "您提交的数据不能转换成JSON!%1",
|
|
12
|
-
//错误
|
|
13
|
-
"SyntaxError: Unexpected token (.*?) in JSON at position (\\d+)": "【语法错误】:在JSON数据的第$2个位置出现了意外的标记“$1”。",
|
|
14
|
-
"ReferenceError: (.*?) is not defined": "【引用错误】:变量$1没有被定义",
|
|
15
|
-
//登录
|
|
16
|
-
"Please input the username to login!": "请输入用户名再登录!",
|
|
17
|
-
"Username (.*?) not found!": "用户名$1没有找到!",
|
|
18
|
-
"There are more than one users share the username (.*?), try to login in another way!": "有多个用户使用了用户名“$1”,请尝试用其他方式登录!",
|
|
19
|
-
"The login request was denied because the password you provieded seems not to be correct!": "登录请求被拒绝!你提供的密码不正确!",
|
|
20
|
-
"The format of (.*?) should be (.*?)!": "$1的格式应该是$2"
|
|
21
|
-
}
|
package/docs/canvas/main.js
DELETED
package/docs/compare/index.html
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<!Doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>重复文件查找工具</title>
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
|
6
|
-
<meta charset="utf-8" />
|
|
7
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
8
|
-
<link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" />
|
|
9
|
-
<meta name="viewport" content="user-scalable=no,initial-scale=1,maximum-scale=1,width=device-width" />
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<script src=/main.js></script>
|
|
13
|
-
</body>
|
|
14
|
-
</html>
|
package/docs/compare/main.js
DELETED
package/docs/editor/index.html
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<!-- 中文编码 utf-8 -->
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
<html>
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
9
|
-
<link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" />
|
|
10
|
-
<meta name="viewport" content="user-scalable=no,initial-scale=1,maximum-scale=1,width=device-width" />
|
|
11
|
-
<title>紫茉莉</title>
|
|
12
|
-
</head>
|
|
13
|
-
|
|
14
|
-
<body scroll=no style=background-color:#f2f2f2>
|
|
15
|
-
<script>
|
|
16
|
-
- function (body, window) {
|
|
17
|
-
body.removeChild(body.getElementsByTagName("script")[0]);
|
|
18
|
-
var xhr = new(window.XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP');
|
|
19
|
-
xhr.onreadystatechange = function () {
|
|
20
|
-
if (xhr.readyState === 4) {
|
|
21
|
-
new Function(xhr.responseText).call(window);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
xhr.open('POST', 'comm/main');
|
|
25
|
-
xhr.send("step into my sight..");
|
|
26
|
-
}.call(this, document.body, this);
|
|
27
|
-
</script>
|
|
28
|
-
</body>
|
|
29
|
-
|
|
30
|
-
</html>
|
package/docs/editor/main.js
DELETED
package/docs/editor/main.less
DELETED
|
File without changes
|
|
File without changes
|