/** * 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 */ /* magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt CC0-1.0 */ function rcube_elastic_ui(){function t(a,b,e){(a=F(a))&&rcmail.register_button(a.command,b,a.data.type,e,a.data.sel)}function A(a,b,e,c){var f=!0,d=$(""),h=a.attr("id")||(new Date).getTime(),g=h+"-clone";e=a[0].className+(e?" "+e:"");if(!b)e=$.trim(e.replace("btn-primary","primary").replace(/(btn[a-z-]*|button|disabled)/g,"")),e+=" button"+(c?"":" disabled");else if(c=a.data("popup"))d.data({popup:c,"toggle-button":a.data("toggle-button")}),N(d[0]),f=!1,rcmail.register_menu_button(d[0],c);d.attr({id:g, href:"#","class":e}).append($('').text(a.text()));if(f)d.on("click",function(l){a.click()});u&&!b?(d.data("target",a),ea.push($.extend({button_id:g},F(a[0].id)))):t(h,g,e.replace(" disabled",""));return d}function F(a){var b,e;for(e in rcmail.buttons)for(b=0;b").attr({"class":"button selection disabled",role:"button",title:rcmail.gettext("select")}).on("click",function(){$(this).is(".active")&&h.toggleClass("withselection")}).append($('').text(rcmail.gettext("select"))),p.is(".menu")?(d.prependTo(p).wrap('
  • '), k.content&&(l=A(d,!0,"hidden-big hidden-large"),$('
  • ').append(l).appendTo("#toolbar-menu"),d=d.add(l))):(m=h.data("list-select-replace"))?$(m).replaceWith(d):(d.appendTo(p).addClass("icon"),l.is("#layout-sidebar")||d.addClass("toolbar-button")));rcmail.addEventListener("listupdate",function(q){q.list&&q.list==rcmail[g]&&(q.rowcount?d.addClass("active").removeClass("disabled").attr("tabindex",0):d.removeClass("active").addClass("disabled").attr("tabindex",-1))})}T&&rcmail[g]&&("function"== typeof rcmail[g].draggable?rcmail[g].draggable("destroy"):"boolean"==typeof rcmail[g].draggable&&(rcmail[g].draggable=!1))});window.MutationObserver&&$("[data-label-msg]").filter("ul,table").each(function(){var d=$('