Advertisement
Guest User

hide obs bz

a guest
Dec 18th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           hide obs bz
  3. // @author         Jonathan Druart <jonathan.druart@bugs.koha-community.org>
  4. // @namespace      http://bugs.koha-community.org
  5. // @description    Hide obsolete patches on Bugzilla
  6. // @license        the beer-ware license
  7. // @grant          none
  8. // @require        http://code.jquery.com/jquery-1.8.3.min.js
  9. // @include        http://bugs.koha-community.org/*
  10. // ==/UserScript==
  11.  
  12. var comment_nodes = $("div.bz_comment");
  13. $(comment_nodes).each(function(){
  14.     if ( $(this).find('pre.bz_comment_text > span.bz_obsolete').size() > 0 ) {
  15.         var show_link = $('<a onclick=\'$(this).siblings("pre.bz_comment_text").show();$(this).hide()\'>Show content</a>');
  16.         $(this).find('pre.bz_comment_text').hide();
  17.         $(this).append(show_link);
  18.     }
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement