diff --git a/src/main/html/index.html b/src/main/html/index.html
index d95471a1247..56751f06fdc 100644
--- a/src/main/html/index.html
+++ b/src/main/html/index.html
@@ -68,6 +68,8 @@
}
addApiKeyAuthorization();
+
+ toTextareas('input.parameter', 'body-textarea');
},
onFailure: function(data) {
log("Unable to Load SwaggerUI");
@@ -79,6 +81,30 @@
showRequestHeaders: false
});
+ function toTextareas(q, cls) {
+ $(q).keypress(function (e) {
+ if (e.which == 13) {
+ toTextarea(e.target, cls);
+ return false;
+ }
+ });
+ }
+
+ function toTextarea(el, cls) {
+ var $el = $(el);
+ var $ta = $(document.createElement('textarea'));
+ var attributes = $el.prop("attributes");
+ $.each(attributes, function() {
+ $ta.attr(this.name, this.value);
+ });
+ var v = $el.val();
+ if (v) v = v + '\n';
+ $ta.val(v);
+ $ta.addClass(cls);
+ $el.replaceWith($ta);
+ $ta.focus();
+ }
+
function addApiKeyAuthorization(){
var key = encodeURIComponent($('#input_apiKey')[0].value);
if(key && key.trim() != "") {