Mercurial > hg > rc1
comparison plugins/vcard_attachments/vcardattach.min.js @ 0:1e000243b222
vanilla 1.3.3 distro, I hope
author | Charlie Root |
---|---|
date | Thu, 04 Jan 2018 15:50:29 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1e000243b222 |
---|---|
1 /** | |
2 * vcard_attachments plugin script | |
3 * | |
4 * @licstart The following is the entire license notice for the | |
5 * JavaScript code in this file. | |
6 * | |
7 * Copyright (c) 2012-2016, The Roundcube Dev Team | |
8 * | |
9 * The JavaScript code in this page is free software: you can redistribute it | |
10 * and/or modify it under the terms of the GNU General Public License | |
11 * as published by the Free Software Foundation, either version 3 of | |
12 * the License, or (at your option) any later version. | |
13 * | |
14 * @licend The above is the entire license notice | |
15 * for the JavaScript code in this file. | |
16 */ | |
17 function plugin_vcard_save_contact(b){var a=rcmail.set_busy(!0,"loading");rcmail.http_post("plugin.savevcard",{_uid:rcmail.env.uid,_mbox:rcmail.env.mailbox,_part:b},a);return!1}function plugin_vcard_insertrow(b){var a=b.row.ctype;"text/vcard"!=a&&"text/x-vcard"!=a&&"text/directory"!=a||$("#rcmrow"+rcmail.html_identifier(b.uid,!0)+" > td.attachment").html('<img src="'+rcmail.env.vcard_icon+'" alt="" />')} | |
18 function plugin_vcard_attach(){var b,a,c=[],d=(new Date).getTime(),e={_uploadid:d,_id:rcmail.env.compose_id};for(a=0;a<rcmail.contact_list.selection.length;a++)(b=rcmail.contact_list.selection[a])&&"E"!=b.charAt(0)&&rcmail.env.contactdata[b]&&c.push(b);if(!c.length)return!1;e._uri="vcard://"+c.join(",");rcmail.add2attachment_list(d,{name:"",html:rcmail.get_label("attaching"),classname:"uploading",complete:!1})||(rcmail.file_upload_id=rcmail.set_busy(!0,"attaching"));rcmail.http_post("upload",e)} | |
19 window.rcmail&&rcmail.addEventListener("init",function(b){rcmail.gui_objects.messagelist&&rcmail.addEventListener("insertrow",function(a,b){plugin_vcard_insertrow(a)});"compose"==rcmail.env.action&&rcmail.gui_objects.contactslist&&(rcmail.env.compose_commands.push("attach-vcard"),rcmail.register_command("attach-vcard",function(){plugin_vcard_attach()}),rcmail.contact_list.addEventListener("select",function(a){rcmail.enable_command("attach-vcard",1==a.selection.length&&"E"!=rcmail.contact_list.selection[0].charAt(0))}))}); |