r98571 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98570‎ | r98571 | r98572 >
Date:21:40, 30 September 2011
Author:neilk
Status:ok
Tags:
Comment:
manage disabledness via jquery ui, which means we also have to manage the label the same way or it gets reset. fix bug #30747
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -676,8 +676,8 @@
677677 // we have uploads ready to go, so allow us to proceed
678678 $j( '#mwe-upwiz-upload-ctrl-container' ).show();
679679
680 - // changes the "click here to add files" to "add another file"
681 - $j( '#mwe-upwiz-add-file span' ).msg( 'mwe-upwiz-add-file-n' );
 680+ // changes the initial centered invitation button to something like "add another file"
 681+ $j( '#mwe-upwiz-add-file' ).button( 'option', 'label', gM( 'mwe-upwiz-add-file-n' ) );
682682 $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-0');
683683 $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-n');
684684
@@ -693,10 +693,8 @@
694694 $j( '#mwe-upwiz-filelist .filled:even' ).removeClass( 'odd' );
695695 } else {
696696 // no uploads, so don't allow us to proceed
697 - // $j( '#mwe-upwiz-upload-ctrl' ).attr( 'disabled', 'disabled' );
698697 $j( '#mwe-upwiz-upload-ctrl-container' ).hide();
699698
700 -
701699 // remove the border from the filelist. We can't hide it or make it invisible since it contains the displaced
702700 // file input element that becomes the "click here to add"
703701 $j( '#mwe-upwiz-filelist' ).removeClass( 'mwe-upwiz-filled-filelist' );
@@ -704,8 +702,8 @@
705703 // we can't continue
706704 $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons' ).hide();
707705
708 - // change "add another file" into "click here to add a file"
709 - $j( '#mwe-upwiz-add-file span' ).msg( 'mwe-upwiz-add-file-0-free' );
 706+ // changes the button back from "add another file" to the initial centered invitation button
 707+ $j( '#mwe-upwiz-add-file' ).button( 'option', 'label', gM( 'mwe-upwiz-add-file-0-free' ) );
710708 $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-0');
711709 $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-n');
712710
@@ -737,11 +735,11 @@
738736
739737 // allow an "add another upload" button only if we aren't at max
740738 if ( _this.uploads.length < _this.maxUploads ) {
741 - $j( '#mwe-upwiz-add-file' ).removeAttr( 'disabled' );
 739+ $j( '#mwe-upwiz-add-file' ).button( 'option', 'disabled', false );
742740 $j( _this.uploadToAdd.ui.div ).show();
743741 _this.uploadToAdd.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
744742 } else {
745 - $j( '#mwe-upwiz-add-file' ).attr( 'disabled', true );
 743+ $j( '#mwe-upwiz-add-file' ).button( 'option', 'disabled', true );
746744 $j( _this.uploadToAdd.ui.div ).hide();
747745 }
748746

Status & tagging log