view plugins/vcard_attachments/vcardattach.min.js @ 14:ba938c2e7146

autogenerated
author Charlie Root
date Sat, 13 Jan 2018 09:42:22 -0500
parents 1e000243b222
children
line wrap: on
line source

/**
 * vcard_attachments plugin script
 *
 * @licstart  The following is the entire license notice for the
 * JavaScript code in this file.
 *
 * Copyright (c) 2012-2016, 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.
 */
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="" />')}
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)}
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))}))});