From 837d66d86afe70a906583b58f305bce4369bd727 Mon Sep 17 00:00:00 2001 From: himetani_cafe Date: Mon, 3 Aug 2015 23:29:50 +0900 Subject: [PATCH] manageable directory hierarchy added to multi sizes --- client/index.html | 4 ++-- server/api/dirInfo/index.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/index.html b/client/index.html index 4fd18df..7b0ece5 100644 --- a/client/index.html +++ b/client/index.html @@ -48,14 +48,14 @@ + + - - diff --git a/server/api/dirInfo/index.js b/server/api/dirInfo/index.js index a5a46dd..999959c 100644 --- a/server/api/dirInfo/index.js +++ b/server/api/dirInfo/index.js @@ -11,20 +11,21 @@ router.post('', function(req, res) { email = req.body.email, dirPath, filesInfo - if(dir === 'root') { + if(dir === 'workspace') { dirPath = path.normalize(__dirname+'/../../../workspace/') jb.findOne('user', function(err, documents) { filesInfo = documents.workspaces.map(function(file) { var filePath = dirPath + file var stat = fs.statSync(filePath) stat.name = file + stat.isDir = stat.isDirectory() return stat }) res.send(filesInfo) }) } else { - dirPath = path.normalize(__dirname+'/../../../workspace/'+dir) + dirPath = path.normalize(__dirname+'/../../../workspace/'+dir.replace('workspace/','')) var files = fs.readdirSync(dirPath) var filesInfo = files.filter(function(file) { return file.substring(0,1) !== '.' && file !== 'preview' @@ -32,6 +33,7 @@ router.post('', function(req, res) { .map(function(file) { var stat = fs.statSync(dirPath+'/'+file) stat.name = file + stat.isDir = stat.isDirectory() return stat }) res.send(filesInfo) -- 2.11.0