/** * Hide Blockquotes plugin script * * @licstart The following is the entire license notice for the * JavaScript code in this file. * * Copyright (c) 2012-2014, The Roundcube Dev Team * * The JavaScript code in this page is free software: you can redistribute it * and/or modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * @licend The above is the entire license notice * for the JavaScript code in this file. */ window.rcmail&&rcmail.addEventListener("init",function(){hide_blockquote()}); function hide_blockquote(){var b=rcmail.env.blockquote_limit;0>=b||$("div.message-part div.pre > blockquote",$("#messagebody")).each(function(){var a,c=$(this);a=$.trim(c.text()).split(/\n/);a.length<=b&&c.height()<=15*b||(a=$('
').css({"white-space":"nowrap",overflow:"hidden",position:"relative"}).text(a[0]),$('').css({position:"absolute","z-Index":2}).text(rcmail.get_label("hide_blockquote.show")).data("parent",a).click(function(){var a= $(this),b=a.data("parent"),d=b.is(":visible");a.text(rcmail.get_label(d?"hide":"show","hide_blockquote")).detach().appendTo(d?c:b);b[d?"hide":"show"]();c[d?"show":"hide"]()}).appendTo(a),c.hide().css({position:"relative"}).before(a))})};