r84530 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84529‎ | r84530 | r84531 >
Date:14:42, 22 March 2011
Author:catrope
Status:ok
Tags:
Comment:
1.17wmf1: MFT r84474, r84529
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.css (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js
@@ -33,9 +33,11 @@
3434 <button class="articleFeedback-submit articleFeedback-visibleWith-form" type="submit" disabled><html:msg key="form-panel-submit" /></button>\
3535 <div class="articleFeedback-success articleFeedback-visibleWith-form"><span><html:msg key="form-panel-success" /></span></div>\
3636 <div style="clear:both;"></div>\
37 - <div class="articleFeedback-expiry articleFeedback-visibleWith-form">\
38 - <div class="articleFeedback-expiry-title"><html:msg key="form-panel-expiry-title" /></div>\
39 - <div class="articleFeedback-expiry-message"><html:msg key="form-panel-expiry-message" /></div>\
 37+ <div class="articleFeedback-notices articleFeedback-visibleWith-form">\
 38+ <div class="articleFeedback-expiry">\
 39+ <div class="articleFeedback-expiry-title"><html:msg key="form-panel-expiry-title" /></div>\
 40+ <div class="articleFeedback-expiry-message"><html:msg key="form-panel-expiry-message" /></div>\
 41+ </div>\
4042 </div>\
4143 </div>\
4244 <div class="articleFeedback-error"><div class="articleFeedback-error-message"><html:msg key="error" /></div></div>\
@@ -142,8 +144,14 @@
143145 } ),
144146 'success': function( data ) {
145147 var context = this;
146 - $.articleFeedback.fn.load.call( context );
147 - context.$ui.find( '.articleFeedback-lock' ).hide();
 148+ if ( 'error' in data ) {
 149+ mw.log( 'Form submission error' );
 150+ mw.log( data.error );
 151+ context.$ui.find( '.articleFeedback-error' ).show();
 152+ } else {
 153+ $.articleFeedback.fn.load.call( context );
 154+ context.$ui.find( '.articleFeedback-lock' ).hide();
 155+ }
148156 },
149157 'error': function() {
150158 var context = this;
@@ -596,7 +604,7 @@
597605 var context = $(this).data( 'articleFeedback-context' );
598606 if ( !context ) {
599607 // Create context
600 - context = { '$ui': $(this), 'options': { 'ratings': {}, 'pitches': {}, 'bucket': 0 } };
 608+ context = { '$ui': $(this), 'options': { 'ratings': {}, 'pitches': {}, 'bucket': 1 } };
601609 // Allow customization through an options argument
602610 if ( typeof args[0] === 'object' ) {
603611 context = $.extend( true, context, { 'options': args[0] } );
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.css
@@ -23,6 +23,7 @@
2424 display: none;
2525 position: absolute;
2626 top: 0;
 27+ bottom: 0;
2728 left: 0;
2829 right: 0;
2930 background-color: #f9f9f9;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84474* Added error handling on submit failure...tparscal18:57, 21 March 2011
r84529* Bucket was set to 0 by default, but API gives warning if bucket is less tha...tparscal14:38, 22 March 2011

Status & tagging log