r109877 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109876‎ | r109877 | r109878 >
Date:00:10, 24 January 2012
Author:krinkle
Status:ok
Tags:
Comment:
[MoodBar] whitespace
Modified paths:
  • /trunk/extensions/MoodBar/SpecialFeedbackDashboard.php (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/SpecialFeedbackDashboard.php
@@ -68,8 +68,8 @@
6969 $wgOut->addHTML( $this->buildList( $res ) );
7070 $wgOut->addModuleStyles( 'ext.moodBar.dashboard.styles' );
7171 $wgOut->addModules( 'ext.moodBar.dashboard' );
72 - //check for interfaceConcurrency extension, remove check when in core.
73 - if( class_exists( 'ApiConcurrency ') ) {
 72+ // Check for interfaceConcurrency extension, remove check when in core.
 73+ if ( class_exists( 'ApiConcurrency') ) {
7474 $wgOut->addModules( 'jquery.interfaceConcurrency' );
7575 }
7676
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js
@@ -480,7 +480,7 @@
481481 ).append(
482482 $( '<button>' ).attr( 'class', 'fbd-response-preview' ).text ( mw.msg( 'response-preview-text' ) ).prop( 'disabled', true )
483483 ).append(
484 - $( '<div>' ).attr( 'style', 'clear:both' )
 484+ $( '<div>' ).attr( 'style', 'clear: both;' )
485485 );
486486
487487 // Get the feedbackItem
@@ -489,13 +489,14 @@
490490 // Close any open responders prior to opening this one.
491491 closeAllResponders();
492492
493 - $(this).find( '.fbd-item-response-collapsed' )
494 - .addClass( 'fbd-item-response-expanded' )
495 - .removeClass( 'fbd-item-response-collapsed' )
 493+ $(this)
 494+ .find( '.fbd-item-response-collapsed' )
 495+ .addClass( 'fbd-item-response-expanded' )
 496+ .removeClass( 'fbd-item-response-collapsed' )
496497 .end()
497498 .find( '.fbd-item-response-expanded' )
498499 .parent()
499 - .addClass( 'responder-expanded' );
 500+ .addClass( 'responder-expanded' );
500501
501502 $item.append(inlineForm)
502503 .find( '.fbd-response-text' )
@@ -542,18 +543,18 @@
543544 });
544545
545546 //check for concurrency module.
546 - if( typeof $.concurrency !== 'undefined') {
 547+ if ( $.concurrency !== undefined ) {
547548 itemId = $item.data( 'mbccontinue' ).split( '|' )[1];
548549 //concurrency module is here, attempt checkout
549550 $.concurrency.check( {
550551 ccaction: 'checkout',
551552 resourcetype: 'moodbar-feedback-response',
552553 record: itemId
553 - }, function( result ){
 554+ }, function ( result ){
554555 //if checkout failed, show tooltip if it hasn't been shown
555 - if( result == 'failure' && $.inArray( itemId, concurrencyState ) === -1 ) {
556 - concurrencyState.push(itemId);
557 - loadConcurrencyToolTip($item);
 556+ if ( result === 'failure' && $.inArray( itemId, concurrencyState ) === -1 ) {
 557+ concurrencyState.push( itemId );
 558+ loadConcurrencyToolTip( $item );
558559 }
559560 } );
560561 }
@@ -617,8 +618,8 @@
618619 function inlineMessage( $el, msg, callback) {
619620 $el.empty()
620621 .text( msg )
621 - .delay(2000)
622 - .fadeOut( 'slow', callback);
 622+ .delay( 2000 )
 623+ .fadeOut( 'slow', callback );
623624 }
624625 /**
625626 * Set status message for Send Response
@@ -630,46 +631,51 @@
631632 function responseMessage( $el, type, head, body ) {
632633 $el
633634 .find( '.mw-ajax-loader' )
634 - .addClass( 'fbd-item-response-' + type )
635 - .removeClass( 'mw-ajax-loader' )
 635+ .addClass( 'fbd-item-response-' + type )
 636+ .removeClass( 'mw-ajax-loader' )
636637 .end()
637638 .find( '.fbd-ajax-heading' )
638 - .text( head )
 639+ .text( head )
639640 .end()
640641 .find( '.fbd-ajax-text' )
641 - .html( body )
 642+ .html( body )
642643 .end();
 644+
643645 setTimeout( function () {
644646 reloadItem( $el, true );
645 - }, 2000);
 647+ }, 2000 );
646648 }
647649
648650 /**
649651 * Display tooltip for response concurrency notification
650652 * @param $item Feedback item
651653 */
652 - function loadConcurrencyToolTip($item) {
653 - var $tooltip = $('<div>').attr('class', 'fbd-tooltip-overlay-wrap')
654 - .append(
655 - $('<div>').attr('class', 'fbd-tooltip-overlay')
656 - .append(
657 - $('<div>').attr('class', 'fbd-tooltip-pointy')
658 - ).append(
659 - $('<div>').attr('class', 'fbd-tooltip-title')
660 - .text( mw.msg( 'response-concurrency-notification' ) )
661 - .prepend(
662 - $('<span>').attr('class', 'fbd-tooltip-close').text('X')
663 - )
664 - )
 654+ function loadConcurrencyToolTip( $item ) {
 655+ var $tooltip = $( '<div>' )
 656+ .attr( 'class', 'fbd-tooltip-overlay-wrap' )
 657+ .append(
 658+ $( '<div>' ).attr( 'class', 'fbd-tooltip-overlay' )
 659+ .append(
 660+ $( '<div>' ).attr( 'class', 'fbd-tooltip-pointy' )
 661+ ).append(
 662+ $( '<div>' )
 663+ .attr( 'class', 'fbd-tooltip-title' )
 664+ .text( mw.msg( 'response-concurrency-notification' ) )
 665+ .prepend(
 666+ $( '<span>' ).attr( 'class', 'fbd-tooltip-close' ).text( 'X' )
 667+ )
 668+ )
665669 );
666670 $item.find( '.fbd-item-response' ).append( $tooltip );
 671+
667672 // Close event, closure remembers object
668673 $( '.fbd-tooltip-close' )
669674 .live( 'click' , function () {
670675 $tooltip.remove();
671676 } );
672 - setTimeout( function() {
673 - $tooltip.fadeOut( function(){
 677+
 678+ setTimeout( function () {
 679+ $tooltip.fadeOut( function (){
674680 $tooltip.remove();
675681 } );
676682 }, 2500 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108825in preparation of concurrencyCheck extension, add concurrency check call to f...rmoen18:42, 13 January 2012

Status & tagging log