efront 4.7.2 → 4.8.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/#/345/233/275/351/231/205/345/214/226.yml +30 -0
- package/apps/pivot/api.yml +1 -1
- package/apps/pivot/cert/main.xht +1 -1
- package/apps/pivot/cert/orders.xht +15 -2
- package/apps/pivot/main.js +1 -0
- package/apps/pivot/wow/root.js +8 -32
- package/coms/basic/Timer.js +15 -0
- package/coms/compile/Html.js +23 -6
- package/coms/compile/Html_test.js +7 -1
- package/coms/compile/Javascript.js +48 -30
- package/coms/compile/Program.js +28 -5
- package/coms/compile/audit.js +106 -4
- package/coms/compile/audit_test.js +8 -1
- package/coms/compile/autoenum.js +15 -0
- package/coms/compile/common.js +134 -19
- package/coms/compile/downLevel.js +11 -3
- package/coms/compile/downLevel_test.js +9 -1
- package/coms/compile/prefunc.js +38 -0
- package/coms/compile/translate.js +2 -2
- package/coms/compile/unstruct.js +1 -33
- package/coms/compile/unstruct_test.js +8 -8
- package/coms/pivot/acme2.js +5 -1
- package/coms/pivot/plist.js +3 -3
- package/coms/zimoli/alert.js +3 -0
- package/coms/zimoli/loading.html +1 -1
- package/coms/zimoli/remove.js +1 -0
- package/coms/zimoli/zimoli.js +1 -4
- package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +19 -9
- package/docs//347/273/204/344/273/266.xht +38 -12
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/readme-en.md +2 -0
- package/readme.md +2 -0
- package/apps/pivot/wow/root.less +0 -2
|
@@ -195,21 +195,48 @@
|
|
|
195
195
|
});
|
|
196
196
|
var loadcode = async function () {
|
|
197
197
|
jschanged = false;
|
|
198
|
-
var modName = name.replace(/\.js
|
|
198
|
+
var modName = name.replace(/\.js$/i, '_test');
|
|
199
199
|
if (doc.test) {
|
|
200
|
-
var
|
|
201
|
-
|
|
200
|
+
var jstext = [], lessdata = [], htmldata = [];
|
|
201
|
+
for (var f of doc.test) {
|
|
202
|
+
var xhr = await cross("get", "/components:" + name.replace(/[^\\\/]+$/, '') + f);
|
|
203
|
+
if (/\.js$/i.test(f)) {
|
|
204
|
+
jstext.push(xhr.response);
|
|
205
|
+
}
|
|
206
|
+
else if (/\.less$/i.test(f)) {
|
|
207
|
+
lessdata.push(xhr.response);
|
|
208
|
+
}
|
|
209
|
+
else if (/\.html$/i.test(f)) {
|
|
210
|
+
htmldata.push(xhr.response);
|
|
211
|
+
}
|
|
212
|
+
else if (/\.xht$/i.test(f)) {
|
|
213
|
+
alert(i18n`这个文件内的测试代码暂不支持`, 'error');
|
|
214
|
+
break;
|
|
215
|
+
htmldata.push(xhr.response
|
|
216
|
+
.replace(/\<script\>([\s\S]*?)\<\/script\>/ig, function (_, s) {
|
|
217
|
+
jstext.push(s);
|
|
218
|
+
return '';
|
|
219
|
+
})
|
|
220
|
+
.replace(/\<style\>([\s\S]*?)\<\/style\>/ig, function (_, s) {
|
|
221
|
+
lessdata.push(s);
|
|
222
|
+
return '';
|
|
223
|
+
}));
|
|
224
|
+
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
jstext = jstext.join("\r\n");
|
|
228
|
+
lessdata = lessdata.join("\r\n");
|
|
229
|
+
htmldata = htmldata.join("\r\n");
|
|
202
230
|
var code = compile$scanner2(jstext);
|
|
203
231
|
var envs = code.envs;
|
|
204
232
|
var vars = code.vars;
|
|
205
233
|
var commName = modName.replace(/^[\s\S]*\//, '');
|
|
206
|
-
var lessName = commName + ".less",
|
|
234
|
+
var lessName = commName + ".less", lessdata;
|
|
207
235
|
var cssWrap = `css-` + +new Date;
|
|
208
|
-
if (
|
|
209
|
-
|
|
210
|
-
lessData = compile$素馨(lessData.responseText, "." + cssWrap);
|
|
236
|
+
if (lessdata) {
|
|
237
|
+
lessdata = compile$素馨(lessdata, "." + cssWrap);
|
|
211
238
|
if (code.isExpressQueue()) {
|
|
212
|
-
jstext = `return cless(${jstext},\`${
|
|
239
|
+
jstext = `return cless(${jstext},\`${lessdata}\`,"${cssWrap}")`;
|
|
213
240
|
}
|
|
214
241
|
else {
|
|
215
242
|
var entryName;
|
|
@@ -217,7 +244,7 @@
|
|
|
217
244
|
else if (vars.Main) entryName = 'Main';
|
|
218
245
|
else if (vars.MAIN) entryName = "MAIN";
|
|
219
246
|
else if (vars[commName]) entryName = commName;
|
|
220
|
-
if (entryName) jstext += `\r\nreturn cless(${entryName},\`${
|
|
247
|
+
if (entryName) jstext += `\r\nreturn cless(${entryName},\`${lessdata}\`,"${cssWrap}")`;
|
|
221
248
|
}
|
|
222
249
|
}
|
|
223
250
|
else {
|
|
@@ -229,10 +256,9 @@
|
|
|
229
256
|
}
|
|
230
257
|
var templateName = commName;
|
|
231
258
|
if (envs.template) templateName = 'template';
|
|
232
|
-
if (
|
|
259
|
+
if (htmldata) {
|
|
233
260
|
delete envs[templateName];
|
|
234
|
-
|
|
235
|
-
jstext = `var ${templateName}={toString(){return \`${template.responseText.replace(/>\s+</g, '><')}\`}};\r\n` + jstext;
|
|
261
|
+
jstext = `var ${templateName}={toString(){return \`${htmldata.replace(/>\s+</g, '><')}\`}};\r\n` + jstext;
|
|
236
262
|
}
|
|
237
263
|
initcode(jstext);
|
|
238
264
|
}
|