r108573 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108572‎ | r108573 | r108574 >
Date:00:22, 11 January 2012
Author:rmoen
Status:ok (Comments)
Tags:
Comment:
add concurrency call to feedback dashboard, revise loadConcurrencyToolTip method. follow up r108271
Modified paths:
  • /trunk/extensions/MoodBar/MoodBar.php (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js
@@ -13,7 +13,7 @@
1414 myresponse: null,
1515 showunanswered: null
1616 };
17 -
 17+
1818 /**
1919 * Figure out which comment type filters have been selected.
2020 * @return array of comment types
@@ -538,7 +538,18 @@
539539 wikitext = wikitext.replace( /~{3,5}/g, '' ) + "\n\n~~~~"; // Remove and add signature for
540540 parseWikiText( $item, wikitext );
541541 });
542 - }
 542+
 543+ //run concurrency check
 544+ $.concurrency.check( {
 545+ ccaction: 'checkout',
 546+ resourcetype: 'moodbar-feedback-response',
 547+ record: $item.data( 'mbccontinue' ).split( '|' )[1]
 548+ }, function( data ){
 549+ if( data && data.concurrency.result == 'failure' ) { //checkout failed, show tooltip
 550+ loadConcurrencyToolTip($item);
 551+ }
 552+ } );
 553+ }
543554 e.preventDefault();
544555 }
545556
@@ -627,31 +638,31 @@
628639 /**
629640 * Display tooltip for response concurrency notification
630641 * @param $item Feedback item
631 - */
632 - function loadToolTip( $item ) {
633 - var tooltip = $( '<div>' ).attr( 'class', 'fbd-tooltip-overlay-wrap' )
634 - .append(
635 - $( '<div>' ).attr( 'class', 'fbd-tooltip-overlay' )
636 - .append(
637 - $( '<div>' ).attr( 'class', 'fbd-tooltip-pointy' )
638 - ).append(
639 - $( '<div>' ).attr( 'class', 'fbd-tooltip-title' )
640 - .text( mw.msg( 'response-concurrency-notification' ) )
641 - .prepend(
642 - $( '<span>' ).attr( 'class', 'fbd-tooltip-close' ).text( 'X' )
643 - )
 642+ */
 643+ function loadConcurrencyToolTip($item) {
 644+ var $tooltip = $('<div>').attr('class', 'fbd-tooltip-overlay-wrap')
 645+ .append(
 646+ $('<div>').attr('class', 'fbd-tooltip-overlay')
 647+ .append(
 648+ $('<div>').attr('class', 'fbd-tooltip-pointy')
 649+ ).append(
 650+ $('<div>').attr('class', 'fbd-tooltip-title')
 651+ .text( mw.msg( 'response-concurrency-notification' ) )
 652+ .prepend(
 653+ $('<span>').attr('class', 'fbd-tooltip-close').text('X')
644654 )
645 - );
646 - $item.append( tooltip );
 655+ )
 656+ );
 657+ $item.find( '.fbd-item-response' ).append( $tooltip );
647658 // Close event, closure remembers object
648659 $( '.fbd-tooltip-close' )
649660 .live( 'click' , function () {
650 - tooltip.remove();
651 - });
652 - setTimeout( function () {
653 - tooltip.fadeOut(function ( tooltip ) {
654 - tooltip.remove();
655 - });
 661+ $tooltip.remove();
 662+ } );
 663+ setTimeout( function() {
 664+ $tooltip.fadeOut( function(){
 665+ $tooltip.remove();
 666+ } );
656667 }, 1500 );
657668
658669 }
Index: trunk/extensions/MoodBar/MoodBar.php
@@ -189,6 +189,7 @@
190190 'scripts' => 'ext.moodBar.dashboard/ext.moodBar.dashboard.js',
191191 'dependencies' => array(
192192 'mediawiki.util',
 193+ 'jquery.concurrency',
193194 'user.tokens',
194195 'jquery.NobleCount',
195196 'jquery.elastic'

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108271added needed assets and function to load tooltip for response concurrency not...rmoen19:34, 6 January 2012

Comments

#Comment by Catrope (talk | contribs)   17:53, 11 January 2012

This is OK, but let's disable the concurrency stuff for now.

Status & tagging log