Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -93,6 +93,10 @@ |
94 | 94 | 'style' => array('review' => 3), |
95 | 95 | ); |
96 | 96 | |
| 97 | +// For users of the monobook skin, a simplified UI |
| 98 | +// will be used. Ratings will go by the toolbox. |
| 99 | +$wgSimpleFlaggedRevsUI = true; |
| 100 | + |
97 | 101 | # Lets some users access the review UI and set some flags |
98 | 102 | $wgAvailableRights[] = 'review'; |
99 | 103 | # Let some users set higher settings |
— | — | @@ -328,23 +332,38 @@ |
329 | 333 | return $flags; |
330 | 334 | } |
331 | 335 | |
332 | | - public function addTagRatings( $flags ) { |
| 336 | + public function addTagRatings( $flags, $box=false, $css='' ) { |
333 | 337 | global $wgFlaggedRevTags; |
334 | 338 | |
335 | 339 | $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 ) { |
337 | 344 | $valuetext = wfMsgHtml('revreview-' . $this->dimensions[$quality][$flags[$quality]]); |
338 | 345 | $level = $flags[$quality]; |
339 | 346 | $minlevel = $wgFlaggedRevTags[$quality]; |
340 | | - if($level >= $minlevel) |
| 347 | + if( $level >= $minlevel ) |
341 | 348 | $classmarker = 2; |
342 | | - elseif($level > 0) |
| 349 | + elseif( $level > 0 ) |
343 | 350 | $classmarker = 1; |
344 | 351 | else |
345 | 352 | $classmarker = 0; |
| 353 | + |
346 | 354 | $levelmarker = $level * 20 + 20; //XXX do this better |
347 | | - $tag .= " <span class='fr-marker-$levelmarker'><strong>" . wfMsgHtml("revreview-$quality") . "</strong>: <span class='fr-text-value'>$valuetext </span> </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 .= " <span class='fr-marker-$levelmarker'><strong>" . |
| 360 | + wfMsgHtml("revreview-$quality") . |
| 361 | + "</strong>: <span class='fr-text-value'>$valuetext </span> " . |
| 362 | + "</span>\n"; |
| 363 | + } |
348 | 364 | } |
| 365 | + if( $box ) |
| 366 | + $tag .= '</table>'; |
| 367 | + |
349 | 368 | return $tag; |
350 | 369 | } |
351 | 370 | |
— | — | @@ -756,13 +775,13 @@ |
757 | 776 | */ |
758 | 777 | static function pageOverride() { |
759 | 778 | global $wgTitle, $wgFlaggedRevsAnonOnly, $wgFlaggedRevsOverride, $wgUser, $wgRequest, $action; |
760 | | - // This only applies to viewing content pages |
| 779 | + # This only applies to viewing content pages |
761 | 780 | if( $action !='view' || !$wgTitle->isContentPage() ) return; |
762 | | - // Does not apply to diffs/old revisions |
| 781 | + # Does not apply to diffs/old revisions |
763 | 782 | 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? |
765 | 784 | 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 |
767 | 786 | if( $wgFlaggedRevsAnonOnly && $wgUser->isAnon() ) { |
768 | 787 | return !( $wgRequest->getIntOrNull('stable')===0 ); |
769 | 788 | } else { |
— | — | @@ -772,6 +791,75 @@ |
773 | 792 | return !( $wgRequest->getIntOrNull('stable') !==1 ); |
774 | 793 | } |
775 | 794 | } |
| 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 | + } |
776 | 864 | |
777 | 865 | /** |
778 | 866 | * Replaces a page with the last stable version if possible |
— | — | @@ -779,7 +867,7 @@ |
780 | 868 | * Adds a quick review form on the bottom if needed |
781 | 869 | */ |
782 | 870 | function setPageContent( &$article, &$outputDone, &$pcache ) { |
783 | | - global $wgRequest, $wgTitle, $wgOut, $action; |
| 871 | + global $wgRequest, $wgTitle, $wgOut, $action, $wgUser; |
784 | 872 | // Only trigger on article view for content pages, not for protect/delete/hist |
785 | 873 | if( !$article || !$article->exists() || !$article->mTitle->isContentPage() || $action !='view' ) |
786 | 874 | return true; |
— | — | @@ -788,11 +876,13 @@ |
789 | 877 | $revid = $article->mRevision ? $article->mRevision->mId : $article->getLatest(); |
790 | 878 | if( !$revid ) |
791 | 879 | return true; |
| 880 | + |
| 881 | + $skin = $wgUser->getSkin(); |
792 | 882 | |
793 | 883 | $vis_id = $revid; |
794 | 884 | $tag = ''; $notes = ''; |
795 | 885 | // Check the newest stable version... |
796 | | - $tfrev = $this->getOverridingRev( $article ); |
| 886 | + $tfrev = $this->getOverridingRev(); |
797 | 887 | $simpleTag = false; |
798 | 888 | if( $wgRequest->getVal('diff') ) { |
799 | 889 | // Do not clutter up diffs any further... |
— | — | @@ -810,32 +900,40 @@ |
811 | 901 | $simpleTag = true; |
812 | 902 | # Construct some tagging |
813 | 903 | 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 | + } |
821 | 918 | } |
822 | 919 | # Viewing the page normally: override the page |
823 | 920 | } else { |
824 | | - global $wgUser; |
825 | | - |
826 | | - $skin = $wgUser->getSkin(); |
827 | 921 | # We will be looking at the reviewed revision... |
828 | 922 | $vis_id = $tfrev->fr_rev_id; |
829 | 923 | $revs_since = parent::getRevCountSince( $pageid, $vis_id ); |
830 | 924 | // Construct some tagging |
831 | 925 | 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 | + } |
840 | 938 | } |
841 | 939 | # Try the stable page cache |
842 | 940 | $parserOutput = parent::getPageCache( $article ); |
— | — | @@ -859,7 +957,9 @@ |
860 | 958 | $pcache = false; |
861 | 959 | } |
862 | 960 | // Some checks for which tag CSS to use |
863 | | - if( $simpleTag ) |
| 961 | + if( $this->useSimpleUI() ) |
| 962 | + $tagClass = 'flaggedrevs_short'; |
| 963 | + else if( $simpleTag ) |
864 | 964 | $tagClass = 'flaggedrevs_notice'; |
865 | 965 | else if( $pristine ) |
866 | 966 | $tagClass = 'flaggedrevs_tag3'; |
— | — | @@ -896,7 +996,7 @@ |
897 | 997 | // Set new body html text as that of now |
898 | 998 | $tag = ''; |
899 | 999 | // Check the newest stable version |
900 | | - $tfrev = $this->getOverridingRev( $editform->mArticle ); |
| 1000 | + $tfrev = $this->getOverridingRev(); |
901 | 1001 | if( is_object($tfrev) ) { |
902 | 1002 | global $wgLang; |
903 | 1003 | $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $tfrev->fr_timestamp), true ); |
— | — | @@ -908,7 +1008,7 @@ |
909 | 1009 | # Hide clutter |
910 | 1010 | $tag .= ' <a href="javascript:toggleRevRatings()">' . wfMsg('revreview-toggle') . '</a>'; |
911 | 1011 | $tag .= '<span id="mwrevisionratings" style="display:none">' . |
912 | | - wfMsg('revreview-rating') . parent::addTagRatings( $flags ) . |
| 1012 | + wfMsg('revreview-oldrating') . parent::addTagRatings( $flags ) . |
913 | 1013 | '</span>'; |
914 | 1014 | $wgOut->addHTML( '<div id="mwrevisiontag" class="flaggedrevs_notice plainlinks">' . $tag . '</div><br/>' ); |
915 | 1015 | } |
— | — | @@ -977,7 +1077,7 @@ |
978 | 1078 | $article = new Article( $title ); |
979 | 1079 | // If we are viewing a page normally, and it was overridden, |
980 | 1080 | // change the edit tab to a "current revision" tab |
981 | | - $tfrev = $this->getOverridingRev( $article ); |
| 1081 | + $tfrev = $this->getOverridingRev(); |
982 | 1082 | // No quality revs? Find the last reviewed one |
983 | 1083 | if( !is_object($tfrev) ) |
984 | 1084 | return true; |
— | — | @@ -1029,7 +1129,7 @@ |
1030 | 1130 | # Add 'stable' tab if either $wgFlaggedRevsOverride is off, |
1031 | 1131 | # or this is a user viewing the page with $wgFlaggedRevsAnonOnly on |
1032 | 1132 | $new_actions['stable'] = array( |
1033 | | - 'class' => '', |
| 1133 | + 'class' => 'selected', |
1034 | 1134 | 'text' => wfMsg('revreview-stable'), |
1035 | 1135 | 'href' => $title->getLocalUrl( 'stable=1' ) |
1036 | 1136 | ); |
— | — | @@ -1309,34 +1409,36 @@ |
1310 | 1410 | } |
1311 | 1411 | |
1312 | 1412 | // Our class instances |
1313 | | -$flaggedrevs = new FlaggedArticle(); |
| 1413 | +$flaggedRevsModifier = new FlaggedArticle(); |
1314 | 1414 | // Main hooks, overrides pages content, adds tags, sets tabs and permalink |
1315 | | -$wgHooks['SkinTemplateTabs'][] = array($flaggedrevs, 'setCurrentTab'); |
| 1415 | +$wgHooks['SkinTemplateTabs'][] = array($flaggedRevsModifier, 'setCurrentTab'); |
1316 | 1416 | // 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'); |
1320 | 1420 | // Add tags do edit view |
1321 | | -$wgHooks['EditPage::showEditForm:initial'][] = array($flaggedrevs, 'addToEditView'); |
| 1421 | +$wgHooks['EditPage::showEditForm:initial'][] = array($flaggedRevsModifier, 'addToEditView'); |
1322 | 1422 | // Add review form |
1323 | | -$wgHooks['BeforePageDisplay'][] = array($flaggedrevs, 'addReviewForm'); |
| 1423 | +$wgHooks['BeforePageDisplay'][] = array($flaggedRevsModifier, 'addReviewForm'); |
1324 | 1424 | // 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'); |
1327 | 1427 | // Autopromote Editors |
1328 | | -$wgHooks['ArticleSaveComplete'][] = array($flaggedrevs, 'autoPromoteUser'); |
| 1428 | +$wgHooks['ArticleSaveComplete'][] = array($flaggedRevsModifier, 'autoPromoteUser'); |
1329 | 1429 | // Adds table link references to include ones from the stable version |
1330 | | -$wgHooks['TitleLinkUpdatesAfterCompletion'][] = array($flaggedrevs, 'extraLinksUpdate'); |
| 1430 | +$wgHooks['TitleLinkUpdatesAfterCompletion'][] = array($flaggedRevsModifier, 'extraLinksUpdate'); |
1331 | 1431 | // 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'); |
1333 | 1433 | // Update our table NS/Titles when things are moved |
1334 | | -$wgHooks['SpecialMovepageAfterMove'][] = array($flaggedrevs, 'updateFromMove'); |
| 1434 | +$wgHooks['SpecialMovepageAfterMove'][] = array($flaggedRevsModifier, 'updateFromMove'); |
1335 | 1435 | // 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'); |
1340 | 1440 | // 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'); |
1343 | 1445 | ?> |
Index: trunk/extensions/FlaggedRevs/flaggedrevs.css |
— | — | @@ -48,6 +48,18 @@ |
49 | 49 | text-align: center; |
50 | 50 | } |
51 | 51 | |
| 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 | + |
52 | 64 | /*.fr-marker-1 span {display: none};*/ |
53 | 65 | .fr-marker-1 { |
54 | 66 | background-image: url(../FlaggedRevs/img/boxY.png); |
— | — | @@ -66,7 +78,6 @@ |
67 | 79 | |
68 | 80 | } |
69 | 81 | |
70 | | - |
71 | 82 | .fr-marker-20 { |
72 | 83 | background-image: url(../FlaggedRevs/img/bar_20.png); |
73 | 84 | background-position: bottom left; |
— | — | @@ -102,14 +113,134 @@ |
103 | 114 | padding-bottom: 3px; |
104 | 115 | } |
105 | 116 | |
106 | | -.fr-marker-2 { |
| 117 | +.fr-marker-1 { |
107 | 118 | background-image: url(../FlaggedRevs/img/boxC.png); |
108 | 119 | background-repeat: no-repeat; |
109 | 120 | padding: 3px 16px 0px 0px; |
110 | 121 | } |
111 | 122 | |
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; |
116 | 161 | } |
| 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 @@ |
9 | 9 | }
|
10 | 10 | }
|
11 | 11 |
|
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';
|
21 | 19 | }
|
22 | 20 |
|
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 @@ |
16 | 16 | |
17 | 17 | 'revreview-current' => 'Current revision', |
18 | 18 | 'revreview-stable' => 'Stable version', |
19 | | - 'revreview-rating' => 'It was rated as:', |
| 19 | + 'revreview-oldrating' => 'It was rated as:', |
| 20 | + 'revreview-rating' => 'Revision rating:', |
20 | 21 | 'revreview-noflagged' => 'There are no reviewed revisions of this page, so it may \'\'\'not\'\'\' have been |
21 | 22 | [[Help:Article validation|checked]] for quality.', |
22 | 23 | |
| 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]', |
23 | 27 | 'revreview-newest-basic' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} latest sighted revision] |
24 | 28 | ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} see all]) of this page was [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] |
25 | 29 | 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 @@ |
27 | 31 | ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} see all]) of this page was [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] |
28 | 32 | on <i>$2</i>. <br/> There {{plural:$3|is $3 revision|are $3 revisions}} ([{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur}} changes]) awaiting review.', |
29 | 33 | '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] |
31 | 35 | 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.', |
33 | 37 | '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] |
35 | 39 | 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.', |
37 | 41 | 'revreview-static' => 'This is a [[Help:Article validation|reviewed]] revision of \'\'\'[[:$3|this page]]\'\'\', |
38 | 42 | [{{fullurl:Special:Log/review|page=$1}} approved] on <i>$2</i>. The [{{fullurl:$3|stable=0}} current revision] |
39 | 43 | 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 |