r91045 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91044‎ | r91045 | r91046 >
Date:02:01, 29 June 2011
Author:kaldari
Status:ok
Tags:
Comment:
making message field not required per latest discussion, adding error check on Send since we are doing just-in-time now
Modified paths:
  • /trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
@@ -330,12 +330,7 @@
331331 }
332332
333333 if( $.inArray( 'message', currentTypeOrSubtype.fields ) >= 0 ) {
334 - // Check for a message if it is required
335 - if ( $( '#mw-wikilove-message' ).val().length <= 0 ) {
336 - $.wikiLove.showAddDetailsError( 'wikilove-err-msg' ); return false;
337 - }
338 -
339 - // If there isn't a signature already in the message, throw an error
 334+ // If there's a signature already in the message, throw an error
340335 if ( $( '#mw-wikilove-message' ).val().indexOf( '~~~' ) >= 0 ) {
341336 $.wikiLove.showAddDetailsError( 'wikilove-err-sig' ); return false;
342337 }
@@ -501,6 +496,10 @@
502497 submitSend: function( e ) {
503498 e.preventDefault();
504499 $( '#mw-wikilove-dialog' ).find( '.mw-wikilove-error' ).remove();
 500+ // Check for a header if it is required
 501+ if( $.inArray( 'header', currentTypeOrSubtype.fields ) >= 0 && $( '#mw-wikilove-header' ).val().length <= 0 ) {
 502+ $.wikiLove.showAddDetailsError( 'wikilove-err-header' ); return false;
 503+ }
505504 var submitData = {
506505 'header': $( '#mw-wikilove-header' ).val(),
507506 'text': $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.defaultText ),

Status & tagging log