r111604 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111603‎ | r111604 | r111605 >
Date:00:52, 16 February 2012
Author:mah
Status:ok (Comments)
Tags:todo 
Comment:
Fixes Bug 34333 - multi file selection with FF10 fails
Patch from Rainer
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.fileApi.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.fileApi.js
@@ -32,9 +32,9 @@
3333 * @todo is there a way to check this instead of hardcoding browsers and version?
3434 */
3535 isSliceAvailable: function() {
36 - return mw.fileApi.isAvailable() &&
37 - ( ($j.browser.mozilla && $j.browser.version >= '5.0') ||
38 - ($j.browser.webkit && $j.browser.version >= '534.28') );
 36+ return mw.fileApi.isAvailable() &&
 37+ ( ($j.browser.mozilla && parseFloat($j.browser.version) >= 5.0) ||
 38+ ($j.browser.webkit && parseFloat($j.browser.version) >= 534.28) );
3939 }
4040
4141

Follow-up revisions

RevisionCommit summaryAuthorDate
r112164MFT r111604, r111796, r112153, r112160reedy23:31, 22 February 2012

Comments

#Comment by Brion VIBBER (talk | contribs)   22:04, 22 February 2012

I don't like the version checking particularly, this should probably be replaced with checks for exact interfaces unless there's a very specific undetectable bug that it's meant to find.

But this should fix the FF 10 issue for the moment.

#Comment by Krinkle (talk | contribs)   22:07, 22 February 2012

$.browser is deprecated by jQuery.

Use $.client.profile() instead:

$.browser
{
    "webkit": true,
    "version": "535.11",
    "safari": true
}
$.client.profile()
{
    "name": "chrome",
    "layout": "webkit",
    "layoutVersion": 535,
    "platform": "mac",
    "version": "17.0.963.56",
    "versionBase": "17",
    "versionNumber": 17
}

Where versionNumber is a ready to use integer that should help in the > 5 comparison as well.

#Comment by RobLa-WMF (talk | contribs)   23:08, 22 February 2012

Per Brion's comment, we need a capability check here, but not for now. That's probably not going to be up to mah to write a new capability-checking version anyway, so let's get this cleared out of our review queue.

Status & tagging log