r81320 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81319‎ | r81320 | r81321 >
Date:21:06, 1 February 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Added tooltip to remove button, also made expertise ratings clear after the animated slideUp rather than at the same time.
Modified paths:
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php
@@ -51,6 +51,7 @@
5252 'articlefeedback-form-switch-label',
5353 'articlefeedback-form-panel-title',
5454 'articlefeedback-form-panel-instructions',
 55+ 'articlefeedback-form-panel-clear',
5556 'articlefeedback-form-panel-expertise',
5657 'articlefeedback-form-panel-expertise-studies',
5758 'articlefeedback-form-panel-expertise-profession',
Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js
@@ -264,6 +264,9 @@
265265 .attr( 'title', mw.msg( context.options.ratings[key].tip ) )
266266 .text( mw.msg( context.options.ratings[key].label ) )
267267 .end()
 268+ .find( '.articleFeedback-rating-clear' )
 269+ .attr( 'title', mw.msg( 'articlefeedback-form-panel-clear' ) )
 270+ .end()
268271 .appendTo( $(this) );
269272 }
270273 } )
@@ -344,10 +347,11 @@
345348 .change( function() {
346349 var $options = context.$ui.find( '.articleFeedback-expertise-options' );
347350 if ( $(this).is( ':checked' ) ) {
348 - $options.slideDown();
 351+ $options.slideDown( 'fast' );
349352 } else {
350 - $options.slideUp();
351 - $options.find( 'input:checkbox' ).attr( 'checked', false );
 353+ $options.slideUp( 'fast', function() {
 354+ $options.find( 'input:checkbox' ).attr( 'checked', false );
 355+ } );
352356 }
353357 } )
354358 .end()
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js
@@ -277,6 +277,23 @@
278278 $( '#p-tb ul' )
279279 .append( '<li id="t-articlefeedback"><a href="#mw-articlefeedback"></a></li>' )
280280 .find( '#t-articlefeedback a' )
281 - .text( mw.msg( 'articlefeedback-form-switch-label' ) );
 281+ .text( mw.msg( 'articlefeedback-form-switch-label' ) )
 282+ .click( function() {
 283+ // Get the image, set the count and an interval.
 284+ var $box = $( '#mw-articlefeedback .articleFeedback' );
 285+ var count = 0;
 286+ var interval = setInterval( function() {
 287+ // Animate the opacity over .2 seconds
 288+ $box.animate( { 'opacity': 0.5 }, 100, function() {
 289+ // When finished, animate it back to solid.
 290+ $box.animate( { 'opacity': 1.0 }, 100 );
 291+ } );
 292+ // Clear the interval once we've reached 3.
 293+ if ( ++count >= 3 ) {
 294+ clearInterval( interval );
 295+ }
 296+ }, 200 );
 297+ return true;
 298+ } );
282299
283300 } )( jQuery, mediaWiki );
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php
@@ -30,6 +30,7 @@
3131 'articlefeedback-form-switch-label' => 'Rate this page',
3232 'articlefeedback-form-panel-title' => 'Rate this page',
3333 'articlefeedback-form-panel-instructions' => 'Please take a moment to rate this page.',
 34+ 'articlefeedback-form-panel-clear' => 'Remove this rating',
3435 'articlefeedback-form-panel-expertise' => 'I have prior knowledge on this topic',
3536 'articlefeedback-form-panel-expertise-studies' => 'I\'ve studied it',
3637 'articlefeedback-form-panel-expertise-profession' => 'It\'s part of my profession',

Status & tagging log