diff --git a/src/main/javascript/helpers/handlebars.js b/src/main/javascript/helpers/handlebars.js index 226acc30bef..e596e4c3398 100644 --- a/src/main/javascript/helpers/handlebars.js +++ b/src/main/javascript/helpers/handlebars.js @@ -7,7 +7,7 @@ Handlebars.registerHelper('sanitize', function(html) { }); Handlebars.registerHelper('renderTextParam', function(param) { - var result, type = 'text'; + var result, type = 'text', idAtt = ''; var isArray = param.type.toLowerCase() === 'array' || param.allowMultiple; var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default; @@ -16,11 +16,15 @@ Handlebars.registerHelper('renderTextParam', function(param) { } if(param.format && param.format === 'password') { - type = 'password'; + type = 'password'; + } + + if(param.valueId) { + idAtt = ' id=\'' + param.valueId + '\''; } if(isArray) { - result = ''; } else { @@ -29,7 +33,7 @@ Handlebars.registerHelper('renderTextParam', function(param) { parameterClass += ' required'; } result = ''; } return new Handlebars.SafeString(result); diff --git a/src/main/javascript/view/ContentTypeView.js b/src/main/javascript/view/ContentTypeView.js index 5a9b49cb325..bad7ca7b437 100644 --- a/src/main/javascript/view/ContentTypeView.js +++ b/src/main/javascript/view/ContentTypeView.js @@ -4,10 +4,8 @@ SwaggerUi.Views.ContentTypeView = Backbone.View.extend({ initialize: function() {}, render: function(){ + this.model.contentTypeId = 'ct' + Math.random(); $(this.el).html(Handlebars.templates.content_type(this.model)); - - $('label[for=contentType]', $(this.el)).text('Response Content Type'); - return this; } }); \ No newline at end of file diff --git a/src/main/javascript/view/ParameterContentTypeView.js b/src/main/javascript/view/ParameterContentTypeView.js index cf33b3ba824..31a192a9393 100644 --- a/src/main/javascript/view/ParameterContentTypeView.js +++ b/src/main/javascript/view/ParameterContentTypeView.js @@ -4,10 +4,8 @@ SwaggerUi.Views.ParameterContentTypeView = Backbone.View.extend({ initialize: function () {}, render: function(){ + this.model.parameterContentTypeId = 'pct' + Math.random(); $(this.el).html(Handlebars.templates.parameter_content_type(this.model)); - - $('label[for=parameterContentType]', $(this.el)).text('Parameter content type:'); - return this; } diff --git a/src/main/javascript/view/ParameterView.js b/src/main/javascript/view/ParameterView.js index ea7baa126dd..b5079c48e2f 100644 --- a/src/main/javascript/view/ParameterView.js +++ b/src/main/javascript/view/ParameterView.js @@ -31,6 +31,7 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({ this.model.isBody = this.model.paramType === 'body' || this.model.in === 'body'; this.model.isFile = type && type.toLowerCase() === 'file'; this.model.default = (this.model.default || this.model.defaultValue); + this.model.valueId = 'm' + this.model.name + Math.random(); if (this.model.allowableValues) { this.model.isList = true; @@ -98,4 +99,4 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({ } } } -}); +}); \ No newline at end of file diff --git a/src/main/javascript/view/ResponseContentTypeView.js b/src/main/javascript/view/ResponseContentTypeView.js index e391cb19b42..41948ab60c7 100644 --- a/src/main/javascript/view/ResponseContentTypeView.js +++ b/src/main/javascript/view/ResponseContentTypeView.js @@ -4,10 +4,8 @@ SwaggerUi.Views.ResponseContentTypeView = Backbone.View.extend({ initialize: function(){}, render: function(){ + this.model.responseContentTypeId = 'rct' + Math.random(); $(this.el).html(Handlebars.templates.response_content_type(this.model)); - - $('label[for=responseContentType]', $(this.el)).text('Response Content Type'); - return this; } }); \ No newline at end of file diff --git a/src/main/template/apikey_button_view.handlebars b/src/main/template/apikey_button_view.handlebars index 756f3707882..998f911a92f 100644 --- a/src/main/template/apikey_button_view.handlebars +++ b/src/main/template/apikey_button_view.handlebars @@ -1,9 +1,9 @@
diff --git a/src/main/template/basic_auth_button_view.handlebars b/src/main/template/basic_auth_button_view.handlebars index 6b82871429f..13497b88e58 100644 --- a/src/main/template/basic_auth_button_view.handlebars +++ b/src/main/template/basic_auth_button_view.handlebars @@ -1,9 +1,9 @@