updated csslint and jshint
This commit is contained in:
parent
76a01e5f05
commit
83bf15c69e
17 changed files with 117 additions and 38 deletions
|
@ -76,6 +76,74 @@ exports.uploadPDF = function(req, res, next) {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Upload PDF
|
||||
*/
|
||||
/*
|
||||
exports.uploadSubmissionFile = function(req, res, next) {
|
||||
|
||||
console.log('inside uploadPDF');
|
||||
|
||||
// console.log('\n\nProperty Descriptor\n-----------');
|
||||
// console.log(Object.getOwnPropertyDescriptor(req.files.file, 'path'));
|
||||
|
||||
console.log(req.files);
|
||||
|
||||
if(req.files){
|
||||
var file, _user, _path;
|
||||
|
||||
for(var i=0; i<req.files.length; i++){
|
||||
file = req.files[i];
|
||||
_user = req.user;
|
||||
_path = file.path;
|
||||
|
||||
|
||||
if (file.size === 0) {
|
||||
return next(new Error('File uploaded is EMPTY'));
|
||||
}else if(file.size > 100000000){
|
||||
return next(new Error('File uploaded exceeds MAX SIZE of 100MB'));
|
||||
}else {
|
||||
fs.exists(_path, function(exists) {
|
||||
|
||||
//If file exists move to user's form directory
|
||||
if(exists) {
|
||||
var newDestination = config.tmpUploadPath+_user.username;
|
||||
var stat = null;
|
||||
try {
|
||||
stat = fs.statSync(newDestination);
|
||||
} catch (err) {
|
||||
fs.mkdirSync(newDestination);
|
||||
}
|
||||
|
||||
if (stat && !stat.isDirectory()) {
|
||||
console.log('Directory cannot be created');
|
||||
return next(new Error('Directory cannot be created because an inode of a different type exists at "' + newDestination + '"'));
|
||||
}
|
||||
|
||||
console.log(path.join(newDestination, pdfFile.filename));
|
||||
|
||||
fs.move(pdfFile.path, path.join(newDestination, pdfFile.filename), function (err) {
|
||||
if (err) {
|
||||
return next(new Error(err.message));
|
||||
}
|
||||
pdfFile.path = path.join(newDestination, pdfFile.filename);
|
||||
console.log(pdfFile.filename + ' uploaded to ' + pdfFile.path);
|
||||
res.json(pdfFile);
|
||||
});
|
||||
|
||||
} else {
|
||||
return next(new Error('Did NOT get your file!'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
return next(new Error('Uploaded files were NOT detected'));
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
/**
|
||||
* Delete a forms submissions
|
||||
*/
|
||||
|
|
|
@ -20,16 +20,18 @@ var storage = multer.diskStorage({
|
|||
}
|
||||
});
|
||||
|
||||
var upload = multer({ storage: storage });
|
||||
var upload = multer({
|
||||
storage: storage
|
||||
});
|
||||
|
||||
module.exports = function(app) {
|
||||
// Form Routes
|
||||
app.route('/upload/pdf')
|
||||
.post(users.requiresLogin, upload.single('file'), forms.uploadPDF);
|
||||
|
||||
app.route('/forms')
|
||||
.get(users.requiresLogin, forms.list)
|
||||
.post(users.requiresLogin, forms.create);
|
||||
//TODO: Need to finish this
|
||||
//app.route('/forms/:formId([a-zA-Z0-9]+)/upload')
|
||||
// .post(forms.uploadSubmissionFile);
|
||||
|
||||
app.route('/forms/:formId([a-zA-Z0-9]+)')
|
||||
.get(forms.read)
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"async": "^1.4.2",
|
||||
"aws-sdk": "^2.3.9",
|
||||
"body-parser": "~1.14.1",
|
||||
"bower": "~1.6.5",
|
||||
"chalk": "^1.1.3",
|
||||
|
@ -41,9 +42,9 @@
|
|||
"grunt": "~0.4.1",
|
||||
"grunt-cli": "~0.1.13",
|
||||
"grunt-concurrent": "~2.3.0",
|
||||
"grunt-contrib-csslint": "~0.5.0",
|
||||
"grunt-contrib-cssmin": "~0.14.0",
|
||||
"grunt-contrib-jshint": "~0.11.3",
|
||||
"grunt-contrib-csslint": "~1.0.0",
|
||||
"grunt-contrib-cssmin": "~1.0.1",
|
||||
"grunt-contrib-jshint": "~1.0.0",
|
||||
"grunt-contrib-uglify": "~0.11.0",
|
||||
"grunt-contrib-watch": "~0.6.1",
|
||||
"grunt-env": "~0.4.1",
|
||||
|
|
27
public/dist/application.js
vendored
27
public/dist/application.js
vendored
File diff suppressed because one or more lines are too long
2
public/dist/application.min.css
vendored
2
public/dist/application.min.css
vendored
File diff suppressed because one or more lines are too long
4
public/dist/application.min.js
vendored
4
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -31,6 +31,7 @@
|
|||
}
|
||||
|
||||
.public-form input, .public-form textarea {
|
||||
background-color: #000000;
|
||||
background-color: rgba(0,0,0,0);
|
||||
border: 2px dashed #ddd!important;
|
||||
}
|
||||
|
@ -243,11 +244,13 @@ form .row.field {
|
|||
border-radius: 3px;
|
||||
margin: 5px;
|
||||
padding: 10px;
|
||||
background-color: #000000;
|
||||
background-color: rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
form .dropdown > .field-input .ui-select-choices-row-inner.active, form .dropdown > .field-input .ui-select-choices-row-inner.active:focus {
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
background-color: #000000;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
}
|
||||
.config-form {
|
||||
max-width: 100%;
|
||||
|
|
|
@ -111,13 +111,14 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
|||
//console.log('nextfield');
|
||||
//console.log($scope.selected.index);
|
||||
//console.log($scope.myform.form_fields.length-1);
|
||||
var selected_index, selected_id;
|
||||
if($scope.selected.index < $scope.myform.form_fields.length-1){
|
||||
var selected_index = $scope.selected.index+1;
|
||||
var selected_id = $scope.myform.form_fields[selected_index]._id;
|
||||
selected_index = $scope.selected.index+1;
|
||||
selected_id = $scope.myform.form_fields[selected_index]._id;
|
||||
$rootScope.setActiveField(selected_id, selected_index, true);
|
||||
} else if($scope.selected.index === $scope.myform.form_fields.length-1) {
|
||||
var selected_index = $scope.selected.index+1;
|
||||
var selected_id = 'submit_field';
|
||||
selected_index = $scope.selected.index+1;
|
||||
selected_id = 'submit_field';
|
||||
$rootScope.setActiveField(selected_id, selected_index, true);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="field row" ng-click="setActiveField(field._id, index, true)">
|
||||
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}">
|
||||
<h3>
|
||||
<span class="fa fa-angle-double-right"></span>
|
||||
<small>{{index}}</small>
|
||||
{{field.title}}
|
||||
<span class="required-error" ng-show="!field.required && !field.fieldValue">optional</span>
|
||||
</h3>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="field row dropdown" ng-click="setActiveField(field._id, index, true)" ng-if="field.fieldOptions.length > 0">
|
||||
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}">
|
||||
<h3>
|
||||
<span class="fa fa-angle-double-right"></span>
|
||||
<small>{{index}}</small>
|
||||
{{field.title}}
|
||||
<span class="required-error" ng-show="!field.required">optional</span>
|
||||
</h3>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
ng-click="setActiveField(field._id, index, true)"
|
||||
ng-if="field.fieldOptions.length > 0"
|
||||
on-enter-key="chooseDefaultOption()">
|
||||
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="!field.required">optional</span></h3></div>
|
||||
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><small>{{index}}</small>{{field.title}} <span class="required-error" ng-show="!field.required">optional</span></h3></div>
|
||||
<div class="col-xs-12 field-input">
|
||||
<div ng-repeat="option in field.fieldOptions" class="row-fluid">
|
||||
<label class="btn col-xs-4"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
on-enter-key="chooseDefaultOption('rating')">
|
||||
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}">
|
||||
<h3>
|
||||
<span class="fa fa-angle-double-right"></span>
|
||||
<small>{{index}}</small>
|
||||
{{field.title}}
|
||||
<span class="required-error" ng-show="!field.required">optional</span>
|
||||
</h3>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="field row" ng-click="setActiveField(field._id, index, true)">
|
||||
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="!field.required">optional</span></h3></div>
|
||||
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><small>{{index}}</small>{{field.title}} <span class="required-error" ng-show="!field.required">optional</span></h3></div>
|
||||
<div class="col-xs-12 field-input">
|
||||
<textarea class="textarea" type="text"
|
||||
ng-model="field.fieldValue"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="textfield field row" ng-click="setActiveField(field._id, index, true)">
|
||||
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}">
|
||||
<h3>
|
||||
<span class="fa fa-angle-double-right"></span> {{field.title}}
|
||||
<small>{{index}}</small>{{field.title}}
|
||||
<span class="required-error" ng-show="!field.required">
|
||||
(optional)
|
||||
</span>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
on-enter-key="chooseDefaultOption('yes_no')">
|
||||
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}">
|
||||
<h3 class="row">
|
||||
<span class="fa fa-angle-double-right"></span> {{field.title}}
|
||||
<small>{{index}}</small>{{field.title}}
|
||||
<span class="required-error" ng-show="field.required && !field.fieldValue">
|
||||
*(required)
|
||||
</span>
|
||||
|
|
|
@ -31,8 +31,8 @@ angular.module('users').config(['$stateProvider',
|
|||
var deferred = $q.defer();
|
||||
if($window.signupDisabled) {
|
||||
$timeout(deferred.reject());
|
||||
}else{
|
||||
\ $timeout(deferred.resolve());
|
||||
} else {
|
||||
$timeout(deferred.resolve());
|
||||
}
|
||||
return deferred.promise;
|
||||
};
|
||||
|
|
|
@ -155,6 +155,11 @@ var questions = [
|
|||
name: 'COVERALLS_REPO_TOKEN',
|
||||
message: 'What is your Coveralls.io token? (optional)'
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
name: 'COVERALLS_REPO_TOKEN',
|
||||
message: 'What is your reCAPTCHA token? (optional)'
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
name: 'email',
|
||||
|
|
Loading…
Reference in a new issue