mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
hotkeys: Add '>' as a hotkey for quote and reply to message.
Tweaked by tabbott to fix a few minor issues. Fixes #8146.
This commit is contained in:
@@ -365,6 +365,25 @@ exports.on_topic_narrow = function () {
|
||||
$('#compose-textarea').focus().select();
|
||||
};
|
||||
|
||||
exports.quote_and_reply = function (opts) {
|
||||
var textarea = $("#compose-textarea");
|
||||
var message_id = current_msg_list.selected_id();
|
||||
|
||||
exports.respond_to_message(opts);
|
||||
channel.get({
|
||||
url: '/json/messages/' + message_id,
|
||||
idempotent: true,
|
||||
success: function (data) {
|
||||
if (textarea.val() === "") {
|
||||
textarea.val("```quote\n" + data.raw_content +"\n```\n");
|
||||
} else {
|
||||
textarea.val(textarea.val() + "\n```quote\n" + data.raw_content +"\n```\n");
|
||||
}
|
||||
$("#compose-textarea").trigger("autosize.resize");
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
exports.on_narrow = function () {
|
||||
if (narrow_state.narrowed_by_topic_reply()) {
|
||||
exports.on_topic_narrow();
|
||||
|
||||
Reference in New Issue
Block a user