Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -301,7 +301,7 @@ |
302 | 302 | $wgAvailableRights[] = 'stablesettings'; |
303 | 303 | |
304 | 304 | # Bump this number every time you change flaggedrevs.css/flaggedrevs.js |
305 | | -$wgFlaggedRevStyleVersion = 71; |
| 305 | +$wgFlaggedRevStyleVersion = 72; |
306 | 306 | |
307 | 307 | $wgExtensionFunctions[] = 'efLoadFlaggedRevs'; |
308 | 308 | |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php |
— | — | @@ -295,7 +295,14 @@ |
296 | 296 | $box = '<div class="flaggedrevs_short_basic">' . $shtml . |
297 | 297 | ' ' . self::ratingArrow() . "</div>\n"; |
298 | 298 | $box .= '<div style="position: relative;">'; // for rel-absolute child div |
299 | | - $box .= '<div id="mw-fr-revisionratings" class="flaggedrevs_short_details">'; |
| 299 | + $box .= Html::openElement( 'div', |
| 300 | + array( |
| 301 | + 'id' => 'mw-fr-revisionratings', |
| 302 | + 'class' => 'flaggedrevs_short_details', |
| 303 | + 'onMouseOver' => 'FlaggedRevs.showBoxDetails()', |
| 304 | + 'onMouseOut' => 'FlaggedRevs.hideBoxDetails()' |
| 305 | + ) |
| 306 | + ); |
300 | 307 | $box .= $html; // details text |
301 | 308 | # Add any rating tags as needed... |
302 | 309 | if ( $flags && !FlaggedRevs::binaryFlagging() ) { |
— | — | @@ -304,7 +311,8 @@ |
305 | 312 | $box .= '<p>' . self::addTagRatings( $flags, true, $color ) . '</p>'; |
306 | 313 | } |
307 | 314 | } |
308 | | - $box .= "</div></div>\n"; |
| 315 | + $box .= Html::closeElement( 'div' ); |
| 316 | + $box .= "</div>\n"; |
309 | 317 | return $box; |
310 | 318 | } |
311 | 319 | |
— | — | @@ -314,11 +322,13 @@ |
315 | 323 | */ |
316 | 324 | public static function ratingArrow() { |
317 | 325 | $encPath = htmlspecialchars( FlaggedRevs::styleUrlPath() . '/img' ); |
318 | | - return "<img id=\"mw-fr-revisiontoggle\" class=\"fr-toggle-arrow\"" . |
319 | | - " src=\"{$encPath}/arrow-up.png\" style=\"display:none;\" " . |
320 | | - " onclick=\"FlaggedRevs.toggleRevRatings()\" title=\"" . |
321 | | - wfMsgHtml( 'revreview-toggle-title' ) . "\" alt=\"" . |
322 | | - wfMsgHtml( 'revreview-toggle-show' ) . "\" />"; |
| 326 | + $img = '<img id="mw-fr-revisiontoggle" class="fr-toggle-arrow"'; |
| 327 | + $img .= " src=\"{$encPath}/arrow-down.png\" style=\"display:none;\""; |
| 328 | + $img .= ' onMouseOver="FlaggedRevs.showBoxDetails()"'; |
| 329 | + $img .= ' onMouseOut="FlaggedRevs.hideBoxDetails()"'; |
| 330 | + $img .= ' title="' . wfMsgHtml( 'revreview-toggle-title' ) . '"'; |
| 331 | + $img .= ' alt="' . wfMsgHtml( 'revreview-toggle-show' ) . '" />'; |
| 332 | + return $img; |
323 | 333 | } |
324 | 334 | |
325 | 335 | /** |
— | — | @@ -327,7 +337,7 @@ |
328 | 338 | */ |
329 | 339 | public static function ratingToggle() { |
330 | 340 | return '<a id="mw-fr-revisiontoggle" class="fr-toggle-symbol"' . |
331 | | - ' style="display:none;" onclick="FlaggedRevs.toggleRevRatings()" title="' . |
| 341 | + ' style="display:none;" onclick="FlaggedRevs.toggleBoxDetails()" title="' . |
332 | 342 | wfMsgHtml( 'revreview-toggle-title' ) . '" >' . |
333 | 343 | wfMsgHtml( 'revreview-toggle-show' ) . '</a>'; |
334 | 344 | } |
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.js |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | }, |
17 | 17 | /* Hide rating/diff clutter */ |
18 | 18 | 'enableShowhide': function() { |
| 19 | + // Rating detail box |
19 | 20 | var toggle = document.getElementById('mw-fr-revisiontoggle'); |
20 | 21 | if( toggle ) { |
21 | 22 | toggle.style.display = 'inline'; |
— | — | @@ -23,6 +24,7 @@ |
24 | 25 | ratings.style.display = 'none'; |
25 | 26 | } |
26 | 27 | } |
| 28 | + // Diff detail box |
27 | 29 | toggle = document.getElementById('mw-fr-difftoggle'); |
28 | 30 | if( toggle ) { |
29 | 31 | toggle.style.display = 'inline'; |
— | — | @@ -31,6 +33,7 @@ |
32 | 34 | diff.style.display = 'none'; |
33 | 35 | } |
34 | 36 | } |
| 37 | + // Log detail box |
35 | 38 | toggle = document.getElementById('mw-fr-logtoggle'); |
36 | 39 | if( toggle ) { |
37 | 40 | toggle.style.display = 'inline'; |
— | — | @@ -41,30 +44,36 @@ |
42 | 45 | } |
43 | 46 | }, |
44 | 47 | |
45 | | - /* Toggles ratings */ |
46 | | - 'toggleRevRatings': function() { |
| 48 | + /* Expands ratings */ |
| 49 | + 'showBoxDetails': function() { |
47 | 50 | var ratings = document.getElementById('mw-fr-revisionratings'); |
48 | 51 | if( !ratings ) return; |
49 | 52 | var toggle = document.getElementById('mw-fr-revisiontoggle'); |
50 | 53 | if( !toggle ) return; |
| 54 | + ratings.style.display = 'block'; |
| 55 | + toggle.innerHTML = this.messages.toggleHide; |
| 56 | + }, |
| 57 | + |
| 58 | + /* Collapses ratings */ |
| 59 | + 'hideBoxDetails': function() { |
| 60 | + var ratings = document.getElementById('mw-fr-revisionratings'); |
| 61 | + if( !ratings ) return; |
| 62 | + var toggle = document.getElementById('mw-fr-revisiontoggle'); |
| 63 | + if( !toggle ) return; |
| 64 | + ratings.style.display = 'none'; |
| 65 | + toggle.innerHTML = this.messages.toggleShow; |
| 66 | + }, |
| 67 | + |
| 68 | + /* Toggles ratings */ |
| 69 | + 'toggleBoxDetails': function() { |
| 70 | + var ratings = document.getElementById('mw-fr-revisionratings'); |
| 71 | + if( !ratings ) return; |
51 | 72 | // Collapsed -> expand |
52 | 73 | if( ratings.style.display == 'none' ) { |
53 | | - ratings.style.display = 'block'; |
54 | | - if( toggle.tagName == 'IMG' ) { // arrow |
55 | | - toggle.alt = this.messages.toggleHide; // fallback text |
56 | | - toggle.src = toggle.src.replace( 'arrow-up.png', 'arrow-down.png' ); |
57 | | - } else { // text |
58 | | - toggle.innerHTML = this.messages.toggleHide; |
59 | | - } |
| 74 | + this.showBoxDetails(); |
60 | 75 | // Expanded -> collapse |
61 | 76 | } else { |
62 | | - ratings.style.display = 'none'; |
63 | | - if( toggle.tagName == 'IMG' ) { // arrow |
64 | | - toggle.alt = this.messages.toggleShow; // fallback text |
65 | | - toggle.src = toggle.src.replace( 'arrow-down.png', 'arrow-up.png' ); |
66 | | - } else { // text |
67 | | - toggle.innerHTML = this.messages.toggleShow; |
68 | | - } |
| 77 | + this.hideBoxDetails(); |
69 | 78 | } |
70 | 79 | }, |
71 | 80 | |