View difference between Paste ID: 3kwqszbH and fSffTHQw
SHOW: | | - or go back to the newest paste.
1
// ==UserScript==
2
// @name           hide obs bz
3
// @author         Jonathan Druart <[email protected]>
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
    var comment_text_node = $(this).find('pre.bz_comment_text');
15-
    if ( $(comment_text_node).find('span.bz_obsolete').size() > 0 && ! $(comment_text_node).html().match(/^Comment on/) ) {
15+
    if ( $(comment_text_node).find('span.bz_obsolete').size() > 0 && $(comment_text_node).html().match(/^Created/) ) {
16-
        var show_link = $('<a onclick=\'$(this).siblings("pre.bz_comment_text").show();$(this).hide()\'>Show content</a>');
16+
        $(this).find('a.bz_collapse_comment').click();
17-
        $(this).find('pre.bz_comment_text').hide();
17+
18-
        $(this).append(show_link);
18+