You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hide_blockquote.min.js 1.4KB

12345678910111213141516171819
  1. /**
  2. * Hide Blockquotes plugin script
  3. *
  4. * @licstart The following is the entire license notice for the
  5. * JavaScript code in this file.
  6. *
  7. * Copyright (c) 2012-2014, The Roundcube Dev Team
  8. *
  9. * The JavaScript code in this page is free software: you can redistribute it
  10. * and/or modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation, either version 3 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * @licend The above is the entire license notice
  15. * for the JavaScript code in this file.
  16. */
  17. window.rcmail&&rcmail.addEventListener("init",function(){hide_blockquote()});
  18. 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=$('<blockquote class="blockquote-header">').css({"white-space":"nowrap",overflow:"hidden",position:"relative"}).text(a[0]),$('<span class="blockquote-link"></span>').css({position:"absolute","z-Index":2}).text(rcmail.get_label("hide_blockquote.show")).data("parent",a).click(function(){var a=
  19. $(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))})};