This commit is contained in:
Tony Tam
2013-07-16 20:59:46 -07:00
parent f4d77d7124
commit e72dbd6bc6
3 changed files with 6 additions and 18 deletions

13
dist/swagger-ui.js vendored
View File

@@ -1775,7 +1775,7 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
}; };
OperationView.prototype.submitOperation = function(e) { OperationView.prototype.submitOperation = function(e) {
var error_free, form, map, o, opts, _i, _j, _len, _len1, _ref, _ref1; var error_free, form, map, o, opts, _i, _len, _ref;
if (e != null) { if (e != null) {
e.preventDefault(); e.preventDefault();
} }
@@ -1799,22 +1799,13 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
opts = { opts = {
parent: this parent: this
}; };
_ref = form.serializeArray(); _ref = form.find(".body-textarea,.parameter");
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
o = _ref[_i]; o = _ref[_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;
}
}
_ref1 = form.find(".body-textarea,.parameter");
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
o = _ref1[_j];
if ((o.value != null) && jQuery.trim(o.value).length > 0) {
console.log(o.name + ", " + o.value);
map[o.name] = encodeURI(o.value); map[o.name] = encodeURI(o.value);
} }
} }
console.log(map);
opts.responseContentType = $("div select[name=responseContentType]", $(this.el)).val(); opts.responseContentType = $("div select[name=responseContentType]", $(this.el)).val();
opts.requestContentType = $("div select[name=parameterContentType]", $(this.el)).val(); opts.requestContentType = $("div select[name=parameterContentType]", $(this.el)).val();
return this.model["do"](map, opts, this.showCompleteStatus, this.showErrorStatus, this); return this.model["do"](map, opts, this.showCompleteStatus, this.showErrorStatus, this);

File diff suppressed because one or more lines are too long

View File

@@ -70,17 +70,14 @@ class OperationView extends Backbone.View
if error_free if error_free
map = {} map = {}
opts = {parent: @} opts = {parent: @}
for o in form.serializeArray() #for o in form.serializeArray()
if(o.value? && jQuery.trim(o.value).length > 0) #if(o.value? && jQuery.trim(o.value).length > 0)
map[o.name] = o.value #map[o.name] = o.value
for o in form.find(".body-textarea,.parameter") for o in form.find(".body-textarea,.parameter")
if(o.value? && jQuery.trim(o.value).length > 0) if(o.value? && jQuery.trim(o.value).length > 0)
console.log o.name + ", " + o.value
map[o.name] = encodeURI(o.value) map[o.name] = encodeURI(o.value)
console.log map
opts.responseContentType = $("div select[name=responseContentType]", $(@el)).val() opts.responseContentType = $("div select[name=responseContentType]", $(@el)).val()
opts.requestContentType = $("div select[name=parameterContentType]", $(@el)).val() opts.requestContentType = $("div select[name=parameterContentType]", $(@el)).val()