mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
Update app.hta, app/index.js, app/signin.html, app/test.html
This commit is contained in:
parent
c3e9d1b179
commit
0f4dfcef20
4
app.hta
4
app.hta
|
@ -26,7 +26,7 @@
|
|||
-->
|
||||
<hta:application
|
||||
ID="WELSONJS_WINDOW"
|
||||
Version="0.1.5"
|
||||
Version="0.2.7.2"
|
||||
ApplicationName="WelsonJS"
|
||||
Border="None"
|
||||
BorderStyle="Static"
|
||||
|
@ -49,7 +49,7 @@
|
|||
<title>Welcome to WelsonJS application</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9" />
|
||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
|
||||
<meta name="description" content="WelsonJS: Build a Windows desktop apps with JavaScript, HTML, and CSS based on WSH/HTA" />
|
||||
<meta name="description" content="WelsonJS, Build a Windows app on the Windows built-in JavaScript engine" />
|
||||
<meta name="keywords" content="webapp" />
|
||||
<meta name="author" content="abuse@catswords.net" />
|
||||
<meta name="generator" content="welsonjs" />
|
||||
|
|
57
app/index.js
57
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
|
||||
|
|
|
@ -69,5 +69,22 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="cell panel">
|
||||
<div class="header">
|
||||
Manufacturer
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="col">
|
||||
<div class="cell menu">
|
||||
<ul class="left nav links">
|
||||
<li><a href="#" onclick="javascript:Router.go('/test')">Go to the test page</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
32
app/test.html
Normal file
32
app/test.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<div class="cell">
|
||||
<div class="col width-fill">
|
||||
<div class="col">
|
||||
<div class="panel cell">
|
||||
<div class="header">기능 테스트 목록</div>
|
||||
{{for data.tests}}
|
||||
<div class="body">
|
||||
<div class="cell">
|
||||
<div class="col">
|
||||
<div class="col width-fit mobile-width-fit"><span class="icon icon-bookmark color-blue"></span></div>
|
||||
<div class="col width-fill mobile-width-fill" style="position: relative">
|
||||
<span class="float-right" style="position: absolute; top: 0; right: 0;">
|
||||
<button class="button" type="button">시험</button>
|
||||
</span>
|
||||
<div class="col width-fill mobile-width-fill">
|
||||
<a class="fatty" href="#">{{:tags[0]}}</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
{{:description}}
|
||||
</div>
|
||||
<div class="col">
|
||||
{{for tags}}<span class="icon icon-tag"></span> {{:}}{{/for}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/for}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user