ie8 fixes

This commit is contained in:
Tony Tam
2014-02-27 19:55:56 -08:00
parent 2a642f5a5f
commit 7b77ffd079
5 changed files with 222 additions and 194 deletions

15
dist/lib/swagger.js vendored
View File

@@ -1,5 +1,5 @@
// swagger.js
// version 2.0.21
// version 2.0.22
var __bind = function(fn, me){
return function(){
@@ -15,6 +15,15 @@ log = function(){
}
};
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(obj, start) {
for (var i = (start || 0), j = this.length; i < j; i++) {
if (this[i] === obj) { return i; }
}
return -1;
}
}
var SwaggerApi = function(url, options) {
this.url = null;
this.debug = false;
@@ -949,7 +958,7 @@ var SwaggerRequest = function(type, url, params, opts, successCallback, errorCal
}
}
responseContentType = null;
var responseContentType = null;
if (this.opts.responseContentType) {
responseContentType = this.opts.responseContentType;
} else {
@@ -1116,7 +1125,7 @@ JQueryHttpClient.prototype.execute = function(obj) {
headers: headers
};
var contentType = (response._headers["content-type"]||response._headers["Content-Type"]||null)
var contentType = (headers["content-type"]||headers["Content-Type"]||null)
if(contentType != null) {
if(contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {

11
dist/swagger-ui.js vendored
View File

@@ -62,9 +62,14 @@ function clippyCopiedCallback(a) {
}
// Logging function that accounts for browsers that don't have window.console
function log() {
if (window.console) console.log.apply(console,arguments);
}
log = function(){
log.history = log.history || [];
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};
// Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
if (Function.prototype.bind && console && typeof console.log == "object") {
[

View File

@@ -1,5 +1,5 @@
// swagger.js
// version 2.0.21
// version 2.0.22
var __bind = function(fn, me){
return function(){
@@ -15,6 +15,15 @@ log = function(){
}
};
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(obj, start) {
for (var i = (start || 0), j = this.length; i < j; i++) {
if (this[i] === obj) { return i; }
}
return -1;
}
}
var SwaggerApi = function(url, options) {
this.url = null;
this.debug = false;
@@ -949,7 +958,7 @@ var SwaggerRequest = function(type, url, params, opts, successCallback, errorCal
}
}
responseContentType = null;
var responseContentType = null;
if (this.opts.responseContentType) {
responseContentType = this.opts.responseContentType;
} else {
@@ -1116,7 +1125,7 @@ JQueryHttpClient.prototype.execute = function(obj) {
headers: headers
};
var contentType = (response._headers["content-type"]||response._headers["Content-Type"]||null)
var contentType = (headers["content-type"]||headers["Content-Type"]||null)
if(contentType != null) {
if(contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {

View File

@@ -19,7 +19,7 @@
"readmeFilename": "README.md",
"dependencies": {
"coffee-script": "~1.5.0",
"swagger-client": "2.0.21",
"swagger-client": "2.0.22",
"handlebars": "~1.0.10",
"less": "~1.4.2"
}

View File

@@ -62,9 +62,14 @@ function clippyCopiedCallback(a) {
}
// Logging function that accounts for browsers that don't have window.console
function log() {
if (window.console) console.log.apply(console,arguments);
}
log = function(){
log.history = log.history || [];
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};
// Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
if (Function.prototype.bind && console && typeof console.log == "object") {
[