diff --git a/.gitignore b/.gitignore index c0126c3..430d612 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode main +pdwebconfig.toml diff --git a/Makefile b/Makefile index 5969fc9..6fe5919 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,14 @@ run: ts go run main.go +runboth: ts + cd ../pixeldrain-server-launcher && go run main.go build: ts go build main.go -o pixeldrain-web +deps: + npm install -g typescript + ts: tsc --strict res/static/res/typescript/lib/*.ts --outFile res/static/res/script/pixellib.js tsc --strict res/static/res/typescript/home/*.ts \ diff --git a/res/static/res/script/home.js b/res/static/res/script/home.js index 3880cf7..31b5cae 100644 --- a/res/static/res/script/home.js +++ b/res/static/res/script/home.js @@ -1,20 +1,23 @@ "use strict"; +var uploader = null; /* * Form upload handlers */ $("#selectFileButton").click(function (event) { $("#fileInputField").click(); }); -$("#fileInputField").change(function () { - alert(typeof ($("#fileInputField")[0])); - //pushUploads($("#fileInputField")[0].files); +function fileInputChange(dom, files) { + if (uploader === null) { + uploader = new UploadManager(); + } + uploader.uploadFileList(files); // This resets the file input field // http://stackoverflow.com/questions/1043957/clearing-input-type-file-using-jquery $('#fileName').html(""); $("#fileUploadButton").css("visibility", "hidden"); - //$("#fileInputField").wrap("