From d1e0f2a907d78e3b69c8f3a49c0a374c1ee5836f Mon Sep 17 00:00:00 2001 From: Christopher Rose Date: Thu, 23 May 2019 20:23:32 +0530 Subject: [PATCH] General updates --- package-lock.json | 75 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 6 ++-- static/base.js | 19 +++++++----- static/index.html | 4 +-- test.js | 1 + 5 files changed, 94 insertions(+), 11 deletions(-) create mode 100644 test.js diff --git a/package-lock.json b/package-lock.json index 915720f..06b6e3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,11 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, + "axo": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/axo/-/axo-0.0.2.tgz", + "integrity": "sha1-STVfu+qzhEm8ppahqsxGml7p/Uc=" + }, "body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -101,6 +106,11 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, + "eventemitter3": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", + "integrity": "sha1-teEHm1n7XhuidxwKmTvgYKWMmbo=" + }, "express": { "version": "4.17.0", "resolved": "https://registry.npmjs.org/express/-/express-4.17.0.tgz", @@ -138,6 +148,16 @@ "vary": "~1.1.2" } }, + "extendible": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/extendible/-/extendible-0.1.1.tgz", + "integrity": "sha1-4qN+2HEp+0+VM+io11BiMKU5yQU=" + }, + "failure": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/failure/-/failure-1.1.1.tgz", + "integrity": "sha1-qOg9OxYC0kaL/2rU2QceAQO4Goc=" + }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -162,6 +182,11 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, + "hang": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hang/-/hang-1.0.0.tgz", + "integrity": "sha1-ZwUIeYRENeAq4ECcT0VTxkOOHXE=" + }, "http-errors": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", @@ -197,6 +222,17 @@ "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" }, + "loads": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/loads/-/loads-0.0.4.tgz", + "integrity": "sha1-l/MBY5fnDd/0gLgexjjO6iKgqZw=", + "requires": { + "failure": "1.1.x", + "one-time": "0.0.x", + "xhr-response": "1.0.x", + "xhr-status": "1.0.x" + } + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -240,6 +276,11 @@ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" }, + "node-http-xhr": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/node-http-xhr/-/node-http-xhr-1.3.4.tgz", + "integrity": "sha512-0bA08/2RKWxw6pMkOVd3KP+0F5+ifQLMMTDxrCgxlgkoU1N8DhCbCSAYEqpgaVYM2smvbVVewiXjW+8AyoLfxQ==" + }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -248,6 +289,11 @@ "ee-first": "1.1.1" } }, + "one-time": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-0.0.4.tgz", + "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4=" + }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -288,6 +334,20 @@ "unpipe": "1.0.0" } }, + "requests": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/requests/-/requests-0.2.2.tgz", + "integrity": "sha1-Dl7Af9hrSVvbS+2oabIVfsqJO00=", + "requires": { + "axo": "0.0.x", + "eventemitter3": "~2.0.2", + "extendible": "0.1.x", + "hang": "1.0.x", + "loads": "0.0.x", + "node-http-xhr": "~1.3.0", + "xhr-send": "1.0.x" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -374,6 +434,21 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "xhr-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xhr-response/-/xhr-response-1.0.1.tgz", + "integrity": "sha1-r/46CFRLpyGG5NxSzQImZx2Gc/4=" + }, + "xhr-send": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/xhr-send/-/xhr-send-1.0.0.tgz", + "integrity": "sha1-GkDHPl2yAo7gj+kPXD1tx/eWqFQ=" + }, + "xhr-status": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xhr-status/-/xhr-status-1.0.1.tgz", + "integrity": "sha512-VF0WSqtmkf56OmF26LCWsWvRb1a+WYGdHDoQnPPCVUQTM8CVUAOBcUDsm7nP7SQcgEEdrvF4DmhEADuXdGieyw==" } } } diff --git a/package.json b/package.json index 469cf22..e173b07 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "Barebones file manager for a remote location", "main": "index.js", "scripts": { - "test": "node ." + "start": "node .", + "test": "node test" }, "repository": { "type": "git", @@ -23,6 +24,7 @@ "dependencies": { "body-parser": "^1.19.0", "express": "^4.17.0", - "jquery": "^3.4.1" + "jquery": "^3.4.1", + "requests": "^0.2.2" } } diff --git a/static/base.js b/static/base.js index c4825e5..82e2532 100644 --- a/static/base.js +++ b/static/base.js @@ -1,19 +1,23 @@ let currDir = {'loc':'','contents':null}; +let currSel = {'loc':'','path':''} - -function doUpdate(ele){ - console.log(ele.attr('data-choice')); +function doUpdate(ele,isDir=false){ + //console.log(ele.attr('data-choice')); if(ele.hasClass('file-isDir')){ currDir.loc = ele.attr('data-choice'); populateContents(); } + if(!isDir){ + $('.nav-bottom-text').html(ele.html()) + + } //$() //$(this). } function updateContents(contents){ - console.log(contents) + //console.log(contents) // Change top header contents $('#files-location').html(currDir.loc) @@ -24,13 +28,14 @@ function updateContents(contents){ } else { - $('#files-table').empty(); + $('#files-table').hide().empty(); contents.contents.forEach(element => { - $('#files-table').append(`${element.name}`) + $('#files-table').append(`${element.name}`) }); if(contents.back!=null){ - $('#files-table').prepend(`..`) + $('#files-table').prepend(`..`) } + $('#files-table').fadeIn() } } diff --git a/static/index.html b/static/index.html index 2deec8b..10d71b8 100644 --- a/static/index.html +++ b/static/index.html @@ -21,7 +21,7 @@ File Name - Actions + @@ -44,7 +44,7 @@ diff --git a/test.js b/test.js new file mode 100644 index 0000000..ca70cd2 --- /dev/null +++ b/test.js @@ -0,0 +1 @@ +const requests = require('requests')