fix jshint

This commit is contained in:
Toan Vo 2016-10-23 11:31:18 +07:00
parent cc2d6dadf0
commit 2fe9607e43
5 changed files with 78 additions and 76 deletions

View file

@ -8,7 +8,7 @@
"curly": false, // Require {} for every new block or scope. "curly": false, // Require {} for every new block or scope.
"eqeqeq": true, // Require triple equals i.e. `===`. "eqeqeq": true, // Require triple equals i.e. `===`.
"immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` "immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
"latedef": true, // Prohibit variable use before definition. "latedef": false, // Prohibit variable use before definition.
"newcap": false, // Require capitalization of all constructor functions e.g. `new F()`. "newcap": false, // Require capitalization of all constructor functions e.g. `new F()`.
"noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`. "noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`.
"quotmark": "single", // Define quotes to string values. "quotmark": "single", // Define quotes to string values.

View file

@ -145,7 +145,9 @@ FormSubmissionSchema.pre('save', function (next) {
if (this.hasPlugins.oscarhost) { if (this.hasPlugins.oscarhost) {
mongoose.model('Form').findById(self.form, function (err, _form) { mongoose.model('Form').findById(self.form, function (err, _form) {
var form_ids = _.map(_.pluck(_form.form_fields, '_id'), function(id){ return ''+id;}), var form_ids = _.map(_.pluck(_form.form_fields, '_id'), function (id) {
return '' + id;
}),
submission_ids = _.pluck(self.form_fields, '_id'); submission_ids = _.pluck(self.form_fields, '_id');
// console.log('Form form_field ids\n--------'); // console.log('Form form_field ids\n--------');
@ -253,7 +255,7 @@ FormSubmissionSchema.pre('save', function (next){
if (this.isModified('ipAddr') || !this.geoLocation) { if (this.isModified('ipAddr') || !this.geoLocation) {
freegeoip.getLocation(this.ipAddr, function (err, location) { freegeoip.getLocation(this.ipAddr, function (err, location) {
if (err) return next(err); if (err) return next(err);
self.geoLocation = location self.geoLocation = location;
return next(); return next();
}); });
} }

View file

@ -16,8 +16,8 @@ module.exports = function() {
function (username, password, done) { function (username, password, done) {
User.findOne({ User.findOne({
$or: [ $or: [
{ "username": username}, {'username': username},
{ "email": username} {'email': username}
] ]
}, function (err, user) { }, function (err, user) {
if (err) { if (err) {

View file

@ -409,7 +409,7 @@ angular.module('view-form').config(['$stateProvider',
}, },
controller: 'SubmitFormController', controller: 'SubmitFormController',
controllerAs: 'ctrl' controllerAs: 'ctrl'
}) });
} }
]); ]);

View file

@ -17,6 +17,6 @@ angular.module('view-form').config(['$stateProvider',
}, },
controller: 'SubmitFormController', controller: 'SubmitFormController',
controllerAs: 'ctrl' controllerAs: 'ctrl'
}) });
} }
]); ]);