Permalink
Browse files

IE10 fixes.

  • Loading branch information...
1 parent f922683 commit f890ebdebc81fdd7c9c6202f575552c5003cc8f7 @pwnall pwnall committed Jan 6, 2013
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<!-- vim: set tabstop=2 shiftwidth=2 softtabstop=2 expandtab : -->
-<html>
+<html lang="en">
<head>
<title>Checkbox - dropbox.js Sample Application</title>
<link rel="icon" type="image/png" href="images/icon16.png" />
View
@@ -31,15 +31,19 @@ else
if typeof Uint8Array is 'undefined'
DropboxXhrArrayBufferView = null
else
- DropboxXhrArrayBufferView =
- (new Uint8Array(0)).__proto__.__proto__.constructor
+ if Object.getPrototypeOf
+ DropboxXhrArrayBufferView = Object.getPrototypeOf(
+ Object.getPrototypeOf(new Uint8Array(0))).constructor
+ else if Object.__proto__
+ DropboxXhrArrayBufferView =
+ (new Uint8Array(0)).__proto__.__proto__.constructor
# Dispatches low-level AJAX calls (XMLHttpRequests).
class Dropbox.Xhr
# The object used to perform AJAX requests (XMLHttpRequest).
@Request = DropboxXhrRequest
# Set to true when using the XDomainRequest API.
- @ieMode = DropboxXhrIeMode
+ @ieXdr = DropboxXhrIeMode
# Set to true if the platform has proper support for FormData.
@canSendForms = DropboxXhrCanSendForms
# Set to true if the platform performs CORS preflight checks.
@@ -115,7 +119,7 @@ class Dropbox.Xhr
# used to sign the request
# @return {Dropbox.Xhr} this, for easy call chaining
signWithOauth: (oauth) ->
- if Dropbox.Xhr.ieMode or (Dropbox.Xhr.doesPreflight and (not @preflight))
+ if Dropbox.Xhr.ieXdr or (Dropbox.Xhr.doesPreflight and (not @preflight))
@addOauthParams oauth
else
@addOauthHeader oauth
@@ -290,16 +294,16 @@ class Dropbox.Xhr
#
# @return {Dropbox.Xhr} this, for easy call chaining
prepare: ->
- ieMode = Dropbox.Xhr.ieMode
- if @isGet or @body isnt null or ieMode
+ ieXdr = Dropbox.Xhr.ieXdr
+ if @isGet or @body isnt null or ieXdr
@paramsToUrl()
if @body isnt null and typeof @body is 'string'
@headers['Content-Type'] = 'text/plain; charset=utf8'
else
@paramsToBody()
@xhr = new Dropbox.Xhr.Request()
- if ieMode
+ if ieXdr
@xhr.onload = => @onXdrLoad()
@xhr.onerror = => @onXdrError()
@xhr.ontimeout = => @onXdrError()
@@ -310,7 +314,7 @@ class Dropbox.Xhr
@xhr.onreadystatechange = => @onReadyStateChange()
@xhr.open @method, @url, true
- unless ieMode
+ unless ieXdr
for own header, value of @headers
@xhr.setRequestHeader header, value
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
<meta charset="utf-8">
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
<script type="text/javascript">
(function() {
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
<script src="/lib/dropbox.js"></script>
<script src="/test/.token/token.js"></script>
Oops, something went wrong. Retry.

0 comments on commit f890ebd

Please sign in to comment.