Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -286,7 +286,7 @@ |
287 | 287 | $wgAvailableRights[] = 'stablesettings'; |
288 | 288 | |
289 | 289 | # Bump this number every time you change flaggedrevs.css/flaggedrevs.js |
290 | | -$wgFlaggedRevStyleVersion = 63; |
| 290 | +$wgFlaggedRevStyleVersion = 64; |
291 | 291 | |
292 | 292 | $wgExtensionFunctions[] = 'efLoadFlaggedRevs'; |
293 | 293 | |
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -47,6 +47,10 @@ |
48 | 48 | 'hist-stable' => 'sighted revision', |
49 | 49 | 'hist-stable-user' => '[{{fullurl:$1|stableid=$2}} sighted] by [[User:$3|$3]]', |
50 | 50 | 'hist-autoreviewed' => '[{{fullurl:$1|stableid=$2}} automatically sighted]', |
| 51 | + 'review-edit-diff' => '\'\'\'NOTICE: Some pending changes to the published version are incorporated into the edit form below.\'\'\'', |
| 52 | + 'revreview-diff-toggle-show' => '(show changes)', |
| 53 | + 'revreview-diff-toggle-hide' => '(hide changes)', |
| 54 | + 'revreview-diff-toggle-title' => 'Toggle display of changes between draft and the published version', |
51 | 55 | 'review-diff2stable' => 'View changes between stable and current revisions', |
52 | 56 | 'review-logentry-app' => 'reviewed a version of [[$1]]', |
53 | 57 | 'review-logentry-dis' => 'deprecated a version of [[$1]]', |
— | — | @@ -67,7 +71,7 @@ |
68 | 72 | 'revreview-approved' => 'Approved', |
69 | 73 | 'revreview-auto' => '(automatic)', |
70 | 74 | 'revreview-basic' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} sighted] on <i>$2</i>. |
71 | | -The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} draft] contains [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 suggested {{PLURAL:$3|change|changes}}].', |
| 75 | +The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} draft] contains [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}].', |
72 | 76 | 'revreview-basic-i' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} sighted] on <i>$2</i>. |
73 | 77 | The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} draft] contains [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} template/file changes] awaiting review.', |
74 | 78 | 'revreview-basic-old' => 'This is a [[{{MediaWiki:Validationpage}}|sighted]] revision ([{{fullurl:{{#Special:ReviewedVersions}}|page={{FULLPAGENAMEE}}}} list all]), [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. |
— | — | @@ -93,7 +97,7 @@ |
94 | 98 | 'revreview-editnotice' => '\'\'\'Your changes will be [[{{MediaWiki:Validationpage}}|published]] once an authorised user [[{{MediaWiki:Validationpage}}|reviews]] them.\'\'\'', |
95 | 99 | 'revreview-check-flag' => 'Mark pending edits reviewed', |
96 | 100 | 'revreview-edited' => '\'\'\'Changes will be [[{{MediaWiki:Validationpage}}|published]] once an authorised user [[{{MediaWiki:Validationpage}}|reviews]] them.\'\'\' |
97 | | -The \'\'draft\'\', shown below, contains [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $2 suggested {{PLURAL:$2|change|changes}}].', |
| 101 | +The \'\'draft\'\', shown below, contains [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $2 pending {{PLURAL:$2|change|changes}}].', |
98 | 102 | 'revreview-flag' => 'Review this revision', |
99 | 103 | 'revreview-unflag' => 'Unreview this revision', |
100 | 104 | 'revreview-invalid' => '\'\'\'Invalid target:\'\'\' no [[{{MediaWiki:Validationpage}}|reviewed]] revision corresponds to the given ID.', |
— | — | @@ -103,11 +107,11 @@ |
104 | 108 | |
105 | 109 | See the [[Special:Unreviewedpages|list of unreviewed pages]].', |
106 | 110 | 'revreview-newest-basic' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} sighted] on <i>$2</i>. The draft contains |
107 | | -[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 suggested {{PLURAL:$3|change|changes}}].', |
| 111 | +[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}].', |
108 | 112 | 'revreview-newest-basic-i' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} sighted] on <i>$2</i>. The draft contains |
109 | 113 | [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} Template/file changes] await review.', |
110 | 114 | 'revreview-newest-quality' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. The draft contains |
111 | | -[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 suggested {{PLURAL:$3|change|changes}}].', |
| 115 | +[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}].', |
112 | 116 | 'revreview-newest-quality-i' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. The draft contains |
113 | 117 | [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} Template/file changes] await review.', |
114 | 118 | 'revreview-noflagged' => 'There are no reviewed revisions of this page, so it may \'\'\'not\'\'\' have been [[{{MediaWiki:Validationpage}}|checked]] for quality.', |
— | — | @@ -118,7 +122,7 @@ |
119 | 123 | 'revreview-patrol-title' => 'Mark as patrolled', |
120 | 124 | 'revreview-patrolled' => 'The selected revision of [[:$1|$1]] has been marked as patrolled.', |
121 | 125 | 'revreview-quality' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. |
122 | | -The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} draft] contains [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 suggested {{PLURAL:$3|change|changes}}] awaiting review.', |
| 126 | +The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} draft] contains [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}] awaiting review.', |
123 | 127 | 'revreview-quality-i' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. |
124 | 128 | The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} draft] has [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} template/file changes] awaiting review.', |
125 | 129 | 'revreview-quality-old' => 'This is a [[{{MediaWiki:Validationpage}}|quality]] revision ([{{fullurl:{{#Special:ReviewedVersions}}|page={{FULLPAGENAMEE}}}} list all]), [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. |
— | — | @@ -215,10 +219,10 @@ |
216 | 220 | 'flaggedrevs-protect-none' => 'Allow all users', |
217 | 221 | 'flaggedrevs-protect-basic' => 'Default settings', |
218 | 222 | |
219 | | - 'revreview-locked-title' => 'Edits must be reviewed before being displayed on this page.', |
220 | | - 'revreview-unlocked-title' => 'Edits do not require review before being displayed on this page.', |
221 | | - 'revreview-locked' => 'Edits must be [[{{MediaWiki:Validationpage}}|reviewed]] before being displayed on this page.', |
222 | | - 'revreview-unlocked' => 'Edits do not require [[{{MediaWiki:Validationpage}}|review]] before being displayed on this page.', |
| 223 | + 'revreview-locked-title' => 'Edits must be reviewed before being published on this page.', |
| 224 | + 'revreview-unlocked-title' => 'Edits do not require review before being published on this page.', |
| 225 | + 'revreview-locked' => '\'\'\'Edits must be [[{{MediaWiki:Validationpage}}|reviewed]] before being published on this page.\'\'\'', |
| 226 | + 'revreview-unlocked' => 'Edits do not require [[{{MediaWiki:Validationpage}}|review]] before being published on this page.', |
223 | 227 | |
224 | 228 | 'revreview-ak-review' => 's', # do not translate or duplicate this message to other languages |
225 | 229 | 'accesskey-ca-current' => 'v', # do not translate or duplicate this message to other languages |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php |
— | — | @@ -145,7 +145,7 @@ |
146 | 146 | public static function addTagRatings( $flags, $prettyBox = false, $css='' ) { |
147 | 147 | $tag = ''; |
148 | 148 | if( $prettyBox ) { |
149 | | - $tag .= "<table id='mw-revisionratings-box' align='center' class='$css' cellpadding='0'>"; |
| 149 | + $tag .= "<table id='mw-fr-revisionratings-box' align='center' class='$css' cellpadding='0'>"; |
150 | 150 | } |
151 | 151 | foreach( FlaggedRevs::getDimensions() as $quality => $x ) { |
152 | 152 | $level = isset( $flags[$quality] ) ? $flags[$quality] : 0; |
— | — | @@ -230,7 +230,7 @@ |
231 | 231 | $box = "<table style='background: none; border-spacing: 0px;'>"; |
232 | 232 | $box .= "<tr style='white-space:nowrap;'><td>$shtml </td>"; |
233 | 233 | $box .= "<td style='text-align:right;'>" . self::ratingToggle() . "</td></tr>\n"; |
234 | | - $box .= "<tr><td id='mw-revisionratings'>$html<br />"; |
| 234 | + $box .= "<tr><td id='mw-fr-revisionratings'>$html<br />"; |
235 | 235 | # Add ratings if there are any... |
236 | 236 | if( $stable && !empty($flags) ) { |
237 | 237 | $box .= self::addTagRatings( $flags, true, $color ); |
— | — | @@ -244,13 +244,24 @@ |
245 | 245 | * Generates (+/-) JS toggle HTML |
246 | 246 | */ |
247 | 247 | public static function ratingToggle() { |
248 | | - return "<a id='mw-revisiontoggle' class='flaggedrevs_toggle' style='display:none;'" . |
| 248 | + return "<a id='mw-fr-revisiontoggle' class='flaggedrevs_toggle' style='display:none;'" . |
249 | 249 | " onclick='FlaggedRevs.toggleRevRatings()' title='" . |
250 | 250 | wfMsgHtml('revreview-toggle-title') . "' >" . |
251 | 251 | wfMsg( 'revreview-toggle' ) . "</a>"; |
252 | 252 | } |
253 | 253 | |
254 | 254 | /** |
| 255 | + * @returns string |
| 256 | + * Generates (+/-) JS toggle HTML |
| 257 | + */ |
| 258 | + public static function diffToggle() { |
| 259 | + return "<a id='mw-fr-difftoggle' class='flaggedrevs_toggle' style='display:none;'" . |
| 260 | + " onclick='FlaggedRevs.toggleDiff()' title='" . |
| 261 | + wfMsgHtml('revreview-diff-toggle-title') . "' >" . |
| 262 | + wfMsg( 'revreview-diff-toggle-show' ) . "</a>"; |
| 263 | + } |
| 264 | + |
| 265 | + /** |
255 | 266 | * @param array $flags, selected flags |
256 | 267 | * @param array $config, page config |
257 | 268 | * @param bool $disabled, form disabled |
— | — | @@ -271,7 +282,7 @@ |
272 | 283 | if( FlaggedRevs::binaryFlagging() ) { |
273 | 284 | $inputName = empty($tags) ? 'wpApprove' : "wp{$tags[0]}"; |
274 | 285 | return Xml::hidden( $inputName, $reviewed ? 0 : 1, |
275 | | - array('id' => 'mw-reviewstate') ); |
| 286 | + array('id' => 'mw-fr-reviewstate') ); |
276 | 287 | } |
277 | 288 | $items = array(); |
278 | 289 | # Build rating form... |
— | — | @@ -388,36 +399,26 @@ |
389 | 400 | * @returns string |
390 | 401 | * Creates "there are x pending edits" message in a div |
391 | 402 | */ |
392 | | - public static function pendingEditBox( $flaggedArticle, $frev, $revsSince ) { |
| 403 | + public static function pendingEditNotice( $flaggedArticle, $frev, $revsSince ) { |
393 | 404 | global $wgLang; |
394 | 405 | $flags = $frev->getTags(); |
395 | 406 | $quality = FlaggedRevs::isQuality( $flags ); |
396 | 407 | $time = $wgLang->date( $frev->getTimestamp(), true ); |
397 | | - // Is the page config altered? |
398 | | - $prot = self::lockStatusIcon( $flaggedArticle ); |
399 | | - # Streamlined UI |
400 | | - if( FlaggedRevs::useSimpleUI() ) { |
401 | | - $msg = $quality ? 'revreview-newest-quality' : 'revreview-newest-basic'; |
402 | | - $msg .= ($revsSince == 0) ? '-i' : ''; |
403 | | - $tag = "{$prot}<span class='fr-checkbox'></span>" . |
404 | | - wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), $time, $revsSince ); |
405 | | - $tag = "<div id='mw-revisiontag-edit' class='flaggedrevs_editnotice plainlinks'>" . |
406 | | - "$tag</div>"; |
| 408 | + # Add message text for pending edits |
| 409 | + $msg = $quality |
| 410 | + ? 'revreview-newest-quality' |
| 411 | + : 'revreview-newest-basic'; |
| 412 | + $msg .= ($revsSince == 0) ? '-i' : ''; |
| 413 | + $tag = wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), $time, $revsSince ); |
407 | 414 | # Standard UI |
408 | | - } else { |
409 | | - $msg = $quality ? 'revreview-newest-quality' : 'revreview-newest-basic'; |
410 | | - $msg .= ($revsSince == 0) ? '-i' : ''; |
411 | | - $tag = "{$prot}<span class='fr-checkbox'></span>" . |
412 | | - wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), $time, $revsSince ); |
| 415 | + if( !FlaggedRevs::useSimpleUI() ) { |
413 | 416 | # Hide clutter |
414 | 417 | if( !empty($flags) ) { |
415 | 418 | $tag .= " " . FlaggedRevsXML::ratingToggle(); |
416 | | - $tag .= '<span id="mw-revisionratings" style="display:block;"><br />' . |
| 419 | + $tag .= '<span id="mw-fr-revisionratings" style="display:block;"><br />' . |
417 | 420 | wfMsg('revreview-oldrating') . FlaggedRevsXML::addTagRatings( $flags ) . |
418 | 421 | '</span>'; |
419 | 422 | } |
420 | | - $tag = "<div id='mw-revisiontag-edit' class='flaggedrevs_editnotice plainlinks'>" . |
421 | | - "$tag</div>"; |
422 | 423 | } |
423 | 424 | return $tag; |
424 | 425 | } |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -30,6 +30,13 @@ |
31 | 31 | $encJsFile = htmlspecialchars( "$stylePath/review.js?$wgFlaggedRevStyleVersion" ); |
32 | 32 | $head .= "\n<script type=\"{$wgJsMimeType}\" src=\"{$encJsFile}\"></script>"; |
33 | 33 | } |
| 34 | + # Set basic messages |
| 35 | + $msgs = (object) array( |
| 36 | + 'revreviewDiffToggleShow' => wfMsgHtml('revreview-diff-toggle-show'), |
| 37 | + 'revreviewDiffToggleHide' => wfMsgHtml('revreview-diff-toggle-hide') |
| 38 | + ); |
| 39 | + $head .= "\n<script type=\"{$wgJsMimeType}\">" . |
| 40 | + "FlaggedRevs.messages = ".Xml::encodeJsVar($msgs).";</script>"; |
34 | 41 | $wgOut->addHeadItem( 'FlaggedRevs', $head ); |
35 | 42 | return true; |
36 | 43 | } |
— | — | @@ -46,19 +53,19 @@ |
47 | 54 | # Get page-specific meta-data |
48 | 55 | $frev = $fa->getStableRev(); |
49 | 56 | $stableId = $frev ? $frev->getRevId() : 0; |
50 | | - $ajaxReview = (object) array( |
51 | | - 'sendMsg' => wfMsgHtml('revreview-submit'), |
52 | | - 'flagMsg' => wfMsgHtml('revreview-submit-review'), |
53 | | - 'unflagMsg' => wfMsgHtml('revreview-submit-unreview'), |
54 | | - 'flagLegMsg' => wfMsgHtml('revreview-flag'), |
55 | | - 'unflagLegMsg' => wfMsgHtml('revreview-unflag'), |
56 | | - 'sendingMsg' => wfMsgHtml('revreview-submitting'), |
57 | | - 'actioncomplete' => wfMsgHtml('actioncomplete'), |
58 | | - 'actionfailed' => wfMsgHtml('actionfailed') |
59 | | - ); |
60 | 57 | $globalVars['wgFlaggedRevsParams'] = $rTags; |
61 | 58 | $globalVars['wgStableRevisionId'] = $stableId; |
62 | 59 | if( $wgUser->isAllowed('review') ) { |
| 60 | + $ajaxReview = (object) array( |
| 61 | + 'sendMsg' => wfMsgHtml('revreview-submit'), |
| 62 | + 'flagMsg' => wfMsgHtml('revreview-submit-review'), |
| 63 | + 'unflagMsg' => wfMsgHtml('revreview-submit-unreview'), |
| 64 | + 'flagLegMsg' => wfMsgHtml('revreview-flag'), |
| 65 | + 'unflagLegMsg' => wfMsgHtml('revreview-unflag'), |
| 66 | + 'sendingMsg' => wfMsgHtml('revreview-submitting'), |
| 67 | + 'actioncomplete' => wfMsgHtml('actioncomplete'), |
| 68 | + 'actionfailed' => wfMsgHtml('actionfailed') |
| 69 | + ); |
63 | 70 | $globalVars['wgAjaxReview'] = $ajaxReview; // language for AJAX form |
64 | 71 | } |
65 | 72 | return true; |
— | — | @@ -1820,7 +1827,7 @@ |
1821 | 1828 | ); |
1822 | 1829 | # Give a notice if pages on the wachlist are outdated |
1823 | 1830 | if( $watchedOutdated ) { |
1824 | | - $notice .= "<div id='mw-oldreviewed-notice' class='plainlinks fr-watchlist-old-notice'>" . |
| 1831 | + $notice .= "<div id='mw-fr-oldreviewed-notice' class='plainlinks fr-watchlist-old-notice'>" . |
1825 | 1832 | wfMsgExt('flaggedrevs-watched-pending',array('parseinline')) . "</div>"; |
1826 | 1833 | # Otherwise, give a notice if there is a large backlog in general |
1827 | 1834 | } else { |
— | — | @@ -1837,7 +1844,7 @@ |
1838 | 1845 | 'fp_pending_since IS NOT NULL', __METHOD__ ); |
1839 | 1846 | } |
1840 | 1847 | if( $unreviewed > .02*$pages ) { |
1841 | | - $notice .= "<div id='mw-oldreviewed-notice' class='plainlinks fr-backlognotice'>" . |
| 1848 | + $notice .= "<div id='mw-fr-oldreviewed-notice' class='plainlinks fr-backlognotice'>" . |
1842 | 1849 | wfMsgExt('flaggedrevs-backlog',array('parseinline')) . "</div>"; |
1843 | 1850 | } |
1844 | 1851 | } |
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.css |
— | — | @@ -43,6 +43,8 @@ |
44 | 44 | .flaggedrevs_editnotice { |
45 | 45 | font-size: 85%; |
46 | 46 | background-color: #f9f9f9; |
| 47 | + text-align: left; |
| 48 | + width: 100%; |
47 | 49 | } |
48 | 50 | .flaggedrevs_diffnotice { |
49 | 51 | font-size: 85%; |
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.js |
— | — | @@ -3,25 +3,57 @@ |
4 | 4 | /* Every time you change this JS please bump $wgFlaggedRevStyleVersion in FlaggedRevs.php */ |
5 | 5 | |
6 | 6 | var FlaggedRevs = { |
7 | | - /* Hide rating clutter */ |
| 7 | + 'messages': { |
| 8 | + 'revreviewDiffToggleShow': '(show)', |
| 9 | + 'revreviewDiffToggleHide': '(hide)' |
| 10 | + }, |
| 11 | + /* Hide rating/diff clutter */ |
8 | 12 | 'enableShowhide': function() { |
9 | | - var toggle = document.getElementById('mw-revisiontoggle'); |
10 | | - if( !toggle ) return; |
11 | | - toggle.style.display = 'inline'; |
12 | | - var ratings = document.getElementById('mw-revisionratings'); |
13 | | - if( !ratings ) return; |
14 | | - ratings.style.display = 'none'; |
| 13 | + var toggle = document.getElementById('mw-fr-revisiontoggle'); |
| 14 | + if( toggle ) { |
| 15 | + toggle.style.display = 'inline'; |
| 16 | + var ratings = document.getElementById('mw-fr-revisionratings'); |
| 17 | + if( ratings ) { |
| 18 | + ratings.style.display = 'none'; |
| 19 | + } |
| 20 | + } |
| 21 | + toggle = document.getElementById('mw-fr-difftoggle'); |
| 22 | + if( toggle ) { |
| 23 | + toggle.style.display = 'inline'; |
| 24 | + var diff = document.getElementById('mw-fr-stablediff'); |
| 25 | + if( diff ) { |
| 26 | + diff.style.display = 'none'; |
| 27 | + } |
| 28 | + } |
15 | 29 | }, |
16 | 30 | |
17 | 31 | /* Toggles ratings */ |
18 | 32 | 'toggleRevRatings': function() { |
19 | | - var ratings = document.getElementById('mw-revisionratings'); |
| 33 | + var ratings = document.getElementById('mw-fr-revisionratings'); |
20 | 34 | if( !ratings ) return; |
21 | 35 | if( ratings.style.display == 'none' ) { |
22 | 36 | ratings.style.display = 'inline'; |
23 | 37 | } else { |
24 | 38 | ratings.style.display = 'none'; |
25 | 39 | } |
| 40 | + }, |
| 41 | + |
| 42 | + /* Toggles diffs */ |
| 43 | + 'toggleDiff': function() { |
| 44 | + var diff = document.getElementById('mw-fr-stablediff'); |
| 45 | + if( !diff ) return; |
| 46 | + var toggle = document.getElementById('mw-fr-difftoggle'); |
| 47 | + if( diff.style.display == 'none' ) { |
| 48 | + diff.style.display = 'inline'; |
| 49 | + if( toggle ) { |
| 50 | + toggle.innerHTML = this.messages.revreviewDiffToggleHide; |
| 51 | + } |
| 52 | + } else { |
| 53 | + diff.style.display = 'none'; |
| 54 | + if( toggle ) { |
| 55 | + toggle.innerHTML = this.messages.revreviewDiffToggleShow; |
| 56 | + } |
| 57 | + } |
26 | 58 | } |
27 | 59 | }; |
28 | 60 | |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -151,12 +151,12 @@ |
152 | 152 | # Hide clutter |
153 | 153 | if( !FlaggedRevs::useSimpleUI() && !empty($flags) ) { |
154 | 154 | $tag .= " " . FlaggedRevsXML::ratingToggle() . |
155 | | - "<span id='mw-revisionratings' style='display:block;'><br />" . |
| 155 | + "<span id='mw-fr-revisionratings' style='display:block;'><br />" . |
156 | 156 | wfMsgHtml('revreview-oldrating') . |
157 | 157 | FlaggedRevsXML::addTagRatings( $flags ) . '</span>'; |
158 | 158 | } |
159 | 159 | $css = 'flaggedrevs_notice plainlinks noprint'; |
160 | | - $tag = "<div id='mw-revisiontag-old' class='$css'>$tag</div>"; |
| 160 | + $tag = "<div id='mw-fr-revisiontag-old' class='$css'>$tag</div>"; |
161 | 161 | $wgOut->addHTML( $tag ); |
162 | 162 | } |
163 | 163 | return true; |
— | — | @@ -271,7 +271,7 @@ |
272 | 272 | # Wrap tag contents in a div |
273 | 273 | if( $tag != '' ) { |
274 | 274 | $rtl = $wgContLang->isRTL() ? " rtl" : ""; // RTL langauges |
275 | | - $tag = "<div id='mw-revisiontag' class='{$tagClass}{$rtl} plainlinks noprint'>" . |
| 275 | + $tag = "<div id='mw-fr-revisiontag' class='{$tagClass}{$rtl} plainlinks noprint'>" . |
276 | 276 | "$tag</div>"; |
277 | 277 | $this->reviewNotice .= $tag; |
278 | 278 | } |
— | — | @@ -297,13 +297,13 @@ |
298 | 298 | $msg = 'revreview-quick-none'; |
299 | 299 | $tag .= "{$prot}<span class='fr-icon-current plainlinks'></span>" . |
300 | 300 | wfMsgExt($msg,array('parseinline')); |
301 | | - $tag = "<div id='mw-revisiontag' class='flaggedrevs_short{$rtl} plainlinks noprint'>" . |
| 301 | + $tag = "<div id='mw-fr-revisiontag' class='flaggedrevs_short{$rtl} plainlinks noprint'>" . |
302 | 302 | "$tag</div>"; |
303 | 303 | $this->reviewNotice .= $tag; |
304 | 304 | // Standard UI |
305 | 305 | } else { |
306 | 306 | $msg = 'revreview-noflagged'; |
307 | | - $tag = "<div id='mw-revisiontag' class='flaggedrevs_notice plainlinks noprint'>" . |
| 307 | + $tag = "<div id='mw-fr-revisiontag' class='flaggedrevs_notice plainlinks noprint'>" . |
308 | 308 | "{$prot}<span class='fr-icon-current plainlinks'></span>" . |
309 | 309 | wfMsgExt($msg, array('parseinline')) . "</div>"; |
310 | 310 | $this->reviewNotice .= $tag; |
— | — | @@ -340,7 +340,7 @@ |
341 | 341 | $tooltip = wfMsgHtml('revreview-draft-title'); |
342 | 342 | $pending = "{$prot}<span class='fr-icon-current' title=\"{$tooltip}\"></span>" . |
343 | 343 | wfMsgExt('revreview-edited',array('parseinline'),$srev->getRevId(),$revsSince); |
344 | | - $pending = "<div id='mw-reviewnotice' class='flaggedrevs_preview plainlinks'>" . |
| 344 | + $pending = "<div id='mw-fr-reviewnotice' class='flaggedrevs_preview plainlinks'>" . |
345 | 345 | "$pending</div>"; |
346 | 346 | # Notice should always use subtitle |
347 | 347 | $this->reviewNotice = $pending; |
— | — | @@ -397,7 +397,7 @@ |
398 | 398 | # Hide clutter |
399 | 399 | if( !empty($flags) ) { |
400 | 400 | $tag .= " " . FlaggedRevsXML::ratingToggle(); |
401 | | - $tag .= "<span id='mw-revisionratings' style='display:block;'><br />" . |
| 401 | + $tag .= "<span id='mw-fr-revisionratings' style='display:block;'><br />" . |
402 | 402 | wfMsgHtml('revreview-oldrating') . |
403 | 403 | FlaggedRevsXML::addTagRatings( $flags ) . '</span>'; |
404 | 404 | } |
— | — | @@ -457,7 +457,7 @@ |
458 | 458 | # Hide clutter |
459 | 459 | if( !empty($flags) ) { |
460 | 460 | $tag .= " " . FlaggedRevsXML::ratingToggle(); |
461 | | - $tag .= "<span id='mw-revisionratings' style='display:block;'><br />" . |
| 461 | + $tag .= "<span id='mw-fr-revisionratings' style='display:block;'><br />" . |
462 | 462 | wfMsgHtml('revreview-oldrating') . |
463 | 463 | FlaggedRevsXML::addTagRatings( $flags ) . '</span>'; |
464 | 464 | } |
— | — | @@ -531,7 +531,7 @@ |
532 | 532 | wfMsgExt( $msg, array('parseinline'), $srev->getRevId(), $time, $revsSince ); |
533 | 533 | if( !empty($flags) ) { |
534 | 534 | $tag .= " " . FlaggedRevsXML::ratingToggle(); |
535 | | - $tag .= "<span id='mw-revisionratings' style='display:block;'><br />" . |
| 535 | + $tag .= "<span id='mw-fr-revisionratings' style='display:block;'><br />" . |
536 | 536 | FlaggedRevsXML::addTagRatings( $flags ) . '</span>'; |
537 | 537 | } |
538 | 538 | } |
— | — | @@ -673,16 +673,19 @@ |
674 | 674 | * Adds stable version tags to page when viewing history |
675 | 675 | */ |
676 | 676 | public function addToHistView() { |
677 | | - global $wgOut, $wgLang; |
| 677 | + global $wgOut; |
678 | 678 | $this->load(); |
679 | 679 | # Must be reviewable. UI may be limited to unobtrusive patrolling system. |
680 | | - if( !$this->article->isReviewable() || $this->article->limitedUI() ) |
| 680 | + if( !$this->article->isReviewable() || $this->article->limitedUI() ) { |
681 | 681 | return true; |
| 682 | + } |
682 | 683 | # Add a notice if there are pending edits... |
683 | 684 | $frev = $this->article->getStableRev(); |
684 | 685 | if( $frev && $frev->getRevId() < $this->article->getLatest() ) { |
685 | 686 | $revsSince = FlaggedRevs::getRevCountSince( $this->article, $frev->getRevId() ); |
686 | | - $tag = FlaggedRevsXML::pendingEditBox( $this->article, $frev, $revsSince ); |
| 687 | + $tag = "<div id='mw-fr-revisiontag-edit' class='flaggedrevs_notice plainlinks'>" . |
| 688 | + FlaggedRevsXML::lockStatusIcon( $this->article ) . # flag protection icon as needed |
| 689 | + FlaggedRevsXML::pendingEditNotice( $this->article, $frev, $revsSince ) . "</div>"; |
687 | 690 | $wgOut->addHTML( $tag ); |
688 | 691 | } |
689 | 692 | return true; |
— | — | @@ -695,40 +698,38 @@ |
696 | 699 | global $wgRequest, $wgOut, $wgLang, $wgUser; |
697 | 700 | $this->load(); |
698 | 701 | # Must be reviewable. UI may be limited to unobtrusive patrolling system. |
699 | | - if( !$this->article->isReviewable() || $this->article->limitedUI() ) |
| 702 | + if( !$this->article->isReviewable() || $this->article->limitedUI() ) { |
700 | 703 | return true; |
| 704 | + } |
| 705 | + $items = array(); |
| 706 | + $tag = $warning = $prot = ''; |
701 | 707 | # Show stabilization log |
702 | | - $this->showStabilityLog(); |
703 | | - $tag = $warning = $prot = ''; |
| 708 | + $log = $this->stabilityLogExcerpt(); |
| 709 | + if( $log ) $items[] = $log; |
704 | 710 | # Check the newest stable version |
705 | 711 | $quality = 0; |
706 | 712 | $frev = $this->article->getStableRev(); |
707 | 713 | if( $frev ) { |
| 714 | + $quality = $frev->getQuality(); |
708 | 715 | # Find out revision id of base version |
709 | 716 | $latestId = $this->article->getLatest(); |
710 | 717 | $revId = $editPage->oldid ? $editPage->oldid : $latestId; |
711 | 718 | $isOld = ($revId != $latestId); // not the current rev? |
712 | | - # Let new users know about review procedure a tag |
713 | | - if( !$wgUser->getId() && $this->article->showStableByDefault() ) { |
714 | | - $css = 'flaggedrevs_editnotice plainlinks'; |
715 | | - $warning = "<div id='mw-editwarningtag' class='$css'>" . |
716 | | - wfMsgExt('revreview-editnotice',array('parseinline')) . "</div>"; |
| 719 | + # Let new users know about review procedure a tag. |
| 720 | + # If the log excerpt was shown this is redundant. |
| 721 | + if( !$log && !$wgUser->getId() && $this->article->showStableByDefault() ) { |
| 722 | + $items[] = wfMsgExt( 'revreview-editnotice', array('parseinline') ); |
717 | 723 | } |
718 | 724 | # Add a notice if there are pending edits... |
719 | 725 | if( $frev->getRevId() != $revId ) { |
720 | 726 | $revsSince = FlaggedRevs::getRevCountSince( $this->article, $frev->getRevId() ); |
721 | | - $tag = FlaggedRevsXML::pendingEditBox( $this->article, $frev, $revsSince ); |
| 727 | + $items[] = FlaggedRevsXML::pendingEditNotice( $this->article, $frev, $revsSince ); |
722 | 728 | } |
723 | | - # Output notice and warning for editors |
724 | | - if( $tag || $warning ) { |
725 | | - $wgOut->addHTML( $warning . $tag ); |
726 | | - } |
727 | | - |
728 | 729 | # Show diff to stable, to make things less confusing... |
729 | 730 | # This can be disabled via user preferences |
730 | 731 | if( $frev->getRevId() < $revId // changes were made |
731 | 732 | && $this->showDiffOnEditUser() // stable default and user cannot review |
732 | | - && $wgUser->getBoolOption('flaggedrevseditdiffs') // not disable via prefs |
| 733 | + && $wgUser->getBoolOption( 'flaggedrevseditdiffs' ) // not disable via prefs |
733 | 734 | ) { |
734 | 735 | # Don't show for old revisions, diff, preview, or undo |
735 | 736 | if( $isOld || $editPage->section === "new" |
— | — | @@ -738,7 +739,9 @@ |
739 | 740 | } |
740 | 741 | |
741 | 742 | # Conditions are met to show diff... |
742 | | - $leftNote = $quality ? 'revreview-quality-rev' : 'revreview-sighted-rev'; |
| 743 | + $leftNote = $quality |
| 744 | + ? 'revreview-quality-rev' |
| 745 | + : 'revreview-sighted-rev'; |
743 | 746 | $rClass = FlaggedRevsXML::getQualityColor( false ); |
744 | 747 | $lClass = FlaggedRevsXML::getQualityColor( (int)$quality ); |
745 | 748 | $rightNote = "<span class='$rClass'>[".wfMsgHtml('revreview-draft-rev')."]</span>"; |
— | — | @@ -752,8 +755,10 @@ |
753 | 756 | if( $text !== false && strcmp($text,$editPage->textbox1) !== 0 ) { |
754 | 757 | $diffEngine = new DifferenceEngine(); |
755 | 758 | $diffEngine->showDiffStyle(); |
756 | | - $wgOut->addHTML( |
757 | | - "<div>" . |
| 759 | + $diffHtml = |
| 760 | + wfMsgExt( 'review-edit-diff', 'parseinline' ) . ' ' . |
| 761 | + FlaggedRevsXML::diffToggle() . |
| 762 | + "<div id='mw-fr-stablediff'>" . |
758 | 763 | "<table border='0' width='98%' cellpadding='0' cellspacing='4' class='diff'>" . |
759 | 764 | "<col class='diff-marker' />" . |
760 | 765 | "<col class='diff-content' />" . |
— | — | @@ -767,33 +772,42 @@ |
768 | 773 | "</tr>" . |
769 | 774 | $diffEngine->generateDiffBody( $text, $editPage->textbox1 ) . |
770 | 775 | "</table>" . |
771 | | - "</div>\n" |
772 | | - ); |
| 776 | + "</div>\n"; |
| 777 | + $items[] = $diffHtml; |
773 | 778 | } |
774 | 779 | } |
| 780 | + # Output items |
| 781 | + if( count($items) ) { |
| 782 | + $html = "<table class='flaggedrevs_editnotice plainlinks'>"; |
| 783 | + foreach( $items as $item ) { |
| 784 | + $html .= '<tr><td>'.$item.'</td></tr>'; |
| 785 | + } |
| 786 | + $html .= '</table>'; |
| 787 | + $wgOut->addHTML( $html ); |
| 788 | + } |
775 | 789 | } |
776 | 790 | return true; |
777 | 791 | } |
778 | 792 | |
779 | | - protected function showStabilityLog() { |
780 | | - global $wgOut; |
| 793 | + protected function stabilityLogExcerpt() { |
781 | 794 | $this->load(); |
| 795 | + $s = ''; |
782 | 796 | # Only for pages manually made to be stable... |
783 | 797 | if( $this->article->isPageLocked() ) { |
784 | | - $wgOut->addHTML( "<div class='mw-warning-with-logexcerpt'>" ); |
785 | | - $wgOut->addWikiMsg( 'revreview-locked' ); |
786 | | - LogEventsList::showLogExtract( $wgOut, 'stable', |
| 798 | + $s = wfMsgExt( 'revreview-locked', 'parseinline' ); |
| 799 | + $logHtml = ''; |
| 800 | + LogEventsList::showLogExtract( $logHtml, 'stable', |
787 | 801 | $this->article->getTitle()->getPrefixedText(), '', array('lim'=>1) ); |
788 | | - $wgOut->addHTML( "</div>" ); |
| 802 | + $s .= $logHtml; |
789 | 803 | # ...or unstable |
790 | 804 | } elseif( $this->article->isPageUnlocked() ) { |
791 | | - $wgOut->addHTML( "<div class='mw-warning-with-logexcerpt'>" ); |
792 | | - $wgOut->addWikiMsg( 'revreview-unlocked' ); |
793 | | - LogEventsList::showLogExtract( $wgOut, 'stable', |
| 805 | + $s = wfMsgExt( 'revreview-unlocked', 'parseinline' ); |
| 806 | + $logHtml = ''; |
| 807 | + LogEventsList::showLogExtract( $logHtml, 'stable', |
794 | 808 | $this->article->getTitle()->getPrefixedText(), '', array('lim' => 1) ); |
795 | | - $wgOut->addHTML( "</div>" ); |
| 809 | + $s .= $logHtml; |
796 | 810 | } |
797 | | - return true; |
| 811 | + return $s; |
798 | 812 | } |
799 | 813 | |
800 | 814 | /** |
— | — | @@ -816,7 +830,7 @@ |
817 | 831 | wfMsgHtml('oldreviewedpages'), 'category=' . urlencode($category) ); |
818 | 832 | |
819 | 833 | $wgOut->appendSubtitle( |
820 | | - "<span id='mw-category-oldreviewed'>$unreviewedLink / $oldreviewedLink</span>" |
| 834 | + "<span id='mw-fr-category-oldreviewed'>$unreviewedLink / $oldreviewedLink</span>" |
821 | 835 | ); |
822 | 836 | return true; |
823 | 837 | } |
— | — | @@ -1156,16 +1170,16 @@ |
1157 | 1171 | # If the user is allowed to review, prompt them! |
1158 | 1172 | $css = 'flaggedrevs_diffnotice plainlinks'; |
1159 | 1173 | if( empty($changeList) && $wgUser->isAllowed('review') ) { |
1160 | | - $wgOut->addHTML( "<div id='mw-difftostable' class='$css'>" . |
| 1174 | + $wgOut->addHTML( "<div id='mw-fr-difftostable' class='$css'>" . |
1161 | 1175 | wfMsgExt('revreview-update-none', array('parseinline')).$notice.'</div>' ); |
1162 | 1176 | } elseif( !empty($changeList) && $wgUser->isAllowed('review') ) { |
1163 | 1177 | $changeList = implode(', ',$changeList); |
1164 | | - $wgOut->addHTML( "<div id='mw-difftostable' class='$css'>" . |
| 1178 | + $wgOut->addHTML( "<div id='mw-fr-difftostable' class='$css'>" . |
1165 | 1179 | wfMsgExt('revreview-update', array('parseinline')).' '. |
1166 | 1180 | $changeList.$notice.'</div>' ); |
1167 | 1181 | } elseif( !empty($changeList) ) { |
1168 | 1182 | $changeList = implode(', ',$changeList); |
1169 | | - $wgOut->addHTML( "<div id='mw-difftostable' class='$css'>" . |
| 1183 | + $wgOut->addHTML( "<div id='mw-fr-difftostable' class='$css'>" . |
1170 | 1184 | wfMsgExt('revreview-update-includes', array('parseinline')).' '. |
1171 | 1185 | $changeList.$notice.'</div>' ); |
1172 | 1186 | } |
— | — | @@ -1417,7 +1431,7 @@ |
1418 | 1432 | # Begin form... |
1419 | 1433 | $reviewTitle = SpecialPage::getTitleFor( 'RevisionReview' ); |
1420 | 1434 | $action = $reviewTitle->getLocalUrl( 'action=submit' ); |
1421 | | - $params = array( 'method' => 'post', 'action' => $action, 'id' => 'mw-reviewform' ); |
| 1435 | + $params = array( 'method' => 'post', 'action' => $action, 'id' => 'mw-fr-reviewform' ); |
1422 | 1436 | if( $hide ) { |
1423 | 1437 | $params['class'] = 'fr-hiddenform'; |
1424 | 1438 | } |
— | — | @@ -1428,7 +1442,7 @@ |
1429 | 1443 | $legendMsg = ( FlaggedRevs::binaryFlagging() && $frev ) |
1430 | 1444 | ? 'revreview-unflag' |
1431 | 1445 | : 'revreview-flag'; |
1432 | | - $form .= Xml::openElement( 'legend', array('id' => 'mw-reviewformlegend') ); |
| 1446 | + $form .= Xml::openElement( 'legend', array('id' => 'mw-fr-reviewformlegend') ); |
1433 | 1447 | $form .= "<strong>" . wfMsgHtml( $legendMsg ) . "</strong>"; |
1434 | 1448 | $form .= Xml::closeElement( 'legend' ) . "\n"; |
1435 | 1449 | # Show explanatory text |
— | — | @@ -1451,12 +1465,12 @@ |
1452 | 1466 | } |
1453 | 1467 | |
1454 | 1468 | # Add main checkboxes/selects |
1455 | | - $form .= Xml::openElement( 'span', array('id' => 'mw-ratingselects') ); |
| 1469 | + $form .= Xml::openElement( 'span', array('id' => 'mw-fr-ratingselects') ); |
1456 | 1470 | $form .= FlaggedRevsXML::ratingInputs( $flags, $config, $disabled, (bool)$frev ); |
1457 | 1471 | $form .= Xml::closeElement( 'span' ); |
1458 | 1472 | # Add review notes input |
1459 | 1473 | if( FlaggedRevs::allowComments() && $wgUser->isAllowed( 'validate' ) ) { |
1460 | | - $form .= "<div id='mw-notebox'>\n"; |
| 1474 | + $form .= "<div id='mw-fr-notebox'>\n"; |
1461 | 1475 | $form .= "<p>".wfMsgHtml( 'revreview-notes' ) . "</p>\n"; |
1462 | 1476 | $form .= Xml::openElement( 'textarea', array('name' => 'wpNotes', 'id' => 'wpNotes', |
1463 | 1477 | 'class' => 'fr-notes-box', 'rows' => '2', 'cols' => '80') ) . |
— | — | @@ -1496,7 +1510,7 @@ |
1497 | 1511 | if( !$disabled ) { |
1498 | 1512 | if( count(FlaggedRevs::getDimensions()) > 1 ) |
1499 | 1513 | $form .= "<br />"; // Don't put too much on one line |
1500 | | - $form .= "<span id='mw-commentbox' style='clear:both'>" . |
| 1514 | + $form .= "<span id='mw-fr-commentbox' style='clear:both'>" . |
1501 | 1515 | Xml::inputLabel( wfMsg('revreview-log'), 'wpReason', 'wpReason', 40, '', |
1502 | 1516 | array('class' => 'fr-comment-box') ) . " </span>"; |
1503 | 1517 | } |
— | — | @@ -1510,7 +1524,7 @@ |
1511 | 1525 | } |
1512 | 1526 | $form .= Xml::submitButton( wfMsg($submitMsg), |
1513 | 1527 | array( |
1514 | | - 'id' => 'mw-submitreview', 'accesskey' => wfMsg('revreview-ak-review'), |
| 1528 | + 'id' => 'mw-fr-submitreview', 'accesskey' => wfMsg('revreview-ak-review'), |
1515 | 1529 | 'title' => wfMsg('revreview-tt-review').' ['.wfMsg('revreview-ak-review').']' |
1516 | 1530 | ) + $toggle |
1517 | 1531 | ); |