Index: trunk/extensions/MoodBar/SpecialFeedbackDashboard.php |
— | — | @@ -68,8 +68,8 @@ |
69 | 69 | $wgOut->addHTML( $this->buildList( $res ) ); |
70 | 70 | $wgOut->addModuleStyles( 'ext.moodBar.dashboard.styles' ); |
71 | 71 | $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') ) { |
74 | 74 | $wgOut->addModules( 'jquery.interfaceConcurrency' ); |
75 | 75 | } |
76 | 76 | |
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js |
— | — | @@ -480,7 +480,7 @@ |
481 | 481 | ).append( |
482 | 482 | $( '<button>' ).attr( 'class', 'fbd-response-preview' ).text ( mw.msg( 'response-preview-text' ) ).prop( 'disabled', true ) |
483 | 483 | ).append( |
484 | | - $( '<div>' ).attr( 'style', 'clear:both' ) |
| 484 | + $( '<div>' ).attr( 'style', 'clear: both;' ) |
485 | 485 | ); |
486 | 486 | |
487 | 487 | // Get the feedbackItem |
— | — | @@ -489,13 +489,14 @@ |
490 | 490 | // Close any open responders prior to opening this one. |
491 | 491 | closeAllResponders(); |
492 | 492 | |
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' ) |
496 | 497 | .end() |
497 | 498 | .find( '.fbd-item-response-expanded' ) |
498 | 499 | .parent() |
499 | | - .addClass( 'responder-expanded' ); |
| 500 | + .addClass( 'responder-expanded' ); |
500 | 501 | |
501 | 502 | $item.append(inlineForm) |
502 | 503 | .find( '.fbd-response-text' ) |
— | — | @@ -542,18 +543,18 @@ |
543 | 544 | }); |
544 | 545 | |
545 | 546 | //check for concurrency module. |
546 | | - if( typeof $.concurrency !== 'undefined') { |
| 547 | + if ( $.concurrency !== undefined ) { |
547 | 548 | itemId = $item.data( 'mbccontinue' ).split( '|' )[1]; |
548 | 549 | //concurrency module is here, attempt checkout |
549 | 550 | $.concurrency.check( { |
550 | 551 | ccaction: 'checkout', |
551 | 552 | resourcetype: 'moodbar-feedback-response', |
552 | 553 | record: itemId |
553 | | - }, function( result ){ |
| 554 | + }, function ( result ){ |
554 | 555 | //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 ); |
558 | 559 | } |
559 | 560 | } ); |
560 | 561 | } |
— | — | @@ -617,8 +618,8 @@ |
618 | 619 | function inlineMessage( $el, msg, callback) { |
619 | 620 | $el.empty() |
620 | 621 | .text( msg ) |
621 | | - .delay(2000) |
622 | | - .fadeOut( 'slow', callback); |
| 622 | + .delay( 2000 ) |
| 623 | + .fadeOut( 'slow', callback ); |
623 | 624 | } |
624 | 625 | /** |
625 | 626 | * Set status message for Send Response |
— | — | @@ -630,46 +631,51 @@ |
631 | 632 | function responseMessage( $el, type, head, body ) { |
632 | 633 | $el |
633 | 634 | .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' ) |
636 | 637 | .end() |
637 | 638 | .find( '.fbd-ajax-heading' ) |
638 | | - .text( head ) |
| 639 | + .text( head ) |
639 | 640 | .end() |
640 | 641 | .find( '.fbd-ajax-text' ) |
641 | | - .html( body ) |
| 642 | + .html( body ) |
642 | 643 | .end(); |
| 644 | + |
643 | 645 | setTimeout( function () { |
644 | 646 | reloadItem( $el, true ); |
645 | | - }, 2000); |
| 647 | + }, 2000 ); |
646 | 648 | } |
647 | 649 | |
648 | 650 | /** |
649 | 651 | * Display tooltip for response concurrency notification |
650 | 652 | * @param $item Feedback item |
651 | 653 | */ |
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 | + ) |
665 | 669 | ); |
666 | 670 | $item.find( '.fbd-item-response' ).append( $tooltip ); |
| 671 | + |
667 | 672 | // Close event, closure remembers object |
668 | 673 | $( '.fbd-tooltip-close' ) |
669 | 674 | .live( 'click' , function () { |
670 | 675 | $tooltip.remove(); |
671 | 676 | } ); |
672 | | - setTimeout( function() { |
673 | | - $tooltip.fadeOut( function(){ |
| 677 | + |
| 678 | + setTimeout( function () { |
| 679 | + $tooltip.fadeOut( function (){ |
674 | 680 | $tooltip.remove(); |
675 | 681 | } ); |
676 | 682 | }, 2500 ); |