Skip to content

Commit ae4f271

Browse files
author
wiz78
committed
initial import
1 parent a9f82fb commit ae4f271

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

BetterStatusColors.php

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?php
2+
/**
3+
* MantisBT - A PHP based bugtracking system
4+
*
5+
* MantisBT is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 2 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* MantisBT is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
17+
*
18+
* @copyright Copyright 2002 MantisBT Team - mantisbt-dev@lists.sourceforge.net
19+
*/
20+
21+
/**
22+
* Mantis Graph plugin
23+
*/
24+
class BetterStatusColorsPlugin extends MantisPlugin {
25+
26+
/**
27+
* A method that populates the plugin information and minimum requirements.
28+
* @return void
29+
*/
30+
function register() {
31+
$this->name = 'Better status colors';
32+
$this->description = 'Make the status color more prominent';
33+
$this->page = '';
34+
35+
$this->version = '1.0.0';
36+
$this->requires = array(
37+
'MantisCore' => '2.0.0',
38+
);
39+
40+
$this->author = 'Simone Tellini';
41+
$this->url = 'https://tellini.info';
42+
}
43+
44+
/**
45+
* Default plugin configuration.
46+
* @return array
47+
*/
48+
function config() {
49+
return array();
50+
}
51+
52+
/**
53+
* plugin hooks
54+
* @return array
55+
*/
56+
function hooks() {
57+
$t_hooks = array(
58+
'EVENT_LAYOUT_RESOURCES' => 'resources'
59+
);
60+
return $t_hooks;
61+
}
62+
63+
/**
64+
* Include javascript files for chart.js
65+
* @return void
66+
*/
67+
function resources() {
68+
echo '<script src="' . plugin_file( "BetterStatusColors.js" ) . '"></script>';
69+
}
70+
}

files/BetterStatusColors.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
jQuery( document ).ready( function()
2+
{
3+
jQuery( '#buglist tbody tr' ).each( function( i, tr )
4+
{
5+
var status = jQuery( tr ).find( 'td.column-status i' );
6+
7+
if( status.length ) {
8+
var classes = status.attr( 'class' ).split( /\s+/ );
9+
10+
classes = jQuery.grep( classes, function( c ) { return /^status-/.test( c ); } );
11+
12+
if( classes.length ) {
13+
status.parentsUntil( 'tr' ).addClass( classes[ 0 ] );
14+
status.hide();
15+
}
16+
}
17+
} );
18+
} );

0 commit comments

Comments
 (0)