mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] owl: update to v1.0.0-alpha4
This commit is contained in:
+25
-11
@@ -120,20 +120,34 @@ async function makeApp(js, css, xml) {
|
|||||||
.join("\n");
|
.join("\n");
|
||||||
|
|
||||||
const JS = `
|
const JS = `
|
||||||
async function loadTemplates() {
|
/**
|
||||||
try {
|
* This is the javascript code defined in the playground.
|
||||||
return owl.utils.loadFile('app.xml');
|
* In a larger application, this code should probably be moved in different
|
||||||
} catch(e) {
|
* sub files.
|
||||||
console.error(\`This app requires a static server. If you have python installed, try 'python app.py'\`);
|
*/
|
||||||
}
|
function app() {
|
||||||
}
|
|
||||||
|
|
||||||
function start([TEMPLATES]) {
|
|
||||||
// Application code
|
|
||||||
${processedJS}
|
${processedJS}
|
||||||
}
|
}
|
||||||
|
|
||||||
Promise.all([loadTemplates(), owl.utils.whenReady()]).then(start);
|
/**
|
||||||
|
* Initialization code
|
||||||
|
* This code load templates, and make sure everything is properly connected.
|
||||||
|
*/
|
||||||
|
async function start() {
|
||||||
|
let templates;
|
||||||
|
try {
|
||||||
|
templates = await owl.utils.loadFile('app.xml');
|
||||||
|
} catch(e) {
|
||||||
|
console.error(\`This app requires a static server. If you have python installed, try 'python app.py'\`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const env = { qweb: new owl.QWeb({templates})};
|
||||||
|
owl.Component.env = env;
|
||||||
|
await owl.utils.whenReady();
|
||||||
|
app();
|
||||||
|
}
|
||||||
|
|
||||||
|
start();
|
||||||
`;
|
`;
|
||||||
|
|
||||||
zip.file("app.js", JS);
|
zip.file("app.js", JS);
|
||||||
|
|||||||
Reference in New Issue
Block a user