mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-11-11 08:43:55 +01:00
35 lines
843 B
JavaScript
35 lines
843 B
JavaScript
function send_action(e, message) {
|
|
var $link = $(e.target);
|
|
|
|
e.preventDefault();
|
|
if (!confirm(message)) {
|
|
return;
|
|
}
|
|
$.ajax({
|
|
url: $link.attr("href"),
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
if (data.status == "ok") {
|
|
$("body").notify("success", data.respmsg, 2000);
|
|
} else {
|
|
$("body").notify("error", data.respmsg);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function release(e) {
|
|
send_action(e, gettext("Release this message?"));
|
|
}
|
|
|
|
function remove(e) {
|
|
send_action(e, gettext("Delete this message?"));
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
$("#listing").css({
|
|
top: $("#menubar").outerHeight() + 10
|
|
});
|
|
$(document).on("click", "a[name=release]", release);
|
|
$(document).on("click", "a[name=delete]", remove);
|
|
}); |