1 // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPLv3-or-later
3 var batchConfirmed = false;
5 $(document).ready(function () {
6 // Initiale autosize for the textareas.
7 autosize($("textarea.text-autosize"));
9 // Replace the drop contact link of the photo menu
10 // with a confirmation modal.
11 $("body").on("click", ".contact-photo-menu a", function (e) {
12 var photoMenuLink = $(this).attr("href");
13 if (typeof photoMenuLink !== "undefined" && photoMenuLink.indexOf("/drop?confirm=1") !== -1) {
15 addToModal(photoMenuLink);
22 * This function submits the form with the batch action values.
24 * @param {string} name The name of the batch action.
25 * @param {string} value If it isn't empty the action will be posted.
29 function batch_submit_handler(name, value) {
30 if (confirm(value + " ?")) {
31 // Set the value of the hidden input element with the name batch_submit.
32 document.batch_actions_submit.batch_submit.value = value;
33 // Change the name of the input element from batch_submit according to the
34 // name which is transmitted to this function.
35 document.batch_actions_submit.batch_submit.name = name;
37 document.batch_actions_submit.submit();