2 var batchConfirmed = false;
4 $(document).ready(function() {
5 // Initiale autosize for the textareas.
6 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);
23 * @brief This function submits the form with the batch action values.
25 * @param {string} name The name of the batch action.
26 * @param {string} value If it isn't empty the action will be posted.
30 function batch_submit_handler(name, value) {
31 if (confirm(value + " ?")) {
32 // Set the value of the hidden input element with the name batch_submit.
33 document.batch_actions_submit.batch_submit.value = value;
34 // Change the name of the input element from batch_submit according to the
35 // name which is transmitted to this function.
36 document.batch_actions_submit.batch_submit.name = name;
38 document.batch_actions_submit.submit();