| | |
| | | /** |
| | | * 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) { |
| | |
| | | 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); |
| | |
| | | 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) |