DodoApp: Cache static resources.
Change-Id: Ib1f800ea052c5f3b7929a1d325b351dfa0a6633e
diff --git a/core/installer/welcome/stat/dodo-app.js b/core/installer/welcome/stat/dodo-app.js
new file mode 100644
index 0000000..ccb5252
--- /dev/null
+++ b/core/installer/welcome/stat/dodo-app.js
@@ -0,0 +1,20 @@
+function triggerForm(status, buttonTxt) {
+ const form = document.getElementById("create-app");
+ const elements = form.querySelectorAll("input, select, textarea, button");
+ const button = document.getElementById("create-app-button");
+ button.textContent = buttonTxt;
+ button.setAttribute("aria-busy", status);
+ elements.forEach(element => {
+ element.disabled = status;
+ });
+}
+
+document.addEventListener("DOMContentLoaded", () => {
+ const form = document.getElementById("create-app");
+ form.addEventListener("submit", (event) => {
+ setTimeout(() => {
+ triggerForm(true, "creating app ...");
+ }, 0);
+ });
+ triggerForm(false, "create app");
+});