<script src="/client/app/components/commandModal/commandModal.controller.js"></script>
<script src="/client/app/components/login/login.controller.js"></script>
<script src="/client/app/components/login/login.js"></script>
- <script src="/client/app/components/notes/notes.controller.js"></script>
- <script src="/client/app/components/notes/notes.js"></script>
<script src="/client/app/components/previewModal/previewModal.controller.js"></script>
<script src="/client/app/components/saveFileModal/saveFileModal.controller.js"></script>
<script src="/client/app/components/signup/signup.controller.js"></script>
<script src="/client/app/components/signup/signup.js"></script>
<script src="/client/app/components/workspace/workspace.controller.js"></script>
<script src="/client/app/components/workspace/workspace.js"></script>
+ <script src="/client/app/components/notes/notes.controller.js"></script>
+ <script src="/client/app/components/notes/notes.js"></script>
<!-- endinject -->
</body>
</html>
router.post('', function(req, res) {
var dir = req.body.dir,
email = req.body.email,
- dirPath,
- filePath
+ dirPath, filesInfo
- if(dir === 'root')
+ if(dir === 'root') {
dirPath = path.normalize(__dirname+'/../../../workspace/')
- else
- dirPath = path.normalize(__dirname+'/../../../workspace/'+dir+'/')
+ jb.findOne('user', function(err, documents) {
+ filesInfo = documents.workspaces.map(function(file) {
+ var filePath = dirPath + file
+ var stat = fs.statSync(filePath)
+ stat.name = file
+ return stat
+ })
+ res.send(filesInfo)
+ })
- jb.findOne('user', function(err, documents) {
- var filesInfo = documents.workspaces.map(function(file) {
- var filePath = dirPath + file
- var stat = fs.statSync(filePath)
+ } else {
+ dirPath = path.normalize(__dirname+'/../../../workspace/'+dir)
+ var files = fs.readdirSync(dirPath)
+ var filesInfo = files.filter(function(file) {
+ return file.substring(0,1) !== '.' && file !== 'preview'
+ })
+ .map(function(file) {
+ var stat = fs.statSync(dirPath+'/'+file)
stat.name = file
-
return stat
})
res.send(filesInfo)
- })
-
- /*
- var files = fs.readdirSync(dirPath)
- var filesInfo = files.filter(function(file) {
- return file.substring(0,1) !== '.' && file !== 'preview'
- })
- .map(function(file) {
- var stat = fs.statSync(dirPath+'/'+file)
- stat.name = file
- return stat
- })
- */
+ }
})
module.exports = router;