r102555 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102554‎ | r102555 | r102556 >
Date:18:29, 9 November 2011
Author:neilk
Status:ok
Tags:
Comment:
check for fileApi more thoroughly, to fix Safari isues
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.fileApi.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js
@@ -19,7 +19,7 @@
2020 _this.previewLoaded = false;
2121
2222 _this.$fileInputCtrl = $j( '<input size="1" class="mwe-upwiz-file-input" name="file" type="file"/>' );
23 - if( mw.UploadWizard.config['enableMultiFileSelect'] ) {
 23+ if( mw.fileApi.isAvailable() && mw.UploadWizard.config['enableMultiFileSelect'] ) {
2424 _this.$fileInputCtrl.attr( 'multiple', '1' );
2525 }
2626
Index: trunk/extensions/UploadWizard/resources/mw.fileApi.js
@@ -32,8 +32,9 @@
3333 * @todo is there a way to check this instead of hardcoding browsers and version?
3434 */
3535 isSliceAvailable: function() {
36 - return ($j.browser.mozilla && $j.browser.version >= '5.0') ||
37 - ($j.browser.webkit && $j.browser.version >= '534.28');
 36+ return mw.fileApi.isAvailable() &&
 37+ ( ($j.browser.mozilla && $j.browser.version >= '5.0') ||
 38+ ($j.browser.webkit && $j.browser.version >= '534.28') );
3839 }
3940
4041

Status & tagging log