<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>
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'
.map(function(file) {
var stat = fs.statSync(dirPath+'/'+file)
stat.name = file
+ stat.isDir = stat.isDirectory()
return stat
})
res.send(filesInfo)