diff --git a/dist/index.html b/dist/index.html index 481b4cca..2f092c1f 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,7 +5,7 @@ - + diff --git a/dist/swagger-ui.js b/dist/swagger-ui.js index 56f284a2..0fc6ed7b 100644 --- a/dist/swagger-ui.js +++ b/dist/swagger-ui.js @@ -1182,18 +1182,18 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.5.0 (function() { - var ContentTypeView, HeaderView, MainView, OperationView, ParameterContentTypeView, ParameterView, ResourceView, ResponseContentTypeView, SignatureView, StatusCodeView, SwaggerUi, _ref, _ref1, _ref10, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, + var ContentTypeView, HeaderView, MainView, OperationView, ParameterContentTypeView, ParameterView, ResourceView, ResponseContentTypeView, SignatureView, StatusCodeView, SwaggerUi, __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; }; SwaggerUi = (function(_super) { + __extends(SwaggerUi, _super); function SwaggerUi() { - _ref = SwaggerUi.__super__.constructor.apply(this, arguments); - return _ref; + SwaggerUi.__super__.constructor.apply(this, arguments); } SwaggerUi.prototype.dom_id = "swagger_ui"; @@ -1242,9 +1242,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; }; SwaggerUi.prototype.load = function() { - var url, _ref1; - if ((_ref1 = this.mainView) != null) { - _ref1.clear(); + var url, _ref; + if ((_ref = this.mainView) != null) { + _ref.clear(); } url = this.options.url; if (url.indexOf("http") !== 0) { @@ -1322,11 +1322,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; window.SwaggerUi = SwaggerUi; HeaderView = (function(_super) { + __extends(HeaderView, _super); function HeaderView() { - _ref1 = HeaderView.__super__.constructor.apply(this, arguments); - return _ref1; + HeaderView.__super__.constructor.apply(this, arguments); } HeaderView.prototype.events = { @@ -1384,21 +1384,21 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; })(Backbone.View); MainView = (function(_super) { + __extends(MainView, _super); function MainView() { - _ref2 = MainView.__super__.constructor.apply(this, arguments); - return _ref2; + MainView.__super__.constructor.apply(this, arguments); } MainView.prototype.initialize = function() {}; MainView.prototype.render = function() { - var resource, _i, _len, _ref3; + var resource, _i, _len, _ref; $(this.el).html(Handlebars.templates.main(this.model)); - _ref3 = this.model.apisArray; - for (_i = 0, _len = _ref3.length; _i < _len; _i++) { - resource = _ref3[_i]; + _ref = this.model.apisArray; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + resource = _ref[_i]; this.addResource(resource); } return this; @@ -1424,23 +1424,23 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; })(Backbone.View); ResourceView = (function(_super) { + __extends(ResourceView, _super); function ResourceView() { - _ref3 = ResourceView.__super__.constructor.apply(this, arguments); - return _ref3; + ResourceView.__super__.constructor.apply(this, arguments); } ResourceView.prototype.initialize = function() {}; ResourceView.prototype.render = function() { - var operation, _i, _len, _ref4; + var operation, _i, _len, _ref; console.log(this.model.description); $(this.el).html(Handlebars.templates.resource(this.model)); this.number = 0; - _ref4 = this.model.operationsArray; - for (_i = 0, _len = _ref4.length; _i < _len; _i++) { - operation = _ref4[_i]; + _ref = this.model.operationsArray; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + operation = _ref[_i]; this.addOperation(operation); } return this; @@ -1463,11 +1463,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; })(Backbone.View); OperationView = (function(_super) { + __extends(OperationView, _super); function OperationView() { - _ref4 = OperationView.__super__.constructor.apply(this, arguments); - return _ref4; + OperationView.__super__.constructor.apply(this, arguments); } OperationView.prototype.invocationUrl = null; @@ -1482,7 +1482,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; OperationView.prototype.initialize = function() {}; OperationView.prototype.render = function() { - var contentTypeModel, isMethodSubmissionSupported, param, responseContentTypeView, responseSignatureView, signatureModel, statusCode, type, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7; + var contentTypeModel, isMethodSubmissionSupported, param, responseContentTypeView, responseSignatureView, signatureModel, statusCode, type, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2; isMethodSubmissionSupported = true; if (!isMethodSubmissionSupported) { this.model.isReadOnly = true; @@ -1507,9 +1507,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; }; contentTypeModel.consumes = this.model.consumes; contentTypeModel.produces = this.model.produces; - _ref5 = this.model.parameters; - for (_i = 0, _len = _ref5.length; _i < _len; _i++) { - param = _ref5[_i]; + _ref = this.model.parameters; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + param = _ref[_i]; type = param.type || param.dataType; if (type.toLowerCase() === 'file') { if (!contentTypeModel.consumes) { @@ -1522,14 +1522,14 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; model: contentTypeModel }); $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el); - _ref6 = this.model.parameters; - for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) { - param = _ref6[_j]; + _ref1 = this.model.parameters; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + param = _ref1[_j]; this.addParameter(param, contentTypeModel.consumes); } - _ref7 = this.model.responseMessages; - for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) { - statusCode = _ref7[_k]; + _ref2 = this.model.responseMessages; + for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { + statusCode = _ref2[_k]; this.addStatusCode(statusCode); } return this; @@ -1556,7 +1556,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; }; OperationView.prototype.submitOperation = function(e) { - var error_free, form, isFileUpload, map, o, opts, val, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7; + var error_free, form, isFileUpload, map, o, opts, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2; if (e != null) { e.preventDefault(); } @@ -1581,9 +1581,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; parent: this }; isFileUpload = false; - _ref5 = form.find("input"); - for (_i = 0, _len = _ref5.length; _i < _len; _i++) { - o = _ref5[_i]; + _ref = form.find("input"); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + o = _ref[_i]; if ((o.value != null) && jQuery.trim(o.value).length > 0) { map[o.name] = o.value; } @@ -1591,16 +1591,16 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; isFileUpload = true; } } - _ref6 = form.find("textarea"); - for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) { - o = _ref6[_j]; + _ref1 = form.find("textarea"); + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + o = _ref1[_j]; if ((o.value != null) && jQuery.trim(o.value).length > 0) { map["body"] = o.value; } } - _ref7 = form.find("select"); - for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) { - o = _ref7[_k]; + _ref2 = form.find("select"); + for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { + o = _ref2[_k]; val = this.getSelectedValue(o); if ((val != null) && jQuery.trim(val).length > 0) { map[o.name] = val; @@ -1622,36 +1622,38 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; }; OperationView.prototype.handleFileUpload = function(map, form) { - var bodyParam, headerParams, o, obj, param, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7, + var bodyParam, el, headerParams, o, obj, param, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _this = this; console.log("it's a file upload"); - _ref5 = form.serializeArray(); - for (_i = 0, _len = _ref5.length; _i < _len; _i++) { - o = _ref5[_i]; + _ref = form.serializeArray(); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + o = _ref[_i]; if ((o.value != null) && jQuery.trim(o.value).length > 0) { map[o.name] = o.value; } } bodyParam = new FormData(); - _ref6 = this.model.parameters; - for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) { - param = _ref6[_j]; + _ref1 = this.model.parameters; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + param = _ref1[_j]; if (param.paramType === 'form') { bodyParam.append(param.name, map[param.name]); } } headerParams = {}; - _ref7 = this.model.parameters; - for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) { - param = _ref7[_k]; + _ref2 = this.model.parameters; + for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { + param = _ref2[_k]; if (param.paramType === 'header') { headerParams[param.name] = map[param.name]; } } console.log(headerParams); - $.each($('input[type~="file"]'), function(i, el) { - return bodyParam.append($(el).attr('name'), el.files[0]); - }); + _ref3 = form.find('input[type~="file"]'); + for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { + el = _ref3[_l]; + bodyParam.append($(el).attr('name'), el.files[0]); + } console.log(bodyParam); this.invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), this.model.urlify(map, false)) : this.model.urlify(map, true); $(".request_url", $(this.el)).html("
" + this.invocationUrl + ""); @@ -1698,14 +1700,14 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; }; OperationView.prototype.getSelectedValue = function(select) { - var opt, options, _i, _len, _ref5; + var opt, options, _i, _len, _ref; if (!select.multiple) { return select.value; } else { options = []; - _ref5 = select.options; - for (_i = 0, _len = _ref5.length; _i < _len; _i++) { - opt = _ref5[_i]; + _ref = select.options; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + opt = _ref[_i]; if (opt.selected) { options.push(opt.value); } @@ -1793,9 +1795,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; padding = ''; indent += transitions[fromTo]; padding = ((function() { - var _j, _ref5, _results; + var _j, _ref, _results; _results = []; - for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) { + for (j = _j = 0, _ref = indent; 0 <= _ref ? _j < _ref : _j > _ref; j = 0 <= _ref ? ++_j : --_j) { _results.push(' '); } return _results; @@ -1862,11 +1864,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; })(Backbone.View); StatusCodeView = (function(_super) { + __extends(StatusCodeView, _super); function StatusCodeView() { - _ref5 = StatusCodeView.__super__.constructor.apply(this, arguments); - return _ref5; + StatusCodeView.__super__.constructor.apply(this, arguments); } StatusCodeView.prototype.initialize = function() {}; @@ -1887,11 +1889,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; })(Backbone.View); ParameterView = (function(_super) { + __extends(ParameterView, _super); function ParameterView() { - _ref6 = ParameterView.__super__.constructor.apply(this, arguments); - return _ref6; + ParameterView.__super__.constructor.apply(this, arguments); } ParameterView.prototype.initialize = function() {}; @@ -1968,11 +1970,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; })(Backbone.View); SignatureView = (function(_super) { + __extends(SignatureView, _super); function SignatureView() { - _ref7 = SignatureView.__super__.constructor.apply(this, arguments); - return _ref7; + SignatureView.__super__.constructor.apply(this, arguments); } SignatureView.prototype.events = { @@ -2037,11 +2039,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; })(Backbone.View); ContentTypeView = (function(_super) { + __extends(ContentTypeView, _super); function ContentTypeView() { - _ref8 = ContentTypeView.__super__.constructor.apply(this, arguments); - return _ref8; + ContentTypeView.__super__.constructor.apply(this, arguments); } ContentTypeView.prototype.initialize = function() {}; @@ -2063,11 +2065,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; })(Backbone.View); ResponseContentTypeView = (function(_super) { + __extends(ResponseContentTypeView, _super); function ResponseContentTypeView() { - _ref9 = ResponseContentTypeView.__super__.constructor.apply(this, arguments); - return _ref9; + ResponseContentTypeView.__super__.constructor.apply(this, arguments); } ResponseContentTypeView.prototype.initialize = function() {}; @@ -2089,11 +2091,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; })(Backbone.View); ParameterContentTypeView = (function(_super) { + __extends(ParameterContentTypeView, _super); function ParameterContentTypeView() { - _ref10 = ParameterContentTypeView.__super__.constructor.apply(this, arguments); - return _ref10; + ParameterContentTypeView.__super__.constructor.apply(this, arguments); } ParameterContentTypeView.prototype.initialize = function() {}; diff --git a/dist/swagger-ui.min.js b/dist/swagger-ui.min.js index be2c1052..a80a3f78 100644 --- a/dist/swagger-ui.min.js +++ b/dist/swagger-ui.min.js @@ -1 +1 @@ -$(function(){$.fn.vAlign=function(){return this.each(function(c){var a=$(this).height();var d=$(this).parent().height();var b=(d-a)/2;$(this).css("margin-top",b)})};$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(b){var d=$(this).closest("form").innerWidth();var c=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10);var a=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",d-c-a)})};$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent();$("ul.downplayed li div.content p").vAlign();$("form.sandbox").submit(function(){var a=true;$(this).find("input.required").each(function(){$(this).removeClass("error");if($(this).val()==""){$(this).addClass("error");$(this).wiggle();a=false}});return a})});function clippyCopiedCallback(b){$("#api_key_copied").fadeIn().delay(1000).fadeOut()}function log(){if(window.console){console.log.apply(console,arguments)}}if(Function.prototype.bind&&console&&typeof console.log=="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(a){console[a]=this.bind(console[a],console)},Function.prototype.call)}var Docs={shebang:function(){var b=$.param.fragment().split("/");b.shift();switch(b.length){case 1:var d="resource_"+b[0];Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});break;case 2:Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});var c=b.join("_");var a=c+"_content";Docs.expandOperation($("#"+a));$("#"+c).slideto({highlight:false});break}},toggleEndpointListForResource:function(b){var a=$("li#resource_"+Docs.escapeResourceName(b)+" ul.endpoints");if(a.is(":visible")){Docs.collapseEndpointListForResource(b)}else{Docs.expandEndpointListForResource(b)}},expandEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);if(b==""){$(".resource ul.endpoints").slideDown();return}$("li#resource_"+b).addClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideDown()},collapseEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);$("li#resource_"+b).removeClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideUp()},expandOperationsForResource:function(a){Docs.expandEndpointListForResource(a);if(a==""){$(".resource ul.endpoints li.operation div.content").slideDown();return}$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(a){Docs.expandEndpointListForResource(a);$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(a){return a.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(a){a.slideDown()},collapseOperation:function(a){a.slideUp()}};(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n \n ";return o}function n(p,o){return'\n \n'}i+='\n\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.main=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",c,h="function",j=this.escapeExpression,p=this;function e(v,u){var r="",t,s;r+='\n
";if(t=g.notes){t=t.call(v,{hash:{},data:u})}else{t=v.notes;t=typeof t===i?t.apply(v):t}if(t||t===0){s+=t}s+="
\n ";return s}function c(t,s){return'\n\n
Parameter | \nValue | \nDescription | \nParameter Type | \nData Type | \n
---|
HTTP Status Code | \nReason | \n
---|
';if(c=d.sampleJSON){c=c.call(k,{hash:{},data:i})}else{c=k.sampleJSON;c=typeof c===f?c.apply(k):c}g+=h(c)+'
\n \n
").text(JSON.stringify(JSON.parse(B),null,2));E=$('').append(C)}else{if(G.indexOf("application/xml")===0){C=$("
").text(this.formatXml(B));E=$('').append(C)}else{if(G.indexOf("text/html")===0){C=$("
").html(B);E=$('').append(C)}else{if(G.indexOf("image/")===0){E=$("").attr("src",D.request.url)}else{C=$("
").text(B);E=$('').append(C)}}}}}A=E;$(".request_url",$(this.el)).html(""+D.request.url+"");$(".response_code",$(this.el)).html("
"+D.status+"");$(".response_body",$(this.el)).html(A);$(".response_headers",$(this.el)).html("
"+JSON.stringify(D.getHeaders(),null," ").replace(/\n/g,"");$(".response",$(this.el)).slideDown();$(".response_hider",$(this.el)).show();$(".response_throbber",$(this.el)).hide();return hljs.highlightBlock($(".response_body",$(this.el))[0])};y.prototype.toggleOperationContent=function(){var A;A=$("#"+Docs.escapeResourceName(this.model.resourceName)+"_"+this.model.nickname+"_"+this.model.method+"_"+this.model.number+"_content");if(A.is(":visible")){return Docs.collapseOperation(A)}else{return Docs.expandOperation(A)}};return y})(Backbone.View);p=(function(z){v(y,z);function y(){d=y.__super__.constructor.apply(this,arguments);return d}y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));return this};y.prototype.template=function(){return Handlebars.templates.status_code};return y})(Backbone.View);k=(function(z){v(y,z);function y(){b=y.__super__.constructor.apply(this,arguments);return b}y.prototype.initialize=function(){};y.prototype.render=function(){var G,A,C,F,B,H,E,D;D=this.model.type||this.model.dataType;if(this.model.paramType==="body"){this.model.isBody=true}if(D.toLowerCase()==="file"){this.model.isFile=true}E=this.template();$(this.el).html(E(this.model));B={sampleJSON:this.model.sampleJSON,isParam:true,signature:this.model.signature};if(this.model.sampleJSON){H=new i({model:B,tagName:"div"});$(".model-signature",$(this.el)).append(H.render().el)}else{$(".model-signature",$(this.el)).html(this.model.signature)}A=false;if(this.model.isBody){A=true}G={isParam:A};G.consumes=this.model.consumes;if(A){C=new l({model:G});$(".parameter-content-type",$(this.el)).append(C.render().el)}else{F=new m({model:G});$(".response-content-type",$(this.el)).append(F.render().el)}return this};y.prototype.template=function(){if(this.model.isList){return Handlebars.templates.param_list}else{if(this.options.readOnly){if(this.model.required){return Handlebars.templates.param_readonly_required}else{return Handlebars.templates.param_readonly}}else{if(this.model.required){return Handlebars.templates.param_required}else{return Handlebars.templates.param}}}};return y})(Backbone.View);i=(function(z){v(y,z);function y(){a=y.__super__.constructor.apply(this,arguments);return a}y.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"};y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));this.switchToDescription();this.isParam=this.model.isParam;if(this.isParam){$(".notice",$(this.el)).text("Click to set as parameter value")}return this};y.prototype.template=function(){return Handlebars.templates.signature};y.prototype.switchToDescription=function(A){if(A!=null){A.preventDefault()}$(".snippet",$(this.el)).hide();$(".description",$(this.el)).show();$(".description-link",$(this.el)).addClass("selected");return $(".snippet-link",$(this.el)).removeClass("selected")};y.prototype.switchToSnippet=function(A){if(A!=null){A.preventDefault()}$(".description",$(this.el)).hide();$(".snippet",$(this.el)).show();$(".snippet-link",$(this.el)).addClass("selected");return $(".description-link",$(this.el)).removeClass("selected")};y.prototype.snippetToTextArea=function(A){var B;if(this.isParam){if(A!=null){A.preventDefault()}B=$("textarea",$(this.el.parentNode.parentNode.parentNode));if($.trim(B.val())===""){return B.val(this.model.sampleJSON)}}};return y})(Backbone.View);j=(function(y){v(z,y);function z(){x=z.__super__.constructor.apply(this,arguments);return x}z.prototype.initialize=function(){};z.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=contentType]",$(this.el)).text("Response Content Type");return this};z.prototype.template=function(){return Handlebars.templates.content_type};return z})(Backbone.View);m=(function(y){v(z,y);function z(){w=z.__super__.constructor.apply(this,arguments);return w}z.prototype.initialize=function(){};z.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=responseContentType]",$(this.el)).text("Response Content Type");return this};z.prototype.template=function(){return Handlebars.templates.response_content_type};return z})(Backbone.View);l=(function(z){v(y,z);function y(){c=y.__super__.constructor.apply(this,arguments);return c}y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:");return this};y.prototype.template=function(){return Handlebars.templates.parameter_content_type};return y})(Backbone.View)}).call(this); \ No newline at end of file +$(function(){$.fn.vAlign=function(){return this.each(function(c){var a=$(this).height();var d=$(this).parent().height();var b=(d-a)/2;$(this).css("margin-top",b)})};$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(b){var d=$(this).closest("form").innerWidth();var c=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10);var a=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",d-c-a)})};$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent();$("ul.downplayed li div.content p").vAlign();$("form.sandbox").submit(function(){var a=true;$(this).find("input.required").each(function(){$(this).removeClass("error");if($(this).val()==""){$(this).addClass("error");$(this).wiggle();a=false}});return a})});function clippyCopiedCallback(b){$("#api_key_copied").fadeIn().delay(1000).fadeOut()}function log(){if(window.console){console.log.apply(console,arguments)}}if(Function.prototype.bind&&console&&typeof console.log=="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(a){console[a]=this.bind(console[a],console)},Function.prototype.call)}var Docs={shebang:function(){var b=$.param.fragment().split("/");b.shift();switch(b.length){case 1:var d="resource_"+b[0];Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});break;case 2:Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});var c=b.join("_");var a=c+"_content";Docs.expandOperation($("#"+a));$("#"+c).slideto({highlight:false});break}},toggleEndpointListForResource:function(b){var a=$("li#resource_"+Docs.escapeResourceName(b)+" ul.endpoints");if(a.is(":visible")){Docs.collapseEndpointListForResource(b)}else{Docs.expandEndpointListForResource(b)}},expandEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);if(b==""){$(".resource ul.endpoints").slideDown();return}$("li#resource_"+b).addClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideDown()},collapseEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);$("li#resource_"+b).removeClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideUp()},expandOperationsForResource:function(a){Docs.expandEndpointListForResource(a);if(a==""){$(".resource ul.endpoints li.operation div.content").slideDown();return}$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(a){Docs.expandEndpointListForResource(a);$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(a){return a.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(a){a.slideDown()},collapseOperation:function(a){a.slideUp()}};(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n \n ";return o}function n(p,o){return'\n \n'}i+='\n\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.main=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",c,h="function",j=this.escapeExpression,p=this;function e(v,u){var r="",t,s;r+='\n
")+"
";if(t=g.notes){t=t.call(v,{hash:{},data:u})}else{t=v.notes;t=typeof t===i?t.apply(v):t}if(t||t===0){s+=t}s+="
\n ";return s}function c(t,s){return'\n\n
Parameter | \nValue | \nDescription | \nParameter Type | \nData Type | \n
---|
HTTP Status Code | \nReason | \n
---|
';if(c=d.sampleJSON){c=c.call(k,{hash:{},data:i})}else{c=k.sampleJSON;c=typeof c===f?c.apply(k):c}g+=h(c)+'
\n \n 0){r[u.name]=u.value}if(u.type==="file"){C=true}}y=t.find("textarea");for(z=0,s=y.length;z0){r.body=u.value}}w=t.find("select");for(x=0,q=w.length;x0){r[u.name]=v}}p.responseContentType=$("div select[name=responseContentType]",$(this.el)).val();p.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val();$(".response_throbber",$(this.el)).show();if(C){return this.handleFileUpload(r,t)}else{return this.model["do"](r,p,this.showCompleteStatus,this.showErrorStatus,this)}}};n.prototype.success=function(p,q){return q.showCompleteStatus(p)};n.prototype.handleFileUpload=function(G,u){var C,t,p,D,B,z,w,s,r,q,F,J,I,H,A,y,x,v,E=this;console.log("it's a file upload");A=u.serializeArray();for(w=0,F=A.length;w
0){return r.join(",")}else{return null}}};n.prototype.hideResponse=function(p){if(p!=null){p.preventDefault()}$(".response",$(this.el)).slideUp();return $(".response_hider",$(this.el)).fadeOut()};n.prototype.showResponse=function(p){var q;q=JSON.stringify(p,null,"\t").replace(/\n/g,"
");return $(".response_body",$(this.el)).html(escape(q))};n.prototype.showErrorStatus=function(q,p){return p.showStatus(q)};n.prototype.showCompleteStatus=function(q,p){return p.showStatus(q)};n.prototype.formatXml=function(w){var s,v,q,x,C,y,r,p,A,B,u,t,z;p=/(>)(<)(\/*)/g;B=/[ ]*(.*)[ ]+\n/g;s=/(<.+>)(.+\n)/g;w=w.replace(p,"$1\n$2$3").replace(B,"$1\n").replace(s,"$1\n$2");r=0;v="";C=w.split("\n");q=0;x="other";A={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0};u=function(I){var E,D,G,K,H,F,J;F={single:Boolean(I.match(/<.+\/>/)),closing:Boolean(I.match(/<\/.+>/)),opening:Boolean(I.match(/<[^!?].*>/))};H=((function(){var L;L=[];for(G in F){J=F[G];if(J){L.push(G)}}return L})())[0];H=H===void 0?"other":H;E=x+"->"+H;x=H;K="";q+=A[E];K=((function(){var M,N,L;L=[];for(D=M=0,N=q;0<=N?M").text(JSON.stringify(JSON.parse(q),null,2));t=$('').append(r)}else{if(v.indexOf("application/xml")===0){r=$("
").text(this.formatXml(q));t=$('').append(r)}else{if(v.indexOf("text/html")===0){r=$("
").html(q);t=$('').append(r)}else{if(v.indexOf("image/")===0){t=$("").attr("src",s.request.url)}else{r=$("
").text(q);t=$('').append(r)}}}}}p=t;$(".request_url",$(this.el)).html("
"+s.request.url+"
");$(".response_code",$(this.el)).html(""+s.status+"
");$(".response_body",$(this.el)).html(p);$(".response_headers",$(this.el)).html(""+JSON.stringify(s.getHeaders(),null," ").replace(/\n/g,"
");$(".response",$(this.el)).slideDown();$(".response_hider",$(this.el)).show();$(".response_throbber",$(this.el)).hide();return hljs.highlightBlock($(".response_body",$(this.el))[0])};n.prototype.toggleOperationContent=function(){var p;p=$("#"+Docs.escapeResourceName(this.model.resourceName)+"_"+this.model.nickname+"_"+this.model.method+"_"+this.model.number+"_content");if(p.is(":visible")){return Docs.collapseOperation(p)}else{return Docs.expandOperation(p)}};return n})(Backbone.View);j=(function(o){e(n,o);function n(){n.__super__.constructor.apply(this,arguments)}n.prototype.initialize=function(){};n.prototype.render=function(){var p;p=this.template();$(this.el).html(p(this.model));return this};n.prototype.template=function(){return Handlebars.templates.status_code};return n})(Backbone.View);f=(function(o){e(n,o);function n(){n.__super__.constructor.apply(this,arguments)}n.prototype.initialize=function(){};n.prototype.render=function(){var v,p,r,u,q,w,t,s;s=this.model.type||this.model.dataType;if(this.model.paramType==="body"){this.model.isBody=true}if(s.toLowerCase()==="file"){this.model.isFile=true}t=this.template();$(this.el).html(t(this.model));q={sampleJSON:this.model.sampleJSON,isParam:true,signature:this.model.signature};if(this.model.sampleJSON){w=new l({model:q,tagName:"div"});$(".model-signature",$(this.el)).append(w.render().el)}else{$(".model-signature",$(this.el)).html(this.model.signature)}p=false;if(this.model.isBody){p=true}v={isParam:p};v.consumes=this.model.consumes;if(p){r=new m({model:v});$(".parameter-content-type",$(this.el)).append(r.render().el)}else{u=new a({model:v});$(".response-content-type",$(this.el)).append(u.render().el)}return this};n.prototype.template=function(){if(this.model.isList){return Handlebars.templates.param_list}else{if(this.options.readOnly){if(this.model.required){return Handlebars.templates.param_readonly_required}else{return Handlebars.templates.param_readonly}}else{if(this.model.required){return Handlebars.templates.param_required}else{return Handlebars.templates.param}}}};return n})(Backbone.View);l=(function(o){e(n,o);function n(){n.__super__.constructor.apply(this,arguments)}n.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"};n.prototype.initialize=function(){};n.prototype.render=function(){var p;p=this.template();$(this.el).html(p(this.model));this.switchToDescription();this.isParam=this.model.isParam;if(this.isParam){$(".notice",$(this.el)).text("Click to set as parameter value")}return this};n.prototype.template=function(){return Handlebars.templates.signature};n.prototype.switchToDescription=function(p){if(p!=null){p.preventDefault()}$(".snippet",$(this.el)).hide();$(".description",$(this.el)).show();$(".description-link",$(this.el)).addClass("selected");return $(".snippet-link",$(this.el)).removeClass("selected")};n.prototype.switchToSnippet=function(p){if(p!=null){p.preventDefault()}$(".description",$(this.el)).hide();$(".snippet",$(this.el)).show();$(".snippet-link",$(this.el)).addClass("selected");return $(".description-link",$(this.el)).removeClass("selected")};n.prototype.snippetToTextArea=function(p){var q;if(this.isParam){if(p!=null){p.preventDefault()}q=$("textarea",$(this.el.parentNode.parentNode.parentNode));if($.trim(q.val())===""){return q.val(this.model.sampleJSON)}}};return n})(Backbone.View);g=(function(n){e(o,n);function o(){o.__super__.constructor.apply(this,arguments)}o.prototype.initialize=function(){};o.prototype.render=function(){var p;p=this.template();$(this.el).html(p(this.model));$("label[for=contentType]",$(this.el)).text("Response Content Type");return this};o.prototype.template=function(){return Handlebars.templates.content_type};return o})(Backbone.View);a=(function(n){e(o,n);function o(){o.__super__.constructor.apply(this,arguments)}o.prototype.initialize=function(){};o.prototype.render=function(){var p;p=this.template();$(this.el).html(p(this.model));$("label[for=responseContentType]",$(this.el)).text("Response Content Type");return this};o.prototype.template=function(){return Handlebars.templates.response_content_type};return o})(Backbone.View);m=(function(o){e(n,o);function n(){n.__super__.constructor.apply(this,arguments)}n.prototype.initialize=function(){};n.prototype.render=function(){var p;p=this.template();$(this.el).html(p(this.model));$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:");return this};n.prototype.template=function(){return Handlebars.templates.parameter_content_type};return n})(Backbone.View)}).call(this);
\ No newline at end of file
diff --git a/src/main/coffeescript/view/OperationView.coffee b/src/main/coffeescript/view/OperationView.coffee
index e8000060..4a79f138 100644
--- a/src/main/coffeescript/view/OperationView.coffee
+++ b/src/main/coffeescript/view/OperationView.coffee
@@ -132,7 +132,7 @@ class OperationView extends Backbone.View
console.log headerParams
# add files
- $.each $('input[type~="file"]'), (i, el) ->
+ for el in form.find('input[type~="file"]')
bodyParam.append($(el).attr('name'), el.files[0])
console.log(bodyParam)
")+"