Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -7,6 +7,7 @@ |
8 | 8 | } |
9 | 9 | |
10 | 10 | 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' ); |
11 | 12 | |
12 | 13 | if( !function_exists( 'extAddSpecialPage' ) ) { |
13 | 14 | require( dirname(__FILE__) . '/../ExtensionFunctions.php' ); |
— | — | @@ -31,7 +32,7 @@ |
32 | 33 | extAddSpecialPage( dirname(__FILE__) . '/FlaggedRevsPage.body.php', 'Unreviewedpages', 'UnreviewedPages' ); |
33 | 34 | |
34 | 35 | function efLoadReviewMessages() { |
35 | | - global $wgMessageCache, $RevisionreviewMessages, $wgOut; |
| 36 | + global $wgMessageCache, $RevisionreviewMessages, $wgOut, $wgJsMimeType; |
36 | 37 | # Internationalization |
37 | 38 | require( dirname( __FILE__ ) . '/FlaggedRevsPage.i18n.php' ); |
38 | 39 | foreach ( $RevisionreviewMessages as $lang => $langMessages ) { |
— | — | @@ -44,6 +45,8 @@ |
45 | 46 | 'media' => 'screen,projection', |
46 | 47 | 'href' => FLAGGED_CSS, |
47 | 48 | ) ); |
| 49 | + # UI JS |
| 50 | + $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"" . FLAGGED_JS . "\"></script>\n" ); |
48 | 51 | } |
49 | 52 | |
50 | 53 | ######### |
— | — | @@ -66,7 +69,7 @@ |
67 | 70 | # Define the tags we can use to rate an article, |
68 | 71 | # and set the minimum level to have it become a "quality" version. |
69 | 72 | # "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 ); |
71 | 74 | # How high can we rate these revisions? |
72 | 75 | $wgFlaggedRevValues = 4; |
73 | 76 | # Who can set what flags to what level? (use -1 for not at all) |
— | — | @@ -719,9 +722,9 @@ |
720 | 723 | $vis_id = $tfrev->fr_rev_id; |
721 | 724 | $revs_since = parent::getRevCountSince( $pageid, $vis_id ); |
722 | 725 | 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); |
724 | 727 | 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); |
726 | 729 | # Try the stable page cache |
727 | 730 | $parserOutput = parent::getPageCache( $article ); |
728 | 731 | # If no cache is available, get the text and parse it |
— | — | @@ -744,20 +747,21 @@ |
745 | 748 | $pcache = false; |
746 | 749 | } |
747 | 750 | // 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>'; |
749 | 753 | // Some checks for which tag CSS to use |
750 | 754 | if( $pristine ) |
751 | | - $tag = '<div class="flaggedrevs_tag3 plainlinks">'.$tag.'</div>'; |
| 755 | + $tag = '<div id="mwrevisiontag" class="flaggedrevs_tag3 plainlinks">'.$tag.'</div>'; |
752 | 756 | else if( $quality ) |
753 | | - $tag = '<div class="flaggedrevs_tag2 plainlinks">'.$tag.'</div>'; |
| 757 | + $tag = '<div id="mwrevisiontag" class="flaggedrevs_tag2 plainlinks">'.$tag.'</div>'; |
754 | 758 | else if( $stable ) |
755 | | - $tag = '<div class="flaggedrevs_tag1 plainlinks">'.$tag.'</div>'; |
| 759 | + $tag = '<div id="mwrevisiontag" class="flaggedrevs_tag1 plainlinks">'.$tag.'</div>'; |
756 | 760 | else |
757 | | - $tag = '<div class="flaggedrevs_notice plainlinks">'.$tag.'</div>'; |
| 761 | + $tag = '<div id="mwrevisiontag" class="flaggedrevs_notice plainlinks">'.$tag.'</div>'; |
758 | 762 | // Set the new body HTML, place a tag on top |
759 | 763 | $wgOut->mBodytext = $tag . $wgOut->mBodytext . $notes; |
760 | 764 | } 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>'; |
762 | 766 | $wgOut->addHTML( $tag ); |
763 | 767 | } |
764 | 768 | } |
— | — | @@ -787,7 +791,7 @@ |
788 | 792 | // Construct some tagging |
789 | 793 | $tag = wfMsgExt('revreview-newest', array('parse'), $tfrev->fr_rev_id, $time, $revs_since ); |
790 | 794 | $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/>' ); |
792 | 796 | } |
793 | 797 | } |
794 | 798 | |
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 @@ |
534 | 534 | $parserOutput = $RevFlagging->parseStableText( $page, $text, $this->oldid, $options ); |
535 | 535 | $notes = $RevFlagging->ReviewNotes( $frev ); |
536 | 536 | // 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); |
538 | 538 | # Show stable categories and interwiki links only |
539 | 539 | $wgOut->addCategoryLinks( $parserOutput->getCategories() ); |
540 | 540 | } |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php |
— | — | @@ -13,8 +13,8 @@ |
14 | 14 | 'group-reviewer-member' => 'reviewer', |
15 | 15 | 'grouppage-reviewer' => '{{ns:project}}:reviewer', |
16 | 16 | |
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.', |
19 | 19 | 'revreview-newest' => 'The [{{fullurl:Special:stableversions|oldid=$1}} latest reviewed revision] |
20 | 20 | ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} see all]) was [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] |
21 | 21 | on <i>$2</i>. |
— | — | @@ -31,6 +31,7 @@ |
32 | 32 | 'revreview-static' => 'This is a [[Help:Article validation|reviewed]] revision of the page \'\'\'[[:$3]]\'\'\', |
33 | 33 | [{{fullurl:Special:Log/review|page=$1}} approved] on <i>$2</i>. The [{{fullurl:$3|stable=0}} current revision] |
34 | 34 | is usually editable and more up to date.', |
| 35 | + 'revreview-toggle' => '(toggle details)', |
35 | 36 | 'revreview-note' => '[[User:$1]] made the following notes [[Help:Article validation|reviewing]] this revision:', |
36 | 37 | |
37 | 38 | 'hist-stable' => '[stable]', |
— | — | @@ -42,7 +43,7 @@ |
43 | 44 | for content pages.', |
44 | 45 | 'review-logentrygrant' => 'reviewed a version of [[:$1]]', |
45 | 46 | 'review-logentryrevoke' => 'depreciated a version of [[:$1]]', |
46 | | - 'review-logaction' => 'revision $1', |
| 47 | + 'review-logaction' => 'revision ID $1', |
47 | 48 | |
48 | 49 | 'revisionreview' => 'Review revisions', |
49 | 50 | 'revreview-main' => 'You must select a particular revision from a content page in order to review. |