diff --git a/app.hta b/app.hta index 14f15d2..9d1c5da 100644 --- a/app.hta +++ b/app.hta @@ -46,11 +46,11 @@ -

Hello world!

+
diff --git a/app/app.html b/app/app.html new file mode 100644 index 0000000..dd60957 --- /dev/null +++ b/app/app.html @@ -0,0 +1 @@ +

It works!

diff --git a/lib/file.js b/lib/file.js index e240d01..50e6b65 100644 --- a/lib/file.js +++ b/lib/file.js @@ -3,7 +3,7 @@ // file-lib.js // // Common routines. Defines LIB object which contains the API, as well as -// a global DBG function. +// a global console.log function. // ///////////////////////////////////////////////////////////////////////////////// @@ -21,7 +21,7 @@ module.VERSIONINFO = "File Lib (file-libs.js) version 0.1"; ///////////////////////////////////////////////////////////////////////////////// module.fileExists = function(FN) { - var FSO = module.CreateObject("Scripting.FileSystemObject"); + var FSO = CreateObject("Scripting.FileSystemObject"); var exists = FSO.FileExists(FN); FSO = null; return exists; @@ -32,7 +32,7 @@ module.fileExists = function(FN) { ///////////////////////////////////////////////////////////////////////////////// module.folderExists = function(FN) { - var FSO = module.CreateObject("Scripting.FileSystemObject"); + var FSO = CreateObject("Scripting.FileSystemObject"); var exists = FSO.FolderExists(FN); FSO = null; return exists; @@ -43,7 +43,7 @@ module.folderExists = function(FN) { ///////////////////////////////////////////////////////////////////////////////// module.fileGet = function(FN) { - var FSO = module.CreateObject("Scripting.FileSystemObject"); + var FSO = CreateObject("Scripting.FileSystemObject"); var file = FSO.GetFile(FN); FSO = null; return file; @@ -55,7 +55,7 @@ module.fileGet = function(FN) { ///////////////////////////////////////////////////////////////////////////////// module.readFile = function(FN) { - var FSO = module.CreateObject("Scripting.FileSystemObject"); + var FSO = CreateObject("Scripting.FileSystemObject"); var T = null; try { var TS = FSO.OpenTextFile(FN,1); @@ -64,7 +64,7 @@ module.readFile = function(FN) { TS.Close(); TS = null; } catch(e) { - DBG("ERROR! " + e.number + ", " + e.description + ", FN=" + FN); + console.log("ERROR! " + e.number + ", " + e.description + ", FN=" + FN); } FSO = null; return T; @@ -78,9 +78,9 @@ module.readFile = function(FN) { module.writeFile = function(FN, content, charset) { var ok; if (charset) { - DBG("WRITE TO DISK USING ADODB.Stream CHARSET " + charset); + console.log("WRITE TO DISK USING ADODB.Stream CHARSET " + charset); try { - var fsT = module.CreateObject("ADODB.Stream"); + 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(); @@ -88,11 +88,11 @@ module.writeFile = function(FN, content, charset) { fsT.SaveToFile(FN, 2); // save as binary to disk ok = true; } catch(e) { - DBG("ADODB.Stream: ERROR! " + e.number + ", " + e.description + ", FN=" + FN); + console.log("ADODB.Stream: ERROR! " + e.number + ", " + e.description + ", FN=" + FN); } } else { - DBG("WRITE TO DISK USING OpenTextFile CHARSET ascii"); - var FSO = module.CreateObject("Scripting.FileSystemObject"); + 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); @@ -100,7 +100,7 @@ module.writeFile = function(FN, content, charset) { TS = null; ok = true; } catch(e) { - DBG("OpenTextFile: ERROR! " + e.number + ", " + e.description + ", FN=" + FN); + console.log("OpenTextFile: ERROR! " + e.number + ", " + e.description + ", FN=" + FN); } FSO = null; } @@ -112,7 +112,7 @@ module.writeFile = function(FN, content, charset) { ///////////////////////////////////////////////////////////////////////////////// module.moveFile = function(FROM, TO) { - var FSO = module.CreateObject("Scripting.FileSystemObject"); + var FSO = CreateObject("Scripting.FileSystemObject"); var res = FSO.MoveFile(FROM, TO); FSO = null; return res; @@ -123,7 +123,7 @@ module.moveFile = function(FROM, TO) { ///////////////////////////////////////////////////////////////////////////////// module.createFolder = function(FN) { - var FSO = module.CreateObject("Scripting.FileSystemObject"); + var FSO = CreateObject("Scripting.FileSystemObject"); var res = FSO.CreateFolder(FN); FSO = null; return res; diff --git a/webloader.js b/webloader.js new file mode 100644 index 0000000..ea4cf09 --- /dev/null +++ b/webloader.js @@ -0,0 +1,13 @@ +/* + * webloader.js + */ + +var FILE = require('lib/file'); + +return { + main: function() { + var contents = FILE.readFile("app\\app.html"); + document.getElementById("app").innerHTML = contents; + return 0; + } +}