From abcd97d51211d8a1145cad9227959b60c532c45b Mon Sep 17 00:00:00 2001 From: Greg MacLellan Date: Fri, 9 Nov 2012 17:06:18 -0500 Subject: [PATCH 1/2] Added doctype declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In IE in particular, not including a doctype causes it to do all sorts of ridiculous things, like rendering in IE5 quirks mode.  I am not sure why any developers would using IE, but my QA team found this and it's an easy enough fix and technically the right thing to do, so might as well fix it. --- src/main/html/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/html/index.html b/src/main/html/index.html index d78acc38..a94d8f7d 100644 --- a/src/main/html/index.html +++ b/src/main/html/index.html @@ -1,3 +1,4 @@ + Swagger UI From ad944b93f3bfde234033e2d9cb9cfff23e680387 Mon Sep 17 00:00:00 2001 From: Greg MacLellan Date: Tue, 13 Nov 2012 13:03:16 -0500 Subject: [PATCH 2/2] Support console.log in IE9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IE9 does console incorrectly, this fixes according to http://stackoverflow.com/questions/5538972/console-log-apply-not-working-in-ie9 --- src/main/javascript/doc.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/javascript/doc.js b/src/main/javascript/doc.js index fad24eb9..9b55a658 100644 --- a/src/main/javascript/doc.js +++ b/src/main/javascript/doc.js @@ -65,7 +65,15 @@ function clippyCopiedCallback(a) { function log() { if (window.console) console.log.apply(console,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") { + [ + "log","info","warn","error","assert","dir","clear","profile","profileEnd" + ].forEach(function (method) { + console[method] = this.bind(console[method], console); + }, Function.prototype.call); +} + var Docs = { shebang: function() {