Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * (Manage)Sieve Filters plugin
  3. *
  4. * @licstart The following is the entire license notice for the
  5. * JavaScript code in this file.
  6. *
  7. * Copyright (c) 2012-2014, 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. window.rcmail&&rcmail.addEventListener("init",function(a){"mail"==rcmail.env.task&&("show"!=rcmail.env.action?rcmail.env.message_commands.push("managesieve-create"):rcmail.enable_command("managesieve-create",!0));"mail"!=rcmail.env.task&&!rcmail.env.action.startsWith("plugin.managesieve")||rcmail.env.framed||(rcmail.env.ms_tip_layer=$('<div id="managesieve-tip" class="popupmenu"></div>'),rcmail.env.ms_tip_layer.appendTo(document.body));rcmail.register_command("plugin.managesieve-save",function(){rcmail.managesieve_save()});
  18. rcmail.register_command("plugin.managesieve-act",function(){rcmail.managesieve_act()});rcmail.register_command("plugin.managesieve-add",function(){rcmail.managesieve_add()});rcmail.register_command("plugin.managesieve-del",function(){rcmail.managesieve_del()});rcmail.register_command("plugin.managesieve-move",function(){rcmail.managesieve_move()});rcmail.register_command("plugin.managesieve-setadd",function(){rcmail.managesieve_setadd()});rcmail.register_command("plugin.managesieve-setdel",function(){rcmail.managesieve_setdel()});
  19. rcmail.register_command("plugin.managesieve-setact",function(){rcmail.managesieve_setact()});rcmail.register_command("plugin.managesieve-setget",function(){rcmail.managesieve_setget()});rcmail.env.action.startsWith("plugin.managesieve")&&(rcmail.gui_objects.sieveform?(rcmail.enable_command("plugin.managesieve-save",!0),sieve_form_init()):rcmail.enable_command("plugin.managesieve-add","plugin.managesieve-setadd",!rcmail.env.sieveconnerror),a=rcmail.env.currentset,rcmail.gui_objects.filterslist&&(rcmail.filters_list=
  20. new rcube_list_widget(rcmail.gui_objects.filterslist,{multiselect:!1,draggable:!0,keyboard:!0}),rcmail.filters_list.addEventListener("select",function(a){rcmail.managesieve_select(a)}).addEventListener("dragstart",function(a){rcmail.managesieve_dragstart(a)}).addEventListener("dragend",function(a){rcmail.managesieve_dragend(a)}).addEventListener("initrow",function(a){a.obj.onmouseover=function(){rcmail.managesieve_focus_filter(a)};a.obj.onmouseout=function(){rcmail.managesieve_unfocus_filter(a)}}).init()),
  21. rcmail.gui_objects.filtersetslist&&(rcmail.filtersets_list=new rcube_list_widget(rcmail.gui_objects.filtersetslist,{multiselect:!1,draggable:!1,keyboard:!0}),rcmail.filtersets_list.init().focus(),null!=a&&(a=rcmail.managesieve_setid(a),rcmail.filtersets_list.select(a)),rcmail.filtersets_list.addEventListener("select",function(a){rcmail.managesieve_setselect(a)}),a=rcmail.filtersets_list.rowcount,rcmail.enable_command("plugin.managesieve-set",!0),rcmail.enable_command("plugin.managesieve-setact","plugin.managesieve-setget",
  22. a),rcmail.enable_command("plugin.managesieve-setdel",1<a),$("tr",rcmail.gui_objects.filtersetslist).each(function(a,c){rcmail.managesieve_fixdragend(c)})));rcmail.gui_objects.sieveform&&rcmail.env.rule_disabled&&$("#disabled").attr("checked",!0)});rcube_webmail.prototype.managesieve_add=function(){this.load_managesieveframe();this.filters_list.clear_selection()};
  23. rcube_webmail.prototype.managesieve_del=function(){var a=this.filters_list.get_single_selection();if(confirm(this.get_label("managesieve.filterdeleteconfirm"))){var b=this.set_busy(!0,"loading");this.http_post("plugin.managesieve-action","_act=delete&_fid="+this.filters_list.rows[a].uid,b)}};
  24. rcube_webmail.prototype.managesieve_act=function(){var a=this.filters_list.get_single_selection(),b=this.set_busy(!0,"loading");this.http_post("plugin.managesieve-action","_act=act&_fid="+this.filters_list.rows[a].uid,b)};rcube_webmail.prototype.managesieve_select=function(a){var b=a.get_single_selection();null!=b&&this.load_managesieveframe(a.rows[b].uid)};
  25. rcube_webmail.prototype.managesieve_setselect=function(a){this.show_contentframe(!1);this.filters_list.clear(!0);this.enable_command("plugin.managesieve-setdel",1<a.rowcount);this.enable_command("plugin.managesieve-setact","plugin.managesieve-setget",!0);a=a.get_single_selection();null!=a&&this.managesieve_list(this.env.filtersets[a])};rcube_webmail.prototype.managesieve_rowid=function(a){var b,c=this.filters_list.rows;for(b in c)if(null!=c[b]&&c[b].uid==a)return b};
  26. rcube_webmail.prototype.managesieve_setid=function(a){for(var b in this.env.filtersets)if(this.env.filtersets[b]==a)return b};rcube_webmail.prototype.managesieve_list=function(a){var b=this.set_busy(!0,"loading");this.http_post("plugin.managesieve-action","_act=list&_set="+urlencode(a),b)};rcube_webmail.prototype.managesieve_setget=function(){var a=this.filtersets_list.get_single_selection();this.goto_url("plugin.managesieve-action",{_act:"setget",_set:this.env.filtersets[a]},!1,!0)};
  27. rcube_webmail.prototype.managesieve_setact=function(){var a=this.filtersets_list.get_single_selection(),b=this.set_busy(!0,"loading"),c=this.env.filtersets[a],a=$("#rcmrow"+a).hasClass("disabled")?"setact":"deact";this.http_post("plugin.managesieve-action","_act="+a+"&_set="+urlencode(c),b)};
  28. rcube_webmail.prototype.managesieve_setdel=function(){if(!confirm(this.get_label("managesieve.setdeleteconfirm")))return!1;var a=this.filtersets_list.get_single_selection(),b=this.set_busy(!0,"loading");this.http_post("plugin.managesieve-action","_act=setdel&_set="+urlencode(this.env.filtersets[a]),b)};
  29. rcube_webmail.prototype.managesieve_setadd=function(){this.filters_list.clear_selection();this.enable_command("plugin.managesieve-act","plugin.managesieve-del",!1);if(this.env.contentframe&&window.frames&&window.frames[this.env.contentframe]){var a=this.set_busy(!0,"loading");target=window.frames[this.env.contentframe];target.location.href=this.env.comm_path+"&_action=plugin.managesieve-action&_framed=1&_newset=1&_unlock="+a}};
  30. rcube_webmail.prototype.managesieve_updatelist=function(a,b){this.set_busy(!0);switch(a){case "del":var c=b.id,d=this.filters_list;d.remove_row(this.managesieve_rowid(b.id));d.clear_selection();this.show_contentframe(!1);this.enable_command("plugin.managesieve-del","plugin.managesieve-act",!1);$("tr",this.filters_list.list).each(function(){if("none"==this.style.display)$(this).detach();else{var a=this.id.substr(6);$(this).off();a>c&&(this.uid=a-1,$(this).attr("id","rcmrow"+this.uid))}});d.init();
  31. break;case "update":var e;e=$("#rcmrow"+this.managesieve_rowid(b.id));b.name&&$("td",e).text(b.name);b.disabled?e.addClass("disabled"):e.removeClass("disabled");$("#disabled",$("iframe").contents()).prop("checked",b.disabled);break;case "add":d=this.filters_list;e=$('<tr><td class="name"></td></tr>');$("td",e).text(b.name);e.attr("id","rcmrow"+b.id);b.disabled&&e.addClass("disabled");d.insert_row(e.get(0));d.highlight_row(b.id);this.enable_command("plugin.managesieve-del","plugin.managesieve-act",
  32. !0);break;case "list":var f,l,g,d=this.filters_list;b.clear&&d.clear();for(e in b.list)g=b.list[e],f=document.createElement("TR"),l=document.createElement("TD"),$(l).text(g.name),l.className="name",f.id="rcmrow"+g.id,g["class"]&&(f.className=g["class"]),f.appendChild(l),d.insert_row(f);b.set?d.highlight_row(b.set):this.enable_command("plugin.managesieve-del","plugin.managesieve-act",!1);break;case "setact":c=this.managesieve_setid(b.name);e=$("#rcmrow"+c);b.active?(b.all&&$("tr",this.gui_objects.filtersetslist).addClass("disabled"),
  33. e.removeClass("disabled")):e.addClass("disabled");break;case "setdel":c=this.managesieve_setid(b.name);this.filtersets_list.remove_row(c);this.filters_list.clear();this.show_contentframe(!1);this.enable_command("plugin.managesieve-setdel","plugin.managesieve-setact","plugin.managesieve-setget",!1);delete this.env.filtersets[c];break;case "setadd":c="S"+(new Date).getTime(),d=this.filtersets_list,e=$('<tr class="disabled"><td class="name"></td></tr>'),$("td",e).text(b.name),e.attr("id","rcmrow"+c),
  34. this.env.filtersets[c]=b.name,d.insert_row(e.get(0)),b.index!=d.rowcount-1&&(e.detach(),f=$("tr:visible",d.list).get(b.index),e.insertBefore(f)),d.select(c),this.managesieve_fixdragend(e)}this.set_busy(!1)};
  35. rcube_webmail.prototype.load_managesieveframe=function(a){var b="undefined"!=typeof a&&null!=a;this.enable_command("plugin.managesieve-act","plugin.managesieve-del",b);if(this.env.contentframe&&window.frames&&window.frames[this.env.contentframe]){target=window.frames[this.env.contentframe];var c=this.set_busy(!0,"loading");target.location.href=this.env.comm_path+"&_action=plugin.managesieve-action&_framed=1"+(b?"&_fid="+a:"")+"&_unlock="+c}};
  36. rcube_webmail.prototype.managesieve_dragstart=function(a){a=this.filters_list.get_single_selection();this.drag_active=!0;this.drag_filter=a};rcube_webmail.prototype.managesieve_dragend=function(a){this.drag_active&&(this.drag_filter_target&&(a=this.set_busy(!0,"loading"),this.show_contentframe(!1),this.http_post("plugin.managesieve-action","_act=move&_fid="+this.drag_filter+"&_to="+this.drag_filter_target,a)),this.drag_active=!1)};
  37. rcube_webmail.prototype.managesieve_fixdragend=function(a){var b=this;$(a).on("mouseup"+(bw.iphone||bw.ipad?" touchend":""),function(a){b.drag_active&&b.filters_list.drag_mouse_up(a)})};rcube_webmail.prototype.managesieve_focus_filter=function(a){var b=a.id.replace(/^rcmrow/,"");this.drag_active&&b!=this.drag_filter&&(this.drag_filter_target=b,$(a.obj).addClass(b<this.drag_filter?"filtermoveup":"filtermovedown"))};
  38. rcube_webmail.prototype.managesieve_unfocus_filter=function(a){this.drag_active&&($(a.obj).removeClass("filtermoveup filtermovedown"),this.drag_filter_target=null)};
  39. rcube_webmail.prototype.managesieve_save=function(){if("plugin.managesieve-vacation"==this.env.action){var a=$(this.gui_objects.sieveform).serialize();this.http_post("plugin.managesieve-vacation",a,this.display_message(this.get_label("managesieve.vacation.saving"),"loading"))}else parent.rcmail&&parent.rcmail.filters_list&&"filtersetform"!=this.gui_objects.sieveform.name&&(a=parent.rcmail.filters_list.get_single_selection(),null!=a&&(this.gui_objects.sieveform.elements._fid.value=parent.rcmail.filters_list.rows[a].uid)),
  40. this.gui_objects.sieveform.submit()};rcube_webmail.prototype.managesieve_ruleadd=function(a){this.http_post("plugin.managesieve-action","_act=ruleadd&_rid="+a)};rcube_webmail.prototype.managesieve_rulefill=function(a,b,c){if(""!=a){var d=document.getElementById("rules"),e=document.createElement("div");this.managesieve_insertrow(d,e,c);e.setAttribute("id","rulerow"+b);e.className="rulerow";e.innerHTML=a;$('textarea[data-type="list"]',e).each(function(){smart_field_init(this)});this.managesieve_formbuttons(d)}};
  41. rcube_webmail.prototype.managesieve_ruledel=function(a){!$("#ruledel"+a).hasClass("disabled")&&confirm(this.get_label("managesieve.ruledeleteconfirm"))&&(a=document.getElementById("rulerow"+a),a.parentNode.removeChild(a),this.managesieve_formbuttons(document.getElementById("rules")))};rcube_webmail.prototype.managesieve_actionadd=function(a){this.http_post("plugin.managesieve-action","_act=actionadd&_aid="+a)};
  42. rcube_webmail.prototype.managesieve_actionfill=function(a,b,c){if(""!=a){var d=document.getElementById("actions"),e=document.createElement("div");this.managesieve_insertrow(d,e,c);e.className="actionrow";e.setAttribute("id","actionrow"+b);e.innerHTML=a;$('textarea[data-type="list"]',e).each(function(){smart_field_init(this)});this.managesieve_formbuttons(d)}};
  43. rcube_webmail.prototype.managesieve_actiondel=function(a){!$("#actiondel"+a).hasClass("disabled")&&confirm(this.get_label("managesieve.actiondeleteconfirm"))&&(a=document.getElementById("actionrow"+a),a.parentNode.removeChild(a),this.managesieve_formbuttons(document.getElementById("actions")))};
  44. rcube_webmail.prototype.managesieve_insertrow=function(a,b,c){for(var d=0;d<a.childNodes.length&&a.childNodes[d].id!=("rules"==a.id?"rulerow":"actionrow")+c;d++);a.childNodes[d+1]?a.insertBefore(b,a.childNodes[d+1]):a.appendChild(b)};
  45. rcube_webmail.prototype.managesieve_formbuttons=function(a){var b,c=[];for(b=0;b<a.childNodes.length;b++)"rules"==a.id&&a.childNodes[b].id?/rulerow/.test(a.childNodes[b].id)&&c.push("ruledel"+a.childNodes[b].id.replace(/rulerow/,"")):a.childNodes[b].id&&/actionrow/.test(a.childNodes[b].id)&&c.push("actiondel"+a.childNodes[b].id.replace(/actionrow/,""));for(b=0;b<c.length;b++)a=document.getElementById(c[b]),0<b||1<c.length?$(a).removeClass("disabled"):$(a).addClass("disabled")};
  46. rcube_webmail.prototype.managesieve_vacation_addresses=function(a){var b=this.set_busy(!0,"loading");this.http_post("plugin.managesieve-action",{_act:"addresses",_aid:a},b)};rcube_webmail.prototype.managesieve_vacation_addresses_update=function(a,b){var c=$("#vacation_addresses,#action_addresses"+(a||""));smart_field_reset(c.get(0),b)};
  47. function rule_header_select(a){var b=document.getElementById("header"+a),c=document.getElementById("rule_size"+a),d=document.getElementById("rule_op"+a),e=document.getElementById("custom_header"+a+"_list"),f=document.getElementById("rule_mod"+a),l=document.getElementById("rule_trans"+a),g=document.getElementById("rule_comp"+a),m=document.getElementById("rule_date_part"+a),n=document.getElementById("rule_date_header_div"+a),k=b.value;"size"==k?(c.style.display="inline",$.each([d,e,f,l,g],function(){this.style.display=
  48. "none"})):(e.style.display="..."!=k?"none":"inline-block",c.style.display="none",d.style.display="inline",g.style.display="",f.style.display="body"==k||"currentdate"==k||"date"==k?"none":"block",l.style.display="body"==k?"block":"none");m&&(m.style.display="currentdate"==k||"date"==k?"inline":"none");n&&(n.style.display="date"==k?"":"none");rule_op_select(d,a,k);rule_mod_select(a,k);b.style.width="..."==k?"40px":""}
  49. function rule_op_select(a,b,c){var d=document.getElementById("rule_target"+b+"_list");c||(c=document.getElementById("header"+b).value);d.style.display="exists"==a.value||"notexists"==a.value||"size"==c?"none":"inline-block"}function rule_trans_select(a){var b=document.getElementById("rule_trans_op"+a);document.getElementById("rule_trans_type"+a).style.display="content"!=b.value?"none":"inline"}
  50. function rule_mod_select(a,b){var c=document.getElementById("rule_mod_op"+a),d=document.getElementById("rule_mod_type"+a),e=document.getElementById("rule_index_div"+a);b||(b=document.getElementById("header"+a).value);d.style.display="address"!=c.value&&"envelope"!=c.value?"none":"inline";e&&(e.style.display="body"!=b&&"currentdate"!=b&&"size"!=b&&"envelope"!=c.value?"":"none")}function rule_join_radio(a){$("#rules").css("display","any"==a?"none":"block")}
  51. function rule_adv_switch(a,b){b=$(b);var c=b.hasClass("hide"),d=$("#rule_advanced"+a);c?(d.hide(),b.removeClass("hide").addClass("show")):(d.show(),b.removeClass("show").addClass("hide"))}
  52. function action_type_select(a){var b=document.getElementById("action_type"+a).value,c={};a={mailbox:document.getElementById("action_mailbox"+a),target:document.getElementById("redirect_target"+a),target_area:document.getElementById("action_target_area"+a),flags:document.getElementById("action_flags"+a),vacation:document.getElementById("action_vacation"+a),set:document.getElementById("action_set"+a),notify:document.getElementById("action_notify"+a)};"fileinto"==b||"fileinto_copy"==b?c.mailbox=1:"redirect"==
  53. b||"redirect_copy"==b?c.target=1:b.match(/^reject|ereject$/)?c.target_area=1:b.match(/^(add|set|remove)flag$/)?c.flags=1:"vacation"==b?c.vacation=1:"set"==b?c.set=1:"notify"==b&&(c.notify=1);for(var d in a)a[d].style.display=c[d]?"inline":"none"}function vacation_action_select(){var a=$("#vacation_action").val();$("#action_target_span")["discard"==a||"keep"==a?"hide":"show"]()}
  54. function smart_field_init(a){var b=a.id+"_list",c=$('<span class="listarea"></span>'),d=a.value?a.value.split("\n"):[""];$("#"+b).length||($.each(d,function(b,d){c.append(smart_field_row(d,a.name,b,$(a).data("size")))}),c.attr("id",b),a=$(a),a.attr("disabled")?c.hide():a.prop("disabled",!0),a.after(c),a.hasClass("error")&&(c.addClass("error"),rcmail.managesieve_tip_register([[b,a.data("tip")]])))}
  55. function smart_field_row(a,b,c,d){c=$('<span class="listelement"><span class="reset"></span><input type="text"></span>');a={value:a,name:b+"[]"};d&&(a.size=d);$("input",c).attr(a).keydown(function(a){var b=$(this);if(13==a.which){a=b.attr("name").replace(/\[\]$/,"");var c=(new Date).getTime();a=smart_field_row("",a,c,d);b.parent().after(a);$("input",a).focus()}else if((8==a.which||46==a.which)&&""==b.val()&&(b=b.parent(),1<b.parent().children().length))return b.prev().length?b.prev().children("input").focus():
  56. b.next().children("input").focus(),b.remove(),!1});$('span[class="reset"]',c).click(function(){var a=$(this.parentNode);1<a.parent().children().length?a.remove():$("input",a).val("").focus()});return c}function smart_field_reset(a,b){var c=b.length?b:[""];area=$("#"+(a.id+"_list"));area.empty();$.each(c,function(b,c){area.append(smart_field_row(c,a.name,b,$(a).data("size")))})}
  57. rcube_webmail.prototype.managesieve_tip_register=function(a){var b,c=parent.rcmail,d=c?parent.rcmail.env.ms_tip_layer:rcmail.env.ms_tip_layer;for(b in a)$("#"+a[b][0]).data("tip",a[b][1]).mouseleave(function(a){d.hide()}).mouseenter(function(a){a=$(this);var b=a.offset(),l=b.left,g=b.top-12,m=a.width();c&&(b=$("mail"==rcmail.env.task?"#sievefilterform > iframe":"#filter-box",parent.document).offset(),g+=b.top,l+=b.left);d.html(a.data("tip"));g-=d.height();d.css({left:l,top:g,minWidth:m-2+"px"}).show()})};
  58. function sieve_formattime(a,b){var c,d,e="",f=rcmail.env.time_format||"H:i";for(c=0;c<f.length;c++)switch(d=f.charAt(c),d){case "a":e+=12<a?"am":"pm";break;case "A":e+=12<a?"AM":"PM";break;case "g":case "h":e+=("h"==d&&10>a?"0":"")+a;break;case "G":e+=a;break;case "H":e+=(10>a?"0":"")+a;break;case "i":e+=(10>b?"0":"")+b;break;case "s":e+="00";default:e+=d}return e}
  59. function sieve_form_init(){$('select[name="_header[]"]',rcmail.gui_objects.sieveform).each(function(){"..."==this.value&&(this.style.width="40px")});"plugin.managesieve"==rcmail.env.action&&"mail"==rcmail.env.task&&parent.rcmail.managesieve_dialog_resize(rcmail.gui_objects.sieveform);$('input[type="text"]:first',rcmail.gui_objects.sieveform).focus();$('textarea[data-type="list"]',rcmail.gui_objects.sieveform).each(function(){smart_field_init(this)});$.datepicker&&rcmail.env.date_format&&($.datepicker.setDefaults({dateFormat:rcmail.env.date_format,
  60. changeMonth:!0,showOtherMonths:!0,selectOtherMonths:!0,onSelect:function(a){$(this).focus().val(a)}}),$("input.datepicker").datepicker());$("#vacation_timefrom, #vacation_timeto").attr("autocomplete","off").autocomplete({delay:100,minLength:1,source:function(a,b){var c,d=[];for(c=0;24>c;c++)d.push(sieve_formattime(c,0));d.push(sieve_formattime(23,59));return b(d)},open:function(a,b){var c=$(this),d=c.val(),e=c.autocomplete("widget").css("width","10em"),f=c.data("ui-autocomplete").menu;d&&d.length&&
  61. e.children().each(function(){var a=$(this);0==a.text().indexOf(d)&&f._scrollIntoView(a)})},select:function(a,b){$(this).val(b.item.value);return!1}}).click(function(){$(this).autocomplete("search",$(this).val()||" ")})}
  62. rcube_webmail.prototype.managesieve_create=function(a){if(!a&&"show"!=this.env.action){var b=this.message_list.get_single_selection();a=this.set_busy(!0,"loading");this.http_post("plugin.managesieve-action",{_uid:b},a)}else if(this.env.sieve_headers&&this.env.sieve_headers.length){var c={},d=$("#sievefilterform");d.length||(d=$('<div id="sievefilterform"></div>'),$("body").append(d));a="<fieldset><legend>"+this.get_label("managesieve.usedata")+"</legend><ul>";for(b in this.env.sieve_headers)a+='<li><input type="checkbox" name="headers[]" id="sievehdr'+
  63. b+'" value="'+b+'" checked="checked" /><label for="sievehdr'+b+'">'+this.env.sieve_headers[b][0]+":</label> "+this.env.sieve_headers[b][1]+"</li>";d.html(a+"</ul></fieldset>");c[this.get_label("managesieve.nextstep")]=function(){var a=$('input[name="headers[]"]:checked',d);if(a.length){var b=rcmail.get_task_url("mail"),b=rcmail.add_url(b,"_action","plugin.managesieve"),b=rcmail.add_url(b,"_framed",1);a.map(function(){var a=rcmail.env.sieve_headers[this.value];b=rcmail.add_url(b,"r["+this.value+"]",
  64. a[0]+":"+a[1])});a=$("<iframe>").attr({src:b,frameborder:0});d.empty().append(a).dialog("widget").resize();c={};c[rcmail.get_label("save")]=function(){$("iframe",d).get(0).contentWindow.rcmail.managesieve_save()};d.dialog("option","buttons",c)}else alert(rcmail.get_label("managesieve.nodata"))};d.dialog({modal:!1,resizable:!0,closeOnEscape:!bw.ie7,title:this.get_label("managesieve.newfilter"),close:function(){rcmail.managesieve_dialog_close()},buttons:c,minWidth:600,minHeight:300,height:250}).show();
  65. this.env.managesieve_dialog=d}};rcube_webmail.prototype.managesieve_dialog_close=function(){var a=this.env.managesieve_dialog;a.html("");a.dialog("destroy").hide()};rcube_webmail.prototype.managesieve_dialog_resize=function(a){var b=this.env.managesieve_dialog,c=$(window),d=$(a);width=$("fieldset:first",a).width();height=d.height();w=c.width();h=c.height();b.dialog("option",{height:Math.min(h-20,height+120),width:Math.min(w-20,width+65)}).dialog("option","position",["center","center"])};