HOME


Mini Shell 1.0
DIR:/usr/local/cwpsrv/var/services/roundcube/plugins/vcard_attachments/
Upload File :
Current File : //usr/local/cwpsrv/var/services/roundcube/plugins/vcard_attachments/vcardattach.min.js
/**
 * vcard_attachments plugin script
 *
 * @licstart  The following is the entire license notice for the
 * JavaScript code in this file.
 *
 * Copyright (c) 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(a){var c=rcmail.set_busy(!0,"loading");rcmail.http_post("plugin.savevcard",{_uid:rcmail.env.uid,_mbox:rcmail.env.mailbox,_part:a},c);return!1}function plugin_vcard_insertrow(a){a.row.ctype.match(/^(text\/vcard|text\/x-vcard|text\/directory)$/i)&&$(a.row.obj).find(".attachment > .attachment").addClass("vcard")}
function plugin_vcard_attach(){var a,c=[],b=(new Date).getTime(),d={_uploadid:b,_id:rcmail.env.compose_id||null},f=rcmail.contact_list.get_selection();for(a=0;a<f.length;a++)if("addressbook"==rcmail.env.task){var e=f[a];c.push(rcmail.env.source+"-"+e+"-0")}else(e=f[a])&&"E"!=e.charAt(0)&&rcmail.env.contactdata[e]&&c.push(e);if(!c.length)return!1;d._uri="vcard://"+c.join(",");"addressbook"==rcmail.env.task?(d._attach_vcard=1,rcmail.open_compose_step(d)):(rcmail.add2attachment_list(b,{name:"",html:rcmail.get_label("attaching"),
classname:"uploading",complete:!1})||(rcmail.file_upload_id=rcmail.set_busy(!0,"attaching")),rcmail.http_post("upload",d))}
window.rcmail&&rcmail.addEventListener("init",function(a){rcmail.gui_objects.messagelist&&rcmail.addEventListener("insertrow",function(b,d){plugin_vcard_insertrow(b)});if(("compose"==rcmail.env.action||"addressbook"==rcmail.env.task&&""==rcmail.env.action)&&rcmail.gui_objects.contactslist){if("compose"==rcmail.env.action&&(rcmail.env.compose_commands.push("attach-vcard"),window.UI&&UI.recipient_selector)){a=$("#compose-attachments > div");var c=$('<button class="btn btn-secondary attach vcard">').attr({type:"button",
tabindex:$("button,input",a).first().attr("tabindex")||0}).text(rcmail.gettext("vcard_attachments.attachvcard")).appendTo(a).click(function(){UI.recipient_selector("",{title:"vcard_attachments.attachvcard",button:"vcard_attachments.attachvcard",button_class:"attach",focus:c,multiselect:!1,action:function(){rcmail.command("attach-vcard")}})})}rcmail.register_command("attach-vcard",function(){plugin_vcard_attach()});rcmail.contact_list.addEventListener("select",function(b){b=b.get_selection();rcmail.enable_command("attach-vcard",
1==b.length&&"E"!=b[0].charAt(0))})}});