r22497 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22496‎ | r22497 | r22498 >
Date:04:25, 28 May 2007
Author:aaron
Status:old
Tags:
Comment:
*Simply UI a tad more, add toggle
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/flaggedrevs.js (added) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -7,6 +7,7 @@
88 }
99
1010 if( !defined( 'FLAGGED_CSS' ) ) define('FLAGGED_CSS', $wgScriptPath.'/extensions/FlaggedRevs/flaggedrevs.css' );
 11+if( !defined( 'FLAGGED_JS' ) ) define('FLAGGED_JS', $wgScriptPath.'/extensions/FlaggedRevs/flaggedrevs.js' );
1112
1213 if( !function_exists( 'extAddSpecialPage' ) ) {
1314 require( dirname(__FILE__) . '/../ExtensionFunctions.php' );
@@ -31,7 +32,7 @@
3233 extAddSpecialPage( dirname(__FILE__) . '/FlaggedRevsPage.body.php', 'Unreviewedpages', 'UnreviewedPages' );
3334
3435 function efLoadReviewMessages() {
35 - global $wgMessageCache, $RevisionreviewMessages, $wgOut;
 36+ global $wgMessageCache, $RevisionreviewMessages, $wgOut, $wgJsMimeType;
3637 # Internationalization
3738 require( dirname( __FILE__ ) . '/FlaggedRevsPage.i18n.php' );
3839 foreach ( $RevisionreviewMessages as $lang => $langMessages ) {
@@ -44,6 +45,8 @@
4546 'media' => 'screen,projection',
4647 'href' => FLAGGED_CSS,
4748 ) );
 49+ # UI JS
 50+ $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"" . FLAGGED_JS . "\"></script>\n" );
4851 }
4952
5053 #########
@@ -66,7 +69,7 @@
6770 # Define the tags we can use to rate an article,
6871 # and set the minimum level to have it become a "quality" version.
6972 # "quality" revisions take precidence over other reviewed revisions
70 -$wgFlaggedRevTags = array( 'accuracy'=>2, 'depth'=>1, 'style'=>1 );
 73+$wgFlaggedRevTags = array( 'accuracy'=>2, 'depth'=>2, 'style'=>1 );
7174 # How high can we rate these revisions?
7275 $wgFlaggedRevValues = 4;
7376 # Who can set what flags to what level? (use -1 for not at all)
@@ -719,9 +722,9 @@
720723 $vis_id = $tfrev->fr_rev_id;
721724 $revs_since = parent::getRevCountSince( $pageid, $vis_id );
722725 if( $quality )
723 - $tag = wfMsgExt('revreview-quality', array('parse'), $vis_id, $article->getLatest(), $revs_since, $time);
 726+ $tag = wfMsgExt('revreview-quality', array('parseinline'), $vis_id, $article->getLatest(), $revs_since, $time);
724727 else
725 - $tag = wfMsgExt('revreview-basic', array('parse'), $vis_id, $article->getLatest(), $revs_since, $time);
 728+ $tag = wfMsgExt('revreview-basic', array('parseinline'), $vis_id, $article->getLatest(), $revs_since, $time);
726729 # Try the stable page cache
727730 $parserOutput = parent::getPageCache( $article );
728731 # If no cache is available, get the text and parse it
@@ -744,20 +747,21 @@
745748 $pcache = false;
746749 }
747750 // Construct some tagging
748 - $tag .= parent::addTagRatings( $flags );
 751+ $tag .= ' <a href="javascript:toggleRevRatings()">' . wfMsg('revreview-toggle') . '</a>';
 752+ $tag .= '<span id="mwrevisionratings" style="display:none">' . parent::addTagRatings( $flags ) . '</span>';
749753 // Some checks for which tag CSS to use
750754 if( $pristine )
751 - $tag = '<div class="flaggedrevs_tag3 plainlinks">'.$tag.'</div>';
 755+ $tag = '<div id="mwrevisiontag" class="flaggedrevs_tag3 plainlinks">'.$tag.'</div>';
752756 else if( $quality )
753 - $tag = '<div class="flaggedrevs_tag2 plainlinks">'.$tag.'</div>';
 757+ $tag = '<div id="mwrevisiontag" class="flaggedrevs_tag2 plainlinks">'.$tag.'</div>';
754758 else if( $stable )
755 - $tag = '<div class="flaggedrevs_tag1 plainlinks">'.$tag.'</div>';
 759+ $tag = '<div id="mwrevisiontag" class="flaggedrevs_tag1 plainlinks">'.$tag.'</div>';
756760 else
757 - $tag = '<div class="flaggedrevs_notice plainlinks">'.$tag.'</div>';
 761+ $tag = '<div id="mwrevisiontag" class="flaggedrevs_notice plainlinks">'.$tag.'</div>';
758762 // Set the new body HTML, place a tag on top
759763 $wgOut->mBodytext = $tag . $wgOut->mBodytext . $notes;
760764 } else {
761 - $tag = '<div class="mw-warning plainlinks">'.wfMsgExt('revreview-noflagged', array('parse')).'</div>';
 765+ $tag = '<div id="mwrevisiontag" class="mw-warning plainlinks">'.wfMsgExt('revreview-noflagged', array('parse')).'</div>';
762766 $wgOut->addHTML( $tag );
763767 }
764768 }
@@ -787,7 +791,7 @@
788792 // Construct some tagging
789793 $tag = wfMsgExt('revreview-newest', array('parse'), $tfrev->fr_rev_id, $time, $revs_since );
790794 $tag .= parent::addTagRatings( $flags );
791 - $wgOut->addHTML( '<div class="flaggedrevs_notice plainlinks">' . $tag . '</div><br/>' );
 795+ $wgOut->addHTML( '<div id="mwrevisiontag" class="flaggedrevs_notice plainlinks">' . $tag . '</div><br/>' );
792796 }
793797 }
794798
Index: trunk/extensions/FlaggedRevs/flaggedrevs.js
@@ -0,0 +1,9 @@
 2+function toggleRevRatings() {
 3+ var ratings = document.getElementById('mwrevisionratings');
 4+ if( !ratings ) return;
 5+ if( ratings.style.display == 'none' ) {
 6+ ratings.style.display = 'block';
 7+ } else {
 8+ ratings.style.display = 'none';
 9+ }
 10+}
\ No newline at end of file
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php
@@ -533,7 +533,7 @@
534534 $parserOutput = $RevFlagging->parseStableText( $page, $text, $this->oldid, $options );
535535 $notes = $RevFlagging->ReviewNotes( $frev );
536536 // Set the new body HTML, place a tag on top
537 - $wgOut->addHTML('<div class="flaggedrevs_notice plainlinks">'.$tag.'</div>' . $parserOutput->getText() . $notes);
 537+ $wgOut->addHTML('<div id="mwrevisiontag" class="flaggedrevs_notice plainlinks">'.$tag.'</div>' . $parserOutput->getText() . $notes);
538538 # Show stable categories and interwiki links only
539539 $wgOut->addCategoryLinks( $parserOutput->getCategories() );
540540 }
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php
@@ -13,8 +13,8 @@
1414 'group-reviewer-member' => 'reviewer',
1515 'grouppage-reviewer' => '{{ns:project}}:reviewer',
1616
17 - 'revreview-noflagged' => 'There are no reviewed revisions of this page, so it may \'\'\'not\'\'\' have been
18 - [[Help:Article validation|checked]] for quality.',
 17+ 'revreview-noflagged' => 'There are no reviewed revisions of this page, so it may \'\'\'not\'\'\' have been
 18+ [[Help:Article validation|checked]] for quality.',
1919 'revreview-newest' => 'The [{{fullurl:Special:stableversions|oldid=$1}} latest reviewed revision]
2020 ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} see all]) was [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved]
2121 on <i>$2</i>.
@@ -31,6 +31,7 @@
3232 'revreview-static' => 'This is a [[Help:Article validation|reviewed]] revision of the page \'\'\'[[:$3]]\'\'\',
3333 [{{fullurl:Special:Log/review|page=$1}} approved] on <i>$2</i>. The [{{fullurl:$3|stable=0}} current revision]
3434 is usually editable and more up to date.',
 35+ 'revreview-toggle' => '(toggle details)',
3536 'revreview-note' => '[[User:$1]] made the following notes [[Help:Article validation|reviewing]] this revision:',
3637
3738 'hist-stable' => '[stable]',
@@ -42,7 +43,7 @@
4344 for content pages.',
4445 'review-logentrygrant' => 'reviewed a version of [[:$1]]',
4546 'review-logentryrevoke' => 'depreciated a version of [[:$1]]',
46 - 'review-logaction' => 'revision $1',
 47+ 'review-logaction' => 'revision ID $1',
4748
4849 'revisionreview' => 'Review revisions',
4950 'revreview-main' => 'You must select a particular revision from a content page in order to review.