Insert a link with a pretty file name when uploading a file.

(imported from commit 1367004792e145afa19a02417fb564ad3662f576)
This commit is contained in:
Luke Faraone 2013-04-05 13:20:00 -07:00
parent 59684c20f2
commit 429edfbdcd
1 changed files with 4 additions and 2 deletions

View File

@ -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")