From 0f4dfcef20d598fa5ab2fb47974b600a8c8a2461 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Mon, 30 Oct 2023 16:58:29 +0900 Subject: [PATCH] Update app.hta, app/index.js, app/signin.html, app/test.html --- app.hta | 4 ++-- app/index.js | 57 ++++++++++++++++++++++++------------------------- app/signin.html | 17 +++++++++++++++ app/test.html | 32 +++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 31 deletions(-) create mode 100644 app/test.html diff --git a/app.hta b/app.hta index c905194..1705f60 100644 --- a/app.hta +++ b/app.hta @@ -26,7 +26,7 @@ --> Welcome to WelsonJS application - + diff --git a/app/index.js b/app/index.js index 59bd026..e0da2f8 100644 --- a/app/index.js +++ b/app/index.js @@ -7,47 +7,46 @@ var Router = require("lib/router").Router; // using jsrender Router.setRender(function(filename, data) { - var template = OldBrowser.setContent(FILE.readFile(filename, FILE.CdoCharset.CdoUTF_8)); - var tmpl = $.templates(template); - return tmpl.render(data); + var template = FILE.readFile(filename, FILE.CdoCharset.CdoUTF_8); + var tmpl = $.templates(template); + OldBrowser.setContent(tmpl.render(data)); }); // main Router.add('/', function(render) { - render("app\\signin.html", {}); + render("app\\signin.html", {}); - var token; - if (FILE.fileExists("token.txt")) { - token = FILE.readFile("token.txt", FILE.CdoCharset.CdoUTF_8); - } + var token; + if (FILE.fileExists("token.txt")) { + token = FILE.readFile("token.txt", FILE.CdoCharset.CdoUTF_8); + } - document.getElementById("loginform").onsubmit = function(ev) { - ev.preventDefault(); - }; + document.getElementById("loginform").onsubmit = function(ev) { + ev.preventDefault(); + }; - if (FILE.fileExists("credential.json")) { - var credential = JSON.parse(FILE.readFile("credential.json", FILE.CdoCharset.CdoUTF_8)); - document.getElementById("txt_email").value = credential.email; - document.getElementById("txt_password").value = credential.password; - } + if (FILE.fileExists("credential.json")) { + var credential = JSON.parse(FILE.readFile("credential.json", FILE.CdoCharset.CdoUTF_8)); + document.getElementById("txt_email").value = credential.email; + document.getElementById("txt_password").value = credential.password; + } - document.getElementById("btn_submit").onclick = function() { - var credential = { - "email": document.getElementById("txt_email").value, - "password": document.getElementById("txt_password").value - }; - - FILE.writeFile("credential.json", JSON.stringify(credential), FILE.CdoCharset.CdoUTF_8); - }; + document.getElementById("btn_submit").onclick = function() { + var credential = { + "email": document.getElementById("txt_email").value, + "password": document.getElementById("txt_password").value + }; + + FILE.writeFile("credential.json", JSON.stringify(credential), FILE.CdoCharset.CdoUTF_8); + }; }); // test Router.add('/test', function(render) { - var profile = JSON.parse(FILE.readFile("data/test-oss-20231030.json", FILE.CdoCharset.CdoUTF_8)); - - render("app\\test.html", { - "profile": profile - }); + var data = JSON.parse(FILE.readFile("data/test-oss-20231030.json", FILE.CdoCharset.CdoUTF_8)); + render("app\\test.html", { + "data": data + }); }); // go diff --git a/app/signin.html b/app/signin.html index dbf3e9c..29438a9 100644 --- a/app/signin.html +++ b/app/signin.html @@ -69,5 +69,22 @@ + +
+
+
+ Manufacturer +
+
+
+ +
+
+
+
diff --git a/app/test.html b/app/test.html new file mode 100644 index 0000000..2052580 --- /dev/null +++ b/app/test.html @@ -0,0 +1,32 @@ +
+
+
+
+
기능 테스트 목록
+ {{for data.tests}} +
+
+
+
+
+ + + + +
+ {{:description}} +
+
+ {{for tags}} {{:}}{{/for}} +
+
+
+
+
+ {{/for}} +
+
+
+