mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Made the file uploading just overwrite files with the same name.
This commit is contained in:
parent
881ec1a4b3
commit
246bbefc91
1 changed files with 3 additions and 4 deletions
|
@ -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 })
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue