This commit is contained in:
Namhyeon Go 2020-06-29 00:12:12 +09:00
parent d7bdf7bb89
commit 633304378a
8 changed files with 185 additions and 91 deletions

12
app.hta
View File

@ -1,3 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--
@ -38,18 +40,14 @@
/>
<title>Application Title</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<style type="text/css">
body {
font-size: 11pt;
font-family: "Segoe UI", Calibri, Arial, Sans-Serif;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="app/assets/css/style.css" />
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript">
window.resizeTo(400, 300);
window.resizeTo(800, 600);
init_window("webloader");
</script>
</body>

View File

@ -1 +1,15 @@
<h1>It works!</h1>
<div id="aside">
<div class="searchbox">
<input id="keyword" class="text" type="text" placeholder="위치 찾아보기..."/>
</div>
<div class="serverbox">
<ul>
</ul>
</div>
</div>
<div id="content">
</div>

88
app/assets/css/style.css Normal file
View File

@ -0,0 +1,88 @@
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
html, body {
width: 100%;
height: 100%;
font-size: 1em;
font-family: "맑은 고딕",, "Malgun Gothic", "Segoe UI", Calibri, Arial, Sans-Serif;
}
input.text {
font-family: "맑은 고딕",, "Malgun Gothic", "Segoe UI", Calibri, Arial, Sans-Serif;
}
#app {
width: 100%;
height: 100%;
overflow: hidden;
background: url(../img/bg.png) repeat-x;
}
#aside {
float: left;
width: 30%;
height: 100%;
background-color: #333333;
}
#aside .searchbox {
position: relative;
height: 35px;
background: #1d1d1d url(../img/search-3-16.png) no-repeat 10px 10px;
}
#aside .searchbox input.text {
left: 32px;
position: absolute;
height: 100%;
background: none;
border: none;
color: #505050;
}
#content {
float: right;
width: 70%;
}

BIN
app/assets/img/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

View File

@ -1,18 +0,0 @@
/*
* index.js
*/
var LIB = require('lib/std');
//var DB = require('lib/db');
return {
main: function() {
console.log("welcome index.js");
document.getElementById("click1").onclick = function() {
alert("hello world");
};
return 0;
}
}

View File

@ -6,14 +6,16 @@
// a global console.log function.
//
/////////////////////////////////////////////////////////////////////////////////
var LIB = require('lib/std');
/////////////////////////////////////////////////////////////////////////////////
// Private APIs / Utility functions
/////////////////////////////////////////////////////////////////////////////////
var module = { global: global, require: global.require };
var module = {
global: global,
require: global.require
};
module.VERSIONINFO = "File Lib (file-libs.js) version 0.1";
/////////////////////////////////////////////////////////////////////////////////
@ -21,10 +23,10 @@ module.VERSIONINFO = "File Lib (file-libs.js) version 0.1";
/////////////////////////////////////////////////////////////////////////////////
module.fileExists = function(FN) {
var FSO = CreateObject("Scripting.FileSystemObject");
var exists = FSO.FileExists(FN);
FSO = null;
return exists;
var FSO = CreateObject("Scripting.FileSystemObject");
var exists = FSO.FileExists(FN);
FSO = null;
return exists;
};
/////////////////////////////////////////////////////////////////////////////////
@ -32,10 +34,10 @@ module.fileExists = function(FN) {
/////////////////////////////////////////////////////////////////////////////////
module.folderExists = function(FN) {
var FSO = CreateObject("Scripting.FileSystemObject");
var exists = FSO.FolderExists(FN);
FSO = null;
return exists;
var FSO = CreateObject("Scripting.FileSystemObject");
var exists = FSO.FolderExists(FN);
FSO = null;
return exists;
};
/////////////////////////////////////////////////////////////////////////////////
@ -43,10 +45,10 @@ module.folderExists = function(FN) {
/////////////////////////////////////////////////////////////////////////////////
module.fileGet = function(FN) {
var FSO = CreateObject("Scripting.FileSystemObject");
var file = FSO.GetFile(FN);
FSO = null;
return file;
var FSO = CreateObject("Scripting.FileSystemObject");
var file = FSO.GetFile(FN);
FSO = null;
return file;
};
/////////////////////////////////////////////////////////////////////////////////
@ -54,20 +56,30 @@ module.fileGet = function(FN) {
// Read the conents of the pass filename and return as a string
/////////////////////////////////////////////////////////////////////////////////
module.readFile = function(FN) {
var FSO = CreateObject("Scripting.FileSystemObject");
var T = null;
try {
var TS = FSO.OpenTextFile(FN,1);
if (TS.AtEndOfStream) return "";
T = TS.ReadAll();
TS.Close();
TS = null;
} catch(e) {
console.log("ERROR! " + e.number + ", " + e.description + ", FN=" + FN);
}
FSO = null;
return T;
module.readFile = function(FN, charset) {
if(typeof(charset) === "undefined") {
var FSO = CreateObject("Scripting.FileSystemObject");
var T = null;
try {
var TS = FSO.OpenTextFile(FN, 1);
if (TS.AtEndOfStream) return "";
T = TS.ReadAll();
TS.Close();
TS = null;
} catch (e) {
console.log("ERROR! " + e.number + ", " + e.description + ", FN=" + FN);
}
FSO = null;
return T;
} else {
var fsT = CreateObject("ADODB.Stream");
fsT.CharSet = charset;
fsT.Open();
fsT.LoadFromFile(FN);
T = fsT.ReadText();
fsT = null;
return T;
}
};
/////////////////////////////////////////////////////////////////////////////////
@ -76,35 +88,35 @@ module.readFile = function(FN) {
/////////////////////////////////////////////////////////////////////////////////
module.writeFile = function(FN, content, charset) {
var ok;
if (charset) {
console.log("WRITE TO DISK USING ADODB.Stream CHARSET " + charset);
try {
var fsT = CreateObject("ADODB.Stream");
fsT.Type = 2; // save as text/string data.
fsT.Charset = charset; // Specify charset For the source text data.
fsT.Open();
fsT.WriteText(content);
fsT.SaveToFile(FN, 2); // save as binary to disk
ok = true;
} catch(e) {
console.log("ADODB.Stream: ERROR! " + e.number + ", " + e.description + ", FN=" + FN);
var ok;
if (charset) {
console.log("WRITE TO DISK USING ADODB.Stream CHARSET " + charset);
try {
var fsT = CreateObject("ADODB.Stream");
fsT.Type = 2; // save as text/string data.
fsT.Charset = charset; // Specify charset For the source text data.
fsT.Open();
fsT.WriteText(content);
fsT.SaveToFile(FN, 2); // save as binary to disk
ok = true;
} catch (e) {
console.log("ADODB.Stream: ERROR! " + e.number + ", " + e.description + ", FN=" + FN);
}
} else {
console.log("WRITE TO DISK USING OpenTextFile CHARSET ascii");
var FSO = CreateObject("Scripting.FileSystemObject");
try {
var TS = FSO.OpenTextFile(FN, 2, true, 0); // ascii
TS.Write(content);
TS.Close();
TS = null;
ok = true;
} catch (e) {
console.log("OpenTextFile: ERROR! " + e.number + ", " + e.description + ", FN=" + FN);
}
FSO = null;
}
} else {
console.log("WRITE TO DISK USING OpenTextFile CHARSET ascii");
var FSO = CreateObject("Scripting.FileSystemObject");
try {
var TS = FSO.OpenTextFile(FN,2,true,0); // ascii
TS.Write(content);
TS.Close();
TS = null;
ok = true;
} catch(e) {
console.log("OpenTextFile: ERROR! " + e.number + ", " + e.description + ", FN=" + FN);
}
FSO = null;
}
return ok;
return ok;
};
/////////////////////////////////////////////////////////////////////////////////
@ -112,10 +124,10 @@ module.writeFile = function(FN, content, charset) {
/////////////////////////////////////////////////////////////////////////////////
module.moveFile = function(FROM, TO) {
var FSO = CreateObject("Scripting.FileSystemObject");
var res = FSO.MoveFile(FROM, TO);
FSO = null;
return res;
var FSO = CreateObject("Scripting.FileSystemObject");
var res = FSO.MoveFile(FROM, TO);
FSO = null;
return res;
};
/////////////////////////////////////////////////////////////////////////////////
@ -123,10 +135,10 @@ module.moveFile = function(FROM, TO) {
/////////////////////////////////////////////////////////////////////////////////
module.createFolder = function(FN) {
var FSO = CreateObject("Scripting.FileSystemObject");
var res = FSO.CreateFolder(FN);
FSO = null;
return res;
var FSO = CreateObject("Scripting.FileSystemObject");
var res = FSO.CreateFolder(FN);
FSO = null;
return res;
};
/////////////////////////////////////////////////////////////////////////////////

View File

@ -6,7 +6,7 @@ var FILE = require('lib/file');
return {
main: function() {
var contents = FILE.readFile("app\\app.html");
var contents = FILE.readFile("app\\app.html", "utf-8");
document.getElementById("app").innerHTML = contents;
return 0;
}