Thomas Bruederli
2014-04-27 b34d67907566663ab46b487b99817673ce4e32e5
plugins/zipdownload/zipdownload.js
@@ -1,5 +1,18 @@
/**
 * ZipDownload plugin script
 *
 * @licstart  The following is the entire license notice for the
 * JavaScript code in this file.
 *
 * Copyright (c) 2013-2014, The Roundcube Dev Team
 *
 * The JavaScript code in this page is free software: you can redistribute it
 * and/or modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * @licend  The above is the entire license notice
 * for the JavaScript code in this file.
 */
window.rcmail && rcmail.addEventListener('init', function(evt) {
@@ -9,7 +22,7 @@
    rcmail.register_command('download-maildir', function() { rcmail_zipdownload('maildir'); });
    // commands status
    rcmail.message_list.addEventListener('select', function(list) {
    rcmail.message_list && rcmail.message_list.addEventListener('select', function(list) {
        var selected = list.get_selection().length;
        rcmail.enable_command('download', selected > 0);
@@ -65,7 +78,13 @@
        post._token = rcmail.env.request_token;
        $.each(post, function(k, v) {
            inputs.push($('<input>').attr({type: 'hidden', name: k, value: v}));
            if (typeof v == 'object' && v.length > 1) {
              for (var j=0; j < v.length; j++)
                  inputs.push($('<input>').attr({type: 'hidden', name: k+'[]', value: v[j]}));
            }
            else {
                inputs.push($('<input>').attr({type: 'hidden', name: k, value: v}));
            }
        });
        if (!form.length)