Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ui.min.js 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * Roundcube functions for default skin interface
  3. *
  4. * Copyright (c) 2013, The Roundcube Dev Team
  5. *
  6. * The contents are subject to the Creative Commons Attribution-ShareAlike
  7. * License. It is allowed to copy, distribute, transmit and to adapt the work
  8. * by keeping credits to the original autors in the README file.
  9. * See http://creativecommons.org/licenses/by-sa/3.0/ for details.
  10. *
  11. * @license magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt CC0-1.0
  12. */
  13. /*
  14. magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt CC0-1.0
  15. */
  16. function rcube_mail_ui(){function f(a){p||(p=rcmail.local_storage_get_item("prefs.larry",{}));if(null==p[a]){var d=rcmail.get_cookie(a);null!=d&&(p[a]=d,rcmail.local_storage_set_item("prefs.larry",p)&&rcmail.set_cookie(a,d,new Date))}return p[a]}function q(a,d){p[a]=d;if(!rcmail.local_storage_set_item("prefs.larry",p)){var c=new Date;c.setYear(c.getFullYear()+1);rcmail.set_cookie(a,d,c)}}function s(a){a=a?10:0;rcmail.resize_timeout&&window.clearTimeout(rcmail.resize_timeout);rcmail.resize_timeout=
  17. window.setTimeout(function(){"mail"==rcmail.env.task&&("show"==rcmail.env.action||"preview"==rcmail.env.action?v():"compose"==rcmail.env.action&&t());$("body.iframe .footerleft").each(function(){var a=$(this),c=$(document.body),b=a.hasClass("floating"),g=c.outerHeight(!0)>$(window).height();g!=b&&(b=g?"addClass":"removeClass",a[b]("floating"),c[b]("floatingbuttons"))})},a)}function k(a){var d=$(a.object).siblings("div");d.length&&$(a.object).insertBefore(d.first());if("error"==a.type&&"login"!=rcmail.env.task){rcmail.hide_message(a.object);
  18. l.message_timer&&window.clearTimeout(l.message_timer);l.messagedialog||(l.messagedialog=$("<div>").addClass("popupdialog").hide());var d=a.message,c=function(){l.messagedialog.is(":visible")&&l.messagedialog.dialog("destroy").hide()};l.messagedialog.is(":visible")&&l.messagedialog.text()!=d&&(d=l.messagedialog.html()+"<p>"+a.message+"</p>");l.messagedialog.html(d).dialog({resizable:!1,closeOnEscape:!0,dialogClass:"popupmessage "+a.type,title:r.errortitle,close:c,position:["center","center"],hide:{effect:"fadeOut"},
  19. width:420,minHeight:90}).show();l.messagedialog.closest("div[role=dialog]").attr("role","alertdialog");0<a.timeout&&(l.message_timer=window.setTimeout(c,a.timeout))}}function v(){$("#messagecontent").css("top",$("#messageheader").outerHeight()+1+"px");$("#message-objects div a").addClass("button");$("#attachment-list li").length||($("div.rightcol").hide().attr("aria-hidden","true"),$("div.leftcol").css("margin-right","0"));var a=$("#messagebody.mailvelope, #messagebody > .mailvelope");if(a.length){var d=
  20. $("#messagecontent").length?$("#messagecontent").height()-16:$(window).height()-a.offset().top-10;a.height(d)}}function b(a){}function e(a){}function F(a){if("TEXTAREA"==a.nodeName){var d=$(a),c=a.scrollHeight;d.css("height",14*(80<a.value.length&&21<c?2:1)+"px");t()}}function t(){var a=$("#composebody"),d=$("#compose-content"),c=$("#composeview-bottom"),b,g;b=d.height()-c.position().top;g=300-b;c.height(Math.max(300,b));d.css("overflow",0<g?"auto":"hidden");d=a.parent().width()-5;c=a.parent().height()-
  21. 8;a.width(d).height(c);$("#composebodycontainer > div").width(d+8);$("#composebody_ifr").height(c+4-$("div.mce-toolbar").height());$("#googie_edit_layer").width(d).height(c);a=$("#directorylist");a.length&&$("#compose-contacts .scroller").css("top",a.position().top+a.outerHeight())}function A(a){var d=$("#quotadisplay"),c=$("#quotamenu"),b=a.total?24*Math.ceil(a.percent/100*20):0;a.total&&480==b&&100>a.percent&&(b-=24);d.css("background-position","0 -"+b+"px");d.attr("class","countdisplay p"+10*Math.round(a.percent/
  22. 10));a.table&&(c.length||(c=$('<div id="quotamenu" class="popupmenu">').appendTo($("body"))),c.html(a.table),d.css("cursor","pointer").off("click").on("click",function(a){return rcmail.command("menu-open","quotamenu",a.target,a)}))}function G(a){$(".boxtitle a.search",a).click(function(d){var c=$(".boxtitle",a),b=$(".listsearchbox",a),g=b.is(":visible")?-1:1,m=34+($("select",b).length?22:0);b.slideToggle({duration:160,progress:function(d,b){0>g&&(b=1-b);$(".scroller",a).css("top",c.outerHeight()+
  23. m*b+"px")},complete:function(){b.toggleClass("expanded");b.is(":visible")?(b.find("input[type=text]").focus(),m=34+($("select",b).length?$("select",b).outerHeight()+4:0),$(".scroller",a).css("top",c.outerHeight()+m+"px")):$("a.reset",b).click()}});return!1})}function L(a){"reply-list"==a.command&&1==rcmail.env.reply_all_mode?(a=rcmail.gettext(a.status?"replylist":"replyall"),"preview"==rcmail.env.action?$("a.button.replyall").attr("title",a):$("a.button.reply-all").text(a).attr("title",a)):"compose-encrypted"==
  24. a.command&&$("a.button.encrypt").show()}function B(a,d){var b=w[a]=$("#"+a);b.appendTo(document.body);b.length&&(u[a]=$.extend(u[a]||{},d||{}))}function H(){$("#preview-shortheaders").toggle();var a=$("#preview-allheaders").toggle(),d=$("a#previewheaderstoggle");a.is(":visible")?d.attr("href","#hide").removeClass("add").addClass("remove").attr("aria-expanded","true"):d.attr("href","#details").removeClass("remove").addClass("add").attr("aria-expanded","false");q("previewheaders",a.is(":visible")?"1":
  25. "0")}function x(a,d){if(d||!$("#mail"+a+"mode").hasClass("disabled"))$("#maillistmode, #mailthreadmode").removeClass("selected").attr("tabindex","0").attr("aria-disabled","false"),$("#mail"+a+"mode").addClass("selected").attr("tabindex","-1").attr("aria-disabled","true")}function y(a){if(a&&"messagelistmenu"==a.name)M(a);else if(a){var d=u[a.name]||{},b=$(d.link||"#"+a.name+"link"),e=a.obj&&a.obj.is(":visible");if(a.obj&&e&&b.length){var g=b.parent();$(window);g.hasClass("dropbutton")&&(b=g);if(d.above||
  26. b.hasClass("dropbutton"))g=b.offset(),a.obj.css({left:g.left+"px",top:g.top+(d.above?-a.obj.height():b.outerHeight())+"px"})}a.obj&&d.iconized&&a.obj.children("ul").addClass("iconized");a.obj&&d.editable&&a.obj.attr("data-editable","true");"function"==typeof d.callback&&d.callback(e,a)}}function N(a,b){var c=a.parentNode.id.replace(/^attach/,"");$("#attachmenuopen").off("click").attr("onclick","").click(function(a){return rcmail.command("open-attachment",c,this)});$("#attachmenudownload").off("click").attr("onclick",
  27. "").click(function(){rcmail.command("download-attachment",c,this)});u.attachmentmenu.link=a;rcmail.command("menu-open",{menu:"attachmentmenu",id:c},a,b)}function M(a){var b=$("#listoptions");b.is(":visible")?b.dialog("close",a.originalEvent):($('input[name="sort_col"][value="'+rcmail.env.sort_col+'"]').prop("checked",!0),$('input[name="sort_ord"][value="DESC"]').prop("checked","DESC"==rcmail.env.sort_order),$('input[name="sort_ord"][value="ASC"]').prop("checked","DESC"!=rcmail.env.sort_order),$('input[name="list_col[]"]').each(function(){$(this).prop("checked",
  28. -1!=$.inArray(this.value,rcmail.env.listcols))}),b.dialog({modal:!0,resizable:!1,closeOnEscape:!0,title:null,open:function(a){setTimeout(function(){b.find("a, input:not(:disabled)").not("[aria-disabled=true]").first().focus()},100)},close:function(a){b.dialog("destroy").hide();a.originalEvent&&rcube_event.is_keyboard(a.originalEvent)&&$("#listmenulink").focus()},minWidth:500,width:b.width()+25}).show())}function O(a){$("#listoptions").dialog("close");rcube_event.is_keyboard(a.originalEvent)&&$("#listmenulink").focus();
  29. a=$('input[name="sort_col"]:checked').val();var b=$('input[name="sort_ord"]:checked').val(),c=$('input[name="list_col[]"]:checked').map(function(){return this.value}).get();rcmail.set_list_options(c,a,b,rcmail.env.threading)}function P(a){a=$("#contacts-table");var b=a.parent().css("overflow","hidden");a.clone().css({position:"absolute",top:"0",left:"0",width:a.width()+"px","z-index":10}).appendTo(b).animate({left:-(a.width()+5)+"px"},300,"swing",function(){$(this).remove();b.css("overflow","auto")})}
  30. function Q(a){a=$("#contacts-table");var b=a.parent().css("overflow","hidden"),c=a.clone().appendTo(b);a.css({position:"absolute",top:"0",left:-(a.width()+5)+"px",width:a.width()+"px",height:a.height()+"px","z-index":10}).animate({left:"0"},300,"linear",function(){c.remove();$(this).css({position:"relative",left:"0",width:"100%",height:"auto","z-index":1});b.css("overflow","auto")})}function z(a){var b=$("#upload-dialog");b.is(":visible")?b.dialog("close"):rcmail.mailvelope_editor||("compose"!=rcmail.env.action||
  31. b.data("extended")||($("<a>").addClass("iconlink add").attr("href","#add").html("Add").appendTo($('input[type="file"]',b).parent()).click(I),b.data("extended",!0)),b.dialog({modal:!0,resizable:!1,closeOnEscape:!0,title:b.attr("title"),open:function(a){document.all||$("input[type=file]",b).first().click()},close:function(){try{$("#upload-dialog form").get(0).reset()}catch(a){}b.dialog("destroy").hide();$("div.addline",b).remove()},width:480}).show())}function I(a){a=$(this).parent();a=a.clone().addClass("addline").insertAfter(a);
  32. a.children(".iconlink").click(I);a.children("input").val("");document.all||$("input[type=file]",a).click()}function C(a,b){var c=$("#compose-"+a);if(!c.is(":visible"))return D[a]&&!b&&$("#_"+a).val(D[a]),c.show(),$("#"+a+"-link").hide(),t(),$("input,textarea",c).focus(),!1}function J(a,b){var c=$(a),e=c.get(0).id,g=c.children("fieldset");if(g.length){e||(e="rcmtabcontainer",c.attr("id",e));var m=$("<ul>").addClass("tabsbar").prependTo(c);g.each(function(a){var b,c=$(this),d=c.children("legend"),g=
  33. e+"-t"+a;b=$("<a>").text(d.text()).attr("href","#"+g);a=$("<li>").addClass("tablink");d.remove();c.attr("id",g);a.append(b).appendTo(m)});c.tabs({active:b||0,heightStyle:"content",activate:function(a,b){s()}})}}var r={},w={},u={forwardmenu:{editable:1},searchmenu:{editable:1,callback:function(a){if(a&&rcmail.env.search_mods){var b,c;a=$('input:checkbox[name="s_mods[]"]',w.searchmenu);var e=rcmail.env.mailbox,g=rcmail.env.search_mods,m=rcmail.env.search_scope||"base";"mail"==rcmail.env.task?("all"==
  34. m&&(e="*"),g=g[e]?g[e]:g["*"],c="text",$('input:radio[name="s_scope"]').prop("checked",!1).filter("#s_scope_"+m).prop("checked",!0)):c="*";if(g[c])a.map(function(){this.checked=!0;this.disabled=this.value!=c});else for(b in a.prop("disabled",!1).prop("checked",!1),g)$("#s_mod_"+b).prop("checked",!0)}}},attachmentmenu:{},listoptions:{editable:1},groupmenu:{above:1},mailboxmenu:{above:1},spellmenu:{callback:function(a,b){var c,e,g,m=rcmail.spellcheck_lang(),f=$("ul",b.obj);if(!f.length){f=$('<ul class="toolbarmenu selectable" role="menu">');
  35. for(c in rcmail.env.spell_langs)g=$('<li role="menuitem">'),e=$('<a href="#'+c+'" tabindex="0"></a>').text(rcmail.env.spell_langs[c]).addClass("active").data("lang",c).on("click keypress",function(a){if("keypress"!=a.type||13==rcube_event.get_keycode(a))return rcmail.spellcheck_lang_set($(this).data("lang")),rcmail.hide_menu("spellmenu",a),!1}),e.appendTo(g),g.appendTo(f);f.appendTo(b.obj)}$("li",f).each(function(){var a=$("a",this);a.data("lang")==m?a.addClass("selected").attr("aria-selected","true"):
  36. a.hasClass("selected")&&a.removeClass("selected").removeAttr("aria-selected")})}},"folder-selector":{iconized:1}},l=this,n,D={},p;this.set=function(a,b){r[a]=b};this.init=function(){rcmail.addEventListener("message",k);$("#taskbar a").each(function(a,b){$(b).append('<span class="tooltip">'+$(".button-inner",this).html()+"</span>")});$("#taskbar .minmodetoggle").click(function(a){a=$(document.body).toggleClass("minimal").hasClass("minimal");q("minimalmode",a?1:0);$(window).resize()});if("mail"==rcmail.env.task){rcmail.addEventListener("menu-open",
  37. y).addEventListener("menu-close",y).addEventListener("menu-save",O).addEventListener("enable-command",L).addEventListener("responseafterlist",function(a){x(rcmail.env.threading?"thread":"list",!0)}).addEventListener("responseaftersearch",function(a){x(rcmail.env.threading?"thread":"list",!0)});var a=$("#dragmessagemenu");a.length&&(rcmail.gui_object("dragmenu","dragmessagemenu"),w.dragmenu=a);if("show"==rcmail.env.action||"preview"==rcmail.env.action)rcmail.addEventListener("aftershow-headers",function(){v()}).addEventListener("afterhide-headers",
  38. function(){v()}),$("#previewheaderstoggle").click(function(a){H();this.blur&&!rcube_event.is_keyboard(a)&&this.blur();return!1}),$("#attachment-list > li").each(function(){$(this).append($('<a class="drop" tabindex="0" aria-haspopup="true">Show options</a>').on("click keypress",function(a){if("keypress"!=a.type||13==rcube_event.get_keycode(a))return N(this,a),!1}))}),"1"==f("previewheaders")&&H();else if("compose"==rcmail.env.action){rcmail.addEventListener("aftersend-attachment",z).addEventListener("aftertoggle-editor",
  39. function(a){window.setTimeout(function(){t()},200);a&&a.mode&&$("select[name='editorSelector']").val(a.mode)}).addEventListener("compose-encrypted",function(a){$("select[name='editorSelector']").prop("disabled",a.active);$("a.button.attach, a.button.responses")[a.active?"addClass":"removeClass"]("disabled");$("#responseslist a.insertresponse")[a.active?"removeClass":"addClass"]("active")});for(var d,c,E=["cc","bcc","replyto","followupto"],a=0;a<E.length;a++)d=E[a],c=$("#_"+d),c.length&&(c.on("change",
  40. {v:d},function(a){this.value&&C(a.data.v,!0)}),""!=c.val()&&C(d,!0));$("#composeoptionstoggle").click(function(a){var b=$("#composeoptions").toggle().is(":visible");$("#composeoptionstoggle").toggleClass("remove").attr("aria-expanded",b?"true":"false");t();q("composeoptions",b?"1":"0");rcube_event.is_keyboard(a)||this.blur();return!1}).css("cursor","pointer");"0"!==f("composeoptions")&&$("#composeoptionstoggle").click();$("textarea[name='_to'], textarea[name='_cc'], textarea[name='_bcc']").change(function(a){F(this)}).change();
  41. rcmail.addEventListener("autocomplete_insert",function(a){F(a.field)});(a=rcmail.opener())&&"compose"==a.env.action&&$("#composeoptionstoggle",opener.document).hasClass("remove")&&$("#composeoptionstoggle").click();(new rcube_splitter({id:"composesplitterv",p1:"#composeview-left",p2:"#composeview-right",orientation:"v",relative:!0,start:206,min:170,size:12,render:t})).init()}else"list"!=rcmail.env.action&&rcmail.env.action?"get"==rcmail.env.action&&(new rcube_splitter({id:"mailpartsplitterv",p1:"#messagepartheader",
  42. p2:"#messagepartcontainer",orientation:"v",relative:!0,start:226,min:150,size:12})).init():(a=$("#mailpreviewframe").is(":visible"),$("#mailpreviewtoggle").addClass(a?"enabled":"closed").attr("aria-expanded",a?"true":"false").click(function(a){a=$(a.target);var b=$("#mailpreviewframe"),c=!b.is(":visible");n.pos||parseInt(f("mailviewsplitter")||320);var d;b.toggle();a.toggleClass("enabled closed").attr("aria-expanded",c?"true":"false");c?($("#mailview-top").removeClass("fullheight").css({bottom:"auto"}),
  43. $("#mailview-bottom").css({height:"auto"}).show(),rcmail.env.contentframe="messagecontframe",(d=rcmail.message_list.get_single_selection())&&rcmail.show_message(d,!1,!0),n.handle?(n.handle.show(),n.resize()):n.init()):(rcmail.env.contentframe=null,rcmail.show_contentframe(!1),$("#mailview-top").addClass("fullheight").css({height:"auto",bottom:"0px"}),$("#mailview-bottom").css({top:"auto",height:"0px"}).hide(),n.handle&&n.handle.hide());rcmail.message_list&&(c&&d&&rcmail.message_list.scrollto(d),rcmail.message_list.resize());
  44. rcmail.command("save-pref",{name:"preview_pane",value:c?1:0});return!1}),$("#maillistmode").addClass(rcmail.env.threading?"":"selected").click(function(a){x("list");return!1}),$("#mailthreadmode").addClass(rcmail.env.threading?"selected":"").click(function(a){x("thread");return!1}),n=new rcube_splitter({id:"mailviewsplitter",p1:"#mailview-top",p2:"#mailview-bottom",orientation:"h",relative:!0,start:276,min:150,size:12,offset:4}),a&&n.init(),rcmail.init_pagejumper("#pagejumper"),rcmail.addEventListener("setquota",
  45. A).addEventListener("afterimport-messages",z));$("#mailview-left").length&&(new rcube_splitter({id:"mailviewsplitterv",p1:"#mailview-left",p2:"#mailview-right",orientation:"v",relative:!0,start:206,min:150,size:12,callback:b,render:e})).init()}else if("settings"==rcmail.env.task)if(rcmail.addEventListener("init",function(){var a="#settingstabpreferences";rcmail.env.action&&(a="#settingstab"+(0<rcmail.env.action.indexOf("identity")?"identities":rcmail.env.action.replace(/\./g,"")));$(a).addClass("selected").children().first().removeAttr("onclick").click(function(){return!1})}),
  46. "folders"==rcmail.env.action)(new rcube_splitter({id:"folderviewsplitter",p1:"#folderslist",p2:"#folder-details",orientation:"v",relative:!0,start:266,min:180,size:12})).init(),rcmail.addEventListener("setquota",A),G($("#folderslist"));else if("identities"==rcmail.env.action)(new rcube_splitter({id:"identviewsplitter",p1:"#identitieslist",p2:"#identity-details",orientation:"v",relative:!0,start:266,min:180,size:12})).init();else if("responses"==rcmail.env.action)(new rcube_splitter({id:"responseviewsplitter",
  47. p1:"#identitieslist",p2:"#identity-details",orientation:"v",relative:!0,start:266,min:180,size:12})).init();else if("preferences"==rcmail.env.action||!rcmail.env.action)(new rcube_splitter({id:"prefviewsplitter",p1:"#sectionslist",p2:"#preferences-box",orientation:"v",relative:!0,start:266,min:180,size:12})).init();else{if("edit-prefs"==rcmail.env.action){var a=$("#preferences-details fieldset.advanced legend"),g=$('<a href="#toggle"></a>').text(r.toggleoptions).attr("title",r.toggleoptions).addClass("advanced-toggle");
  48. a.click(function(a){g.html($(this).hasClass("collapsed")?"&#9650;":"&#9660;");$(this).toggleClass("collapsed").closest("fieldset").children(".propform").toggle()}).append(g).addClass("collapsed");bw.mz&&a.parents("form").css("display","inline")}}else"addressbook"==rcmail.env.task&&(rcmail.addEventListener("afterupload-photo",z).addEventListener("beforepushgroup",P).addEventListener("beforepopgroup",Q).addEventListener("menu-open",y).addEventListener("menu-close",y),""==rcmail.env.action&&((new rcube_splitter({id:"addressviewsplitterd",
  49. p1:"#addressview-left",p2:"#addressview-right",orientation:"v",relative:!0,start:206,min:150,size:12,render:e})).init(),(new rcube_splitter({id:"addressviewsplitter",p1:"#addresslist",p2:"#contacts-box",orientation:"v",relative:!0,start:266,min:260,size:12})).init()),a=$("#dragcontactmenu"),a.length&&(rcmail.gui_object("dragmenu","dragcontactmenu"),w.dragmenu=a));$(".tabbed").each(function(a,b){J(b)});$("select.decorated").each(function(){if(bw.opera)$(this).removeClass("decorated");else{var a=$(this),
  50. b=a.parent(),c=Math.max(a.height(),26)-2,d=a.width()-22,e=$("option",this).first().text();""!=$("option:selected",this).val()&&(e=$("option:selected",this).text());var g=$('<a class="menuselector" tabindex="-1"><span class="handle">'+e+"</span></a>").css("position","absolute").offset(a.position()).insertAfter(a);g.children().width(d).height(c).css("line-height",c-1+"px");"absolute"!=b.css("position")&&b.css("position","relative");a.width(g.width()).on(bw.mz?"change keyup":"change",function(){var a=
  51. $("option:selected",this).text();$(this).next().children().text(a)});a.on("focus",function(a){g.addClass("focus")}).on("blur",function(a){g.removeClass("focus")})}});a=$("body.minwidth");a.length&&a.css("min-width",$(".toolbar").width()+$("#quicksearchbar").width()+$("#searchfilter").width()+30);window.onresize=s;s()};this.init_tabs=J;this.show_about=function(a){var b=$("<iframe>").attr({id:"aboutframe",src:rcmail.url("settings/about"),frameborder:"0"});h=Math.floor(0.75*$(window).height());buttons=
  52. {};supportln=$("#supportlink");supportln.length&&(r.supporturl=supportln.attr("href"))&&(buttons[supportln.html()]=function(a){0>r.supporturl.indexOf("mailto:")?window.open(r.supporturl):location.href=r.supporturl});b.dialog({modal:!0,resizable:!1,closeOnEscape:!0,title:a?a.title||a.innerHTML:null,close:function(){b.dialog("destroy").remove()},buttons:buttons,width:640,height:h}).width(640)};this.show_popup=function(a,b,c){!c&&u[a]||B(a,c);c=u[a]||{};c=$(c.link?c.link:"#"+a+"link");var e=c.offset();
  53. c.has(".inner")&&(c=c.children(".inner"));return rcmail.command("menu-open",{menu:a,show:b},c.get(0),$.Event("click",{target:c.get(0),pageX:e.left,pageY:e.top,clientX:e.left,clientY:e.top}))};this.toggle_popup=function(a,b,c){!c&&u[a]||B(a,c);return rcmail.command("menu-open",a,b.target,b)};this.add_popup=B;this.set_searchmod=function(a){var b,c;b=rcmail.env.task;var e=rcmail.env.search_mods,g=rcmail.env.mailbox;"all"==$('input[name="s_scope"]:checked').val()&&(g="*");e||(e={});"mail"==b?(e[g]||(e[g]=
  54. rcube_clone_object(e["*"])),c=e[g],b="text"):(c=e,b="*");a.checked?c[a.value]=1:delete c[a.value];a.value==b&&$('input:checkbox[name="s_mods[]"]').map(function(){this!=a&&(this.checked=!0,a.checked?(this.disabled=!0,delete c[this.value]):(this.disabled=!1,c[this.value]=1))});rcmail.set_searchmods(c)};this.set_searchscope=function(a){rcmail.set_searchscope(a.value)};this.show_uploadform=z;this.show_header_row=C;this.hide_header_row=function(a){var b=$("#_"+a);D[a]=b.val();b.val("");$("#compose-"+a).hide();
  55. $("#"+a+"-link").show();t();return!1};this.update_quota=A;this.get_pref=f;this.save_pref=q;this.folder_search_init=G;if(window.$&&document.body){var K=f("minimalmode");(parseInt(K)||null===K&&850>$(window).height())&&$(document.body).addClass("minimal");bw.tablet&&$("#viewport").attr("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0")}}
  56. function rcube_scroller(f,q,s){var k=this;this.list=$(f);this.top=$(q);this.bottom=$(s);this.step_size=6;this.step_time=20;this.delay=500;this.top.mouseenter(function(){rcmail.drag_active&&(k.ts=window.setTimeout(function(){k.scroll("down")},k.delay))}).mouseout(function(){k.ts&&window.clearTimeout(k.ts)});this.bottom.mouseenter(function(){rcmail.drag_active&&(k.ts=window.setTimeout(function(){k.scroll("up")},k.delay))}).mouseout(function(){k.ts&&window.clearTimeout(k.ts)});this.scroll=function(f){var b=
  57. this,e=this.step_size;rcmail.drag_active&&("down"==f&&(e*=-1),this.list.get(0).scrollTop+=e,this.ts=window.setTimeout(function(){b.scroll(f)},this.step_time))}}
  58. function rcube_splitter(f){function q(e){if(bw.konq||bw.chrome||bw.safari)document.body.style.webkitUserSelect="none";b.p1pos=b.relative?b.p1.position():b.p1.offset();b.p2pos=b.relative?b.p2.position():b.p2.offset();b.drag_active=!0;$(document).on("mousemove."+this.id,s).on("mouseup."+this.id,k);$("iframe").each(function(b,e){$("<div>").attr("id","iframe-splitter-fix-"+b).addClass("iframe-splitter-fix").css({background:"#fff",width:e.offsetWidth+"px",height:e.offsetHeight+"px",position:"absolute",
  59. opacity:"0.001",zIndex:1E3}).css($(this).offset()).appendTo("body")})}function s(e){if(!b.drag_active)return!1;window.clearTimeout(b.ts);b.ts=window.setTimeout(function(){var f=rcube_event.get_mouse_pos(e);if(b.relative){var k=b.parent.offset();f.x-=k.left;f.y-=k.top}b.horizontal?f.y-b.halfsize>b.p1pos.top&&f.y+b.halfsize<b.p2pos.top+b.p2.outerHeight()&&(b.pos=Math.max(b.min,f.y-Math.max(0,b.offset)),b.pos>b.min&&(b.pos=Math.min(b.pos,b.parent.height()-b.min)),b.resize()):f.x-b.halfsize>b.p1pos.left&&
  60. f.x+b.halfsize<b.p2pos.left+b.p2.outerWidth()&&(b.pos=Math.max(b.min,f.x-Math.max(0,b.offset)),b.pos>b.min&&(b.pos=Math.min(b.pos,b.parent.width()-b.min)),b.resize());b.p1pos=b.relative?b.p1.position():b.p1.offset();b.p2pos=b.relative?b.p2.position():b.p2.offset()},1);return!1}function k(e){if(bw.konq||bw.chrome||bw.safari)document.body.style.webkitUserSelect="auto";$(document).off("."+b.id);b.drag_active=!1;$("div.iframe-splitter-fix").remove();b.set_cookie();"function"==typeof b.callback&&b.callback(b);
  61. return bw.safari?!0:rcube_event.cancel(e)}function v(e){b.horizontal?(e=parseInt(b.parent.outerHeight(),10)-parseInt(b.p2[0].style.top,10)-(bw.ie8?2:0),b.p2.css("height",(0<e?e:0)+"px")):(e=parseInt(b.parent.outerWidth(),10)-parseInt(b.p2[0].style.left,10),b.p2.css("width",(0<e?e:0)+"px"))}this.p=f;this.id=f.id;this.horizontal="horizontal"==f.orientation||"h"==f.orientation;this.halfsize=(void 0!==f.size?f.size:10)/2;this.pos=f.start||0;this.min=f.min||20;this.offset=f.offset||0;this.relative=f.relative?
  62. !0:!1;this.drag_active=!1;this.render=f.render;this.callback=f.callback;var b=this;rcube_splitter._instances[this.id]=b;this.init=function(){this.p1=$(this.p.p1);this.p2=$(this.p.p2);this.parent=this.p1.parent();if(this.p1.length&&this.p2.length){this.p1pos=this.relative?this.p1.position():this.p1.offset();this.p2pos=this.relative?this.p2.position():this.p2.offset();this.handle=$("<div>").attr("id",this.id).attr("unselectable","on").attr("role","presentation").addClass("splitter "+(this.horizontal?
  63. "splitter-h":"splitter-v")).appendTo(this.parent).mousedown(q);if(this.horizontal){var b=this.p1pos.top+this.p1.outerHeight();this.handle.css({left:"0px",top:b+"px"})}else b=this.p1pos.left+this.p1.outerWidth(),this.handle.css({left:b+"px",top:"0px"});bw.ie&&$(window).resize(v);(b=this.get_cookie())&&!isNaN(b)?(this.pos=parseFloat(b),this.resize()):this.pos&&(this.resize(),this.set_cookie())}};this.resize=function(){if(this.horizontal){if(this.p1.css("height",Math.floor(this.pos-this.p1pos.top-Math.floor(this.halfsize))+
  64. "px"),this.p2.css("top",Math.ceil(this.pos+Math.ceil(this.halfsize)+2)+"px"),this.handle.css("top",Math.round(this.pos-this.halfsize+this.offset)+"px"),bw.ie){var b=parseInt(this.parent.outerHeight(),10)-parseInt(this.p2.css("top"),10)-(bw.ie8?2:0);this.p2.css("height",(0<b?b:0)+"px")}}else this.p1.css("width",Math.floor(this.pos-this.p1pos.left-Math.floor(this.halfsize))+"px"),this.p2.css("left",Math.ceil(this.pos+Math.ceil(this.halfsize))+"px"),this.handle.css("left",Math.round(this.pos-this.halfsize+
  65. this.offset+3)+"px"),bw.ie&&(b=parseInt(this.parent.outerWidth(),10)-parseInt(this.p2.css("left"),10),this.p2.css("width",(0<b?b:0)+"px"));this.p2.resize();this.p1.resize();this.drag_active&&$("iframe").each(function(b,e){var f=$(this).offset();$("#iframe-splitter-fix-"+b).css({top:f.top+"px",left:f.left+"px",width:e.offsetWidth+"px",height:e.offsetHeight+"px"})});"function"==typeof this.render&&this.render(this)};this.get_cookie=function(){return window.UI?UI.get_pref(this.id):null};this.set_cookie=
  66. function(){window.UI&&UI.save_pref(this.id,this.pos)}}rcube_splitter._instances={};rcube_splitter.get_instance=function(f){return rcube_splitter._instances[f]};