-
Notifications
You must be signed in to change notification settings - Fork 2
/
hms_externalaccounts.min.js
1 lines (1 loc) · 2.87 KB
/
hms_externalaccounts.min.js
1
window.rcmail&&rcmail.addEventListener("init",function(a){if(rcmail.env.disabled_externalaccounts){var b=rcmail.get_label("hms_externalaccounts.disabled");$.each(rcmail.env.disabled_externalaccounts,function(d,c){$("#rcmrow"+c).addClass("disabled").children("td").append(" - "+b);});}if(rcmail.env.externalaccounts_reload){window.top.location.href=rcmail.env.comm_path+"&_action=plugin.externalaccounts&_eaid="+rcmail.env.externalaccounts_reload;}rcmail.register_command("plugin.hmsexternalaccounts-add",function(){rcmail.hmsexternalaccounts_add();},true);rcmail.register_command("plugin.hmsexternalaccounts-delete",function(){rcmail.hmsexternalaccounts_del();});rcmail.register_command("plugin.hmsexternalaccounts-download",function(){rcmail.hmsexternalaccounts_download();});if(rcmail.gui_objects.externalaccountlist){rcmail.externalaccounts_list=new rcube_list_widget(rcmail.gui_objects.externalaccountlist,{multiselect:false,draggable:false,keyboard:true});rcmail.externalaccounts_list.addEventListener("select",function(c){rcmail.hmsexternalaccounts_select(c);}).init();if(rcmail.env.externalaccounts_selected){rcmail.externalaccounts_list.select(rcmail.env.externalaccounts_selected);}}if(rcmail.gui_objects.externalaccountform){rcmail.register_command("plugin.hmsexternalaccount-submit",function(){rcmail.set_busy(true,"loading");rcmail.gui_objects.externalaccountform.submit();},true);}$("input:not(:hidden):first").focus();});rcube_webmail.prototype.hmsexternalaccounts_select=function(a){var b=a.get_single_selection();if(b!=null){this.load_hmsexternalaccountframe(b);this.enable_command("plugin.hmsexternalaccounts-delete","plugin.hmsexternalaccounts-download",true);}};rcube_webmail.prototype.hmsexternalaccounts_add=function(){this.load_hmsexternalaccountframe();this.externalaccounts_list.clear_selection();this.enable_command("plugin.hmsexternalaccounts-delete","plugin.hmsexternalaccounts-download",false);};rcube_webmail.prototype.hmsexternalaccounts_del=function(){var a=this.externalaccounts_list.get_single_selection();if(a!=null&&confirm(this.get_label("hms_externalaccounts.externalaccountdeleteconfirm"))){this.set_busy(true);this.addEventListener("plugin.externalaccounts-reload",function(){location.href="./?_task=settings&_action=plugin.externalaccounts";});this.http_post("plugin.externalaccounts-actions","_act=delete&_eaid="+a);this.set_busy(false);}};rcube_webmail.prototype.hmsexternalaccounts_download=function(){var a=this.externalaccounts_list.get_single_selection();if(a!=null){this.http_post("plugin.externalaccounts-actions","_act=download&_eaid="+a);}};rcube_webmail.prototype.load_hmsexternalaccountframe=function(c){var b=typeof(c)!="undefined"&&c!=null;if(this.env.contentframe&&window.frames&&window.frames[this.env.contentframe]){target=window.frames[this.env.contentframe];var a="";target.location.href=this.env.comm_path+"&_action=plugin.externalaccounts-edit"+(b?"&_eaid="+c:"")+"&_unlock="+a;}};