🎨 Finish restructuring app

This commit is contained in:
brunosimon
2017-07-30 01:53:52 +02:00
parent fd18099109
commit ef8d9279af
8 changed files with 173 additions and 230 deletions
+11 -9
View File
@@ -6,11 +6,13 @@ const File = require('./file.js')
class Files
{
constructor(_options)
constructor(_config, _options)
{
this.items = {}
this.count = 0
this.socket = _options.socket
this.config = _config
this.items = {}
this.count = 0
this.projectSocket = _options.projectSocket
this.lastVersionDate = new Date()
}
@@ -31,10 +33,10 @@ class Files
// Create
file = new File({
name : parsedPath.base,
path : parsedPath.dir,
name: parsedPath.base,
path: parsedPath.dir,
content: _content,
socket : this.socket
projectSocket: this.projectSocket
})
// Save
@@ -43,7 +45,7 @@ class Files
this.lastVersionDate = new Date()
// Emit
this.socket.emit('create_file', file.describe())
this.projectSocket.emit('create_file', file.describe())
return file
}
@@ -115,7 +117,7 @@ class Files
this.lastVersionDate = new Date()
// Emit
this.socket.emit('delete_file', file.describe())
this.projectSocket.emit('delete_file', file.describe())
return true
}