r91051 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91050‎ | r91051 | r91052 >
Date:04:18, 29 June 2011
Author:kaldari
Status:ok (Comments)
Tags:needs-js-test 
Comment:
finishing fix for bug 29624 per comments
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
@@ -229,17 +229,25 @@
230230 };
231231 }
232232 if( currentTypeOrSubtype !== null ) {
233 - if( !currentTypeOrSubtype.header || $( '#mw-wikilove-header' ).val() != currentTypeOrSubtype.header ) {
234 - rememberData.header = $( '#mw-wikilove-header' ).val();
 233+ if( $.inArray( 'header', currentTypeOrSubtype.fields ) >= 0 &&
 234+ ( !currentTypeOrSubtype.header || $( '#mw-wikilove-header' ).val() != currentTypeOrSubtype.header ) )
 235+ {
 236+ rememberData.header = $( '#mw-wikilove-header' ).val();
235237 }
236 - if( !currentTypeOrSubtype.title || $( '#mw-wikilove-title' ).val() != currentTypeOrSubtype.title ) {
237 - rememberData.title = $( '#mw-wikilove-title' ).val();
 238+ if( $.inArray( 'title', currentTypeOrSubtype.fields ) >= 0 &&
 239+ ( !currentTypeOrSubtype.title || $( '#mw-wikilove-title' ).val() != currentTypeOrSubtype.title ) )
 240+ {
 241+ rememberData.title = $( '#mw-wikilove-title' ).val();
238242 }
239 - if( !currentTypeOrSubtype.message || $( '#mw-wikilove-message' ).val() != currentTypeOrSubtype.message ) {
 243+ if( $.inArray( 'message', currentTypeOrSubtype.fields ) >= 0 &&
 244+ ( !currentTypeOrSubtype.message || $( '#mw-wikilove-message' ).val() != currentTypeOrSubtype.message ) )
 245+ {
240246 rememberData.message = $( '#mw-wikilove-message' ).val();
241247 }
242 - if( typeof currentTypeOrSubtype.gallery == undefined && $.inArray( 'image', currentTypeOrSubtype.fields ) >= 0 ) {
243 - rememberData.image = $( '#mw-wikilove-image' ).val();
 248+ if( typeof currentTypeOrSubtype.gallery == 'undefined' && $.inArray( 'image', currentTypeOrSubtype.fields ) >= 0 &&
 249+ ( !currentTypeOrSubtype.image || $( '#mw-wikilove-image' ).val() != currentTypeOrSubtype.image ) )
 250+ {
 251+ rememberData.image = $( '#mw-wikilove-image' ).val();
244252 }
245253 }
246254 },

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90961Entered input is now remembered when selecting a different type or subtype, f...janpaul12314:35, 28 June 2011

Comments

#Comment by Krinkle (talk | contribs)   17:48, 29 June 2011

Although there isn't a huge amount of stuff, this is one the things that could benefit from a unit test probably. Tagging for later (ie. after July) when extensions are hopefully supported in our qunit set up.

Status & tagging log