momomail-roundcube-theme/ui.min.js

14 lines
60 KiB
JavaScript
Raw Normal View History

2024-04-20 10:57:49 +00:00
/**
* Roundcube webmail functions for the Elastic skin
*
* 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
*/
"use strict";function rcube_elastic_ui(){var a,f,n,R,t,i,N,o,e,s,r,W,P,U,q,l,c,H,d,u,p=this,m="normal",h="light",B=!1,F=!1,v=rcmail.is_framed(),g={config:{standard_windows:rcmail.env.standard_windows,message_extwin:rcmail.env.message_extwin,compose_extwin:rcmail.env.compose_extwin,help_open_extwin:rcmail.env.help_open_extwin},checkboxes:0,small_screen_config:{standard_windows:!0,message_extwin:!1,compose_extwin:!1,help_open_extwin:!1}},b={},Y=[],K=[],_={menu:$("#layout-menu"),sidebar:$("#layout-sidebar"),list:$("#layout-list"),content:$("#layout-content")},k={menu:$("a.task-menu-button"),back_sidebar:$("a.back-sidebar-button"),back_list:$("a.back-list-button"),back_content:$("a.back-content-button")};this.register_content_buttons=function(e){{var t;g.frame_nav&&e&&e.length&&(t=g.frame_nav.children(".buttons"),Y=[],$.each(e,function(){this.data("target")&&Y.push(this.data("target"))}),t.html("").append(e))}},this.menu_hide=O,this.menu_toggle=ce,this.menu_destroy=de,this.popup_init=z,this.about_dialog=function(e){var t,a,n=!1,i=$("<iframe>").attr({id:"aboutframe",src:rcmail.url("settings/about",{_framed:1})}),o=$("#supportlink");o.length&&(t=o.attr("href"))&&(n=o.text(),a=function(e){t.indexOf("mailto:")<0?window.open(t):location.href=t});rcmail.simple_dialog(i,$(e).text(),a,{button:n,button_class:"help",cancel_button:"close",height:400})},this.headers_dialog=function(){var e={_uid:rcmail.env.uid,_mbox:rcmail.env.mailbox,_framed:1},e=$("<iframe>").attr({id:"headersframe",src:rcmail.url("headers",e)});rcmail.simple_dialog(e,"arialabelmessageheaders",null,{cancel_button:"close",height:400})},this.import_dialog=function(){var t;rcmail.commands["import-messages"]&&(t=$("#uploadform").clone(!0),rcmail.simple_dialog(t,"importmessages",function(e){return rcmail.command("import-messages",$(t.find("form")[0]))},{button:"import",closeOnEscape:!0,minWidth:400}))},this.props_dialog=function(){var e=$("#properties-menu").clone();rcmail.simple_dialog(e,"properties",null,{cancel_button:"close",height:400})},this.headers_show=ue,this.spellmenu=function(e){var t,a,n=[],i=rcmail.spellcheck_lang(),o=$("ul",e);if(!o.length){for(t in o=$('<ul class="selectable listing iconized" role="menu">'),rcmail.env.spell_langs)a=$('<li role="menuitem">'),$('<a href="#'+t+'" tabindex="0"></a>').text(rcmail.env.spell_langs[t]).addClass("active").data("lang",t).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("spell-menu",e),!1}).appendTo(a),n.push(a);o.append(n).appendTo(e)}$("li",o).each(function(){var e=$("a",this);e.data("lang")==i?e.addClass("selected").attr("aria-selected","true"):e.hasClass("selected")&&e.removeClass("selected").removeAttr("aria-selected")})},this.searchmenu=function(c){var e,t="*",a=$('input[name="s_mods[]"]',c),n=$("#s_scope",c),i=$("#s_interval",c),o=rcmail.env.mailbox,s=rcmail.env.search_mods,r=rcmail.env.search_scope||"base";$(c).data("initialized")||($(c).data("initialized",!0),a.length&&(a.on("change",function(){var e,t,a=c,n=this,i={},o=$('input[name="s_mods[]"]',a),s=rcmail.env.task,r=rcmail.env.search_mods||{},l=rcmail.env.mailbox;"mail"==s?(r[l]||(r[l]=rcube_clone_object(r["*"])),t=r[l],e="text",i={sender:["from","replyto","followupto"],recipient:["to","cc","bcc"]}):(t=r,e="*"),n.checked?t[n.value]=1:delete t[n.value],n.value==e?o.not(n).each(function(){this.checked=!0,n.checked?(this.disabled=!0,delete t[this.value]):(this.disabled=!1,this.value in i||(t[this.value]=1))}):n.value in i?(delete t[n.value],o.filter(function(){return-1!=$.inArray(this.value,i[n.value])}).each(function(){n.checked?(this.checked=!0,t[this.value]=1):(this.checked=!1,delete t[this.value])})):i.sender&&pe(a),rcmail.set_searchmods(t)}),rcmail.addEventListener("beforesearch",function(){rcmail.env.search_scope=n.val(),rcmail.env.search_interval=i.val()})),$(c).find(".proplist > li > a.dropdown").on("click",function(){var e=$(this).next();e[e.is(".d-none")?"removeClass":"addClass"]("d-none")}));if(n.val(r),s)if("mail"==rcmail.env.task&&(s=s[o]