r104425 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104424‎ | r104425 | r104426 >
Date:13:49, 28 November 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 32682) Remove hard coded CSS from ContributionHistory_body (Contributions Reporting)
* (bug 32681) Resource Loader-ify ContributionsReporting
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionHistory_body.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionReporting.php (modified) (history)
  • /trunk/extensions/ContributionReporting/FundraiserStatistics.css (deleted) (history)
  • /trunk/extensions/ContributionReporting/FundraiserStatistics.js (deleted) (history)
  • /trunk/extensions/ContributionReporting/FundraiserStatistics_body.php (modified) (history)
  • /trunk/extensions/ContributionReporting/modules/ext.fundraiserstatistics.css (added) (history)
  • /trunk/extensions/ContributionReporting/modules/ext.fundraiserstatistics.js (added) (history)
  • /trunk/extensions/ContributionReporting/modules/ext.fundraiserstatistics.table.css (added) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/FundraiserStatistics.css
@@ -1,103 +0,0 @@
2 -div#configholder {
3 - position: absolute;
4 - top: 22px;
5 - right: 0;
6 - z-index: 200;
7 - width: 180px;
8 - border: 1px solid silver;
9 - background-color: white;
10 - padding: 2px 5px 5px 5px;
11 - display: none;
12 -}
13 -div#configtoggle {
14 - position: absolute;
15 - top: 0;
16 - right: 0;
17 - z-index: 199;
18 - height: 17px;
19 - border: 1px solid silver;
20 - background-color: white;
21 - padding: 2px 5px 2px 0px;
22 - cursor: pointer;
23 -}
24 -div#configtoggle a, div#configtoggle a:visited {
25 - background-image: url("arrow.png");
26 - background-position: 0px -3px;
27 - background-repeat: no-repeat;
28 - padding-left: 16px;
29 - outline: 0;
30 -}
31 -
32 -.fundraiserstats-view-box {
33 - border: solid 1px silver;
34 -}
35 -.fundraiserstats-view-box h3 {
36 - margin-top: 0;
37 - padding-top: 0;
38 -}
39 -.fundraiserstats-today {
40 - position: absolute;
41 - width: 6px;
42 - height: 6px;
43 - background-color: black;
44 - margin-top: 3px;
45 - margin-left: -1px;
46 -}
47 -.fundraiserstats-bar {
48 - width: 2px;
49 -}
50 -.fundraiserstats-bar-2007 {
51 - background-color: #AAAAFF;
52 - border: outset 1px #AAAAFF;
53 -}
54 -.fundraiserstats-bar-2008 {
55 - background-color: #AAFFAA;
56 - border: outset 1px #AAFFAA;
57 -}
58 -.fundraiserstats-bar-2009 {
59 - background-color: #FFAAAA;
60 - border: outset 1px #FFAAAA;
61 -}
62 -.fundraiserstats-bar-2010 {
63 - background-color: #a0e8ff;
64 - border: outset 1px #a0e8ff;
65 -}
66 -.fundraiserstats-bar-2011 {
67 - background-color: #ffd617;
68 - border: outset 1px #ffd617;
69 -}
70 -.fundraiserstats-bar-space {
71 - width: 3px;
72 -}
73 -.fundraiserstats-chart {
74 - padding: 10px;
75 - border-left: solid 1px silver;
76 - border-right: solid 1px silver;
77 -}
78 -.fundraiserstats-chart-tabs {
79 - border-bottom: solid 1px silver;
80 - height: 24px;
81 -}
82 -.fundraiserstats-chart-tab-normal {
83 - padding-left: 6px;
84 - padding-right: 6px;
85 - border: solid 1px silver;
86 - float: left;
87 - line-height: 23px;
88 - height: 23px;
89 - margin-right: 6px;
90 - cursor: pointer;
91 - font-weight: bold;
92 -}
93 -.fundraiserstats-chart-tab-current {
94 - padding-left: 6px;
95 - padding-right: 6px;
96 - border: solid 1px silver;
97 - border-bottom-color: white;
98 - float: left;
99 - line-height: 23px;
100 - height: 23px;
101 - margin-right: 6px;
102 - cursor: pointer;
103 - font-weight: bold;
104 -}
Index: trunk/extensions/ContributionReporting/FundraiserStatistics.js
@@ -1,51 +0,0 @@
2 -/* JavaScript */
3 -
4 -$j( document ).ready( function() {
5 -
6 - var currentViewID = 'fundraiserstats-view-box-0';
7 - function replaceView( newLayerID ) {
8 - var currentLayer = document.getElementById( currentViewID );
9 - var newLayer = document.getElementById( newLayerID );
10 - currentLayer.style.display = 'none';
11 - newLayer.style.display = 'block';
12 - currentViewID = newLayerID;
13 - }
14 -
15 - var currentChartID = 'fundraiserstats-chart-totals';
16 - function replaceChart( newLayerID ) {
17 - var currentLayer = document.getElementById( currentChartID );
18 - var currentTab = document.getElementById( currentChartID + '-tab' );
19 - var newLayer = document.getElementById( newLayerID );
20 - var newTab = document.getElementById( newLayerID + '-tab' );
21 - currentLayer.style.display = 'none';
22 - currentTab.setAttribute( 'class', 'fundraiserstats-chart-tab-normal' );
23 - newLayer.style.display = 'block';
24 - newTab.setAttribute( 'class', 'fundraiserstats-chart-tab-current' );
25 - currentChartID = newLayerID;
26 - }
27 -
28 - $j( '.fundraiserstats-bar' ).hover( function() {
29 - replaceView( $j(this).attr( 'rel' ) )
30 - } );
31 - $j( '.fundraiserstats-chart-tab' ).click( function() {
32 - replaceChart( $j(this).attr( 'rel' ) )
33 - } );
34 - $j( '.fundraiserstats-current' ).each( function() {
35 - replaceView( $j(this).attr( 'rel' ) )
36 - } );
37 - $j( '#configholder .yeartoggle' ).click( function() {
38 - $j('.fundraiserstats-'+$j(this).attr( 'id' )).toggle();
39 - } );
40 - $j( '#configtoggle' ).click( function() {
41 - $j('#configholder').toggle();
42 - if ($j( '#configtoggle a' ).css( 'background-position' ) == '0px -18px') {
43 - $j( '#configtoggle a' ).css( 'background-position', '0px -3px' );
44 - } else {
45 - $j( '#configtoggle a' ).css( 'background-position','0px -18px' );
46 - }
47 - } );
48 - $j( '#timezone' ).change( function() {
49 - $j('#configform').submit();
50 - } );
51 -
52 -} );
Index: trunk/extensions/ContributionReporting/ContributionReporting.php
@@ -110,6 +110,20 @@
111111
112112 $wgContributionTrackingStatisticsViewWeeks = 3;
113113
 114+$commonModuleInfo = array(
 115+ 'localBasePath' => dirname( __FILE__ ) . '/modules',
 116+ 'remoteExtPath' => 'ContributionReporting/modules',
 117+);
 118+
 119+$wgResourceModules['ext.fundraiserstatistics.table'] = array(
 120+ 'styles' => 'ext.fundraiserstatistics.table.css',
 121+) + $commonModuleInfo;
 122+
 123+$wgResourceModules['ext.fundraiserstatistics'] = array(
 124+ 'scripts' => 'ext.fundraiserstatistics.edit.js',
 125+ 'styles' => 'ext.fundraiserstatistics.css',
 126+) + $commonModuleInfo;
 127+
114128 $wgHooks['ParserFirstCallInit'][] = 'efContributionReportingSetup';
115129 $wgHooks['LanguageGetMagic'][] = 'efContributionReportingTotal_Magic';
116130
Index: trunk/extensions/ContributionReporting/FundraiserStatistics_body.php
@@ -81,14 +81,8 @@
8282 /* Setup */
8383
8484 $this->setHeaders();
 85+ $wgOut->addModules( 'ext.fundraiserstatistics' );
8586 $wgOut->addScriptFile( $wgScriptPath . '/extensions/ContributionReporting/FundraiserStatistics.js' );
86 - $wgOut->addLink(
87 - array(
88 - 'rel' => 'stylesheet',
89 - 'type' => 'text/css',
90 - 'href' => $wgScriptPath . '/extensions/ContributionReporting/FundraiserStatistics.css',
91 - )
92 - );
9387
9488 /* Display */
9589
Index: trunk/extensions/ContributionReporting/ContributionHistory_body.php
@@ -24,11 +24,7 @@
2525
2626 $db = efContributionReportingConnection();
2727
28 - $output = '<style type="text/css">';
29 - $output .= 'td.left {padding-right: 10px;}';
30 - $output .= 'td.right {padding-left: 10px; text-align: right;}';
31 - $output .= 'td.alt {background-color: #DDDDDD;}';
32 - $output .= '</style>';
 28+ $wgOut->addModules( 'ext.fundraiserstatistics.table' );
3329
3430 // Paging controls
3531 $newer = $db->selectField( 'public_reporting', 'received',
Index: trunk/extensions/ContributionReporting/modules/ext.fundraiserstatistics.css
@@ -0,0 +1,103 @@
 2+div#configholder {
 3+ position: absolute;
 4+ top: 22px;
 5+ right: 0;
 6+ z-index: 200;
 7+ width: 180px;
 8+ border: 1px solid silver;
 9+ background-color: white;
 10+ padding: 2px 5px 5px 5px;
 11+ display: none;
 12+}
 13+div#configtoggle {
 14+ position: absolute;
 15+ top: 0;
 16+ right: 0;
 17+ z-index: 199;
 18+ height: 17px;
 19+ border: 1px solid silver;
 20+ background-color: white;
 21+ padding: 2px 5px 2px 0px;
 22+ cursor: pointer;
 23+}
 24+div#configtoggle a, div#configtoggle a:visited {
 25+ background-image: url("arrow.png");
 26+ background-position: 0px -3px;
 27+ background-repeat: no-repeat;
 28+ padding-left: 16px;
 29+ outline: 0;
 30+}
 31+
 32+.fundraiserstats-view-box {
 33+ border: solid 1px silver;
 34+}
 35+.fundraiserstats-view-box h3 {
 36+ margin-top: 0;
 37+ padding-top: 0;
 38+}
 39+.fundraiserstats-today {
 40+ position: absolute;
 41+ width: 6px;
 42+ height: 6px;
 43+ background-color: black;
 44+ margin-top: 3px;
 45+ margin-left: -1px;
 46+}
 47+.fundraiserstats-bar {
 48+ width: 2px;
 49+}
 50+.fundraiserstats-bar-2007 {
 51+ background-color: #AAAAFF;
 52+ border: outset 1px #AAAAFF;
 53+}
 54+.fundraiserstats-bar-2008 {
 55+ background-color: #AAFFAA;
 56+ border: outset 1px #AAFFAA;
 57+}
 58+.fundraiserstats-bar-2009 {
 59+ background-color: #FFAAAA;
 60+ border: outset 1px #FFAAAA;
 61+}
 62+.fundraiserstats-bar-2010 {
 63+ background-color: #a0e8ff;
 64+ border: outset 1px #a0e8ff;
 65+}
 66+.fundraiserstats-bar-2011 {
 67+ background-color: #ffd617;
 68+ border: outset 1px #ffd617;
 69+}
 70+.fundraiserstats-bar-space {
 71+ width: 3px;
 72+}
 73+.fundraiserstats-chart {
 74+ padding: 10px;
 75+ border-left: solid 1px silver;
 76+ border-right: solid 1px silver;
 77+}
 78+.fundraiserstats-chart-tabs {
 79+ border-bottom: solid 1px silver;
 80+ height: 24px;
 81+}
 82+.fundraiserstats-chart-tab-normal {
 83+ padding-left: 6px;
 84+ padding-right: 6px;
 85+ border: solid 1px silver;
 86+ float: left;
 87+ line-height: 23px;
 88+ height: 23px;
 89+ margin-right: 6px;
 90+ cursor: pointer;
 91+ font-weight: bold;
 92+}
 93+.fundraiserstats-chart-tab-current {
 94+ padding-left: 6px;
 95+ padding-right: 6px;
 96+ border: solid 1px silver;
 97+ border-bottom-color: white;
 98+ float: left;
 99+ line-height: 23px;
 100+ height: 23px;
 101+ margin-right: 6px;
 102+ cursor: pointer;
 103+ font-weight: bold;
 104+}
Property changes on: trunk/extensions/ContributionReporting/modules/ext.fundraiserstatistics.css
___________________________________________________________________
Added: svn:eol-style
1105 + native
Index: trunk/extensions/ContributionReporting/modules/ext.fundraiserstatistics.js
@@ -0,0 +1,51 @@
 2+/* JavaScript */
 3+
 4+$j( document ).ready( function() {
 5+
 6+ var currentViewID = 'fundraiserstats-view-box-0';
 7+ function replaceView( newLayerID ) {
 8+ var currentLayer = document.getElementById( currentViewID );
 9+ var newLayer = document.getElementById( newLayerID );
 10+ currentLayer.style.display = 'none';
 11+ newLayer.style.display = 'block';
 12+ currentViewID = newLayerID;
 13+ }
 14+
 15+ var currentChartID = 'fundraiserstats-chart-totals';
 16+ function replaceChart( newLayerID ) {
 17+ var currentLayer = document.getElementById( currentChartID );
 18+ var currentTab = document.getElementById( currentChartID + '-tab' );
 19+ var newLayer = document.getElementById( newLayerID );
 20+ var newTab = document.getElementById( newLayerID + '-tab' );
 21+ currentLayer.style.display = 'none';
 22+ currentTab.setAttribute( 'class', 'fundraiserstats-chart-tab-normal' );
 23+ newLayer.style.display = 'block';
 24+ newTab.setAttribute( 'class', 'fundraiserstats-chart-tab-current' );
 25+ currentChartID = newLayerID;
 26+ }
 27+
 28+ $j( '.fundraiserstats-bar' ).hover( function() {
 29+ replaceView( $j(this).attr( 'rel' ) )
 30+ } );
 31+ $j( '.fundraiserstats-chart-tab' ).click( function() {
 32+ replaceChart( $j(this).attr( 'rel' ) )
 33+ } );
 34+ $j( '.fundraiserstats-current' ).each( function() {
 35+ replaceView( $j(this).attr( 'rel' ) )
 36+ } );
 37+ $j( '#configholder .yeartoggle' ).click( function() {
 38+ $j('.fundraiserstats-'+$j(this).attr( 'id' )).toggle();
 39+ } );
 40+ $j( '#configtoggle' ).click( function() {
 41+ $j('#configholder').toggle();
 42+ if ($j( '#configtoggle a' ).css( 'background-position' ) == '0px -18px') {
 43+ $j( '#configtoggle a' ).css( 'background-position', '0px -3px' );
 44+ } else {
 45+ $j( '#configtoggle a' ).css( 'background-position','0px -18px' );
 46+ }
 47+ } );
 48+ $j( '#timezone' ).change( function() {
 49+ $j('#configform').submit();
 50+ } );
 51+
 52+} );
Property changes on: trunk/extensions/ContributionReporting/modules/ext.fundraiserstatistics.js
___________________________________________________________________
Added: svn:eol-style
153 + native
Index: trunk/extensions/ContributionReporting/modules/ext.fundraiserstatistics.table.css
@@ -0,0 +1,10 @@
 2+td.left {
 3+ padding-right: 10px
 4+}
 5+td.right {
 6+ padding-left: 10px;
 7+ text-align: right;
 8+}
 9+td.alt {
 10+ background-color: #DDDDDD;
 11+}
\ No newline at end of file
Property changes on: trunk/extensions/ContributionReporting/modules/ext.fundraiserstatistics.table.css
___________________________________________________________________
Added: svn:eol-style
112 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r104428Followup r104425, missed removing a line in FundraiserStatistics_body.phpreedy14:13, 28 November 2011
r104586MFT r104062, r104247, r104248, r104362, r104370, r104372, r104424, r104425, r...awjrichards20:22, 29 November 2011

Status & tagging log