r64473 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64472‎ | r64473 | r64474 >
Date:04:58, 1 April 2010
Author:aaron
Status:ok
Tags:
Comment:
Made log excerpt (show) toggles reversible
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/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -305,7 +305,7 @@
306306 $wgAvailableRights[] = 'stablesettings';
307307
308308 # Bump this number every time you change flaggedrevs.css/flaggedrevs.js
309 -$wgFlaggedRevStyleVersion = 67;
 309+$wgFlaggedRevStyleVersion = 68;
310310
311311 $wgExtensionFunctions[] = 'efLoadFlaggedRevs';
312312
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -54,7 +54,9 @@
5555 'revreview-diff-toggle-hide' => '(hide changes)',
5656 'revreview-diff-toggle-title' => 'Toggle display of pending changes to the published version',
5757 'revreview-log-toggle-show' => '(show stability log)',
 58+ 'revreview-log-toggle-hide' => '(hide stability log)',
5859 'revreview-log-details-show' => '(show details)',
 60+ 'revreview-log-details-hide' => '(hide details)',
5961 'review-diff2stable' => 'View all pending changes',
6062 'review-logentry-app' => 'reviewed a version of [[$1]]',
6163 'review-logentry-dis' => 'deprecated a version of [[$1]]',
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php
@@ -336,14 +336,25 @@
337337 * Generates (show/hide) JS toggle HTML
338338 * @returns string
339339 */
340 - public static function logToggle( $msg ) {
 340+ public static function logToggle() {
341341 return '<a id="mw-fr-logtoggle" class="flaggedrevs_toggle" style="display:none;"' .
342342 ' onclick="FlaggedRevs.toggleLog()" title="' .
343 - wfMsgHtml( $msg ) . '" >' .
344 - wfMsgHtml( $msg ) . '</a>';
 343+ wfMsgHtml( 'revreview-log-toggle-show' ) . '" >' .
 344+ wfMsgHtml( 'revreview-log-toggle-show' ) . '</a>';
345345 }
346 -
 346+
347347 /**
 348+ * Generates (show/hide) JS toggle HTML
 349+ * @returns string
 350+ */
 351+ public static function logDetailsToggle() {
 352+ return '<a id="mw-fr-logtoggle" class="flaggedrevs_toggle" style="display:none;"' .
 353+ ' onclick="FlaggedRevs.toggleLogDetails()" title="' .
 354+ wfMsgHtml( 'revreview-log-details-show' ) . '" >' .
 355+ wfMsgHtml( 'revreview-log-details-show' ) . '</a>';
 356+ }
 357+
 358+ /**
348359 * @param array $flags, selected flags
349360 * @param array $config, page config
350361 * @param bool $disabled, form disabled
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -63,10 +63,14 @@
6464 }
6565 # Set basic messages
6666 $msgs = (object) array(
67 - 'revreviewDiffToggleShow' => wfMsgHtml( 'revreview-diff-toggle-show' ),
68 - 'revreviewDiffToggleHide' => wfMsgHtml( 'revreview-diff-toggle-hide' ),
69 - 'revreviewToggleShow' => wfMsgHtml( 'revreview-toggle-show'),
70 - 'revreviewToggleHide' => wfMsgHtml( 'revreview-toggle-hide')
 67+ 'diffToggleShow' => wfMsgHtml( 'revreview-diff-toggle-show' ),
 68+ 'diffToggleHide' => wfMsgHtml( 'revreview-diff-toggle-hide' ),
 69+ 'logToggleShow' => wfMsgHtml( 'revreview-log-toggle-show'),
 70+ 'logToggleHide' => wfMsgHtml( 'revreview-log-toggle-hide'),
 71+ 'logDetailsShow' => wfMsgHtml( 'revreview-log-details-show'),
 72+ 'logDetailsHide' => wfMsgHtml( 'revreview-log-details-hide'),
 73+ 'toggleShow' => wfMsgHtml( 'revreview-toggle-show'),
 74+ 'toggleHide' => wfMsgHtml( 'revreview-toggle-hide')
7175 );
7276 $head .= "\n<script type=\"{$wgJsMimeType}\">" .
7377 "FlaggedRevs.messages = " . Xml::encodeJsVar( $msgs ) . ";</script>\n";
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.js
@@ -4,10 +4,14 @@
55
66 var FlaggedRevs = {
77 'messages': {
8 - 'revreviewDiffToggleShow': '(show)',
9 - 'revreviewDiffToggleHide': '(hide)',
10 - 'revreviewToggleShow' : '(+)',
11 - 'revreviewToggleHide' : '(-)'
 8+ 'diffToggleShow' : '(show changes)',
 9+ 'diffToggleHide' : '(hide changes)',
 10+ 'logToggleShow' : '(show log)',
 11+ 'logToggleHide' : '(hide log)',
 12+ 'logDetailsShow' : '(show details)',
 13+ 'logDetailsHide' : '(hide details)',
 14+ 'toggleShow' : '(+)',
 15+ 'toggleHide' : '(-)'
1216 },
1317 /* Hide rating/diff clutter */
1418 'enableShowhide': function() {
@@ -45,10 +49,10 @@
4650 if( !toggle ) return;
4751 if( ratings.style.display == 'none' ) {
4852 ratings.style.display = 'inline';
49 - toggle.innerHTML = this.messages.revreviewToggleHide;
 53+ toggle.innerHTML = this.messages.toggleHide;
5054 } else {
5155 ratings.style.display = 'none';
52 - toggle.innerHTML = this.messages.revreviewToggleShow;
 56+ toggle.innerHTML = this.messages.toggleShow;
5357 }
5458 },
5559
@@ -60,10 +64,10 @@
6165 if( !toggle ) return;
6266 if( diff.style.display == 'none' ) {
6367 diff.style.display = 'inline';
64 - toggle.innerHTML = this.messages.revreviewDiffToggleHide;
 68+ toggle.innerHTML = this.messages.diffToggleHide;
6569 } else {
6670 diff.style.display = 'none';
67 - toggle.innerHTML = this.messages.revreviewDiffToggleShow;
 71+ toggle.innerHTML = this.messages.diffToggleShow;
6872 }
6973 },
7074
@@ -75,8 +79,26 @@
7680 if( !toggle ) return;
7781 if( log.style.display == 'none' ) {
7882 log.style.display = 'inline';
79 - toggle.innerHTML = '';
 83+ toggle.innerHTML = this.messages.logToggleHide;
 84+ } else {
 85+ log.style.display = 'none';
 86+ toggle.innerHTML = this.messages.logToggleShow;
8087 }
 88+ },
 89+
 90+ /* Toggles log excerpts */
 91+ 'toggleLogDetails': function() {
 92+ var log = document.getElementById('mw-fr-logexcerpt');
 93+ if( !log ) return;
 94+ var toggle = document.getElementById('mw-fr-logtoggle');
 95+ if( !toggle ) return;
 96+ if( log.style.display == 'none' ) {
 97+ log.style.display = 'inline';
 98+ toggle.innerHTML = this.messages.logDetailsHide;
 99+ } else {
 100+ log.style.display = 'none';
 101+ toggle.innerHTML = this.messages.logDetailsShow;
 102+ }
81103 }
82104 };
83105
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -859,12 +859,12 @@
860860 # Only for pages manually made to be stable...
861861 if ( $this->article->isPageLocked() ) {
862862 $s = wfMsgExt( 'revreview-locked', 'parseinline' );
863 - $s .= ' ' . FlaggedRevsXML::logToggle('revreview-log-details-show');
 863+ $s .= ' ' . FlaggedRevsXML::logDetailsToggle();
864864 $s .= FlaggedRevsXML::stabilityLogExcerpt( $this->article );
865865 # ...or unstable
866866 } elseif ( $this->article->isPageUnlocked() ) {
867867 $s = wfMsgExt( 'revreview-unlocked', 'parseinline' );
868 - $s .= ' ' . FlaggedRevsXML::logToggle('revreview-log-details-show');
 868+ $s .= ' ' . FlaggedRevsXML::logDetailsToggle();
869869 $s .= FlaggedRevsXML::stabilityLogExcerpt( $this->article );
870870 }
871871 return $s;

Follow-up revisions

RevisionCommit summaryAuthorDate
r64498MFT r64173-r64473aaron20:06, 1 April 2010

Status & tagging log