This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Sequenzia/app/assets/javascripts/dmail.js
2013-10-26 18:06:58 -05:00

28 lines
765 B
JavaScript
Executable File

(function($) {
Dmail = {
respond: function(to) {
$('#dmail_to_name').val(to);
var stripped_body = $('#dmail_body').val().replace(/\[quote\](?:.|\n)+?\[\/quote\]\n*/gm, "");
$('#dmail_body').val("[quote]You said:\n" + stripped_body + "\n[/quote]\n\n");
$('#response').show();
},
expand: function(parent_id, id) {
notice("Fetching previous messages...")
$.ajax({
url: Moebooru.path('/dmail/show_previous_messages'),
type: 'get',
data: {
"id": id,
"parent_id": parent_id
}
}).done(function(data) {
$('#previous-messages').html(data);
$('#previous-messages').show();
notice('Previous messages loaded');
})
}
}
}) (jQuery);