r23312 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23311‎ | r23312 | r23313 >
Date:06:19, 24 June 2007
Author:aaron
Status:old
Tags:
Comment:
*Hack at this second UI deal (still needs work), clean up some other stuff
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/flaggedrevs.css (modified) (history)
  • /trunk/extensions/FlaggedRevs/flaggedrevs.js (modified) (history)
  • /trunk/extensions/FlaggedRevs/img/boxQ.png (deleted) (history)
  • /trunk/extensions/FlaggedRevs/img/boxY.png (deleted) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -93,6 +93,10 @@
9494 'style' => array('review' => 3),
9595 );
9696
 97+// For users of the monobook skin, a simplified UI
 98+// will be used. Ratings will go by the toolbox.
 99+$wgSimpleFlaggedRevsUI = true;
 100+
97101 # Lets some users access the review UI and set some flags
98102 $wgAvailableRights[] = 'review';
99103 # Let some users set higher settings
@@ -328,23 +332,38 @@
329333 return $flags;
330334 }
331335
332 - public function addTagRatings( $flags ) {
 336+ public function addTagRatings( $flags, $box=false, $css='' ) {
333337 global $wgFlaggedRevTags;
334338
335339 $tag = '';
336 - foreach ( $this->dimensions as $quality => $value ) {
 340+ if( $box )
 341+ $tag .= "<table align='center' class='$css' cellpading='0'>";
 342+
 343+ foreach( $this->dimensions as $quality => $value ) {
337344 $valuetext = wfMsgHtml('revreview-' . $this->dimensions[$quality][$flags[$quality]]);
338345 $level = $flags[$quality];
339346 $minlevel = $wgFlaggedRevTags[$quality];
340 - if($level >= $minlevel)
 347+ if( $level >= $minlevel )
341348 $classmarker = 2;
342 - elseif($level > 0)
 349+ elseif( $level > 0 )
343350 $classmarker = 1;
344351 else
345352 $classmarker = 0;
 353+
346354 $levelmarker = $level * 20 + 20; //XXX do this better
347 - $tag .= "&nbsp;<span class='fr-marker-$levelmarker'><strong>" . wfMsgHtml("revreview-$quality") . "</strong>: <span class='fr-text-value'>$valuetext&nbsp;</span>&nbsp;</span>\n";
 355+ if( $box ) {
 356+ $tag .= "<tr><td><span class='fr-group'><span class='fr-text'>" . wfMsgHtml("revreview-$quality") .
 357+ "</span></tr><tr><td><span class='fr-marker fr_value$levelmarker'>$valuetext</span></span></td></tr>\n";
 358+ } else {
 359+ $tag .= "&nbsp;<span class='fr-marker-$levelmarker'><strong>" .
 360+ wfMsgHtml("revreview-$quality") .
 361+ "</strong>: <span class='fr-text-value'>$valuetext&nbsp;</span>&nbsp;" .
 362+ "</span>\n";
 363+ }
348364 }
 365+ if( $box )
 366+ $tag .= '</table>';
 367+
349368 return $tag;
350369 }
351370
@@ -756,13 +775,13 @@
757776 */
758777 static function pageOverride() {
759778 global $wgTitle, $wgFlaggedRevsAnonOnly, $wgFlaggedRevsOverride, $wgUser, $wgRequest, $action;
760 - // This only applies to viewing content pages
 779+ # This only applies to viewing content pages
761780 if( $action !='view' || !$wgTitle->isContentPage() ) return;
762 - // Does not apply to diffs/old revisions
 781+ # Does not apply to diffs/old revisions
763782 if( $wgRequest->getVal('oldid') || $wgRequest->getVal('diff') ) return;
764 - // Does the stable version override the current one?
 783+ # Does the stable version override the current one?
765784 if( $wgFlaggedRevsOverride ) {
766 - // If $wgFlaggedRevsAnonOnly is set to false, stable version are only requested explicitly
 785+ # If $wgFlaggedRevsAnonOnly is set to false, stable version are only requested explicitly
767786 if( $wgFlaggedRevsAnonOnly && $wgUser->isAnon() ) {
768787 return !( $wgRequest->getIntOrNull('stable')===0 );
769788 } else {
@@ -772,6 +791,75 @@
773792 return !( $wgRequest->getIntOrNull('stable') !==1 );
774793 }
775794 }
 795+
 796+ static function useSimpleUI() {
 797+ global $wgDefaultSkin, $wgSimpleFlaggedRevsUI, $wgUser, $wgRequest;
 798+ # get the user skin name
 799+ $userSkin = $wgUser->getOption( 'skin' );
 800+ $userSkin = $wgRequest->getVal('useskin', $userSkin);
 801+
 802+ if( !$userSkin ) $userSkin = $wgDefaultSkin;
 803+
 804+ return( $wgSimpleFlaggedRevsUI && $userSkin=='monobook' );
 805+ }
 806+
 807+ function addPrettyRatingBox( &$tmpl ) {
 808+ global $wgUser, $wgArticle, $wgOut, $wgRequest, $action, $wgSimpleFlaggedRevsUI;
 809+
 810+ if( !$this->useSimpleUI() )
 811+ return true;
 812+ // Only trigger on article view for content pages, not for protect/delete/hist
 813+ if( !$wgArticle || !$wgArticle->exists() || !$wgArticle->mTitle->isContentPage() || $action !='view' )
 814+ return true;
 815+ // Check the newest stable version...
 816+ if( !$this->pageOverride() )
 817+ return true;
 818+
 819+ $box = '';
 820+ $tfrev = $this->getOverridingRev();
 821+ if( is_null($tfrev) )
 822+ return true;
 823+ $simpleTag = false;
 824+
 825+ global $wgLang;
 826+ # Get flags and date
 827+ $flags = $this->getFlagsForRevision( $tfrev->fr_rev_id );
 828+ # Get quality level
 829+ $quality = $this->isQuality( $flags );
 830+ $pristine = $this->isPristine( $flags );
 831+ $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $tfrev->fr_timestamp), true );
 832+
 833+ $skin = $wgUser->getSkin();
 834+ # We will be looking at the reviewed revision...
 835+ $vis_id = $tfrev->fr_rev_id;
 836+ $revs_since = parent::getRevCountSince( $pageid, $vis_id );
 837+ // Some checks for which tag CSS to use
 838+ if( $simpleTag )
 839+ $tagClass = 'flaggedrevs_box0';
 840+ else if( $pristine )
 841+ $tagClass = 'flaggedrevs_box3';
 842+ else if( $quality )
 843+ $tagClass = 'flaggedrevs_box2';
 844+ else
 845+ $tagClass = 'flaggedrevs_box1';
 846+ // Construct some tagging
 847+ if( !$wgOut->isPrintable() ) {
 848+ $msg = $quality ? 'revreview-newest-quality' : 'revreview-newest-basic';
 849+ $box = parent::addTagRatings( $flags, true, "{$tagClass}a" );
 850+ $box .= '<h5><a href="javascript:toggleRevRatings()">' . wfMsg('revreview-toggle') . '</a></h5>';
 851+ $box .= '<span id="mwrevisionratings" style="display:none">' .
 852+ wfMsgExt($msg, array('parseinline'), $vis_id, $time, $revs_since) .
 853+ '</span>';
 854+ }
 855+ // Ugh...
 856+ print('</ul></div>');
 857+ print('<h5>' . wfMsgExt('revreview-rating', array('parseinline') ) . '</h5>');
 858+ print("<div class='$tagClass'>");
 859+ print($box);
 860+ print("</div><div class='pBody'><ul>");
 861+
 862+ return true;
 863+ }
776864
777865 /**
778866 * Replaces a page with the last stable version if possible
@@ -779,7 +867,7 @@
780868 * Adds a quick review form on the bottom if needed
781869 */
782870 function setPageContent( &$article, &$outputDone, &$pcache ) {
783 - global $wgRequest, $wgTitle, $wgOut, $action;
 871+ global $wgRequest, $wgTitle, $wgOut, $action, $wgUser;
784872 // Only trigger on article view for content pages, not for protect/delete/hist
785873 if( !$article || !$article->exists() || !$article->mTitle->isContentPage() || $action !='view' )
786874 return true;
@@ -788,11 +876,13 @@
789877 $revid = $article->mRevision ? $article->mRevision->mId : $article->getLatest();
790878 if( !$revid )
791879 return true;
 880+
 881+ $skin = $wgUser->getSkin();
792882
793883 $vis_id = $revid;
794884 $tag = ''; $notes = '';
795885 // Check the newest stable version...
796 - $tfrev = $this->getOverridingRev( $article );
 886+ $tfrev = $this->getOverridingRev();
797887 $simpleTag = false;
798888 if( $wgRequest->getVal('diff') ) {
799889 // Do not clutter up diffs any further...
@@ -810,32 +900,40 @@
811901 $simpleTag = true;
812902 # Construct some tagging
813903 if( !$wgOut->isPrintable() ) {
814 - $msg = $quality ? 'revreview-newest-quality' : 'revreview-newest-basic';
815 - $tag .= wfMsgExt($msg, array('parseinline'), $tfrev->fr_rev_id, $time, $revs_since);
816 - # Hide clutter
817 - $tag .= ' <a href="javascript:toggleRevRatings()">' . wfMsg('revreview-toggle') . '</a>';
818 - $tag .= '<span id="mwrevisionratings" style="display:none">' .
819 - wfMsg('revreview-rating') . parent::addTagRatings( $flags ) .
820 - '</span>';
 904+ if( $this->useSimpleUI() ) {
 905+ $msg = $quality ? 'revreview-quick-quality' : 'revreview-quick-basic';
 906+ $css = $quality ? 'fr_tab_quality' : 'fr_tab_stable';
 907+ $tag .= "<span class='$css plainlinks'></span>" . wfMsgExt($msg,array('parseinline'));
 908+ } else {
 909+ $msg = $quality ? 'revreview-newest-quality' : 'revreview-newest-basic';
 910+ $tag .= wfMsgExt($msg, array('parseinline'), $tfrev->fr_rev_id, $time, $revs_since);
 911+ # Hide clutter
 912+ $tag .= ' <a id="mwrevisiontoggle" style="display: none;" href="javascript:toggleRevRatings()">' .
 913+ wfMsg('revreview-toggle') . '</a>';
 914+ $tag .= '<span id="mwrevisionratings" style="display:none">' .
 915+ wfMsg('revreview-oldrating') . parent::addTagRatings( $flags ) .
 916+ '</span>';
 917+ }
821918 }
822919 # Viewing the page normally: override the page
823920 } else {
824 - global $wgUser;
825 -
826 - $skin = $wgUser->getSkin();
827921 # We will be looking at the reviewed revision...
828922 $vis_id = $tfrev->fr_rev_id;
829923 $revs_since = parent::getRevCountSince( $pageid, $vis_id );
830924 // Construct some tagging
831925 if( !$wgOut->isPrintable() ) {
832 - if( $quality )
833 - $tag = wfMsgExt('revreview-quality', array('parseinline'), $vis_id, $article->getLatest(), $revs_since, $time);
834 - else
835 - $tag = wfMsgExt('revreview-basic', array('parseinline'), $vis_id, $article->getLatest(), $revs_since, $time);
836 - $tag .= ' <a href="javascript:toggleRevRatings()">' . wfMsg('revreview-toggle') . '</a>';
837 - $tag .= '<span id="mwrevisionratings" style="display:none"><p>' .
838 - parent::addTagRatings( $flags ) .
839 - '</p></span>';
 926+ if( $this->useSimpleUI() ) {
 927+ $msg = 'revreview-quick-current';
 928+ $tag .= "<span class='fr_tab_current plainlinks'></span>" . wfMsgExt($msg,array('parseinline'));
 929+ } else {
 930+ $msg = $quality ? 'revreview-quality' : 'revreview-basic';
 931+ $tag = wfMsgExt($msg, array('parseinline'), $vis_id, $time, $revs_since);
 932+ $tag .= ' <a id="mwrevisiontoggle" style="display: none;" href="javascript:toggleRevRatings()">' .
 933+ wfMsg('revreview-toggle') . '</a>';
 934+ $tag .= '<span id="mwrevisionratings" style="display:none">' .
 935+ parent::addTagRatings( $flags ) .
 936+ '</span>';
 937+ }
840938 }
841939 # Try the stable page cache
842940 $parserOutput = parent::getPageCache( $article );
@@ -859,7 +957,9 @@
860958 $pcache = false;
861959 }
862960 // Some checks for which tag CSS to use
863 - if( $simpleTag )
 961+ if( $this->useSimpleUI() )
 962+ $tagClass = 'flaggedrevs_short';
 963+ else if( $simpleTag )
864964 $tagClass = 'flaggedrevs_notice';
865965 else if( $pristine )
866966 $tagClass = 'flaggedrevs_tag3';
@@ -896,7 +996,7 @@
897997 // Set new body html text as that of now
898998 $tag = '';
899999 // Check the newest stable version
900 - $tfrev = $this->getOverridingRev( $editform->mArticle );
 1000+ $tfrev = $this->getOverridingRev();
9011001 if( is_object($tfrev) ) {
9021002 global $wgLang;
9031003 $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $tfrev->fr_timestamp), true );
@@ -908,7 +1008,7 @@
9091009 # Hide clutter
9101010 $tag .= ' <a href="javascript:toggleRevRatings()">' . wfMsg('revreview-toggle') . '</a>';
9111011 $tag .= '<span id="mwrevisionratings" style="display:none">' .
912 - wfMsg('revreview-rating') . parent::addTagRatings( $flags ) .
 1012+ wfMsg('revreview-oldrating') . parent::addTagRatings( $flags ) .
9131013 '</span>';
9141014 $wgOut->addHTML( '<div id="mwrevisiontag" class="flaggedrevs_notice plainlinks">' . $tag . '</div><br/>' );
9151015 }
@@ -977,7 +1077,7 @@
9781078 $article = new Article( $title );
9791079 // If we are viewing a page normally, and it was overridden,
9801080 // change the edit tab to a "current revision" tab
981 - $tfrev = $this->getOverridingRev( $article );
 1081+ $tfrev = $this->getOverridingRev();
9821082 // No quality revs? Find the last reviewed one
9831083 if( !is_object($tfrev) )
9841084 return true;
@@ -1029,7 +1129,7 @@
10301130 # Add 'stable' tab if either $wgFlaggedRevsOverride is off,
10311131 # or this is a user viewing the page with $wgFlaggedRevsAnonOnly on
10321132 $new_actions['stable'] = array(
1033 - 'class' => '',
 1133+ 'class' => 'selected',
10341134 'text' => wfMsg('revreview-stable'),
10351135 'href' => $title->getLocalUrl( 'stable=1' )
10361136 );
@@ -1309,34 +1409,36 @@
13101410 }
13111411
13121412 // Our class instances
1313 -$flaggedrevs = new FlaggedArticle();
 1413+$flaggedRevsModifier = new FlaggedArticle();
13141414 // Main hooks, overrides pages content, adds tags, sets tabs and permalink
1315 -$wgHooks['SkinTemplateTabs'][] = array($flaggedrevs, 'setCurrentTab');
 1415+$wgHooks['SkinTemplateTabs'][] = array($flaggedRevsModifier, 'setCurrentTab');
13161416 // Update older, incomplete, page caches (ones that lack template Ids/image timestamps)
1317 -$wgHooks['ArticleViewHeader'][] = array($flaggedrevs, 'maybeUpdateMainCache');
1318 -$wgHooks['ArticleViewHeader'][] = array($flaggedrevs, 'setPageContent');
1319 -$wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = array($flaggedrevs, 'setPermaLink');
 1417+$wgHooks['ArticleViewHeader'][] = array($flaggedRevsModifier, 'maybeUpdateMainCache');
 1418+$wgHooks['ArticleViewHeader'][] = array($flaggedRevsModifier, 'setPageContent');
 1419+$wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = array($flaggedRevsModifier, 'setPermaLink');
13201420 // Add tags do edit view
1321 -$wgHooks['EditPage::showEditForm:initial'][] = array($flaggedrevs, 'addToEditView');
 1421+$wgHooks['EditPage::showEditForm:initial'][] = array($flaggedRevsModifier, 'addToEditView');
13221422 // Add review form
1323 -$wgHooks['BeforePageDisplay'][] = array($flaggedrevs, 'addReviewForm');
 1423+$wgHooks['BeforePageDisplay'][] = array($flaggedRevsModifier, 'addReviewForm');
13241424 // Mark of items in page history
1325 -$wgHooks['PageHistoryBeforeList'][] = array($flaggedrevs, 'addToPageHist');
1326 -$wgHooks['PageHistoryLineEnding'][] = array($flaggedrevs, 'addToHistLine');
 1425+$wgHooks['PageHistoryBeforeList'][] = array($flaggedRevsModifier, 'addToPageHist');
 1426+$wgHooks['PageHistoryLineEnding'][] = array($flaggedRevsModifier, 'addToHistLine');
13271427 // Autopromote Editors
1328 -$wgHooks['ArticleSaveComplete'][] = array($flaggedrevs, 'autoPromoteUser');
 1428+$wgHooks['ArticleSaveComplete'][] = array($flaggedRevsModifier, 'autoPromoteUser');
13291429 // Adds table link references to include ones from the stable version
1330 -$wgHooks['TitleLinkUpdatesAfterCompletion'][] = array($flaggedrevs, 'extraLinksUpdate');
 1430+$wgHooks['TitleLinkUpdatesAfterCompletion'][] = array($flaggedRevsModifier, 'extraLinksUpdate');
13311431 // If a stable version is hidden, move to the next one if possible, and update things
1332 -$wgHooks['ArticleRevisionVisiblityUpdates'][] = array($flaggedrevs, 'articleLinksUpdate');
 1432+$wgHooks['ArticleRevisionVisiblityUpdates'][] = array($flaggedRevsModifier, 'articleLinksUpdate');
13331433 // Update our table NS/Titles when things are moved
1334 -$wgHooks['SpecialMovepageAfterMove'][] = array($flaggedrevs, 'updateFromMove');
 1434+$wgHooks['SpecialMovepageAfterMove'][] = array($flaggedRevsModifier, 'updateFromMove');
13351435 // Parser hooks, selects the desired images/templates
1336 -$wgHooks['BeforeParserrenderImageGallery'][] = array( $flaggedrevs, 'parserMakeGalleryStable');
1337 -$wgHooks['BeforeGalleryFindFile'][] = array( $flaggedrevs, 'galleryFindStableFileTime');
1338 -$wgHooks['BeforeParserFetchTemplateAndtitle'][] = array( $flaggedrevs, 'parserFetchStableTemplate');
1339 -$wgHooks['BeforeParserMakeImageLinkObj'][] = array( $flaggedrevs, 'parserMakeStableImageLink');
 1436+$wgHooks['BeforeParserrenderImageGallery'][] = array( $flaggedRevsModifier, 'parserMakeGalleryStable');
 1437+$wgHooks['BeforeGalleryFindFile'][] = array( $flaggedRevsModifier, 'galleryFindStableFileTime');
 1438+$wgHooks['BeforeParserFetchTemplateAndtitle'][] = array( $flaggedRevsModifier, 'parserFetchStableTemplate');
 1439+$wgHooks['BeforeParserMakeImageLinkObj'][] = array( $flaggedRevsModifier, 'parserMakeStableImageLink');
13401440 // Additional parser versioning
1341 -$wgHooks['ParserAfterTidy'][] = array( $flaggedrevs, 'parserInjectImageTimestamps');
1342 -$wgHooks['OutputPageParserOutput'][] = array( $flaggedrevs, 'outputInjectImageTimestamps');
 1441+$wgHooks['ParserAfterTidy'][] = array( $flaggedRevsModifier, 'parserInjectImageTimestamps');
 1442+$wgHooks['OutputPageParserOutput'][] = array( $flaggedRevsModifier, 'outputInjectImageTimestamps');
 1443+// Fany monobook UI only
 1444+$wgHooks['MonoBookTemplateToolboxEnd'][] = array( $flaggedRevsModifier, 'addPrettyRatingBox');
13431445 ?>
Index: trunk/extensions/FlaggedRevs/flaggedrevs.css
@@ -48,6 +48,18 @@
4949 text-align: center;
5050 }
5151
 52+.flaggedrevs_short {
 53+ border: 1px solid #aaa;
 54+ background-color: #f9f9f9;
 55+ padding: 5px;
 56+ position: relative;
 57+ float: right;
 58+ font-size: 80%;
 59+ margin-left: 50px;
 60+ margin-right: 50px;
 61+ text-align: left;
 62+}
 63+
5264 /*.fr-marker-1 span {display: none};*/
5365 .fr-marker-1 {
5466 background-image: url(../FlaggedRevs/img/boxY.png);
@@ -66,7 +78,6 @@
6779
6880 }
6981
70 -
7182 .fr-marker-20 {
7283 background-image: url(../FlaggedRevs/img/bar_20.png);
7384 background-position: bottom left;
@@ -102,14 +113,134 @@
103114 padding-bottom: 3px;
104115 }
105116
106 -.fr-marker-2 {
 117+.fr-marker-1 {
107118 background-image: url(../FlaggedRevs/img/boxC.png);
108119 background-repeat: no-repeat;
109120 padding: 3px 16px 0px 0px;
110121 }
111122
112 -.fr-marker-0 {
113 - background-image: url(../FlaggedRevs/img/boxQ.png);
114 - background-repeat: no-repeat;
115 - padding: 3px 16px 0px 0px;
 123+.fr_tab_current {
 124+ padding: 0px;
 125+ margin: 0px;
 126+ width: 27px;
 127+ position: relative;
 128+ float: left;
 129+ top: -3px;
 130+ right: 0px;
 131+ background-image: url(../FlaggedRevs/img/1.png);
 132+ background-repeat: no-repeat;
 133+ background-position: 0px 0px;
 134+ height: 27px;
 135+}
 136+.fr_tab_stable {
 137+ padding: 0px;
 138+ margin: 0px;
 139+ width: 27px;
 140+ position: relative;
 141+ float: left;
 142+ top: -3px;
 143+ right: 0px;
 144+ background-image: url(../FlaggedRevs/img/2.png);
 145+ background-repeat: no-repeat;
 146+ background-position: 0px 0px;
 147+ height: 27px;
 148+}
 149+.fr_tab_quality {
 150+ padding: 0px;
 151+ margin: 0px;
 152+ width: 27px;
 153+ position: relative;
 154+ float: left;
 155+ top: -3px;
 156+ right: 0px;
 157+ background-image: url(../FlaggedRevs/img/3.png);
 158+ background-repeat: no-repeat;
 159+ background-position: 0px 0px;
 160+ height: 27px;
116161 }
 162+
 163+.fr-text {
 164+ height: 14px;
 165+ margin: 0px 7px 0px 0px;
 166+ padding: 0px;
 167+ float: center;
 168+ line-height: 15px;
 169+ font-weight: bold;
 170+ width: 80px;
 171+}
 172+.fr-marker {
 173+ height: 14px;
 174+ width: 95px;
 175+ left: 0px;
 176+ top: 0px;
 177+ margin: 0px;
 178+ padding: 0px;
 179+ float: left;
 180+ background-image: url(../FlaggedRevs/img/fr-marker-20.png);
 181+ background-repeat: no-repeat;
 182+ background-position: 0px 0px;
 183+ line-height: 15px;
 184+ text-align: center;
 185+}
 186+
 187+.fr_value40 {
 188+ background-image: url(../FlaggedRevs/img/fr-marker-40.png);
 189+}
 190+.fr_value60 {
 191+ background-image: url(../FlaggedRevs/img/fr-marker-60.png);
 192+}
 193+.fr_value80 {
 194+ background-image: url(../FlaggedRevs/img/fr-marker-80.png);
 195+}
 196+.fr_value100 {
 197+ background-image: url(../FlaggedRevs/img/fr-marker-100.png);
 198+}
 199+
 200+.fr-group {
 201+ display: block;
 202+ float: center;
 203+ margin-top: 5px;
 204+}
 205+
 206+.flaggedrevs_box0 {
 207+ border: 1px solid #aaa;
 208+ background-color: #f9f9f9;
 209+ position: relative;
 210+ text-align: center;
 211+ font-size: 85%;
 212+}
 213+.flaggedrevs_box1 {
 214+ border: 1px solid #aaa;
 215+ background-color: #f0f8ff;
 216+ position: relative;
 217+ text-align: center;
 218+ font-size: 85%;
 219+}
 220+.flaggedrevs_box2 {
 221+ border: 1px solid #aaa;
 222+ background-color: #f0fff0;
 223+ position: relative;
 224+ text-align: center;
 225+ font-size: 85%;
 226+}
 227+.flaggedrevs_box3 {
 228+ border: 1px solid #aaa;
 229+ background-color: #fffff0;
 230+ position: relative;
 231+ text-align: center;
 232+ font-size: 85%;
 233+}
 234+
 235+/* Hack to avoid extra borders */
 236+.flaggedrevs_box0a {
 237+ background-color: #f9f9f9;
 238+}
 239+.flaggedrevs_box1a {
 240+ background-color: #f0f8ff;
 241+}
 242+.flaggedrevs_box2a {
 243+ background-color: #f0fff0;
 244+}
 245+.flaggedrevs_box3a {
 246+ background-color: #fffff0;
 247+}
Index: trunk/extensions/FlaggedRevs/flaggedrevs.js
@@ -8,42 +8,13 @@
99 }
1010 }
1111
12 -function hookAnyEvent(hookName, hookFunct, element) {
13 - if(!element){
14 - var element = window;
15 - }
16 - if (element.addEventListener) {
17 - element.addEventListener(hookName, hookFunct, false);
18 - } else if (element.attachEvent) {
19 - element.attachEvent("on" + hookName, hookFunct);
20 - }
 12+function enable_showhide() {
 13+ var toggle = document.getElementById('mwrevisiontoggle');
 14+ if( !toggle ) return;
 15+ toggle.style.display = '';
 16+ var ratings = document.getElementById('mwrevisionratings');
 17+ if( !ratings ) return;
 18+ ratings.style.display = 'none';
2119 }
2220
23 -var open_review_listen = function(evt){
24 - var review_closed = document.getElementById('mwrevisiontag_closed');
25 - if( !review_closed ) return;
26 - hookAnyEvent("click", open_the_review, review_closed);
27 -}
28 -
29 -var open_the_review = function(evt){
30 - var review_open = document.getElementById('mwrevisiontag_open');
31 - review_open.style.display = 'block';
32 - var review_closed = document.getElementById('mwrevisiontag_closed');
33 - review_closed.style.display = 'none';
34 - var close_review = document.getElementById('close_review');
35 - if(!close_review){
36 - var close_review = document.createElement('div');
37 - close_review.id ="close_review";
38 - close_review.innerHTML = 'X';
39 - review_open.insertBefore(close_review, review_open.firstChild);
40 - hookAnyEvent("click", close_the_review, close_review);
41 - }
42 -}
43 -var close_the_review = function(evt){
44 - var review_open = document.getElementById('mwrevisiontag_open');
45 - review_open.style.display = 'none';
46 - var review_closed = document.getElementById('mwrevisiontag_closed');
47 - review_closed.style.display = 'block';
48 -}
49 -
50 -addOnloadHook(open_review_listen);
 21+addOnloadHook(enable_showhide);
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php
@@ -15,10 +15,14 @@
1616
1717 'revreview-current' => 'Current revision',
1818 'revreview-stable' => 'Stable version',
19 - 'revreview-rating' => 'It was rated as:',
 19+ 'revreview-oldrating' => 'It was rated as:',
 20+ 'revreview-rating' => 'Revision rating:',
2021 'revreview-noflagged' => 'There are no reviewed revisions of this page, so it may \'\'\'not\'\'\' have been
2122 [[Help:Article validation|checked]] for quality.',
2223
 24+ 'revreview-quick-basic' => '[{{fullurl:{{FULLPAGENAMEE}}|stable=1}} See the latest sighted revision]',
 25+ 'revreview-quick-quality' => '[{{fullurl:{{FULLPAGENAMEE}}|stable=1}} See the latest quality revision]',
 26+ 'revreview-quick-current' => '[{{fullurl:{{FULLPAGENAMEE}}|stable=0}} See the current revision]',
2327 'revreview-newest-basic' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} latest sighted revision]
2428 ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} see all]) of this page was [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved]
2529 on <i>$2</i>. <br/> There {{plural:$3|is $3 revision|are $3 revisions}} ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} changes]) awaiting review.',
@@ -26,13 +30,13 @@
2731 ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} see all]) of this page was [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved]
2832 on <i>$2</i>. <br/> There {{plural:$3|is $3 revision|are $3 revisions}} ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} changes]) awaiting review.',
2933 'revreview-basic' => 'This is the latest [[Help:Article validation|sighted]] revision of this page,
30 - [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$4</i>. The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} current revision]
 34+ [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} current revision]
3135 is usually [{{fullurl:{{FULLPAGENAMEE}}|action=edit}} editable] and more up to date. There {{plural:$3|is $3 revision|are $3 revisions}}
32 - ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=$2}} changes]) awaiting review.',
 36+ ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} changes]) awaiting review.',
3337 'revreview-quality' => 'This is the latest [[Help:Article validation|quality]] revision of this page,
34 - [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$4</i>. The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} current revision]
 38+ [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} current revision]
3539 is usually [{{fullurl:{{FULLPAGENAMEE}}|action=edit}} editable] and more up to date. There {{plural:$3|is $3 revision|are $3 revisions}}
36 - ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=$2}} changes]) awaiting review.',
 40+ ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} changes]) awaiting review.',
3741 'revreview-static' => 'This is a [[Help:Article validation|reviewed]] revision of \'\'\'[[:$3|this page]]\'\'\',
3842 [{{fullurl:Special:Log/review|page=$1}} approved] on <i>$2</i>. The [{{fullurl:$3|stable=0}} current revision]
3943 is usually editable and more up to date.',
Index: trunk/extensions/FlaggedRevs/img/boxQ.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: trunk/extensions/FlaggedRevs/img/boxY.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png

Status & tagging log