view skins/larry/ui.min.js @ 7:65fd7d441cf1

x
author Charlie Root
date Sat, 29 Dec 2018 06:32:49 -0500
parents 4681f974d28b
children bf99236cc5cd
line wrap: on
line source

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