64mail-theme/ui.min.js

14 lines
26 KiB
JavaScript
Raw Normal View History

2021-11-21 03:09:44 -06:00
/**
* Roundcube functions for default skin interface
*
* Copyright (c) The Roundcube Dev Team
*
* The contents are subject to the Creative Commons Attribution-ShareAlike
* License. It is allowed to copy, distribute, transmit and to adapt the work
* by keeping credits to the original autors in the README file.
* See http://creativecommons.org/licenses/by-sa/3.0/ for details.
*
* @license magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt CC0-1.0
*/
function rcube_mail_ui(){var a,o,i,e,s={},n={},r={forwardmenu:{editable:1},searchmenu:{editable:1,callback:function(e){if(e&&rcmail.env.search_mods){var t,i="*",s=n.searchmenu,a=$('input:checkbox[name="s_mods[]"]',s),o=rcmail.env.mailbox,e=rcmail.env.search_mods,s=rcmail.env.search_scope||"base";if("mail"==rcmail.env.task&&(e=e[o]||e["*"],i="text",$('input:radio[name="s_scope"]').prop("checked",!1).filter("#s_scope_"+s).prop("checked",!0)),e[i])a.map(function(){this.checked=!0,this.disabled=this.value!=i});else for(t in a.prop("disabled",!1).prop("checked",!1),e)$("#s_mod_"+t).prop("checked",!0)}}},attachmentmenu:{},listoptions:{editable:1},groupmenu:{above:1},mailboxmenu:{above:1},spellmenu:{callback:function(e,t){var i,s,a=rcmail.spellcheck_lang(),o=$("ul",t.obj);if(!o.length){for(i in o=$('<ul class="toolbarmenu selectable" role="menu">'),rcmail.env.spell_langs)s=$('<li role="menuitem">'),$('<a href="#'+i+'" tabindex="0"></a>').text(rcmail.env.spell_langs[i]).addClass("active").data("lang",i).on("click keypress",function(e){if("keypress"!=e.type||13==rcube_event.get_keycode(e))return rcmail.spellcheck_lang_set($(this).data("lang")),rcmail.hide_menu("spellmenu",e),!1}).appendTo(s),s.appendTo(o);o.appendTo(t.obj)}$("li",o).each(function(){var e=$("a",this);e.data("lang")==a?e.addClass("selected").attr("aria-selected","true"):e.hasClass("selected")&&e.removeClass("selected").removeAttr("aria-selected")})}},"folder-selector":{iconized:1}},l=this,c={};function d(e){var t;return null!=(i=i||rcmail.local_storage_get_item("prefs.larry",{}))[e]||null!=(t=rcmail.get_cookie(e))&&(i[e]=t,rcmail.local_storage_set_item("prefs.larry",i)&&rcmail.set_cookie(e,t,new Date)),i[e]}function p(e,t){i[e]=t,rcmail.local_storage_set_item("prefs.larry",i)||rcmail.set_cookie(e,t,!1)}function m(e){e=e?10:0;rcmail.resize_timeout&&window.clearTimeout(rcmail.resize_timeout),rcmail.resize_timeout=window.setTimeout(function(){"mail"==rcmail.env.task&&("show"==rcmail.env.action||"preview"==rcmail.env.action?v():"compose"==rcmail.env.action&&k()),$("body.iframe .footerleft").each(function(){var e=$(this),t=$(document.body),i=e.hasClass("floating"),s=t.outerHeight(!0)>$(window).height();s!=i&&(e[s=s?"addClass":"removeClass"]("floating"),t[s]("floatingbuttons"))})},e)}function u(e){var t,i=$(e.object).siblings("div");i.length&&$(e.object).insertBefore(i.first()),"error"==e.type&&"login"!=rcmail.env.task&&(rcmail.hide_message(e.object),l.message_timer&&window.clearTimeout(l.message_timer),l.messagedialog||(l.messagedialog=$("<div>").addClass("popupdialog").hide()),t=e.message,i=function(){l.messagedialog.is(":visible")&&l.messagedialog.dialog("destroy").hide()},l.messagedialog.is(":visible")&&l.messagedialog.text()!=t&&(t=l.messagedialog.html()+"<p>"+e.message+"</p>"),l.messagedialog.html(t).dialog({resizable:!1,closeOnEscape:!0,dialogClass:e.type,title:rcmail.gettext("errortitle"),close:i,hide:{effect:"fadeOut"},width:420,minHeight:90}).show(),l.messagedialog.closest("div[role=dialog]").attr("role","alertdialog"),0<e.timeout&&(l.message_timer=window.setTimeout(i,e.timeout)))}function f(e){var t=e?e.new_layout:rcmail.env.layout,i=$("#mailview-top"),s=$("#mailview-bottom");e&&$("#mainscreencontent").removeClass().addClass(t),$("#mailviewsplitter")["desktop"==t?"show":"hide"](),$("#mailviewsplitter2")["widescreen"==t?"show":"hide"](),$("#mailpreviewframe")["list"!=t?"show":"hide"](),rcmail.env.contentframe="list"==t?null:"messagecontframe","widescreen"==t?($("#countcontrols").detach().appendTo($("#messagelistheader")),i.css({height:"auto",width:394}),s.css({top:0,left:406,height:"auto"}).show(),o?o.resize():(o=new rcube_splitter({id:"mailviewsplitter2",p1:"#mailview-top",p2:"#mailview-bottom",orientation:"v",relative:!0,start:416,min:400,size:12})).init()):"desktop"==t?(i.css({height:270,width:"auto"}),s.css({left:0,top:284,height:"auto"}).show(),a?a.resize():(a=new rcube_splitter({id:"mailviewsplitter",p1:"#mailview-top",p2:"#mailview-bottom",orientation:"h",relative:!0,start:276,min:150,size:12,offset:4})).init()):(i.css({height:"auto",width:"auto"}),s.hi