mirror of https://github.com/zulip/zulip.git
Insert a link with a pretty file name when uploading a file.
(imported from commit 1367004792e145afa19a02417fb564ad3662f576)
This commit is contained in:
parent
59684c20f2
commit
429edfbdcd
|
@ -522,8 +522,10 @@ $(function () {
|
|||
if (response.uri === undefined) {
|
||||
return;
|
||||
}
|
||||
var textbox = $("#new_message_content");
|
||||
textbox.val(textbox.val() + " " + response.uri);
|
||||
var textbox = $("#new_message_content"),
|
||||
split_uri = response.uri.split("/"),
|
||||
filename = split_uri[split_uri.length - 1];
|
||||
textbox.val(textbox.val() + "[" + filename + "](" + response.uri + ")" + " ");
|
||||
$("#new_message_content").trigger("autosize");
|
||||
$("#compose-send-button").removeAttr("disabled");
|
||||
$("#send-status").removeClass("alert-info")
|
||||
|
|
Loading…
Reference in New Issue