Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -52,6 +52,7 @@ |
53 | 53 | 'revreview-diff-toggle-show' => '(show changes)', |
54 | 54 | 'revreview-diff-toggle-hide' => '(hide changes)', |
55 | 55 | 'revreview-diff-toggle-title' => 'Toggle display of changes between draft and the published version', |
| 56 | + 'revreview-log-toggle-show' => '(show stability log)', |
56 | 57 | 'review-diff2stable' => 'View pending changes to published version', |
57 | 58 | 'review-logentry-app' => 'reviewed a version of [[$1]]', |
58 | 59 | 'review-logentry-dis' => 'deprecated a version of [[$1]]', |
Index: trunk/extensions/FlaggedRevs/FRCacheUpdate.php |
— | — | @@ -1,5 +1,9 @@ |
2 | 2 | <?php |
3 | | - |
| 3 | +/** |
| 4 | + * Class containing cache update methods and job construction |
| 5 | + * for the special case of purging pages due to links contained |
| 6 | + * only in the stable version of pages |
| 7 | + */ |
4 | 8 | class FRCacheUpdate { |
5 | 9 | public $mTitle, $mTable; |
6 | 10 | public $mRowsPerJob, $mRowsPerQuery; |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php |
— | — | @@ -1,5 +1,8 @@ |
2 | 2 | <?php |
3 | | - |
| 3 | +/** |
| 4 | + * Class containing utility XML functions for a FlaggedRevs. |
| 5 | + * Includes functions for selectors, icons, notices, CSS, and form aspects. |
| 6 | + */ |
4 | 7 | class FlaggedRevsXML { |
5 | 8 | /** |
6 | 9 | * Get a selector of reviewable namespaces |
— | — | @@ -242,7 +245,7 @@ |
243 | 246 | $box .= "</td><td></td></tr></table>"; |
244 | 247 | return $box; |
245 | 248 | } |
246 | | - |
| 249 | + |
247 | 250 | /** |
248 | 251 | * @returns string |
249 | 252 | * Generates (+/-) JS toggle HTML |
— | — | @@ -253,7 +256,7 @@ |
254 | 257 | wfMsgHtml( 'revreview-toggle-title' ) . '" >' . |
255 | 258 | wfMsgHtml( 'revreview-toggle' ) . '</a>'; |
256 | 259 | } |
257 | | - |
| 260 | + |
258 | 261 | /** |
259 | 262 | * @returns string |
260 | 263 | * Generates (+/-) JS toggle HTML |
— | — | @@ -264,6 +267,17 @@ |
265 | 268 | wfMsgHtml( 'revreview-diff-toggle-title' ) . '" >' . |
266 | 269 | wfMsgHtml( 'revreview-diff-toggle-show' ) . '</a>'; |
267 | 270 | } |
| 271 | + |
| 272 | + /** |
| 273 | + * @returns string |
| 274 | + * Generates (+/-) JS toggle HTML |
| 275 | + */ |
| 276 | + public static function logToggle() { |
| 277 | + return '<a id="mw-fr-logtoggle" class="flaggedrevs_toggle" style="display:none;"' . |
| 278 | + ' onclick="FlaggedRevs.toggleLog()" title="' . |
| 279 | + wfMsgHtml( 'revreview-log-toggle-show' ) . '" >' . |
| 280 | + wfMsgHtml( 'revreview-log-toggle-show' ) . '</a>'; |
| 281 | + } |
268 | 282 | |
269 | 283 | /** |
270 | 284 | * @param array $flags, selected flags |
— | — | @@ -481,4 +495,16 @@ |
482 | 496 | $tag = wfMsgExt( $msg, array( 'parseinline' ), $frev->getRevId(), $time, $revsSince ); |
483 | 497 | return $tag; |
484 | 498 | } |
| 499 | + |
| 500 | + /* |
| 501 | + * @param Article $article |
| 502 | + * @returns string |
| 503 | + * Creates a stability log excerpt |
| 504 | + */ |
| 505 | + public static function stabilityLogExcerpt( $article ) { |
| 506 | + $logHtml = ''; |
| 507 | + LogEventsList::showLogExtract( $logHtml, 'stable', |
| 508 | + $article->getTitle()->getPrefixedText(), '', array( 'lim' => 1 ) ); |
| 509 | + return "<div id=\"mw-fr-logexcerpt\">$logHtml</div>"; |
| 510 | + } |
485 | 511 | } |
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.js |
— | — | @@ -25,6 +25,14 @@ |
26 | 26 | diff.style.display = 'none'; |
27 | 27 | } |
28 | 28 | } |
| 29 | + toggle = document.getElementById('mw-fr-logtoggle'); |
| 30 | + if( toggle ) { |
| 31 | + toggle.style.display = 'inline'; |
| 32 | + var log = document.getElementById('mw-fr-logexcerpt'); |
| 33 | + if( log ) { |
| 34 | + log.style.display = 'none'; |
| 35 | + } |
| 36 | + } |
29 | 37 | }, |
30 | 38 | |
31 | 39 | /* Toggles ratings */ |
— | — | @@ -54,6 +62,19 @@ |
55 | 63 | toggle.innerHTML = this.messages.revreviewDiffToggleShow; |
56 | 64 | } |
57 | 65 | } |
| 66 | + }, |
| 67 | + |
| 68 | + /* Toggles log excerpts */ |
| 69 | + 'toggleLog': function() { |
| 70 | + var log = document.getElementById('mw-fr-logexcerpt'); |
| 71 | + if( !log ) return; |
| 72 | + var toggle = document.getElementById('mw-fr-logtoggle'); |
| 73 | + if( log.style.display == 'none' ) { |
| 74 | + log.style.display = 'inline'; |
| 75 | + if( toggle ) { |
| 76 | + toggle.innerHTML = ''; |
| 77 | + } |
| 78 | + } |
58 | 79 | } |
59 | 80 | }; |
60 | 81 | |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -737,7 +737,7 @@ |
738 | 738 | $items = array(); |
739 | 739 | $tag = $warning = $prot = ''; |
740 | 740 | # Show stabilization log |
741 | | - $log = $this->stabilityLogExcerpt(); |
| 741 | + $log = $this->stabilityLogNotice(); |
742 | 742 | if ( $log ) $items[] = $log; |
743 | 743 | # Check the newest stable version |
744 | 744 | $quality = 0; |
— | — | @@ -825,7 +825,7 @@ |
826 | 826 | return true; |
827 | 827 | } |
828 | 828 | |
829 | | - protected function stabilityLogExcerpt() { |
| 829 | + protected function stabilityLogNotice() { |
830 | 830 | $this->load(); |
831 | 831 | $s = ''; |
832 | 832 | # Only for pages manually made to be stable... |
— | — | @@ -1594,8 +1594,15 @@ |
1595 | 1595 | } |
1596 | 1596 | # Add the submit buttons |
1597 | 1597 | $form .= FlaggedRevsXML::ratingSubmitButtons( $frev, (bool)$toggle, $allowRereview ); |
1598 | | - |
| 1598 | + # Show stability log if there is anything interesting... |
| 1599 | + if( $this->article->isPageLocked() ) { |
| 1600 | + $form .= ' ' . FlaggedRevsXML::logToggle(); |
| 1601 | + } |
1599 | 1602 | $form .= Xml::closeElement( 'span' ); |
| 1603 | + # ..add the actual stability log body here |
| 1604 | + if( $this->article->isPageLocked() ) { |
| 1605 | + $form .= FlaggedRevsXML::stabilityLogExcerpt( $this->article ); |
| 1606 | + } |
1600 | 1607 | $form .= Xml::closeElement( 'div' ) . "\n"; |
1601 | 1608 | |
1602 | 1609 | # Hidden params |