Made the file uploading just overwrite files with the same name.

This commit is contained in:
Scott Erickson 2014-03-03 17:14:13 -08:00
parent 881ec1a4b3
commit 246bbefc91

View file

@ -39,6 +39,7 @@ class LiveEditingMarkup extends TreemaNode.nodeMap.ace
filename: InkBlob.filename filename: InkBlob.filename
mimetype: InkBlob.mimetype mimetype: InkBlob.mimetype
path: @settings.filePath path: @settings.filePath
force: true
@uploadingPath = [@settings.filePath, InkBlob.filename].join('/') @uploadingPath = [@settings.filePath, InkBlob.filename].join('/')
$.ajax('/file', { type: 'POST', data: body, success: @onFileUploaded }) $.ajax('/file', { type: 'POST', data: body, success: @onFileUploaded })
@ -147,9 +148,8 @@ class SoundFileTreema extends TreemaNode.nodeMap.string
filename: InkBlob.filename filename: InkBlob.filename
mimetype: InkBlob.mimetype mimetype: InkBlob.mimetype
path: @settings.filePath path: @settings.filePath
force: true
# Automatically overwrite if the same path was put in here before
body.force = true # if InkBlob.filename is @data
@uploadingPath = [@settings.filePath, InkBlob.filename].join('/') @uploadingPath = [@settings.filePath, InkBlob.filename].join('/')
$.ajax('/file', { type: 'POST', data: body, success: @onFileUploaded }) $.ajax('/file', { type: 'POST', data: body, success: @onFileUploaded })
@ -185,9 +185,8 @@ class ImageFileTreema extends TreemaNode.nodeMap.string
filename: InkBlob.filename filename: InkBlob.filename
mimetype: InkBlob.mimetype mimetype: InkBlob.mimetype
path: @settings.filePath path: @settings.filePath
force: true
# Automatically overwrite if the same path was put in here before
body.force = true # if InkBlob.filename is @data
@uploadingPath = [@settings.filePath, InkBlob.filename].join('/') @uploadingPath = [@settings.filePath, InkBlob.filename].join('/')
$.ajax('/file', { type: 'POST', data: body, success: @onFileUploaded }) $.ajax('/file', { type: 'POST', data: body, success: @onFileUploaded })