diff options
| author | Douwe Maan <douwe@gitlab.com> | 2016-01-07 13:37:14 +0100 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2016-01-07 13:37:14 +0100 |
| commit | 1886d727f738895bb552151d59d4024f405522e2 (patch) | |
| tree | 684b1abde7d7951456a8bb0956867a953971f5eb /app/assets | |
| parent | 09216e8bbdd82e46705888aba13405a2fd191100 (diff) | |
| download | gitlab-ce-1886d727f738895bb552151d59d4024f405522e2.tar.gz | |
Add API project upload endpoint
Diffstat (limited to 'app/assets')
| -rw-r--r-- | app/assets/javascripts/dropzone_input.js.coffee | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/app/assets/javascripts/dropzone_input.js.coffee b/app/assets/javascripts/dropzone_input.js.coffee index 30a35a04339..c714c0fa939 100644 --- a/app/assets/javascripts/dropzone_input.js.coffee +++ b/app/assets/javascripts/dropzone_input.js.coffee @@ -66,7 +66,7 @@ class @DropzoneInput success: (header, response) -> child = $(dropzone[0]).children("textarea") - $(child).val $(child).val() + formatLink(response.link) + "\n" + $(child).val $(child).val() + response.link.markdown + "\n" return error: (temp, errorMessage) -> @@ -99,11 +99,6 @@ class @DropzoneInput child = $(dropzone[0]).children("textarea") - formatLink = (link) -> - text = "[#{link.alt}](#{link.url})" - text = "!#{text}" if link.is_image - text - handlePaste = (event) -> pasteEvent = event.originalEvent if pasteEvent.clipboardData and pasteEvent.clipboardData.items @@ -162,7 +157,7 @@ class @DropzoneInput closeAlertMessage() success: (e, textStatus, response) -> - insertToTextArea(filename, formatLink(response.responseJSON.link)) + insertToTextArea(filename, response.responseJSON.link.markdown) error: (response) -> showError(response.responseJSON.message) @@ -202,8 +197,3 @@ class @DropzoneInput e.preventDefault() $(@).closest('.gfm-form').find('.div-dropzone').click() return - - formatLink: (link) -> - text = "[#{link.alt}](#{link.url})" - text = "!#{text}" if link.is_image - text |
