Index: trunk/extensions/CodeReview/codereview.css |
— | — | @@ -1,181 +0,0 @@ |
2 | | -table.mw-codereview-meta td { |
3 | | - vertical-align: top; |
4 | | -} |
5 | | - |
6 | | -.mw-codereview-paths { |
7 | | - max-height:600px; |
8 | | - overflow:auto; |
9 | | -} |
10 | | - |
11 | | -.TablePager_col_comments { |
12 | | - text-align: center; |
13 | | -} |
14 | | -.TablePager_col_cr_message { |
15 | | - max-width: 20em; |
16 | | - overflow: hidden; |
17 | | -} |
18 | | - |
19 | | -.TablePager_col_cr_timestamp { |
20 | | - white-space: nowrap; |
21 | | -} |
22 | | - |
23 | | -.mw-codereview-comment { |
24 | | - border: solid 1px #aaaab3; |
25 | | - padding: 0px; |
26 | | - background: #eee; |
27 | | - margin-bottom: 8px; |
28 | | -} |
29 | | - |
30 | | -.mw-codereview-imgdiff { |
31 | | - border: solid 1px #aaaab3; |
32 | | - padding: 1em; |
33 | | - background: #eee; |
34 | | -} |
35 | | - |
36 | | -.mw-codereview-comment-meta { |
37 | | - padding: 4px 8px; |
38 | | -} |
39 | | - |
40 | | -.mw-codereview-comment-text { |
41 | | - background: white; |
42 | | - padding: 16px; |
43 | | -} |
44 | | - |
45 | | -.mw-codereview-comment .mw-codereview-post-comment { |
46 | | - padding: 16px; |
47 | | - padding-left: 48px; |
48 | | -} |
49 | | - |
50 | | -.mw-codereview-status-new, |
51 | | -.mw-codereview-status-new td { |
52 | | - background: #ffffc0 !important; |
53 | | -} |
54 | | - |
55 | | -.mw-codereview-status-new:hover, |
56 | | -.mw-codereview-status-new:hover td { |
57 | | - background: #dfdfa0 !important; |
58 | | -} |
59 | | - |
60 | | -.mw-codereview-status-fixme, |
61 | | -.mw-codereview-status-fixme td { |
62 | | - background: #ff9999 !important; |
63 | | -} |
64 | | -.mw-codereview-status-fixme:hover, |
65 | | -.mw-codereview-status-fixme:hover td { |
66 | | - background: #df0000 !important; |
67 | | - color: white; |
68 | | -} |
69 | | -.mw-codereview-status-fixme:hover a, |
70 | | -.mw-codereview-status-fixme:hover td a { |
71 | | - color: #ff0 !important; |
72 | | -} |
73 | | - |
74 | | -.mw-codereview-status-resolved, |
75 | | -.mw-codereview-status-resolved td { |
76 | | - background: #c0ffc0 !important; |
77 | | -} |
78 | | -.mw-codereview-status-resolved:hover, |
79 | | -.mw-codereview-status-resolved:hover td { |
80 | | - background: #a0dfa0 !important; |
81 | | -} |
82 | | - |
83 | | -.mw-codereview-status-reverted, |
84 | | -.mw-codereview-status-reverted td { |
85 | | - background: #ddd !important; |
86 | | - color: #666 !important; |
87 | | - text-decoration: line-through !important; |
88 | | -} |
89 | | -.mw-codereview-status-reverted:hover, |
90 | | -.mw-codereview-status-reverted:hover td { |
91 | | - background: #aaa !important; |
92 | | - text-decoration: line-through !important; |
93 | | -} |
94 | | -.mw-codereview-status-deferred, |
95 | | -.mw-codereview-status-deferred td { |
96 | | - color: #666; |
97 | | -} |
98 | | - |
99 | | -.mw-codereview-status-old, |
100 | | -.mw-codereview-status-old td { |
101 | | - color: #666; |
102 | | -} |
103 | | - |
104 | | -.mw-codereview-associateform { |
105 | | - float: right; |
106 | | -} |
107 | | - |
108 | | -.mw-codereview-signoffchecks { |
109 | | - float: right; |
110 | | -} |
111 | | - |
112 | | -.mw-codereview-struck td { |
113 | | - text-decoration: line-through; |
114 | | - background: #aaa; |
115 | | -} |
116 | | - |
117 | | -.mw-codereview-success { |
118 | | - color: #1a2; |
119 | | -} |
120 | | -.mw-codereview-fail { |
121 | | - color: #d21; |
122 | | -} |
123 | | - |
124 | | -/* Diffs */ |
125 | | -.mw-codereview-diff ins { |
126 | | - text-decoration: none; |
127 | | - color: green; |
128 | | -} |
129 | | - |
130 | | -.mw-codereview-diff del { |
131 | | - text-decoration: none; |
132 | | - color: red; |
133 | | -} |
134 | | - |
135 | | -.mw-codereview-diff .meta { |
136 | | - color: darkcyan; |
137 | | -} |
138 | | - |
139 | | -.mw-wordcloud-size-1, .mw-wordcloud-size-2, |
140 | | -.mw-wordcloud-size-3, .mw-wordcloud-size-4, |
141 | | -.mw-wordcloud-size-5, .mw-wordcloud-size-6, |
142 | | -.mw-wordcloud-size-7, .mw-wordcloud-size-8, |
143 | | -.mw-wordcloud-size-0 { |
144 | | - padding: 4px 4px 4px 4px; |
145 | | - letter-spacing: 3px; |
146 | | -} |
147 | | -.mw-wordcloud-size-1 { |
148 | | - color: #000; |
149 | | - font-size: 2.4em; |
150 | | -} |
151 | | -.mw-wordcloud-size-2 { |
152 | | - color: #333; |
153 | | - font-size:2.2em; |
154 | | -} |
155 | | -.mw-wordcloud-size-3 { |
156 | | - color: #666; |
157 | | - font-size: 2.0em; |
158 | | -} |
159 | | -.mw-wordcloud-size-4 { |
160 | | - color: #999; |
161 | | - font-size: 1.0em; |
162 | | -} |
163 | | -.mw-wordcloud-size-5 { |
164 | | - color: #aaa; |
165 | | - font-size: 1.6em; |
166 | | -} |
167 | | -.mw-wordcloud-size-6 { |
168 | | - color: #bbb; |
169 | | - font-size: 1.4em; |
170 | | -} |
171 | | -.mw-wordcloud-size-7 { |
172 | | - color: #ccc; |
173 | | - font-size: 1.2em; |
174 | | -} |
175 | | -.mw-wordcloud-size-8 { |
176 | | - color: #ddd; |
177 | | - font-size: .8em; |
178 | | -} |
179 | | -.mw-wordcloud-size-0 { |
180 | | - color: #ccc; |
181 | | - font-size: .6em; |
182 | | -} |
Index: trunk/extensions/CodeReview/codereview.js |
— | — | @@ -1,45 +0,0 @@ |
2 | | -var CodeReview = new Object; |
3 | | -CodeReview.loadDiff = function(repo, rev) { |
4 | | - var path = wgScriptPath + |
5 | | - "/api.php" + |
6 | | - "?action=codediff" + |
7 | | - "&format=json" + |
8 | | - "&repo=" + encodeURIComponent(repo) + |
9 | | - "&rev=" + encodeURIComponent(rev); |
10 | | - var xmlhttp = sajax_init_object(); |
11 | | - if(xmlhttp){ |
12 | | - try { |
13 | | - injectSpinner(CodeReview.diffTarget(), 'codereview-diff'); |
14 | | - xmlhttp.open("GET", path, true); |
15 | | - xmlhttp.onreadystatechange=function(){ |
16 | | - if (xmlhttp.readyState==4) { |
17 | | - CodeReview.decodeAndShowDiff(xmlhttp.responseText); |
18 | | - removeSpinner('codereview-diff'); |
19 | | - } |
20 | | - }; |
21 | | - xmlhttp.send(null); |
22 | | - } catch (e) { |
23 | | - if (window.location.hostname == "localhost") { |
24 | | - alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing."); |
25 | | - } |
26 | | - throw e; |
27 | | - } |
28 | | - } |
29 | | -}; |
30 | | -CodeReview.decodeAndShowDiff = function(jsonText) { |
31 | | - // bleah |
32 | | - eval("var data=" + jsonText); |
33 | | - if (typeof data.code != 'undefined' && |
34 | | - typeof data.code.rev != 'undefined' && |
35 | | - typeof data.code.rev.diff != 'undefined') { |
36 | | - CodeReview.showDiff(data.code.rev.diff); |
37 | | - } else { |
38 | | - CodeReview.showDiff('Diff load failed. :('); |
39 | | - } |
40 | | -}; |
41 | | -CodeReview.diffTarget = function() { |
42 | | - return document.getElementById('mw-codereview-diff'); |
43 | | -}; |
44 | | -CodeReview.showDiff = function(diffHtml) { |
45 | | - CodeReview.diffTarget().innerHTML = diffHtml; |
46 | | -}; |
Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -135,9 +135,21 @@ |
136 | 136 | // What is the default SVN import chunk size? |
137 | 137 | $wgCodeReviewImportBatchSize = 400; |
138 | 138 | |
139 | | -// Bump the version number every time you change a CodeReview .css/.js file |
140 | | -$wgCodeReviewStyleVersion = 7; |
| 139 | +$commonModuleInfo = array( |
| 140 | + 'localBasePath' => dirname( __FILE__ ) . '/modules', |
| 141 | + 'remoteExtPath' => 'CodeReview/modules', |
| 142 | +); |
141 | 143 | |
| 144 | +// Styles and any code common to all Special:Code subviews: |
| 145 | +$wgResourceModules['ext.codereview'] = array( |
| 146 | + 'styles' => 'ext.codereview.css', |
| 147 | +) + $commonModuleInfo; |
| 148 | + |
| 149 | +// On-demand diff loader for CodeRevisionView: |
| 150 | +$wgResourceModules['ext.codereview.loaddiff'] = array( |
| 151 | + 'scripts' => 'ext.codereview.loaddiff.js' |
| 152 | +) + $commonModuleInfo; |
| 153 | + |
142 | 154 | // If you are running a closed svn, fill the following two lines with the username and password |
143 | 155 | // of a user allowed to access it. Otherwise, leave it false. |
144 | 156 | // This is only necessary if using the shell method to access Subversion |
Index: trunk/extensions/CodeReview/modules/ext.codereview.css |
— | — | @@ -0,0 +1,181 @@ |
| 2 | +table.mw-codereview-meta td { |
| 3 | + vertical-align: top; |
| 4 | +} |
| 5 | + |
| 6 | +.mw-codereview-paths { |
| 7 | + max-height:600px; |
| 8 | + overflow:auto; |
| 9 | +} |
| 10 | + |
| 11 | +.TablePager_col_comments { |
| 12 | + text-align: center; |
| 13 | +} |
| 14 | +.TablePager_col_cr_message { |
| 15 | + max-width: 20em; |
| 16 | + overflow: hidden; |
| 17 | +} |
| 18 | + |
| 19 | +.TablePager_col_cr_timestamp { |
| 20 | + white-space: nowrap; |
| 21 | +} |
| 22 | + |
| 23 | +.mw-codereview-comment { |
| 24 | + border: solid 1px #aaaab3; |
| 25 | + padding: 0px; |
| 26 | + background: #eee; |
| 27 | + margin-bottom: 8px; |
| 28 | +} |
| 29 | + |
| 30 | +.mw-codereview-imgdiff { |
| 31 | + border: solid 1px #aaaab3; |
| 32 | + padding: 1em; |
| 33 | + background: #eee; |
| 34 | +} |
| 35 | + |
| 36 | +.mw-codereview-comment-meta { |
| 37 | + padding: 4px 8px; |
| 38 | +} |
| 39 | + |
| 40 | +.mw-codereview-comment-text { |
| 41 | + background: white; |
| 42 | + padding: 16px; |
| 43 | +} |
| 44 | + |
| 45 | +.mw-codereview-comment .mw-codereview-post-comment { |
| 46 | + padding: 16px; |
| 47 | + padding-left: 48px; |
| 48 | +} |
| 49 | + |
| 50 | +.mw-codereview-status-new, |
| 51 | +.mw-codereview-status-new td { |
| 52 | + background: #ffffc0 !important; |
| 53 | +} |
| 54 | + |
| 55 | +.mw-codereview-status-new:hover, |
| 56 | +.mw-codereview-status-new:hover td { |
| 57 | + background: #dfdfa0 !important; |
| 58 | +} |
| 59 | + |
| 60 | +.mw-codereview-status-fixme, |
| 61 | +.mw-codereview-status-fixme td { |
| 62 | + background: #ff9999 !important; |
| 63 | +} |
| 64 | +.mw-codereview-status-fixme:hover, |
| 65 | +.mw-codereview-status-fixme:hover td { |
| 66 | + background: #df0000 !important; |
| 67 | + color: white; |
| 68 | +} |
| 69 | +.mw-codereview-status-fixme:hover a, |
| 70 | +.mw-codereview-status-fixme:hover td a { |
| 71 | + color: #ff0 !important; |
| 72 | +} |
| 73 | + |
| 74 | +.mw-codereview-status-resolved, |
| 75 | +.mw-codereview-status-resolved td { |
| 76 | + background: #c0ffc0 !important; |
| 77 | +} |
| 78 | +.mw-codereview-status-resolved:hover, |
| 79 | +.mw-codereview-status-resolved:hover td { |
| 80 | + background: #a0dfa0 !important; |
| 81 | +} |
| 82 | + |
| 83 | +.mw-codereview-status-reverted, |
| 84 | +.mw-codereview-status-reverted td { |
| 85 | + background: #ddd !important; |
| 86 | + color: #666 !important; |
| 87 | + text-decoration: line-through !important; |
| 88 | +} |
| 89 | +.mw-codereview-status-reverted:hover, |
| 90 | +.mw-codereview-status-reverted:hover td { |
| 91 | + background: #aaa !important; |
| 92 | + text-decoration: line-through !important; |
| 93 | +} |
| 94 | +.mw-codereview-status-deferred, |
| 95 | +.mw-codereview-status-deferred td { |
| 96 | + color: #666; |
| 97 | +} |
| 98 | + |
| 99 | +.mw-codereview-status-old, |
| 100 | +.mw-codereview-status-old td { |
| 101 | + color: #666; |
| 102 | +} |
| 103 | + |
| 104 | +.mw-codereview-associateform { |
| 105 | + float: right; |
| 106 | +} |
| 107 | + |
| 108 | +.mw-codereview-signoffchecks { |
| 109 | + float: right; |
| 110 | +} |
| 111 | + |
| 112 | +.mw-codereview-struck td { |
| 113 | + text-decoration: line-through; |
| 114 | + background: #aaa; |
| 115 | +} |
| 116 | + |
| 117 | +.mw-codereview-success { |
| 118 | + color: #1a2; |
| 119 | +} |
| 120 | +.mw-codereview-fail { |
| 121 | + color: #d21; |
| 122 | +} |
| 123 | + |
| 124 | +/* Diffs */ |
| 125 | +.mw-codereview-diff ins { |
| 126 | + text-decoration: none; |
| 127 | + color: green; |
| 128 | +} |
| 129 | + |
| 130 | +.mw-codereview-diff del { |
| 131 | + text-decoration: none; |
| 132 | + color: red; |
| 133 | +} |
| 134 | + |
| 135 | +.mw-codereview-diff .meta { |
| 136 | + color: darkcyan; |
| 137 | +} |
| 138 | + |
| 139 | +.mw-wordcloud-size-1, .mw-wordcloud-size-2, |
| 140 | +.mw-wordcloud-size-3, .mw-wordcloud-size-4, |
| 141 | +.mw-wordcloud-size-5, .mw-wordcloud-size-6, |
| 142 | +.mw-wordcloud-size-7, .mw-wordcloud-size-8, |
| 143 | +.mw-wordcloud-size-0 { |
| 144 | + padding: 4px 4px 4px 4px; |
| 145 | + letter-spacing: 3px; |
| 146 | +} |
| 147 | +.mw-wordcloud-size-1 { |
| 148 | + color: #000; |
| 149 | + font-size: 2.4em; |
| 150 | +} |
| 151 | +.mw-wordcloud-size-2 { |
| 152 | + color: #333; |
| 153 | + font-size:2.2em; |
| 154 | +} |
| 155 | +.mw-wordcloud-size-3 { |
| 156 | + color: #666; |
| 157 | + font-size: 2.0em; |
| 158 | +} |
| 159 | +.mw-wordcloud-size-4 { |
| 160 | + color: #999; |
| 161 | + font-size: 1.0em; |
| 162 | +} |
| 163 | +.mw-wordcloud-size-5 { |
| 164 | + color: #aaa; |
| 165 | + font-size: 1.6em; |
| 166 | +} |
| 167 | +.mw-wordcloud-size-6 { |
| 168 | + color: #bbb; |
| 169 | + font-size: 1.4em; |
| 170 | +} |
| 171 | +.mw-wordcloud-size-7 { |
| 172 | + color: #ccc; |
| 173 | + font-size: 1.2em; |
| 174 | +} |
| 175 | +.mw-wordcloud-size-8 { |
| 176 | + color: #ddd; |
| 177 | + font-size: .8em; |
| 178 | +} |
| 179 | +.mw-wordcloud-size-0 { |
| 180 | + color: #ccc; |
| 181 | + font-size: .6em; |
| 182 | +} |
Property changes on: trunk/extensions/CodeReview/modules/ext.codereview.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 183 | + native |
Index: trunk/extensions/CodeReview/modules/ext.codereview.loaddiff.js |
— | — | @@ -0,0 +1,45 @@ |
| 2 | +var CodeReview = window.CodeReview = new Object; |
| 3 | +CodeReview.loadDiff = function(repo, rev) { |
| 4 | + var path = wgScriptPath + |
| 5 | + "/api.php" + |
| 6 | + "?action=codediff" + |
| 7 | + "&format=json" + |
| 8 | + "&repo=" + encodeURIComponent(repo) + |
| 9 | + "&rev=" + encodeURIComponent(rev); |
| 10 | + var xmlhttp = sajax_init_object(); |
| 11 | + if(xmlhttp){ |
| 12 | + try { |
| 13 | + injectSpinner(CodeReview.diffTarget(), 'codereview-diff'); |
| 14 | + xmlhttp.open("GET", path, true); |
| 15 | + xmlhttp.onreadystatechange=function(){ |
| 16 | + if (xmlhttp.readyState==4) { |
| 17 | + CodeReview.decodeAndShowDiff(xmlhttp.responseText); |
| 18 | + removeSpinner('codereview-diff'); |
| 19 | + } |
| 20 | + }; |
| 21 | + xmlhttp.send(null); |
| 22 | + } catch (e) { |
| 23 | + if (window.location.hostname == "localhost") { |
| 24 | + alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing."); |
| 25 | + } |
| 26 | + throw e; |
| 27 | + } |
| 28 | + } |
| 29 | +}; |
| 30 | +CodeReview.decodeAndShowDiff = function(jsonText) { |
| 31 | + // bleah |
| 32 | + eval("var data=" + jsonText); |
| 33 | + if (typeof data.code != 'undefined' && |
| 34 | + typeof data.code.rev != 'undefined' && |
| 35 | + typeof data.code.rev.diff != 'undefined') { |
| 36 | + CodeReview.showDiff(data.code.rev.diff); |
| 37 | + } else { |
| 38 | + CodeReview.showDiff('Diff load failed. :('); |
| 39 | + } |
| 40 | +}; |
| 41 | +CodeReview.diffTarget = function() { |
| 42 | + return document.getElementById('mw-codereview-diff'); |
| 43 | +}; |
| 44 | +CodeReview.showDiff = function(diffHtml) { |
| 45 | + CodeReview.diffTarget().innerHTML = diffHtml; |
| 46 | +}; |
Property changes on: trunk/extensions/CodeReview/modules/ext.codereview.loaddiff.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 47 | + native |
Index: trunk/extensions/CodeReview/ui/SpecialCode.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | } |
11 | 11 | |
12 | 12 | public function execute( $subpage ) { |
13 | | - global $wgOut, $wgUser, $wgExtensionAssetsPath, $wgCodeReviewStyleVersion; |
| 13 | + global $wgOut, $wgUser; |
14 | 14 | |
15 | 15 | if ( !$this->userCanExecute( $wgUser ) ) { |
16 | 16 | $this->displayRestrictionError(); |
— | — | @@ -17,7 +17,8 @@ |
18 | 18 | } |
19 | 19 | |
20 | 20 | $this->setHeaders(); |
21 | | - $wgOut->addStyle( "$wgExtensionAssetsPath/CodeReview/codereview.css?$wgCodeReviewStyleVersion" ); |
| 21 | + // Base styles used for all code review UI actions. |
| 22 | + $wgOut->addModules( 'ext.codereview' ); |
22 | 23 | |
23 | 24 | $view = $this->getViewFrom( $subpage ); |
24 | 25 | if( $view ) { |
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -428,10 +428,10 @@ |
429 | 429 | } |
430 | 430 | |
431 | 431 | protected function stubDiffLoader() { |
432 | | - global $wgOut, $wgExtensionAssetsPath, $wgCodeReviewStyleVersion; |
| 432 | + global $wgOut; |
433 | 433 | $encRepo = Xml::encodeJsVar( $this->mRepo->getName() ); |
434 | 434 | $encRev = Xml::encodeJsVar( $this->mRev->getId() ); |
435 | | - $wgOut->addScriptFile( "$wgExtensionAssetsPath/CodeReview/codereview.js?$wgCodeReviewStyleVersion" ); |
| 435 | + $wgOut->addModules( 'ext.codereview.loaddiff' ); |
436 | 436 | $wgOut->addInlineScript( |
437 | 437 | "addOnloadHook( |
438 | 438 | function() { |
Index: trunk/extensions/Configure/scripts/findSettings.php |
— | — | @@ -64,7 +64,6 @@ |
65 | 65 | 'wgCheckUserStyleVersion', |
66 | 66 | 'wgCaptcha', 'wgConfirmEditIP', |
67 | 67 | 'wgCitationCache', 'wgCitationCounter', 'wgCitationRunning', |
68 | | - 'wgCodeReviewStyleVersion', |
69 | 68 | 'wgCollectionVersion', 'wgCollectionStyleVersion', |
70 | 69 | 'wgCSS', |
71 | 70 | 'wgDeleteQueueStyleVersion', |