Skip to content

Commit

Permalink
rebuilt distro for swagger-api#331
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Apr 29, 2014
1 parent f9d01ab commit 913b9af
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
14 changes: 13 additions & 1 deletion lib/swagger.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// swagger.js
// version 2.0.29
// version 2.0.30

var __bind = function(fn, me){
return function(){
Expand Down Expand Up @@ -1475,6 +1475,16 @@ ApiKeyAuthorization.prototype.apply = function(obj, authorizations) {
}
};

var CookieAuthorization = function(cookie) {
this.cookie = cookie;
}

CookieAuthorization.prototype.apply = function(obj, authorizations) {
obj.cookieJar = obj.cookieJar || CookieJar();
obj.cookieJar.setCookie(this.cookie);
return true;
}

/**
* Password Authorization is a basic auth implementation
*/
Expand All @@ -1498,13 +1508,15 @@ PasswordAuthorization.prototype.apply = function(obj, authorizations) {
var e = (typeof window !== 'undefined' ? window : exports);

var sampleModels = {};
var cookies = {};

e.SampleModels = sampleModels;
e.SwaggerHttp = SwaggerHttp;
e.SwaggerRequest = SwaggerRequest;
e.authorizations = new SwaggerAuthorizations();
e.ApiKeyAuthorization = ApiKeyAuthorization;
e.PasswordAuthorization = PasswordAuthorization;
e.CookieAuthorization = CookieAuthorization;
e.JQueryHttpClient = JQueryHttpClient;
e.ShredHttpClient = ShredHttpClient;
e.SwaggerOperation = SwaggerOperation;
Expand Down
21 changes: 17 additions & 4 deletions swagger-ui.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// swagger-ui.js
// version 2.0.15
$(function() {

// Helper function for vertically aligning DOM elements
Expand Down Expand Up @@ -384,7 +383,7 @@ function program14(depth0,data) {
function program16(depth0,data) {


return "\n <div style='margin:0;padding:0;display:inline'></div>\n <h4>Error Status Codes</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n ";
return "\n <div style='margin:0;padding:0;display:inline'></div>\n <h4>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n <th>Response Model</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n ";
}

function program18(depth0,data) {
Expand Down Expand Up @@ -1202,7 +1201,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "</td>\n";
buffer += "</td>\n<td width='50%'><span class=\"model-signature\" /></td>";
return buffer;
});
})();
Expand Down Expand Up @@ -1996,9 +1995,23 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
StatusCodeView.prototype.initialize = function() {};

StatusCodeView.prototype.render = function() {
var template;
var responseModel, responseModelView, template;
template = this.template();
$(this.el).html(template(this.model));
if (swaggerUi.api.models.hasOwnProperty(this.model.responseModel)) {
responseModel = {
sampleJSON: JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(), null, 2),
isParam: false,
signature: swaggerUi.api.models[this.model.responseModel].getMockSignature()
};
responseModelView = new SignatureView({
model: responseModel,
tagName: 'div'
});
$('.model-signature', this.$el).append(responseModelView.render().el);
} else {
$('.model-signature', this.$el).html('');
}
return this;
};

Expand Down
2 changes: 1 addition & 1 deletion swagger-ui.min.js

Large diffs are not rendered by default.

0 comments on commit 913b9af

Please sign in to comment.