Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -343,7 +343,8 @@ |
344 | 344 | else |
345 | 345 | $classmarker = 0; |
346 | 346 | $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"; |
| 347 | + |
| 348 | + $tag .= "<div class='fr-group'><span class='fr-text'>" . wfMsgHtml("revreview-$quality") . " </span><span class='fr-marker value$levelmarker'>$valuetext</span></div>\n"; |
348 | 349 | } |
349 | 350 | return $tag; |
350 | 351 | } |
— | — | @@ -807,16 +808,16 @@ |
808 | 809 | # Looking at some specific old rev or if flagged revs override only for anons |
809 | 810 | if( !$this->pageOverride() ) { |
810 | 811 | $revs_since = parent::getRevCountSince( $pageid, $tfrev->fr_rev_id ); |
811 | | - $simpleTag = true; |
| 812 | + #$simpleTag = true; |
812 | 813 | # Construct some tagging |
813 | 814 | if( !$wgOut->isPrintable() ) { |
814 | 815 | $msg = $quality ? 'revreview-newest-quality' : 'revreview-newest-basic'; |
815 | 816 | $tag .= wfMsgExt($msg, array('parseinline'), $tfrev->fr_rev_id, $time, $revs_since); |
816 | 817 | # 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>'; |
| 818 | + #$tag .= ' <a href="javascript:toggleRevRatings()">' . wfMsg('revreview-toggle') . '</a>'; |
| 819 | + #$tag .= '<span id="mwrevisionratings" style="display:none">' . |
| 820 | + $tag .= wfMsg('revreview-rating') . parent::addTagRatings( $flags ); |
| 821 | + #.'</span>'; |
821 | 822 | } |
822 | 823 | # Viewing the page normally: override the page |
823 | 824 | } else { |
— | — | @@ -832,10 +833,10 @@ |
833 | 834 | $tag = wfMsgExt('revreview-quality', array('parseinline'), $vis_id, $article->getLatest(), $revs_since, $time); |
834 | 835 | else |
835 | 836 | $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>'; |
| 837 | + #$tag .= ' <a href="javascript:toggleRevRatings()">' . wfMsg('revreview-toggle') . '</a>'; |
| 838 | + #$tag .= '<span id="mwrevisionratings" style="display:none"><p>' . |
| 839 | + $tag .= parent::addTagRatings( $flags ); |
| 840 | + #.'</p></span>'; |
840 | 841 | } |
841 | 842 | # Try the stable page cache |
842 | 843 | $parserOutput = parent::getPageCache( $article ); |
— | — | @@ -860,23 +861,30 @@ |
861 | 862 | } |
862 | 863 | // Some checks for which tag CSS to use |
863 | 864 | if( $simpleTag ) |
864 | | - $tagClass = 'flaggedrevs_notice'; |
| 865 | + $tagClass = 'value1'; |
865 | 866 | else if( $pristine ) |
866 | | - $tagClass = 'flaggedrevs_tag3'; |
| 867 | + $tagClass = 'value3'; |
867 | 868 | else if( $quality ) |
868 | | - $tagClass = 'flaggedrevs_tag2'; |
| 869 | + $tagClass = 'value2'; |
869 | 870 | else |
870 | | - $tagClass = 'flaggedrevs_tag1'; |
| 871 | + $tagClass = 'value1'; |
871 | 872 | // Wrap tag contents in a div |
872 | 873 | if( $tag !='' ) |
873 | | - $tag = '<div id="mwrevisiontag" class="' . $tagClass . ' plainlinks">'.$tag.'</div>'; |
| 874 | + $tag = '<div id="mwrevisiontag_open" class="flaggedrevs_tag1 ' . $tagClass1 . ' plainlinks">'.$tag.'</div>'; |
874 | 875 | // Set the new body HTML, place a tag on top |
875 | 876 | $wgOut->mBodytext = $tag . $wgOut->mBodytext . $notes; |
| 877 | + $extra="<div id='mwrevisiontag_closed' class='flaggedrevs_short $tagClass'></div> |
| 878 | + <script type='text/javascript'> |
| 879 | + var review_open = document.getElementById('mwrevisiontag_open'); |
| 880 | + review_open.style.display = 'none'; |
| 881 | + </script>"; |
| 882 | + $wgOut->addHTML($extra); |
| 883 | + |
876 | 884 | } else { |
877 | | - $tag = '<div id="mwrevisiontag" class="mw-warning plainlinks">'.wfMsgExt('revreview-noflagged', array('parseinline')).'</div>'; |
| 885 | + $tag = '<div id="mwrevisiontag_open" class="mw-warning plainlinks">'.wfMsgExt('revreview-noflagged', array('parseinline')).'</div>'; |
878 | 886 | $wgOut->addHTML( $tag ); |
879 | 887 | } |
880 | | - return true; |
| 888 | + return true; |
881 | 889 | } |
882 | 890 | |
883 | 891 | function addToEditView( &$editform ) { |
— | — | @@ -906,10 +914,10 @@ |
907 | 915 | $msg = $this->isQuality( $flags ) ? 'revreview-newest-quality' : 'revreview-newest-basic'; |
908 | 916 | $tag = wfMsgExt($msg, array('parseinline'), $tfrev->fr_rev_id, $time, $revs_since ); |
909 | 917 | # Hide clutter |
910 | | - $tag .= ' <a href="javascript:toggleRevRatings()">' . wfMsg('revreview-toggle') . '</a>'; |
911 | | - $tag .= '<span id="mwrevisionratings" style="display:none">' . |
912 | | - wfMsg('revreview-rating') . parent::addTagRatings( $flags ) . |
913 | | - '</span>'; |
| 918 | + #$tag .= ' <a href="javascript:toggleRevRatings()">' . wfMsg('revreview-toggle') . '</a>'; |
| 919 | + #$tag .= '<span id="mwrevisionratings" style="display:none">' . |
| 920 | + $tag .= wfMsg('revreview-rating') . parent::addTagRatings( $flags ); |
| 921 | + # .'</span>'; |
914 | 922 | $wgOut->addHTML( '<div id="mwrevisiontag" class="flaggedrevs_notice plainlinks">' . $tag . '</div><br/>' ); |
915 | 923 | } |
916 | 924 | return true; |
Index: trunk/extensions/FlaggedRevs/flaggedrevs.css |
— | — | @@ -1,115 +1,100 @@ |
2 | | -.flaggedrevs_tag1 { |
| 2 | +.flaggedrevs_tag1, .flaggedrevs_tag2, .flaggedrevs_tag3, .flaggedrevs_notes { |
3 | 3 | border: 1px solid #aaa; |
4 | 4 | background-color: #f0f8ff; |
5 | | - padding: 5px; |
| 5 | + padding: 10px; |
6 | 6 | font-size: 80%; |
7 | | - margin-left: 50px; |
8 | | - margin-right: 50px; |
9 | | - text-align: center; |
| 7 | + margin-left: 12px; |
| 8 | + width: 200px; |
| 9 | + position: relative; |
| 10 | + float: right; |
| 11 | + top: 5px; |
| 12 | + right: 15px; |
10 | 13 | } |
11 | | - |
12 | | -.flaggedrevs_tag2 { |
13 | | - border: 1px solid #aaa; |
14 | | - background-color: #f0fff0; |
15 | | - padding: 5px; |
16 | | - font-size: 80%; |
17 | | - margin-left: 50px; |
18 | | - margin-right: 50px; |
19 | | - text-align: center; |
| 14 | +.flaggedrevs_short { |
| 15 | + padding: 0px; |
| 16 | + margin: 0px; |
| 17 | + width: 27px; |
| 18 | + position: relative; |
| 19 | + float: right; |
| 20 | + top: 5px; |
| 21 | + right: 15px; |
| 22 | + background-repeat: no-repeat; |
| 23 | + background-position: 0px 0px; |
| 24 | + height: 27px; |
| 25 | + cursor: pointer; |
20 | 26 | } |
21 | 27 | |
22 | | -.flaggedrevs_tag3 { |
23 | | - border: 1px solid #aaa; |
24 | | - background-color: #fffff0; |
25 | | - padding: 5px; |
26 | | - font-size: 80%; |
27 | | - margin-left: 50px; |
28 | | - margin-right: 50px; |
29 | | - text-align: center; |
30 | | -} |
| 28 | +.value1 { |
| 29 | + background-image: url(../FlaggedRevs/img/1.png); |
| 30 | +} |
31 | 31 | |
32 | | -.flaggedrevs_notes { |
33 | | - border: 1px solid #aaa; |
34 | | - background-color: #f9f9f9; |
35 | | - padding: 5px; |
36 | | - font-size: 80%; |
37 | | - margin-left: 50px; |
38 | | - margin-right: 50px; |
39 | | - text-align: center; |
| 32 | +.value2 { |
| 33 | + background-image: url(../FlaggedRevs/img/2.png); |
40 | 34 | } |
41 | | - |
| 35 | +.value3 { |
| 36 | + background-image: url(../FlaggedRevs/img/3.png); |
| 37 | +} |
42 | 38 | .flaggedrevs_notice { |
43 | | - border: 1px solid #aaa; |
44 | | - background-color: #f9f9f9; |
45 | | - padding: 5px; |
46 | 39 | font-size: 80%; |
47 | | - margin-left: 50px; |
48 | | - margin-right: 50px; |
49 | | - text-align: center; |
| 40 | + line-height: 1.2em; |
| 41 | + margin: 0 0 1.4em 1em; |
| 42 | + color: #7d7d7d; |
| 43 | + width: auto; |
50 | 44 | } |
51 | 45 | |
52 | | -/*.fr-marker-1 span {display: none};*/ |
53 | | -.fr-marker-1 { |
54 | | - background-image: url(../FlaggedRevs/img/boxY.png); |
55 | | - background-repeat: no-repeat; |
56 | | - min-width: 16px; |
57 | | - width: 16px; |
58 | | - height: 16px; |
59 | | - min-height: 16px; |
60 | | - padding: 3px 16px 0px 20px; |
| 46 | +.fr-text { |
| 47 | + height: 14px; |
| 48 | + margin: 0px 7px 0px 0px; |
| 49 | + padding: 0px; |
| 50 | + float: left; |
| 51 | + line-height: 15px; |
| 52 | + font-weight: bold; |
| 53 | + width: 80px; |
61 | 54 | } |
62 | | - |
63 | | -.fr-text-value { |
64 | | - /*font-size:0px; */ |
65 | | - min-width:100px; |
66 | | - width: 100px; |
67 | | - |
| 55 | +.fr-marker { |
| 56 | + height: 14px; |
| 57 | + width: 95px; |
| 58 | + left: 0px; |
| 59 | + top: 0px; |
| 60 | + margin: 0px; |
| 61 | + padding: 0px; |
| 62 | + float: left; |
| 63 | + background-image: url(../FlaggedRevs/img/fr-marker-20.png); |
| 64 | + background-repeat: no-repeat; |
| 65 | + background-position: 0px 0px; |
| 66 | + line-height: 15px; |
| 67 | + text-align: center; |
68 | 68 | } |
69 | | - |
70 | | - |
71 | | -.fr-marker-20 { |
72 | | - background-image: url(../FlaggedRevs/img/bar_20.png); |
73 | | - background-position: bottom left; |
74 | | - background-repeat: no-repeat; |
75 | | - padding-bottom: 3px; |
| 69 | +.value40 { |
| 70 | + background-image: url(../FlaggedRevs/img/fr-marker-40.png); |
76 | 71 | } |
77 | | -.fr-marker-40 { |
78 | | - background-image: url(../FlaggedRevs/img/bar_40.png); |
79 | | - background-position: bottom left; |
80 | | - background-repeat: no-repeat; |
81 | | - padding-bottom: 3px; |
| 72 | +.value60 { |
| 73 | + background-image: url(../FlaggedRevs/img/fr-marker-60.png); |
82 | 74 | } |
83 | | - |
84 | | -.fr-marker-60 { |
85 | | - background-image: url(../FlaggedRevs/img/bar_60.png); |
86 | | - background-position: bottom left; |
87 | | - background-repeat: no-repeat; |
88 | | - padding-bottom: 3px; |
89 | | - |
| 75 | +.value80 { |
| 76 | + background-image: url(../FlaggedRevs/img/fr-marker-80.png); |
90 | 77 | } |
91 | | - |
92 | | -.fr-marker-80 { |
93 | | - background-image: url(../FlaggedRevs/img/bar_80.png); |
94 | | - background-position: bottom left; |
95 | | - background-repeat: no-repeat; |
96 | | - padding-bottom: 3px; |
| 78 | +.value100 { |
| 79 | + background-image: url(../FlaggedRevs/img/fr-marker-100.png); |
97 | 80 | } |
98 | | - |
99 | | -.fr-marker-100 { |
100 | | - background-image: url(../FlaggedRevs/img/bar_100.png); |
101 | | - background-position: bottom left; |
102 | | - background-repeat: no-repeat; |
103 | | - padding-bottom: 3px; |
| 81 | +.fr-group { |
| 82 | + display: block; |
| 83 | + clear: left; |
| 84 | + float: left; |
| 85 | + margin-top: 5px; |
104 | 86 | } |
105 | | - |
106 | | -.fr-marker-2 { |
107 | | - background-image: url(../FlaggedRevs/img/boxC.png); |
108 | | - background-repeat: no-repeat; |
109 | | - padding: 3px 16px 0px 0px; |
| 87 | +.flaggedrevs_tag1 p { |
| 88 | + position: relative; |
| 89 | + margin: 0px; |
| 90 | + padding: 0px 0px 10px; |
| 91 | + line-height: 15px; |
110 | 92 | } |
111 | | - |
112 | | -.fr-marker-0 { |
113 | | - background-image: url(../FlaggedRevs/img/boxQ.png); |
114 | | - background-repeat: no-repeat; |
115 | | - padding: 3px 16px 0px 0px; |
| 93 | +#close_review { |
| 94 | + position:relative; |
| 95 | + float: right; |
| 96 | + z-index: 5; |
| 97 | + font-size: 150%; |
| 98 | + margin-top: -5px; |
| 99 | + cursor: pointer; |
116 | 100 | } |
| 101 | + |
Index: trunk/extensions/FlaggedRevs/flaggedrevs.js |
— | — | @@ -6,4 +6,50 @@ |
7 | 7 | } else {
|
8 | 8 | ratings.style.display = 'none';
|
9 | 9 | }
|
10 | | -} |
\ No newline at end of file |
| 10 | +}
|
| 11 | +
|
| 12 | +
|
| 13 | +
|
| 14 | +
|
| 15 | +
|
| 16 | +function hookAnyEvent(hookName, hookFunct, element) {
|
| 17 | + if(!element){
|
| 18 | + var element = window;
|
| 19 | + }
|
| 20 | + if (element.addEventListener) {
|
| 21 | + element.addEventListener(hookName, hookFunct, false);
|
| 22 | + } else if (element.attachEvent) {
|
| 23 | + element.attachEvent("on" + hookName, hookFunct);
|
| 24 | + }
|
| 25 | +}
|
| 26 | +
|
| 27 | +
|
| 28 | +var open_review_listen = function(evt){
|
| 29 | + var review_closed = document.getElementById('mwrevisiontag_closed');
|
| 30 | + hookAnyEvent("click", open_the_review, review_closed);
|
| 31 | +}
|
| 32 | +
|
| 33 | +var open_the_review = function(evt){
|
| 34 | + var review_open = document.getElementById('mwrevisiontag_open');
|
| 35 | + review_open.style.display = 'block';
|
| 36 | + var review_closed = document.getElementById('mwrevisiontag_closed');
|
| 37 | + review_closed.style.display = 'none';
|
| 38 | + var close_review = document.getElementById('close_review');
|
| 39 | + if(!close_review){
|
| 40 | + var close_review = document.createElement('div');
|
| 41 | + close_review.id ="close_review";
|
| 42 | + close_review.innerHTML = 'X';
|
| 43 | + review_open.insertBefore(close_review, review_open.firstChild);
|
| 44 | + hookAnyEvent("click", close_the_review, close_review);
|
| 45 | + }
|
| 46 | +}
|
| 47 | +var close_the_review = function(evt){
|
| 48 | + var review_open = document.getElementById('mwrevisiontag_open');
|
| 49 | + review_open.style.display = 'none';
|
| 50 | + var review_closed = document.getElementById('mwrevisiontag_closed');
|
| 51 | + review_closed.style.display = 'block';
|
| 52 | +}
|
| 53 | +
|
| 54 | +addOnloadHook(open_review_listen);
|
| 55 | +
|
| 56 | +
|
Index: trunk/extensions/FlaggedRevs/img/1.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/1.png |
___________________________________________________________________ |
Added: svn:mime-type |
11 | 57 | + image/png |
Index: trunk/extensions/FlaggedRevs/img/2.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/2.png |
___________________________________________________________________ |
Added: svn:mime-type |
12 | 58 | + image/png |
Index: trunk/extensions/FlaggedRevs/img/3.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/3.png |
___________________________________________________________________ |
Added: svn:mime-type |
13 | 59 | + image/png |
Index: trunk/extensions/FlaggedRevs/img/fr-marker-20.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/fr-marker-20.png |
___________________________________________________________________ |
Added: svn:mime-type |
14 | 60 | + image/png |
Index: trunk/extensions/FlaggedRevs/img/1-small.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/1-small.png |
___________________________________________________________________ |
Added: svn:mime-type |
15 | 61 | + image/png |
Index: trunk/extensions/FlaggedRevs/img/fr-marker-40.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/fr-marker-40.png |
___________________________________________________________________ |
Added: svn:mime-type |
16 | 62 | + image/png |
Index: trunk/extensions/FlaggedRevs/img/2-small.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/2-small.png |
___________________________________________________________________ |
Added: svn:mime-type |
17 | 63 | + image/png |
Index: trunk/extensions/FlaggedRevs/img/3-small.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/3-small.png |
___________________________________________________________________ |
Added: svn:mime-type |
18 | 64 | + image/png |
Index: trunk/extensions/FlaggedRevs/img/fr-marker-60.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/fr-marker-60.png |
___________________________________________________________________ |
Added: svn:mime-type |
19 | 65 | + image/png |
Index: trunk/extensions/FlaggedRevs/img/fr-marker-80.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/fr-marker-80.png |
___________________________________________________________________ |
Added: svn:mime-type |
20 | 66 | + image/png |
Index: trunk/extensions/FlaggedRevs/img/fr-marker-100.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/FlaggedRevs/img/fr-marker-100.png |
___________________________________________________________________ |
Added: svn:mime-type |
21 | 67 | + image/png |