1
0
Fork 0

last trial

This commit is contained in:
Thomas Richter 2013-07-11 14:32:04 +02:00
parent 715ac096fd
commit a8f50f1e50
2 changed files with 61 additions and 61 deletions

View File

@ -603,7 +603,7 @@ function program7(depth0,data) {
function program9(depth0,data) { function program9(depth0,data) {
return "\n <div style='margin:0;padding:0;display:inline'></div>\n <h4>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>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 </tbody>\n </table>\n ";
} }
function program11(depth0,data) { function program11(depth0,data) {
@ -948,19 +948,18 @@ function program12(depth0,data) {
//@ sourceMappingURL=_swagger-ui.map // Generated by CoffeeScript 1.6.3
// Generated by CoffeeScript 1.6.1
(function() { (function() {
var ContentTypeView, HeaderView, MainView, OperationView, ParameterView, ResourceView, SignatureView, StatusCodeView, SwaggerUi, var ContentTypeView, HeaderView, MainView, OperationView, ParameterView, ResourceView, SignatureView, StatusCodeView, SwaggerUi, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8,
__hasProp = {}.hasOwnProperty, __hasProp = {}.hasOwnProperty,
__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; }; __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; };
SwaggerUi = (function(_super) { SwaggerUi = (function(_super) {
__extends(SwaggerUi, _super); __extends(SwaggerUi, _super);
function SwaggerUi() { function SwaggerUi() {
return SwaggerUi.__super__.constructor.apply(this, arguments); _ref = SwaggerUi.__super__.constructor.apply(this, arguments);
return _ref;
} }
SwaggerUi.prototype.dom_id = "swagger_ui"; SwaggerUi.prototype.dom_id = "swagger_ui";
@ -1010,9 +1009,9 @@ function program12(depth0,data) {
}; };
SwaggerUi.prototype.load = function() { SwaggerUi.prototype.load = function() {
var _ref; var _ref1;
if ((_ref = this.mainView) != null) { if ((_ref1 = this.mainView) != null) {
_ref.clear(); _ref1.clear();
} }
this.headerView.update(this.options.discoveryUrl, this.options.apiKey); this.headerView.update(this.options.discoveryUrl, this.options.apiKey);
return this.api = new SwaggerApi(this.options); return this.api = new SwaggerApi(this.options);
@ -1071,11 +1070,11 @@ function program12(depth0,data) {
window.SwaggerUi = SwaggerUi; window.SwaggerUi = SwaggerUi;
HeaderView = (function(_super) { HeaderView = (function(_super) {
__extends(HeaderView, _super); __extends(HeaderView, _super);
function HeaderView() { function HeaderView() {
return HeaderView.__super__.constructor.apply(this, arguments); _ref1 = HeaderView.__super__.constructor.apply(this, arguments);
return _ref1;
} }
HeaderView.prototype.events = { HeaderView.prototype.events = {
@ -1137,21 +1136,21 @@ function program12(depth0,data) {
})(Backbone.View); })(Backbone.View);
MainView = (function(_super) { MainView = (function(_super) {
__extends(MainView, _super); __extends(MainView, _super);
function MainView() { function MainView() {
return MainView.__super__.constructor.apply(this, arguments); _ref2 = MainView.__super__.constructor.apply(this, arguments);
return _ref2;
} }
MainView.prototype.initialize = function() {}; MainView.prototype.initialize = function() {};
MainView.prototype.render = function() { MainView.prototype.render = function() {
var resource, _i, _len, _ref; var resource, _i, _len, _ref3;
$(this.el).html(Handlebars.templates.main(this.model)); $(this.el).html(Handlebars.templates.main(this.model));
_ref = this.model.apisArray; _ref3 = this.model.apisArray;
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
resource = _ref[_i]; resource = _ref3[_i];
this.addResource(resource); this.addResource(resource);
} }
return this; return this;
@ -1177,22 +1176,22 @@ function program12(depth0,data) {
})(Backbone.View); })(Backbone.View);
ResourceView = (function(_super) { ResourceView = (function(_super) {
__extends(ResourceView, _super); __extends(ResourceView, _super);
function ResourceView() { function ResourceView() {
return ResourceView.__super__.constructor.apply(this, arguments); _ref3 = ResourceView.__super__.constructor.apply(this, arguments);
return _ref3;
} }
ResourceView.prototype.initialize = function() {}; ResourceView.prototype.initialize = function() {};
ResourceView.prototype.render = function() { ResourceView.prototype.render = function() {
var operation, _i, _len, _ref; var operation, _i, _len, _ref4;
$(this.el).html(Handlebars.templates.resource(this.model)); $(this.el).html(Handlebars.templates.resource(this.model));
this.number = 0; this.number = 0;
_ref = this.model.operationsArray; _ref4 = this.model.operationsArray;
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
operation = _ref[_i]; operation = _ref4[_i];
this.addOperation(operation); this.addOperation(operation);
} }
return this; return this;
@ -1215,11 +1214,11 @@ function program12(depth0,data) {
})(Backbone.View); })(Backbone.View);
OperationView = (function(_super) { OperationView = (function(_super) {
__extends(OperationView, _super); __extends(OperationView, _super);
function OperationView() { function OperationView() {
return OperationView.__super__.constructor.apply(this, arguments); _ref4 = OperationView.__super__.constructor.apply(this, arguments);
return _ref4;
} }
OperationView.prototype.events = { OperationView.prototype.events = {
@ -1233,7 +1232,7 @@ function program12(depth0,data) {
OperationView.prototype.initialize = function() {}; OperationView.prototype.initialize = function() {};
OperationView.prototype.render = function() { OperationView.prototype.render = function() {
var contentTypeModel, contentTypeView, isMethodSubmissionSupported, param, responseSignatureView, signatureModel, statusCode, _i, _j, _len, _len1, _ref, _ref1; var contentTypeModel, contentTypeView, isMethodSubmissionSupported, param, responseSignatureView, signatureModel, statusCode, _i, _j, _len, _len1, _ref5, _ref6;
isMethodSubmissionSupported = jQuery.inArray(this.model.httpMethod, this.model.supportedSubmitMethods()) >= 0; isMethodSubmissionSupported = jQuery.inArray(this.model.httpMethod, this.model.supportedSubmitMethods()) >= 0;
if (!isMethodSubmissionSupported) { if (!isMethodSubmissionSupported) {
this.model.isReadOnly = true; this.model.isReadOnly = true;
@ -1266,14 +1265,14 @@ function program12(depth0,data) {
model: contentTypeModel model: contentTypeModel
}); });
$('.content-type', $(this.el)).append(contentTypeView.render().el); $('.content-type', $(this.el)).append(contentTypeView.render().el);
_ref = this.model.parameters; _ref5 = this.model.parameters;
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
param = _ref[_i]; param = _ref5[_i];
this.addParameter(param); this.addParameter(param);
} }
_ref1 = this.model.errorResponses; _ref6 = this.model.errorResponses;
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
statusCode = _ref1[_j]; statusCode = _ref6[_j];
this.addStatusCode(statusCode); this.addStatusCode(statusCode);
} }
return this; return this;
@ -1299,7 +1298,7 @@ function program12(depth0,data) {
}; };
OperationView.prototype.submitOperation = function(e) { OperationView.prototype.submitOperation = function(e) {
var bodyParam, consumes, error_free, form, headerParams, invocationUrl, isFileUpload, isFormPost, map, o, obj, param, paramContentTypeField, responseContentTypeField, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4, var bodyParam, consumes, error_free, form, headerParams, invocationUrl, isFileUpload, isFormPost, map, o, obj, param, paramContentTypeField, responseContentTypeField, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref5, _ref6, _ref7, _ref8, _ref9,
_this = this; _this = this;
if (e != null) { if (e != null) {
e.preventDefault(); e.preventDefault();
@ -1321,9 +1320,9 @@ function program12(depth0,data) {
}); });
if (error_free) { if (error_free) {
map = {}; map = {};
_ref = form.serializeArray(); _ref5 = form.serializeArray();
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
o = _ref[_i]; o = _ref5[_i];
if ((o.value != null) && jQuery.trim(o.value).length > 0) { if ((o.value != null) && jQuery.trim(o.value).length > 0) {
map[o.name] = o.value; map[o.name] = o.value;
} }
@ -1334,9 +1333,9 @@ function program12(depth0,data) {
if (this.model.consumes && this.model.consumes.length > 0) { if (this.model.consumes && this.model.consumes.length > 0) {
consumes = this.model.consumes[0]; consumes = this.model.consumes[0];
} else { } else {
_ref1 = this.model.parameters; _ref6 = this.model.parameters;
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
o = _ref1[_j]; o = _ref6[_j];
if (o.paramType === 'form') { if (o.paramType === 'form') {
isFormPost = true; isFormPost = true;
consumes = false; consumes = false;
@ -1350,9 +1349,9 @@ function program12(depth0,data) {
} }
if (isFileUpload) { if (isFileUpload) {
bodyParam = new FormData(); bodyParam = new FormData();
_ref2 = this.model.parameters; _ref7 = this.model.parameters;
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
param = _ref2[_k]; param = _ref7[_k];
if (param.paramType === 'body' && param.name !== 'file') { if (param.paramType === 'body' && param.name !== 'file') {
bodyParam.append(param.name, map[param.name]); bodyParam.append(param.name, map[param.name]);
} }
@ -1363,16 +1362,16 @@ function program12(depth0,data) {
console.log(bodyParam); console.log(bodyParam);
} else if (isFormPost) { } else if (isFormPost) {
bodyParam = new FormData(); bodyParam = new FormData();
_ref3 = this.model.parameters; _ref8 = this.model.parameters;
for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { for (_l = 0, _len3 = _ref8.length; _l < _len3; _l++) {
param = _ref3[_l]; param = _ref8[_l];
bodyParam.append(param.name, map[param.name]); bodyParam.append(param.name, map[param.name]);
} }
} else { } else {
bodyParam = null; bodyParam = null;
_ref4 = this.model.parameters; _ref9 = this.model.parameters;
for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) { for (_m = 0, _len4 = _ref9.length; _m < _len4; _m++) {
param = _ref4[_m]; param = _ref9[_m];
if (param.paramType === 'body') { if (param.paramType === 'body') {
bodyParam = map[param.name]; bodyParam = map[param.name];
} }
@ -1505,9 +1504,9 @@ function program12(depth0,data) {
padding = ''; padding = '';
indent += transitions[fromTo]; indent += transitions[fromTo];
padding = ((function() { padding = ((function() {
var _j, _ref, _results; var _j, _ref5, _results;
_results = []; _results = [];
for (j = _j = 0, _ref = indent; 0 <= _ref ? _j < _ref : _j > _ref; j = 0 <= _ref ? ++_j : --_j) { for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) {
_results.push(' '); _results.push(' ');
} }
return _results; return _results;
@ -1526,11 +1525,12 @@ function program12(depth0,data) {
}; };
OperationView.prototype.showStatus = function(data) { OperationView.prototype.showStatus = function(data) {
var code, pre, response_body; var code, error, pre, response_body;
try { try {
code = $('<code />').text(JSON.stringify(JSON.parse(data.responseText), null, 2)); code = $('<code />').text(JSON.stringify(JSON.parse(data.responseText), null, 2));
pre = $('<pre class="json" />').append(code); pre = $('<pre class="json" />').append(code);
} catch (error) { } catch (_error) {
error = _error;
code = $('<code />').text(this.formatXml(data.responseText)); code = $('<code />').text(this.formatXml(data.responseText));
pre = $('<pre class="xml" />').append(code); pre = $('<pre class="xml" />').append(code);
} }
@ -1559,11 +1559,11 @@ function program12(depth0,data) {
})(Backbone.View); })(Backbone.View);
StatusCodeView = (function(_super) { StatusCodeView = (function(_super) {
__extends(StatusCodeView, _super); __extends(StatusCodeView, _super);
function StatusCodeView() { function StatusCodeView() {
return StatusCodeView.__super__.constructor.apply(this, arguments); _ref5 = StatusCodeView.__super__.constructor.apply(this, arguments);
return _ref5;
} }
StatusCodeView.prototype.initialize = function() {}; StatusCodeView.prototype.initialize = function() {};
@ -1584,11 +1584,11 @@ function program12(depth0,data) {
})(Backbone.View); })(Backbone.View);
ParameterView = (function(_super) { ParameterView = (function(_super) {
__extends(ParameterView, _super); __extends(ParameterView, _super);
function ParameterView() { function ParameterView() {
return ParameterView.__super__.constructor.apply(this, arguments); _ref6 = ParameterView.__super__.constructor.apply(this, arguments);
return _ref6;
} }
ParameterView.prototype.initialize = function() {}; ParameterView.prototype.initialize = function() {};
@ -1658,11 +1658,11 @@ function program12(depth0,data) {
})(Backbone.View); })(Backbone.View);
SignatureView = (function(_super) { SignatureView = (function(_super) {
__extends(SignatureView, _super); __extends(SignatureView, _super);
function SignatureView() { function SignatureView() {
return SignatureView.__super__.constructor.apply(this, arguments); _ref7 = SignatureView.__super__.constructor.apply(this, arguments);
return _ref7;
} }
SignatureView.prototype.events = { SignatureView.prototype.events = {
@ -1727,11 +1727,11 @@ function program12(depth0,data) {
})(Backbone.View); })(Backbone.View);
ContentTypeView = (function(_super) { ContentTypeView = (function(_super) {
__extends(ContentTypeView, _super); __extends(ContentTypeView, _super);
function ContentTypeView() { function ContentTypeView() {
return ContentTypeView.__super__.constructor.apply(this, arguments); _ref8 = ContentTypeView.__super__.constructor.apply(this, arguments);
return _ref8;
} }
ContentTypeView.prototype.initialize = function() {}; ContentTypeView.prototype.initialize = function() {};

File diff suppressed because one or more lines are too long