r104642 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104641‎ | r104642 | r104643 >
Date:01:37, 30 November 2011
Author:rmoen
Status:ok (Comments)
Tags:
Comment:
added preview mode for responses, allow wikitext, add response icons / language text
Modified paths:
  • /trunk/extensions/MoodBar/MoodBar.i18n.php (modified) (history)
  • /trunk/extensions/MoodBar/MoodBar.php (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.css (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/response-error.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/response-success.png (added) (history)
  • /trunk/extensions/MoodBar/modules/jquery.elastic (added) (history)
  • /trunk/extensions/MoodBar/modules/jquery.elastic/jquery.elastic.js (added) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/MoodBar.i18n.php
@@ -37,7 +37,7 @@
3838 'moodbar-respond-expanded' => '▼', // Ignore, do not translate. ▼
3939 'moodbar-respond-text' => 'Respond to this',
4040 'moodbar-response-add' => 'Add a response',
41 - 'moodbar-response-nosig' => 'signature not required',
 41+ 'moodbar-response-desc' => 'Response will reference original comment. Signature not required.',
4242 'moodbar-response-btn' => 'Send response',
4343 'moodbar-what-content' => 'This feature is designed to help the community understand the experience of people editing the site.
4444 For more information, please visit the $1.',
@@ -139,6 +139,16 @@
140140 'moodbar-response-gfdl' => 'GFDL',
141141 'moodbar-response-gfdl-link' => 'http://www.gnu.org/copyleft/fdl.html',
142142 'feedbackresponse-success' => 'Thank you. Your response was added to the user\'s talk page.',
 143+ 'response-back-text' => 'Back',
 144+ 'response-preview-text' => 'Preview',
 145+ 'response-ajax-action-head' => 'Responding...',
 146+ 'response-ajax-action-body' => 'Your response is being added.',
 147+ 'response-ajax-success-head' => 'Thanks!',
 148+ 'response-ajax-success-body' => 'Your response has been added.',
 149+ 'response-ajax-error-head' => 'Oops!',
 150+ 'response-ajax-error-body' => 'There was an error adding your response. <br />Please try again later.',
 151+
 152+
143153 );
144154
145155 /** Message documentation (Message documentation)
@@ -253,6 +263,24 @@
254264 'moodbar-response-gfdl' => '{{optional}}
255265 GFDL Text',
256266 'feedbackresponse-success' => 'Text for successful feedback response',
 267+ 'moodbar-action-reason' => 'Text for Admin action reason',
 268+ 'moodbar-action-reason-required' => 'Text explaining admin action reason is required',
 269+ 'moodbar-feedback-action-confirm' => 'Text for admin action confirm button',
 270+ 'moodbar-feedback-action-cancel' => 'Text for admin action cancel button',
 271+ 'moodbar-respond-text' => 'Text for Response toggle',
 272+ 'moodbar-respond-collapsed' => 'Special character for response form collapsed',
 273+ 'moodbar-respond-expanded' => 'Special character for response form expanded',
 274+ 'moodbar-response-add' => 'Text for Response heading',
 275+ 'moodbar-response-desc' => 'Text explaining signature is not required, and indicating that the original feedback will be referenced in response',
 276+ 'moodbar-response-btn' => 'Text for Response button',
 277+ 'response-back-text' => 'Text for response preview back button',
 278+ 'response-preview-text' => 'Text for preview response preview button',
 279+ 'response-ajax-action-head' => 'Text for ajax status heading while request is being made',
 280+ 'response-ajax-action-body' => 'Text for ajax status body while request is being made (can be html)',
 281+ 'response-ajax-success-head' => 'Text for ajax status heading on successful response',
 282+ 'response-ajax-success-body' => 'Text for ajax status body on successful response (can be html)',
 283+ 'response-ajax-error-head' => 'Text for ajax status heading on error',
 284+ 'response-ajax-error-body' => 'Text for ajax status body on error (can be html)',
257285 );
258286
259287 /** Afrikaans (Afrikaans)
Index: trunk/extensions/MoodBar/modules/jquery.elastic/jquery.elastic.js
@@ -0,0 +1,164 @@
 2+/**
 3+* @name Elastic
 4+* @descripton Elastic is jQuery plugin that grow and shrink your textareas automatically
 5+* @version 1.6.10
 6+* @requires jQuery 1.2.6+
 7+*
 8+* @author Jan Jarfalk
 9+* @author-email jan.jarfalk@unwrongest.com
 10+* @author-website http://www.unwrongest.com
 11+*
 12+* @licence MIT License - http://www.opensource.org/licenses/mit-license.php
 13+*
 14+* This file has been downloaded from http://unwrongest.com/projects/elastic/, please notify the author of
 15+* any changes.
 16+*/
 17+
 18+(function(jQuery){
 19+ jQuery.fn.extend({
 20+ elastic: function() {
 21+
 22+ // We will create a div clone of the textarea
 23+ // by copying these attributes from the textarea to the div.
 24+ var mimics = [
 25+ 'paddingTop',
 26+ 'paddingRight',
 27+ 'paddingBottom',
 28+ 'paddingLeft',
 29+ 'fontSize',
 30+ 'lineHeight',
 31+ 'fontFamily',
 32+ 'width',
 33+ 'fontWeight',
 34+ 'border-top-width',
 35+ 'border-right-width',
 36+ 'border-bottom-width',
 37+ 'border-left-width',
 38+ 'borderTopStyle',
 39+ 'borderTopColor',
 40+ 'borderRightStyle',
 41+ 'borderRightColor',
 42+ 'borderBottomStyle',
 43+ 'borderBottomColor',
 44+ 'borderLeftStyle',
 45+ 'borderLeftColor'
 46+ ];
 47+
 48+ return this.each( function() {
 49+
 50+ // Elastic only works on textareas
 51+ if ( this.type !== 'textarea' ) {
 52+ return false;
 53+ }
 54+
 55+ var $textarea = jQuery(this),
 56+ $twin = jQuery('<div />').css({'position': 'absolute','display':'none','word-wrap':'break-word'}),
 57+ lineHeight = parseInt($textarea.css('line-height'),10) || parseInt($textarea.css('font-size'),'10'),
 58+ minheight = parseInt($textarea.css('height'),10) || lineHeight*3,
 59+ maxheight = parseInt($textarea.css('max-height'),10) || Number.MAX_VALUE,
 60+ goalheight = 0;
 61+
 62+ // Opera returns max-height of -1 if not set
 63+ if (maxheight < 0) { maxheight = Number.MAX_VALUE; }
 64+
 65+ // Append the twin to the DOM
 66+ // We are going to meassure the height of this, not the textarea.
 67+ $twin.appendTo($textarea.parent());
 68+
 69+ // Copy the essential styles (mimics) from the textarea to the twin
 70+ var i = mimics.length;
 71+ while(i--){
 72+ $twin.css(mimics[i].toString(),$textarea.css(mimics[i].toString()));
 73+ }
 74+
 75+ // Updates the width of the twin. (solution for textareas with widths in percent)
 76+ function setTwinWidth(){
 77+ curatedWidth = Math.floor(parseInt($textarea.width(),10));
 78+ if($twin.width() !== curatedWidth){
 79+ $twin.css({'width': curatedWidth + 'px'});
 80+
 81+ // Update height of textarea
 82+ update(true);
 83+ }
 84+ }
 85+
 86+ // Sets a given height and overflow state on the textarea
 87+ function setHeightAndOverflow(height, overflow){
 88+
 89+ var curratedHeight = Math.floor(parseInt(height,10));
 90+ if($textarea.height() !== curratedHeight){
 91+ $textarea.css({'height': curratedHeight + 'px','overflow':overflow});
 92+
 93+ // Fire the custom event resize
 94+ //$textarea.trigger('resize');
 95+
 96+ }
 97+ }
 98+
 99+ // This function will update the height of the textarea if necessary
 100+ function update(forced) {
 101+
 102+ // Get curated content from the textarea.
 103+ var textareaContent = $textarea.val().replace(/&/g,'&amp;').replace(/ {2}/g, '&nbsp;').replace(/<|>/g, '&gt;').replace(/\n/g, '<br />');
 104+
 105+ // Compare curated content with curated twin.
 106+ var twinContent = $twin.html().replace(/<br>/ig,'<br />');
 107+
 108+ if(forced || textareaContent+'&nbsp;' !== twinContent){
 109+
 110+ // Add an extra white space so new rows are added when you are at the end of a row.
 111+ $twin.html(textareaContent+'&nbsp;');
 112+
 113+ // Change textarea height if twin plus the height of one line differs more than 3 pixel from textarea height
 114+ if(Math.abs($twin.height() + lineHeight - $textarea.height()) > 3){
 115+
 116+ var goalheight = $twin.height()+lineHeight;
 117+ if(goalheight >= maxheight) {
 118+ setHeightAndOverflow(maxheight,'auto');
 119+ } else if(goalheight <= minheight) {
 120+ setHeightAndOverflow(minheight,'hidden');
 121+ } else {
 122+ setHeightAndOverflow(goalheight,'hidden');
 123+ }
 124+
 125+ }
 126+
 127+ }
 128+
 129+ }
 130+
 131+ // Hide scrollbars
 132+ $textarea.css({'overflow':'hidden'});
 133+
 134+ // Update textarea size on keyup, change, cut and paste
 135+ $textarea.bind('keyup change cut paste', function(){
 136+ update();
 137+ });
 138+
 139+ // Update width of twin if browser or textarea is resized (solution for textareas with widths in percent)
 140+ $(window).bind('resize', setTwinWidth);
 141+ $textarea.bind('resize', setTwinWidth);
 142+ $textarea.bind('update', update);
 143+
 144+ // Compact textarea on blur
 145+ $textarea.bind('blur',function(){
 146+ if($twin.height() < maxheight){
 147+ if($twin.height() > minheight) {
 148+ $textarea.height($twin.height());
 149+ } else {
 150+ $textarea.height(minheight);
 151+ }
 152+ }
 153+ });
 154+
 155+ // And this line is to catch the browser paste event
 156+ $textarea.bind('input paste',function(e){ setTimeout( update, 250); });
 157+
 158+ // Run update once when elastic is initialized
 159+ update();
 160+
 161+ });
 162+
 163+ }
 164+ });
 165+})(jQuery);
\ No newline at end of file
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.css
@@ -138,6 +138,11 @@
139139 position: static;
140140 }
141141
 142+.mw-ajax-loader {
 143+ /* Undo padding due to it destroying the layout for inline response */
 144+ padding:8px 16px 0px 16px !important;
 145+}
 146+
142147 /* The images here are named -ltr instead of -left and -rtl instead of -right
143148 * because ResourceLoader flips -ltr and -rtl in URLs, but not -left and -right
144149 */
@@ -179,7 +184,6 @@
180185 position: relative;
181186 margin-top:0.5em;
182187 margin-bottom:0.5em;
183 -
184188 padding:0;
185189 }
186190
@@ -211,6 +215,45 @@
212216 background-image: url(images/emoticon-sad.png);
213217 }
214218
 219+.fbd-ajax-response {
 220+ padding:1.5em 2em;
 221+}
 222+
 223+.fbd-ajax-response div {
 224+}
 225+
 226+.fbd-item-response-icon {
 227+ float:left;
 228+ display:block;
 229+ height:56px;
 230+ width:56px;
 231+ background-position: center center;
 232+ background-repeat: no-repeat;
 233+ padding:8px 16px;
 234+ position: relative;
 235+ top: -16px;
 236+}
 237+
 238+.fbd-item-response-success {
 239+ background-image: url(images/response-success.png);
 240+
 241+}
 242+
 243+.fbd-item-response-error {
 244+ background-image: url(images/response-error.png);
 245+}
 246+
 247+.fbd-ajax-response > div > .fbd-ajax-heading {
 248+ font-size:1.5em;
 249+ font-weight:bold;
 250+ display:block;
 251+}
 252+
 253+.fbd-ajax-response > div > .fbd-ajax-text {
 254+ color:#262626;
 255+ display:block;
 256+}
 257+
215258 .fbd-item-userName {
216259 font-size: 1.2em;
217260 margin: 0;
@@ -233,6 +276,22 @@
234277 min-height:40px;
235278 }
236279
 280+.fbd-response-text {
 281+ height:5em;
 282+ overflow:hidden;
 283+}
 284+
 285+.fbd-response-preview-spinner {
 286+ height:32px;
 287+ line-height:32px;
 288+}
 289+
 290+.fbd-response-wikitext{
 291+ background-color: #FDFFE7;
 292+ border: 1px solid #FCEB92;
 293+ padding:5px;
 294+}
 295+
237296 .fbd-item-permalink,
238297 .fbd-item-show,
239298 .fbd-item-hide,
@@ -263,14 +322,14 @@
264323 .fbd-response-form b {
265324 font-size:1em;
266325 }
267 -.fbd-response-form small{
 326+.fbd-response-form small, .fbd-response-form .small{
268327 font-size:0.8em;
269328 color:#262626;
270329 }
271330 .fbd-response-formNote {
272331 float:right;
273332 }
274 -.fbd-response-submit {
 333+.fbd-response-submit, .fbd-response-preview {
275334 float:right;
276335 }
277336 .center {
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js
@@ -404,17 +404,17 @@
405405
406406 //ULA
407407 var ula = mw.msg( 'moodbar-response-ula' )
408 - .replace ( /\$1/, mw.msg( 'moodbar-response-btn') )
409 - .replace ( /\$2/, termsofuse)
410 - .replace ( /\$3/, creativecommons)
411 - .replace ( /\$4/, gfdl);
 408+ .replace ( /\$1/g, mw.msg( 'moodbar-response-btn') )
 409+ .replace ( /\$2/g, termsofuse)
 410+ .replace ( /\$3/g, creativecommons)
 411+ .replace ( /\$4/g, gfdl);
412412
413413 //build form
414414 var inlineForm = $('<div>').attr( 'class', 'fbd-response-form' )
415415 .append(
416416 $('<b>').text( mw.msg( 'moodbar-response-add' ) )
417417 ).append(
418 - $('<small>').attr( 'class', 'fbd-text-gray' ).text( ' (' + mw.msg( 'moodbar-response-nosig' ) + ') ' )
 418+ $('<small>').attr( 'class', 'fbd-text-gray' ).text( ' (' + mw.msg( 'moodbar-response-desc' ) + ') ' )
419419 ).append(
420420 $('<div>').attr( 'class', 'fbd-response-formNote' )
421421 .append($('<small>')
@@ -427,11 +427,25 @@
428428 ).append(
429429 $('<textarea>').attr( { 'class':'fbd-response-text', 'name':'fbd-response-text' } )
430430 ).append(
431 - $('<div>').attr('class', 'ula').html( ula )
 431+ $('<div />').attr('class', 'fbd-response-preview-spinner')
 432+ .append($('<span />').attr('class', 'mw-ajax-loader')
 433+ //hack the .mw-ajax-loader styles beacuse they are horrible for reuse
 434+ .css({ 'top':'0px','padding':'16px', 'display':'block', 'width':'32px' }).html('&nbsp;')
 435+ ).hide()
432436 ).append(
 437+ $('<div />').attr('class', 'fbd-response-preview-block')
 438+ .append(
 439+ $('<div />').attr('class', 'fbd-response-wikitext').hide())
 440+ .append(
 441+ $('<div>').attr('class', 'ula small').html( ula ).hide())
 442+ ).append(
433443 $('<button>').attr( 'class', 'fbd-response-submit' ).text( mw.msg( 'moodbar-response-btn' ) + ' ' + mw.msg( 'moodbar-respond-collapsed' ) )
434 - .attr({'disabled':'true'})
 444+ .attr( 'disabled', 'true' ).hide()
435445 ).append(
 446+ $('<button>').attr('class', 'fbd-response-preview-back').text( mw.msg( 'response-back-text' ) ).hide()
 447+ ).append(
 448+ $('<button>').attr( 'class', 'fbd-response-preview').text ( mw.msg( 'response-preview-text' ) ).attr( 'disabled', 'true' )
 449+ ).append(
436450 $('<div>').attr( 'style', 'clear:both' )
437451 );
438452
@@ -453,72 +467,71 @@
454468 .keyup( function(event) {
455469 validateResponse($item);
456470 })
 471+ .elastic()
457472 .end()
458 - .find('.fbd-response-submit')
 473+ .find('.fbd-response-preview')
459474 .click (function () {
460 - var fbResponse = $item.find('.fbd-response-text').val();
461 - if( fbResponse ){
462 - var clientData = $.client.profile(),
463 - item_id = $item.data('mbccontinue').split('|')[1],
464 - resData = {
465 - 'action':'feedbackdashboardresponse',
466 - 'useragent': clientData.name + '/' + clientData.versionNumber,
467 - 'system': clientData.platform,
468 - 'token': mw.config.get('mbEditToken'),
469 - 'response': fbResponse,
470 - 'feedback': item_id,
471 - 'format':'json'
472 - };
473 - $item.find('.fbd-item-response').remove(); //remove feedback response link for duration of request
474 - var $spinner = $('<span class="mw-ajax-loader">&nbsp;</span>');
475 - $responseForm = $item.find('.fbd-response-form').empty().append( $spinner );
476 -
477 - //send response
478 - $.ajax( {
479 - 'type': 'POST',
480 - 'url': mw.util.wikiScript( 'api' ),
481 - 'data': resData,
482 - 'success': function (data) {
483 - inlineMessage($responseForm, mw.msg( 'feedbackresponse-success' ), function() {
484 - closeAllResponders();
485 - reloadItem( $item, true );
486 - });
487 - },
488 - 'error': function( jqXHR, textStatus, errorThrown ) {
489 - //ajax error
490 - inlineMessage($responseForm, mw.msg( 'moodbar-feedback-ajaxerror' ), function() {
491 - closeAllResponders();
492 - reloadItem( $item, true );
493 - });
494 -
495 - },
496 - 'dataType': 'json'
497 - } );
498 -
499 - }
500 - })
501 - .end();
 475+ //toggle preview
 476+ $item = $(this).parent().parent();
 477+ $item.find('.fbd-response-preview, .fbd-response-text').hide();
 478+ $item.find('.fbd-response-submit, .fbd-response-preview-back, .ula').show();
 479+ var wikitext = $item.find('.fbd-response-text').val();
 480+ wikitext = wikitext.replace(/~{3,5}/g, '') + "\n\n~~~~"; //remove and add signature for
 481+ parseWikiText($item, wikitext);
 482+ });
502483 }
503484 e.preventDefault();
504 -
505485 }
506 -
 486+
 487+ function parseWikiText($item, wikitext) {
 488+ $item.find('.fbd-response-preview-spinner').show();
 489+ $.ajax({
 490+ url: mw.util.wikiScript( 'api' ),
 491+ data: {
 492+ 'action': 'parse',
 493+ 'title': mw.config.get( 'wgPageName' ),
 494+ 'format': 'json',
 495+ 'text': wikitext,
 496+ 'prop': 'text',
 497+ 'pst': true
 498+ },
 499+ dataType: 'json',
 500+ type: 'POST',
 501+ success: function( data ) {
 502+ $item
 503+ .find('.fbd-response-preview-spinner') //fadeout spinner
 504+ .hide()
 505+ .end()
 506+ .find('.fbd-response-wikitext')
 507+ .html( data.parse.text['*'] )
 508+ .fadeIn()
 509+ .end();
 510+ },
 511+ error: function() {
 512+ //handle error
 513+ //fadeout spinner
 514+ }
 515+ });
 516+ }
 517+
507518 /**
508 - * Toggle submit button from enabled to disabled
 519+ * Toggle submit / preview button from enabled to disabled
509520 * Depends on value of .fbd-response-text
510521 * @param $item jQuery item containing the .fbd-item
 522+ * Require at least 1 character and limit to 5000
511523 */
512524 function validateResponse($item) {
513 - if( $item.find('.fbd-response-text').val() !== "" ) {
514 - $item.find( '.fbd-response-submit').removeAttr('disabled');
 525+ var response = $item.find('.fbd-response-text').val();
 526+ if( response.length > 0 && response.length <= 5000 ) {
 527+ $item.find( '.fbd-response-submit, .fbd-response-preview').removeAttr('disabled');
515528 } else {
516 - $item.find( '.fbd-response-submit').attr({'disabled':'true'});
 529+ $item.find( '.fbd-response-submit, .fbd-response-preview').attr({'disabled':'true'});
517530 }
518531 }
519532
520533 /**
521 - * Send Message to item in regards with response
522 - * @param $el Element to display message inside of and fadeout
 534+ * Generic inline message, with fadeout
 535+ * @param $el Element to display message inside
523536 * @param msg text to display
524537 * @callback to execute after fadeOut
525538 */
@@ -529,7 +542,6 @@
530543 .fadeOut('slow', callback);
531544 }
532545
533 -
534546 // On-load stuff
535547
536548 $('.fbd-item-show a').live( 'click', showHiddenItem );
@@ -540,6 +552,80 @@
541553
542554 $('.fbd-respond-link').live ('click', showResponseForm );
543555
 556+ //handle preview back button
 557+ $('.fbd-response-preview-back').live('click', function(){
 558+ $item = $(this).parent().parent();
 559+ $item.find('.fbd-response-submit, .fbd-response-wikitext, .fbd-response-preview-back, .ula').hide();
 560+ $item.find('.fbd-response-preview, .fbd-response-text').show();
 561+ });
 562+
 563+ //handle response submit
 564+ $('.fbd-response-submit').live('click', function () {
 565+ $item = $(this).parent().parent();
 566+ var fbResponse = $item.find('.fbd-response-text').val();
 567+ if( fbResponse ){
 568+ var clientData = $.client.profile(),
 569+ item_id = $item.data('mbccontinue').split('|')[1],
 570+ resData = {
 571+ 'action':'feedbackdashboardresponse',
 572+ 'useragent': clientData.name + '/' + clientData.versionNumber,
 573+ 'system': clientData.platform,
 574+ 'token': mw.config.get('mbEditToken'),
 575+ 'response': fbResponse,
 576+ 'feedback': item_id,
 577+ 'format':'json'
 578+ };
 579+
 580+ var $responseStatus = $('<div />').attr('class', 'fbd-ajax-response')
 581+ .append($('<span />').attr('class','mw-ajax-loader fbd-item-response-icon').html('&nbsp;') )
 582+ .append($('<div />')
 583+ .append($('<span />').attr('class', 'fbd-ajax-heading').text( mw.msg( 'response-ajax-action-head' ) ) )
 584+ .append($('<span />').attr('class', 'fbd-ajax-text').text( mw.msg( 'response-ajax-action-body' ) ) )
 585+ );
 586+
 587+ $responseForm = $item.find('.fbd-response-form');
 588+ $responseForm.empty().append( $responseStatus );
 589+
 590+ //send response
 591+ $.ajax( {
 592+ 'type': 'POST',
 593+ 'url': mw.util.wikiScript( 'api' ),
 594+ 'data': resData,
 595+ 'success': function (data) {
 596+ $responseForm
 597+ .find('.mw-ajax-loader')
 598+ .addClass('fbd-item-response-success')
 599+ .removeClass('mw-ajax-loader')
 600+ .end()
 601+ .find('.fbd-ajax-heading')
 602+ .text( mw.msg( 'response-ajax-success-head' ) )
 603+ .end()
 604+ .find('.fbd-ajax-text')
 605+ .html( mw.msg( 'response-ajax-success-body') )
 606+ .end();
 607+ setTimeout(function(){
 608+ reloadItem($item, true);
 609+ }, 5000);
 610+
 611+ },
 612+ 'error': function( jqXHR, textStatus, errorThrown ) {
 613+ $responseForm
 614+ .find('.mw-ajax-loader')
 615+ .addClass('fbd-item-response-error')
 616+ .removeClass('mw-ajax-loader')
 617+ .end()
 618+ .find('.fbd-ajax-heading')
 619+ .text( mw.msg( 'response-ajax-error-head' ) )
 620+ .end()
 621+ .find('.fbd-ajax-text')
 622+ .html( mw.msg( 'response-ajax-error-body' ) );
 623+ },
 624+ 'dataType': 'json'
 625+ } );
 626+
 627+ }
 628+ });
 629+
544630 $( '#fbd-filters' ).children( 'form' ).submit( function( e ) {
545631 e.preventDefault();
546632 saveFormState();
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/response-success.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/response-success.png
___________________________________________________________________
Added: svn:mime-type
547633 + application/octet-stream
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/response-error.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/response-error.png
___________________________________________________________________
Added: svn:mime-type
548634 + application/octet-stream
Index: trunk/extensions/MoodBar/MoodBar.php
@@ -148,7 +148,8 @@
149149 'scripts' => 'ext.moodBar.dashboard/ext.moodBar.dashboard.js',
150150 'dependencies' => array(
151151 'mediawiki.util',
152 - 'jquery.NobleCount'
 152+ 'jquery.NobleCount',
 153+ 'jquery.elastic'
153154 ),
154155 'messages' => array(
155156 'moodbar-feedback-nomore',
@@ -163,7 +164,7 @@
164165 'moodbar-respond-collapsed',
165166 'moodbar-respond-expanded',
166167 'moodbar-response-add',
167 - 'moodbar-response-nosig',
 168+ 'moodbar-response-desc',
168169 'moodbar-response-btn',
169170 'moodbar-form-note-dynamic',
170171 'moodbar-response-ula',
@@ -174,6 +175,15 @@
175176 'moodbar-response-gfdl',
176177 'moodbar-response-gfdl-link',
177178 'feedbackresponse-success',
 179+ 'response-back-text',
 180+ 'response-preview-text',
 181+ 'response-preview-text',
 182+ 'response-ajax-action-head',
 183+ 'response-ajax-action-body',
 184+ 'response-ajax-success-head',
 185+ 'response-ajax-success-body',
 186+ 'response-ajax-error-head',
 187+ 'response-ajax-error-body',
178188 ),
179189 );
180190
@@ -188,6 +198,10 @@
189199 ),
190200 );
191201
 202+$wgResourceModules['jquery.elastic'] = $mbResourceTemplate + array(
 203+ 'scripts' => 'jquery.elastic/jquery.elastic.js'
 204+);
 205+
192206 /** Configuration **/
193207 /** The registration time after which users will be shown the MoodBar **/
194208 $wgMoodBarCutoffTime = null;

Follow-up revisions

RevisionCommit summaryAuthorDate
r104644followup to r104642 - Moodbar Phase 2 server side changebsitu01:42, 30 November 2011
r104720followup to r104642, revised language and response terms section, adjusted su...rmoen19:20, 30 November 2011
r104747Follow up to r104642, removed protocol from terms url in language filermoen21:02, 30 November 2011
r104748Make message (r104642) optional for Translatewiki. It seems there are current...raymond21:06, 30 November 2011
r107621Fix indenting from r104642tstarling06:06, 30 December 2011

Comments

#Comment by Catrope (talk | contribs)   20:47, 30 November 2011
+.fbd-ajax-response div {
+}
+

Empty block?

+.fbd-item-response-icon {
+	float:left;
+	display:block;
+	height:56px;
+	width:56px;
+    background-position: center center;
+    background-repeat: no-repeat;
+	padding:8px 16px;
+    position: relative;
+    top: -16px;
+}
+

Inconsistent indentation. Please also consistently use key: value; as opposed to key:value; .

+.fbd-item-response-success {
+	background-image: url(images/response-success.png);
+
+}
+ 
+.fbd-item-response-error {
+	background-image: url(images/response-error.png);
+}

Use /* @embed */ above each background-image rule to trigger ResourceLoader's data URI embedding.

OK otherwise, but please address these comments.

#Comment by Platonides (talk | contribs)   23:30, 28 December 2011

'Signature not required'? I suspect that should read 'The signature will be added automatically'.

Status & tagging log