efront 4.0.34 → 4.0.35
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/coms/compile/Javascript.js +2 -2
- package/coms/compile/Javascript_test.js +2 -0
- package/docs/main.xht +29 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
|
@@ -506,8 +506,9 @@ var removeImport = function (c, i, code) {
|
|
|
506
506
|
var [dec, map, o] = getDeclared(c.next);
|
|
507
507
|
if (dec.length !== 1 || !o) throw new Error("代码结构异常!");
|
|
508
508
|
if (o.type !== STRAP || o.text !== 'from') throw new Error("缺少from语句");
|
|
509
|
+
var oi = code.indexOf(o, i);
|
|
509
510
|
}
|
|
510
|
-
else code.splice(i, 1), o = c;
|
|
511
|
+
else code.splice(i, 1), o = c, oi = i - 1;
|
|
511
512
|
var n = o.next;
|
|
512
513
|
var t = null;
|
|
513
514
|
if (n && n.type === EXPRESS) {
|
|
@@ -522,7 +523,6 @@ var removeImport = function (c, i, code) {
|
|
|
522
523
|
n = n.next;
|
|
523
524
|
}
|
|
524
525
|
if (!n || n.type !== QUOTED) throw new Error("缺少导入路径!");
|
|
525
|
-
var oi = code.indexOf(o, i);
|
|
526
526
|
var ns = skipAssignment(n);
|
|
527
527
|
var nsi = ns ? code.indexOf(ns, i) : code.length;
|
|
528
528
|
var q = scan(`require()`);
|
|
@@ -9,3 +9,5 @@ testFix(`import {a} from "a";console.log(a)`, 'var a1 = require("a"); console.lo
|
|
|
9
9
|
testFix(`console.log(import("a"))`, 'console.log(require("a"))');
|
|
10
10
|
testFix(`import("a")`, 'require("a")');
|
|
11
11
|
testFix(`import "windows.inc"`, 'require("windows.inc")');
|
|
12
|
+
testFix(`import "windows.inc";import "abc.inc";`, 'require("windows.inc"); require("abc.inc");');
|
|
13
|
+
testFix(`import "windows.inc";\r\nimport "abc.inc";`, 'require("windows.inc");\r\nrequire("abc.inc");');
|
package/docs/main.xht
CHANGED
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
menu {
|
|
46
|
+
margin: 0;
|
|
46
47
|
width: var(--leftwidth);
|
|
47
48
|
margin-left: -var(--leftwidth);
|
|
48
49
|
height: 100%;
|
|
@@ -51,6 +52,20 @@
|
|
|
51
52
|
max-width: 600px;
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
titlebar {
|
|
56
|
+
background: #2c2c2c;
|
|
57
|
+
-webkit-app-region: drag;
|
|
58
|
+
|
|
59
|
+
>.drop {
|
|
60
|
+
-webkit-app-region: no-drag;
|
|
61
|
+
vertical-align: top;
|
|
62
|
+
right: 20px;
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
padding: 0 7px;
|
|
65
|
+
line-height: 44px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
54
69
|
div1 {
|
|
55
70
|
display: inline-block;
|
|
56
71
|
width: 100%;
|
|
@@ -204,6 +219,20 @@
|
|
|
204
219
|
};
|
|
205
220
|
var page = document.createElement('grid');
|
|
206
221
|
page.innerHTML = template;
|
|
222
|
+
if (window.require) {
|
|
223
|
+
var title = document.createElement('titlebar');
|
|
224
|
+
title.innerHTML = document.title;
|
|
225
|
+
css(page, { paddingTop: "44px" })
|
|
226
|
+
css(title, { height: '44px', lineHeight: '44px' });
|
|
227
|
+
page.insertBefore(title, page.firstChild);
|
|
228
|
+
var close = drop();
|
|
229
|
+
title.appendChild(close);
|
|
230
|
+
onclick(close, function () {
|
|
231
|
+
window.close();
|
|
232
|
+
})
|
|
233
|
+
titlebar(title, false);
|
|
234
|
+
drag.on(close, window);
|
|
235
|
+
}
|
|
207
236
|
render(page, scope);
|
|
208
237
|
var s = scrollbar();
|
|
209
238
|
on("mounted")(page, initMenus);
|