r63589 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63588‎ | r63589 | r63590 >
Date:09:45, 11 March 2010
Author:aaron
Status:resolved
Tags:
Comment:
* Improved rating toggles (use + and -)
* Made log excerpt on edit page collapsible
* Shortened review form comment box a bit
* Made buttons indicate review completion
* A few JS cleanups
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsXML.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/client/flaggedrevs.js (modified) (history)
  • /trunk/extensions/FlaggedRevs/client/review.js (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -307,7 +307,7 @@
308308 $wgAvailableRights[] = 'stablesettings';
309309
310310 # Bump this number every time you change flaggedrevs.css/flaggedrevs.js
311 -$wgFlaggedRevStyleVersion = 66;
 311+$wgFlaggedRevStyleVersion = 67;
312312
313313 $wgExtensionFunctions[] = 'efLoadFlaggedRevs';
314314
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -54,6 +54,7 @@
5555 'revreview-diff-toggle-hide' => '(hide changes)',
5656 'revreview-diff-toggle-title' => 'Toggle display of changes between draft and the published version',
5757 'revreview-log-toggle-show' => '(show stability log)',
 58+ 'revreview-log-details-show' => '(show details)',
5859 'review-diff2stable' => 'View pending changes to published version',
5960 'review-logentry-app' => 'reviewed a version of [[$1]]',
6061 'review-logentry-dis' => 'deprecated a version of [[$1]]',
@@ -162,13 +163,16 @@
163164 'revreview-style-3' => 'Concise',
164165 'revreview-style-4' => 'Featured',
165166 'revreview-submit' => 'Submit',
166 - 'revreview-submit-review' => 'Mark reviewed',
167 - 'revreview-submit-unreview' => 'Mark unreviewed',
 167+ 'revreview-submit-review' => 'Mark checked',
 168+ 'revreview-submit-unreview' => 'Mark unchecked',
168169 'revreview-submitting' => 'Submitting...',
 170+ 'revreview-submit-reviewed' => 'Done. Checked!',
 171+ 'revreview-submit-unreviewed' => 'Done. Unchecked!',
169172 'revreview-successful' => '\'\'\'Revision of [[:$1|$1]] successfully flagged. ([{{fullurl:{{#Special:ReviewedVersions}}|page=$2}} view reviewed versions])\'\'\'',
170173 'revreview-successful2' => '\'\'\'Revision of [[:$1|$1]] successfully unflagged.\'\'\'',
171174 'revreview-text' => '\'\'[[{{MediaWiki:Validationpage}}|Reviewed versions]] are checked versions of pages used to determine the published version.\'\'',
172 - 'revreview-toggle' => '(+/-)',
 175+ 'revreview-toggle-show' => '(+)',
 176+ 'revreview-toggle-hide' => '(-)',
173177 'revreview-toggle-title' => 'show/hide details',
174178 'revreview-toolow' => '\'\'\'You must rate each of the below attributes higher than "unapproved" in order for a revision to be considered reviewed.\'\'\'
175179 To deprecate a revision, set all fields to "unapproved".
@@ -236,8 +240,8 @@
237241 'log-show-hide-review' => '$1 review log',
238242
239243 'revreview-tt-review' => 'Apply this status to this revision',
240 - 'revreview-tt-flag' => 'Mark this revision as reviewed',
241 - 'revreview-tt-unflag' => 'Mark this revision as not reviewed',
 244+ 'revreview-tt-flag' => 'Approve this revision by marking it as checked',
 245+ 'revreview-tt-unflag' => 'De-approve this revision by marking it as unchecked',
242246 'validationpage' => '{{ns:help}}:Page validation',
243247 );
244248
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php
@@ -257,7 +257,7 @@
258258 return '<a id="mw-fr-revisiontoggle" class="flaggedrevs_toggle" style="display:none;"' .
259259 ' onclick="FlaggedRevs.toggleRevRatings()" title="' .
260260 wfMsgHtml( 'revreview-toggle-title' ) . '" >' .
261 - wfMsgHtml( 'revreview-toggle' ) . '</a>';
 261+ wfMsgHtml( 'revreview-toggle-show' ) . '</a>';
262262 }
263263
264264 /**
@@ -275,11 +275,11 @@
276276 * @returns string
277277 * Generates (+/-) JS toggle HTML
278278 */
279 - public static function logToggle() {
 279+ public static function logToggle( $msg ) {
280280 return '<a id="mw-fr-logtoggle" class="flaggedrevs_toggle" style="display:none;"' .
281281 ' onclick="FlaggedRevs.toggleLog()" title="' .
282 - wfMsgHtml( 'revreview-log-toggle-show' ) . '" >' .
283 - wfMsgHtml( 'revreview-log-toggle-show' ) . '</a>';
 282+ wfMsgHtml( $msg ) . '" >' .
 283+ wfMsgHtml( $msg ) . '</a>';
284284 }
285285
286286 /**
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -67,7 +67,9 @@
6868 # Set basic messages
6969 $msgs = (object) array(
7070 'revreviewDiffToggleShow' => wfMsgHtml( 'revreview-diff-toggle-show' ),
71 - 'revreviewDiffToggleHide' => wfMsgHtml( 'revreview-diff-toggle-hide' )
 71+ 'revreviewDiffToggleHide' => wfMsgHtml( 'revreview-diff-toggle-hide' ),
 72+ 'revreviewToggleShow' => wfMsgHtml( 'revreview-toggle-show'),
 73+ 'revreviewToggleHide' => wfMsgHtml( 'revreview-toggle-hide')
7274 );
7375 $head .= "\n<script type=\"{$wgJsMimeType}\">" .
7476 "FlaggedRevs.messages = " . Xml::encodeJsVar( $msgs ) . ";</script>\n";
@@ -97,6 +99,8 @@
98100 'unflagMsg' => wfMsgHtml( 'revreview-submit-unreview' ),
99101 'flagLegMsg' => wfMsgHtml( 'revreview-flag' ),
100102 'sendingMsg' => wfMsgHtml( 'revreview-submitting' ),
 103+ 'flaggedMsg' => wfMsgHtml( 'revreview-submit-reviewed' ),
 104+ 'unflaggedMsg' => wfMsgHtml( 'revreview-submit-unreviewed' ),
101105 'actioncomplete' => wfMsgHtml( 'actioncomplete' ),
102106 'actionfailed' => wfMsgHtml( 'actionfailed' ),
103107 'draftRev' => wfMsgHtml( 'revreview-hist-draft' ),
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.js
@@ -5,7 +5,9 @@
66 var FlaggedRevs = {
77 'messages': {
88 'revreviewDiffToggleShow': '(show)',
9 - 'revreviewDiffToggleHide': '(hide)'
 9+ 'revreviewDiffToggleHide': '(hide)',
 10+ 'revreviewToggleShow' : '(+)',
 11+ 'revreviewToggleHide' : '(-)'
1012 },
1113 /* Hide rating/diff clutter */
1214 'enableShowhide': function() {
@@ -39,10 +41,14 @@
4042 'toggleRevRatings': function() {
4143 var ratings = document.getElementById('mw-fr-revisionratings');
4244 if( !ratings ) return;
 45+ var toggle = document.getElementById('mw-fr-revisiontoggle');
 46+ if( !toggle ) return;
4347 if( ratings.style.display == 'none' ) {
4448 ratings.style.display = 'inline';
 49+ toggle.innerHTML = this.messages.revreviewToggleHide;
4550 } else {
4651 ratings.style.display = 'none';
 52+ toggle.innerHTML = this.messages.revreviewToggleShow;
4753 }
4854 },
4955
@@ -51,16 +57,13 @@
5258 var diff = document.getElementById('mw-fr-stablediff');
5359 if( !diff ) return;
5460 var toggle = document.getElementById('mw-fr-difftoggle');
 61+ if( !toggle ) return;
5562 if( diff.style.display == 'none' ) {
5663 diff.style.display = 'inline';
57 - if( toggle ) {
58 - toggle.innerHTML = this.messages.revreviewDiffToggleHide;
59 - }
 64+ toggle.innerHTML = this.messages.revreviewDiffToggleHide;
6065 } else {
6166 diff.style.display = 'none';
62 - if( toggle ) {
63 - toggle.innerHTML = this.messages.revreviewDiffToggleShow;
64 - }
 67+ toggle.innerHTML = this.messages.revreviewDiffToggleShow;
6568 }
6669 },
6770
@@ -69,11 +72,10 @@
7073 var log = document.getElementById('mw-fr-logexcerpt');
7174 if( !log ) return;
7275 var toggle = document.getElementById('mw-fr-logtoggle');
 76+ if( !toggle ) return;
7377 if( log.style.display == 'none' ) {
7478 log.style.display = 'inline';
75 - if( toggle ) {
76 - toggle.innerHTML = '';
77 - }
 79+ toggle.innerHTML = '';
7880 }
7981 }
8082 };
Index: trunk/extensions/FlaggedRevs/client/review.js
@@ -202,11 +202,13 @@
203203 msg = msg.substr(5); // remove <t#x>
204204 }
205205 var tier = regm ? regm[1] : 0; // review tier
 206+ /*
206207 // Output any response message
207208 if( msg.length ) {
208209 jsMsg( msg, 'review' ); // success/failure notice
209210 window.scroll(0,0); // scroll up to notice
210211 }
 212+ */
211213 var rsubmit = document.getElementById("mw-fr-submitreview");
212214 var usubmit = document.getElementById("mw-fr-submitunreview");
213215 var legend = document.getElementById("mw-fr-reviewformlegend");
@@ -223,12 +225,20 @@
224226 if( rsubmit.value == wgAjaxReview.sendingMsg ) {
225227 // For template review case go from re-review to review message
226228 legend.innerHTML = '<strong>'+wgAjaxReview.flagLegMsg+'</strong>';
227 - rsubmit.value = wgAjaxReview.flagMsg; // back to normal
228 - usubmit.disabled = ''; // unlock unflag button
 229+ rsubmit.value = wgAjaxReview.flaggedMsg; // done!
 230+ rsubmit.style.fontWeight = 'bold';
 231+ // Unlock and reset *unflag* button
 232+ usubmit.value = wgAjaxReview.unflagMsg;
 233+ usubmit.removeAttribute( 'style' ); // back to normal
 234+ usubmit.disabled = '';
229235 // Revision was unflagged
230236 } else if( usubmit.value == wgAjaxReview.sendingMsg ) {
231 - usubmit.value = wgAjaxReview.unflagMsg; // back to normal
232 - rsubmit.disabled = ''; // unlock flag button
 237+ usubmit.value = wgAjaxReview.unflaggedMsg; // done!
 238+ usubmit.style.fontWeight = 'bold';
 239+ // Unlock and reset *flag* button
 240+ rsubmit.value = wgAjaxReview.flagMsg;
 241+ rsubmit.removeAttribute( 'style' ); // back to normal
 242+ rsubmit.disabled = '';
233243 }
234244 } else {
235245 rsubmit.value = wgAjaxReview.sendMsg; // back to normal
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -851,10 +851,12 @@
852852 # Only for pages manually made to be stable...
853853 if ( $this->article->isPageLocked() ) {
854854 $s = wfMsgExt( 'revreview-locked', 'parseinline' );
 855+ $s .= ' ' . FlaggedRevsXML::logToggle('revreview-log-details-show');
855856 $s .= FlaggedRevsXML::stabilityLogExcerpt( $this->article );
856857 # ...or unstable
857858 } elseif ( $this->article->isPageUnlocked() ) {
858859 $s = wfMsgExt( 'revreview-unlocked', 'parseinline' );
 860+ $s .= ' ' . FlaggedRevsXML::logToggle('revreview-log-details-show');
859861 $s .= FlaggedRevsXML::stabilityLogExcerpt( $this->article );
860862 }
861863 return $s;
@@ -1615,14 +1617,14 @@
16161618 if ( count( FlaggedRevs::getDimensions() ) > 1 )
16171619 $form .= "<br />"; // Don't put too much on one line
16181620 $form .= "<span id='mw-fr-commentbox' style='clear:both'>" .
1619 - Xml::inputLabel( wfMsg( 'revreview-log' ), 'wpReason', 'wpReason', 40, '',
 1621+ Xml::inputLabel( wfMsg( 'revreview-log' ), 'wpReason', 'wpReason', 35, '',
16201622 array( 'class' => 'fr-comment-box' ) ) . "&nbsp;&nbsp;&nbsp;</span>";
16211623 }
16221624 # Add the submit buttons
16231625 $form .= FlaggedRevsXML::ratingSubmitButtons( $frev, (bool)$toggle, $allowRereview );
16241626 # Show stability log if there is anything interesting...
16251627 if( $this->article->isPageLocked() ) {
1626 - $form .= ' ' . FlaggedRevsXML::logToggle();
 1628+ $form .= ' ' . FlaggedRevsXML::logToggle('revreview-log-toggle-show');
16271629 }
16281630 $form .= Xml::closeElement( 'span' );
16291631 # ..add the actual stability log body here

Follow-up revisions

RevisionCommit summaryAuthorDate
r63602Follow-up r63589: Update for translatewikiraymond15:30, 11 March 2010
r63611Follow-up r63589 button change for non-binary caseaaron19:20, 11 March 2010
r64104Follow-up r63589: Do show the error message when AJAX review failsaaron03:08, 24 March 2010

Status & tagging log