diff --git a/index.html b/index.html index 1461a72c..42a7891a 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@
diff --git a/playground/libs/FileSaver.min.js b/libs/FileSaver.min.js similarity index 100% rename from playground/libs/FileSaver.min.js rename to libs/FileSaver.min.js diff --git a/playground/libs/ace.js b/libs/ace.js similarity index 100% rename from playground/libs/ace.js rename to libs/ace.js diff --git a/playground/libs/jszip.min.js b/libs/jszip.min.js similarity index 100% rename from playground/libs/jszip.min.js rename to libs/jszip.min.js diff --git a/playground/libs/mode-css.js b/libs/mode-css.js similarity index 100% rename from playground/libs/mode-css.js rename to libs/mode-css.js diff --git a/playground/libs/mode-javascript.js b/libs/mode-javascript.js similarity index 100% rename from playground/libs/mode-javascript.js rename to libs/mode-javascript.js diff --git a/playground/libs/mode-xml.js b/libs/mode-xml.js similarity index 100% rename from playground/libs/mode-xml.js rename to libs/mode-xml.js diff --git a/playground/libs/owl.js b/libs/owl.js similarity index 100% rename from playground/libs/owl.js rename to libs/owl.js diff --git a/playground/libs/theme-monokai.js b/libs/theme-monokai.js similarity index 100% rename from playground/libs/theme-monokai.js rename to libs/theme-monokai.js diff --git a/playground/libs/worker-javascript.js b/libs/worker-javascript.js similarity index 100% rename from playground/libs/worker-javascript.js rename to libs/worker-javascript.js diff --git a/package.json b/package.json index d22e01b6..02ad6ca1 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,6 @@ "name": "owl-playground", "description": "Odoo Web Library", "scripts": { - "start": "python -m SimpleHTTPServer 8001" + "start": "python server.py" } } diff --git a/playground/src/app.js b/playground/app.js similarity index 96% rename from playground/src/app.js rename to playground/app.js index 5243fd9f..7b9d1f63 100644 --- a/playground/src/app.js +++ b/playground/app.js @@ -6,7 +6,7 @@ async function owlSourceCode() { if (owlJS) { return owlJS; } - const result = await fetch("/playground/libs/owl.js"); + const result = await fetch("/libs/owl.js"); owlJS = await result.text(); return owlJS; } @@ -196,7 +196,7 @@ class App extends owl.Component { // inject js const owlScript = doc.createElement("script"); owlScript.type = "text/javascript"; - owlScript.src = "libs/owl.js"; + owlScript.src = "/libs/owl.js"; owlScript.addEventListener("load", () => { const script = doc.createElement("script"); script.type = "text/javascript"; @@ -278,8 +278,8 @@ class App extends owl.Component { } async downloadCode() { - await owl.utils.loadJS("libs/FileSaver.min.js"); - await owl.utils.loadJS("libs/jszip.min.js"); + await owl.utils.loadJS("/libs/FileSaver.min.js"); + await owl.utils.loadJS("/libs/jszip.min.js"); const zip = new JSZip(); @@ -317,7 +317,7 @@ owl.utils.whenReady(startApp);`; //------------------------------------------------------------------------------ document.title = `${document.title} (v${owl._version})`; document.addEventListener("DOMContentLoaded", async function() { - const templates = await owl.utils.loadTemplates("src/templates.xml"); + const templates = await owl.utils.loadTemplates("templates.xml"); const qweb = new owl.QWeb(templates); const env = { qweb }; const app = new App(env); diff --git a/playground/index.html b/playground/index.html index e310cf04..b4b33421 100644 --- a/playground/index.html +++ b/playground/index.html @@ -5,12 +5,12 @@