Fix all JSHint errors
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
node_modules
|
||||||
|
test
|
||||||
src/main/javascript/doc.js
|
src/main/javascript/doc.js
|
||||||
dist
|
dist
|
||||||
lib
|
lib
|
||||||
@@ -23,13 +23,13 @@
|
|||||||
"$": false,
|
"$": false,
|
||||||
"jQuery": false,
|
"jQuery": false,
|
||||||
"marked": false,
|
"marked": false,
|
||||||
"HeaderView": false,
|
|
||||||
"MainView": false,
|
|
||||||
"Docs": false,
|
"Docs": false,
|
||||||
"SwaggerClient": false,
|
"SwaggerClient": false,
|
||||||
"Handlebars": false,
|
"Handlebars": false,
|
||||||
"ApiKeyAuthorization": false,
|
"ApiKeyAuthorization": false,
|
||||||
"PasswordAuthorization": false,
|
"PasswordAuthorization": false,
|
||||||
"hljs": false
|
"hljs": false,
|
||||||
|
"SwaggerUi": false,
|
||||||
|
"swaggerUi": false // TODO: remove me
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
12
dist/swagger-ui.js
vendored
12
dist/swagger-ui.js
vendored
@@ -200,8 +200,7 @@ window.SwaggerUi = Backbone.Router.extend({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.SwaggerUi.Views = {};
|
window.SwaggerUi.Views = {};
|
||||||
window.SwaggerUi = SwaggerUi;
|
|
||||||
this["Handlebars"] = this["Handlebars"] || {};
|
this["Handlebars"] = this["Handlebars"] || {};
|
||||||
this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {};
|
this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {};
|
||||||
this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
|
this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
|
||||||
@@ -1159,7 +1158,7 @@ SwaggerUi.Views.HeaderView = Backbone.View.extend({
|
|||||||
|
|
||||||
update: function(url, apiKey, trigger){
|
update: function(url, apiKey, trigger){
|
||||||
if (trigger === undefined) {
|
if (trigger === undefined) {
|
||||||
trigger = false
|
trigger = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#input_baseUrl').val(url);
|
$('#input_baseUrl').val(url);
|
||||||
@@ -1509,7 +1508,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
|
|
||||||
addStatusCode: function(statusCode) {
|
addStatusCode: function(statusCode) {
|
||||||
// Render status codes
|
// Render status codes
|
||||||
var statusCodeView = new StatusCodeView({model: statusCode, tagName: 'tr'});
|
var statusCodeView = new SwaggerUi.Views.StatusCodeView({model: statusCode, tagName: 'tr'});
|
||||||
$('.operation-status', $(this.el)).append(statusCodeView.render().el);
|
$('.operation-status', $(this.el)).append(statusCodeView.render().el);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -2053,7 +2052,7 @@ SwaggerUi.Views.ResourceView = Backbone.View.extend({
|
|||||||
operation.nickname = id;
|
operation.nickname = id;
|
||||||
operation.parentId = this.model.id;
|
operation.parentId = this.model.id;
|
||||||
this.addOperation(operation);
|
this.addOperation(operation);
|
||||||
};
|
}
|
||||||
|
|
||||||
$('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource'));
|
$('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource'));
|
||||||
$('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource'));
|
$('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource'));
|
||||||
@@ -2163,7 +2162,7 @@ SwaggerUi.Views.SignatureView = Backbone.View.extend({
|
|||||||
});
|
});
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var StatusCodeView = Backbone.View.extend({
|
SwaggerUi.Views.StatusCodeView = Backbone.View.extend({
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -2171,6 +2170,7 @@ var StatusCodeView = Backbone.View.extend({
|
|||||||
render: function(){
|
render: function(){
|
||||||
$(this.el).html(Handlebars.templates.status_code(this.model));
|
$(this.el).html(Handlebars.templates.status_code(this.model));
|
||||||
|
|
||||||
|
// TODO get rid of "swaggerUi" global dependency
|
||||||
if (swaggerUi.api.models.hasOwnProperty(this.model.responseModel)) {
|
if (swaggerUi.api.models.hasOwnProperty(this.model.responseModel)) {
|
||||||
var responseModel = {
|
var responseModel = {
|
||||||
sampleJSON: JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(), null, 2),
|
sampleJSON: JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(), null, 2),
|
||||||
|
|||||||
4
dist/swagger-ui.min.js
vendored
4
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -96,13 +96,13 @@ gulp.task('copy', ['less'], function() {
|
|||||||
gulp
|
gulp
|
||||||
.src(['./lib/**/*.{js,map}'])
|
.src(['./lib/**/*.{js,map}'])
|
||||||
.pipe(gulp.dest('./dist/lib'))
|
.pipe(gulp.dest('./dist/lib'))
|
||||||
.on('error', log)
|
.on('error', log);
|
||||||
|
|
||||||
// copy all files inside html folder
|
// copy all files inside html folder
|
||||||
gulp
|
gulp
|
||||||
.src(['./src/main/html/**/*'])
|
.src(['./src/main/html/**/*'])
|
||||||
.pipe(gulp.dest('./dist'))
|
.pipe(gulp.dest('./dist'))
|
||||||
.on('error', log)
|
.on('error', log);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,4 +130,4 @@ function log(error) {
|
|||||||
|
|
||||||
|
|
||||||
gulp.task('default', ['dist', 'copy']);
|
gulp.task('default', ['dist', 'copy']);
|
||||||
gulp.task('serve', ['connect', 'watch'])
|
gulp.task('serve', ['connect', 'watch']);
|
||||||
|
|||||||
@@ -194,5 +194,4 @@ window.SwaggerUi = Backbone.Router.extend({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.SwaggerUi.Views = {};
|
window.SwaggerUi.Views = {};
|
||||||
window.SwaggerUi = SwaggerUi;
|
|
||||||
@@ -42,7 +42,7 @@ SwaggerUi.Views.HeaderView = Backbone.View.extend({
|
|||||||
|
|
||||||
update: function(url, apiKey, trigger){
|
update: function(url, apiKey, trigger){
|
||||||
if (trigger === undefined) {
|
if (trigger === undefined) {
|
||||||
trigger = false
|
trigger = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#input_baseUrl').val(url);
|
$('#input_baseUrl').val(url);
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
|
|
||||||
addStatusCode: function(statusCode) {
|
addStatusCode: function(statusCode) {
|
||||||
// Render status codes
|
// Render status codes
|
||||||
var statusCodeView = new StatusCodeView({model: statusCode, tagName: 'tr'});
|
var statusCodeView = new SwaggerUi.Views.StatusCodeView({model: statusCode, tagName: 'tr'});
|
||||||
$('.operation-status', $(this.el)).append(statusCodeView.render().el);
|
$('.operation-status', $(this.el)).append(statusCodeView.render().el);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ SwaggerUi.Views.ResourceView = Backbone.View.extend({
|
|||||||
operation.nickname = id;
|
operation.nickname = id;
|
||||||
operation.parentId = this.model.id;
|
operation.parentId = this.model.id;
|
||||||
this.addOperation(operation);
|
this.addOperation(operation);
|
||||||
};
|
}
|
||||||
|
|
||||||
$('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource'));
|
$('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource'));
|
||||||
$('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource'));
|
$('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource'));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var StatusCodeView = Backbone.View.extend({
|
SwaggerUi.Views.StatusCodeView = Backbone.View.extend({
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -8,6 +8,7 @@ var StatusCodeView = Backbone.View.extend({
|
|||||||
render: function(){
|
render: function(){
|
||||||
$(this.el).html(Handlebars.templates.status_code(this.model));
|
$(this.el).html(Handlebars.templates.status_code(this.model));
|
||||||
|
|
||||||
|
// TODO get rid of "swaggerUi" global dependency
|
||||||
if (swaggerUi.api.models.hasOwnProperty(this.model.responseModel)) {
|
if (swaggerUi.api.models.hasOwnProperty(this.model.responseModel)) {
|
||||||
var responseModel = {
|
var responseModel = {
|
||||||
sampleJSON: JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(), null, 2),
|
sampleJSON: JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(), null, 2),
|
||||||
|
|||||||
Reference in New Issue
Block a user