diff --git a/dist/swagger-ui.js b/dist/swagger-ui.js
index 9882a3cb..e2c30f76 100644
--- a/dist/swagger-ui.js
+++ b/dist/swagger-ui.js
@@ -4,6 +4,227 @@
* @link http://swagger.io
* @license Apache 2.0
*/
+var SwaggerUi,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ __hasProp = {}.hasOwnProperty;
+
+SwaggerUi = (function(_super) {
+ __extends(SwaggerUi, _super);
+
+ function SwaggerUi() {
+ return SwaggerUi.__super__.constructor.apply(this, arguments);
+ }
+
+ SwaggerUi.prototype.dom_id = "swagger_ui";
+
+ SwaggerUi.prototype.options = null;
+
+ SwaggerUi.prototype.api = null;
+
+ SwaggerUi.prototype.headerView = null;
+
+ SwaggerUi.prototype.mainView = null;
+
+ SwaggerUi.prototype.initialize = function(options) {
+ if (options == null) {
+ options = {};
+ }
+ if (options.dom_id != null) {
+ this.dom_id = options.dom_id;
+ delete options.dom_id;
+ }
+ if (options.supportedSubmitMethods == null) {
+ options.supportedSubmitMethods = ['get', 'put', 'post', 'delete', 'head', 'options', 'patch'];
+ }
+ if ($('#' + this.dom_id) == null) {
+ $('body').append('
');
+ }
+ this.options = options;
+ marked.setOptions({
+ gfm: true
+ });
+ this.options.success = (function(_this) {
+ return function() {
+ return _this.render();
+ };
+ })(this);
+ this.options.progress = (function(_this) {
+ return function(d) {
+ return _this.showMessage(d);
+ };
+ })(this);
+ this.options.failure = (function(_this) {
+ return function(d) {
+ return _this.onLoadFailure(d);
+ };
+ })(this);
+ this.headerView = new HeaderView({
+ el: $('#header')
+ });
+ return this.headerView.on('update-swagger-ui', (function(_this) {
+ return function(data) {
+ return _this.updateSwaggerUi(data);
+ };
+ })(this));
+ };
+
+ SwaggerUi.prototype.setOption = function(option, value) {
+ return this.options[option] = value;
+ };
+
+ SwaggerUi.prototype.getOption = function(option) {
+ return this.options[option];
+ };
+
+ SwaggerUi.prototype.updateSwaggerUi = function(data) {
+ this.options.url = data.url;
+ return this.load();
+ };
+
+ SwaggerUi.prototype.load = function() {
+ var url, _ref;
+ if ((_ref = this.mainView) != null) {
+ _ref.clear();
+ }
+ url = this.options.url;
+ if (url && url.indexOf("http") !== 0) {
+ url = this.buildUrl(window.location.href.toString(), url);
+ }
+ this.options.url = url;
+ this.headerView.update(url);
+ return this.api = new SwaggerClient(this.options);
+ };
+
+ SwaggerUi.prototype.collapseAll = function() {
+ return Docs.collapseEndpointListForResource('');
+ };
+
+ SwaggerUi.prototype.listAll = function() {
+ return Docs.collapseOperationsForResource('');
+ };
+
+ SwaggerUi.prototype.expandAll = function() {
+ return Docs.expandOperationsForResource('');
+ };
+
+ SwaggerUi.prototype.render = function() {
+ this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
+ this.mainView = new MainView({
+ model: this.api,
+ el: $('#' + this.dom_id),
+ swaggerOptions: this.options
+ }).render();
+ this.showMessage();
+ switch (this.options.docExpansion) {
+ case "full":
+ this.expandAll();
+ break;
+ case "list":
+ this.listAll();
+ }
+ this.renderGFM();
+ if (this.options.onComplete) {
+ this.options.onComplete(this.api, this);
+ }
+ return setTimeout((function(_this) {
+ return function() {
+ return Docs.shebang();
+ };
+ })(this), 100);
+ };
+
+ SwaggerUi.prototype.buildUrl = function(base, url) {
+ var endOfPath, parts;
+ if (url.indexOf("/") === 0) {
+ parts = base.split("/");
+ base = parts[0] + "//" + parts[2];
+ return base + url;
+ } else {
+ endOfPath = base.length;
+ if (base.indexOf("?") > -1) {
+ endOfPath = Math.min(endOfPath, base.indexOf("?"));
+ }
+ if (base.indexOf("#") > -1) {
+ endOfPath = Math.min(endOfPath, base.indexOf("#"));
+ }
+ base = base.substring(0, endOfPath);
+ if (base.indexOf("/", base.length - 1) !== -1) {
+ return base + url;
+ }
+ return base + "/" + url;
+ }
+ };
+
+ SwaggerUi.prototype.showMessage = function(data) {
+ if (data == null) {
+ data = '';
+ }
+ $('#message-bar').removeClass('message-fail');
+ $('#message-bar').addClass('message-success');
+ return $('#message-bar').html(data);
+ };
+
+ SwaggerUi.prototype.onLoadFailure = function(data) {
+ var val;
+ if (data == null) {
+ data = '';
+ }
+ $('#message-bar').removeClass('message-success');
+ $('#message-bar').addClass('message-fail');
+ val = $('#message-bar').html(data);
+ if (this.options.onFailure != null) {
+ this.options.onFailure(data);
+ }
+ return val;
+ };
+
+ SwaggerUi.prototype.renderGFM = function(data) {
+ if (data == null) {
+ data = '';
+ }
+ return $('.markdown').each(function(index) {
+ return $(this).html(marked($(this).html()));
+ });
+ };
+
+ return SwaggerUi;
+
+})(Backbone.Router);
+
+window.SwaggerUi = SwaggerUi;
+
+this["Handlebars"] = this["Handlebars"] || {};
+this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {};
+this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return "\n\n\n";
+},"useData":true});
+this["Handlebars"]["templates"]["basic_auth_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ return "\n\n\n";
+ },"useData":true});
+this["Handlebars"]["templates"]["content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer;
+},"2":function(depth0,helpers,partials,data) {
+ var stack1, lambda=this.lambda, buffer = " \n";
+},"4":function(depth0,helpers,partials,data) {
+ return " \n";
+ },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, buffer = "\n\n";
+},"useData":true});
$(function() {
// Helper function for vertically aligning DOM elements
@@ -199,337 +420,11 @@ var Docs = {
}
};
-var SwaggerUi,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- __hasProp = {}.hasOwnProperty;
-
-SwaggerUi = (function(_super) {
- __extends(SwaggerUi, _super);
-
- function SwaggerUi() {
- return SwaggerUi.__super__.constructor.apply(this, arguments);
- }
-
- SwaggerUi.prototype.dom_id = "swagger_ui";
-
- SwaggerUi.prototype.options = null;
-
- SwaggerUi.prototype.api = null;
-
- SwaggerUi.prototype.headerView = null;
-
- SwaggerUi.prototype.mainView = null;
-
- SwaggerUi.prototype.initialize = function(options) {
- if (options == null) {
- options = {};
- }
- if (options.dom_id != null) {
- this.dom_id = options.dom_id;
- delete options.dom_id;
- }
- if (options.supportedSubmitMethods == null) {
- options.supportedSubmitMethods = ['get', 'put', 'post', 'delete', 'head', 'options', 'patch'];
- }
- if ($('#' + this.dom_id) == null) {
- $('body').append('');
- }
- this.options = options;
- this.options.success = (function(_this) {
- return function() {
- return _this.render();
- };
- })(this);
- this.options.progress = (function(_this) {
- return function(d) {
- return _this.showMessage(d);
- };
- })(this);
- this.options.failure = (function(_this) {
- return function(d) {
- return _this.onLoadFailure(d);
- };
- })(this);
- this.headerView = new HeaderView({
- el: $('#header')
- });
- return this.headerView.on('update-swagger-ui', (function(_this) {
- return function(data) {
- return _this.updateSwaggerUi(data);
- };
- })(this));
- };
-
- SwaggerUi.prototype.setOption = function(option, value) {
- return this.options[option] = value;
- };
-
- SwaggerUi.prototype.getOption = function(option) {
- return this.options[option];
- };
-
- SwaggerUi.prototype.updateSwaggerUi = function(data) {
- this.options.url = data.url;
- return this.load();
- };
-
- SwaggerUi.prototype.load = function() {
- var url, _ref;
- if ((_ref = this.mainView) != null) {
- _ref.clear();
- }
- url = this.options.url;
- if (url && url.indexOf("http") !== 0) {
- url = this.buildUrl(window.location.href.toString(), url);
- }
- this.options.url = url;
- this.headerView.update(url);
- return this.api = new SwaggerClient(this.options);
- };
-
- SwaggerUi.prototype.collapseAll = function() {
- return Docs.collapseEndpointListForResource('');
- };
-
- SwaggerUi.prototype.listAll = function() {
- return Docs.collapseOperationsForResource('');
- };
-
- SwaggerUi.prototype.expandAll = function() {
- return Docs.expandOperationsForResource('');
- };
-
- SwaggerUi.prototype.render = function() {
- this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
- this.mainView = new MainView({
- model: this.api,
- el: $('#' + this.dom_id),
- swaggerOptions: this.options
- }).render();
- this.showMessage();
- switch (this.options.docExpansion) {
- case "full":
- this.expandAll();
- break;
- case "list":
- this.listAll();
- }
- this.renderGFM();
- if (this.options.onComplete) {
- this.options.onComplete(this.api, this);
- }
- return setTimeout((function(_this) {
- return function() {
- return Docs.shebang();
- };
- })(this), 100);
- };
-
- SwaggerUi.prototype.buildUrl = function(base, url) {
- var endOfPath, parts;
- if (url.indexOf("/") === 0) {
- parts = base.split("/");
- base = parts[0] + "//" + parts[2];
- return base + url;
- } else {
- endOfPath = base.length;
- if (base.indexOf("?") > -1) {
- endOfPath = Math.min(endOfPath, base.indexOf("?"));
- }
- if (base.indexOf("#") > -1) {
- endOfPath = Math.min(endOfPath, base.indexOf("#"));
- }
- base = base.substring(0, endOfPath);
- if (base.indexOf("/", base.length - 1) !== -1) {
- return base + url;
- }
- return base + "/" + url;
- }
- };
-
- SwaggerUi.prototype.showMessage = function(data) {
- if (data == null) {
- data = '';
- }
- $('#message-bar').removeClass('message-fail');
- $('#message-bar').addClass('message-success');
- return $('#message-bar').html(data);
- };
-
- SwaggerUi.prototype.onLoadFailure = function(data) {
- var val;
- if (data == null) {
- data = '';
- }
- $('#message-bar').removeClass('message-success');
- $('#message-bar').addClass('message-fail');
- val = $('#message-bar').html(data);
- if (this.options.onFailure != null) {
- this.options.onFailure(data);
- }
- return val;
- };
-
- SwaggerUi.prototype.renderGFM = function(data) {
- if (data == null) {
- data = '';
- }
- return $('.markdown').each(function(index) {
- return $(this).html(marked($(this).html()));
- });
- };
-
- return SwaggerUi;
-
-})(Backbone.Router);
-
-window.SwaggerUi = SwaggerUi;
-
-this["Handlebars"] = this["Handlebars"] || {};
-this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {};
-this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
- var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
- return "\n\n\n";
-},"useData":true});
-this["Handlebars"]["templates"]["basic_auth_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
- return "\n\n\n";
- },"useData":true});
Handlebars.registerHelper('sanitize', function(html) {
html = html.replace(/