Merge branch 'master' of git://github.com/whitef0x0/tellform
7
.gitignore
vendored
@ -1,9 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
ecosystem.js
|
||||
=======
|
||||
dist/
|
||||
npm-debug.*
|
||||
>>>>>>> 08a672a87432ca61efb3613b22e5a8b16698f722
|
||||
docs/Oscar_Credentials.md
|
||||
scripts/test_oscarhost.js
|
||||
scripts/oscarhost/private/
|
||||
@ -20,7 +15,6 @@ Oscar_Credentials.*
|
||||
|
||||
# Node and related ecosystem
|
||||
# ==========================
|
||||
ecosystem.json
|
||||
.nodemonignore
|
||||
.sass-cache/
|
||||
npm-debug.log
|
||||
@ -34,7 +28,6 @@ app/tests/coverage/
|
||||
# ======================
|
||||
config/sslcerts/*.pem
|
||||
access.log
|
||||
public/dist/
|
||||
public/dist/populate_template_cache.js
|
||||
uploads/
|
||||
# API keys file
|
||||
|
||||
6
PULL_REQUEST_TEMPLATE.md
Normal file
@ -0,0 +1,6 @@
|
||||
Include the following information with your issue:
|
||||
|
||||
1) Nodemailer version you are having problems with (eg. v1.3.0)
|
||||
2) Node.js version you are using (run node -v to see it, eg v5.5.0)
|
||||
3) Your operating system (eg. Windows 10, Ubuntu 14.04 etc.)
|
||||
4) If possible, include a minimal test case that can be used to verify your issue (link to a gist would be great!)
|
||||
16
README.md
@ -17,6 +17,8 @@ TellForm is an *opensource alternative to TypeForm* built ontop of nodejs that c
|
||||
|
||||
[Contact Form Example](https://stage.tellform.com/#!/forms/57196d592601ed12074eecc0)
|
||||
|
||||
[Patient Registration Example](https://stage.tellform.com/#!/forms/573f8329d18419854559c29c)
|
||||
|
||||
##Screenshots
|
||||

|
||||
|
||||
@ -147,9 +149,17 @@ $ sh ./scripts/generate-ssl-certs.sh
|
||||
Windows users can follow instructions found [here](http://www.websense.com/support/article/kbarticle/How-to-use-OpenSSL-and-Microsoft-Certification-Authority).
|
||||
After you've generated the key and certificate, place them in the *config/sslcerts* folder.
|
||||
|
||||
## Where to get help
|
||||
|
||||
## Credits
|
||||
Inspired/built off the great work of the [MeanJS team](https://github.com/mean/).
|
||||
[Gitter Chat](https://gitter.im/whitef0x0/tellform)
|
||||
|
||||
[Official Twitter](https://twitter.com/tellform_real)
|
||||
|
||||
## Contributor list
|
||||
|
||||
[David Baldwynn](https://github.com/whitef0x0/)
|
||||
|
||||
[Samuel Laulhau](https://github.com/lalop)
|
||||
|
||||
## Mentions on the Web
|
||||
|
||||
@ -163,4 +173,6 @@ Inspired/built off the great work of the [MeanJS team](https://github.com/mean/)
|
||||
|
||||
[Reddit Posts](https://www.reddit.com/domain/tellform.com/)
|
||||
|
||||
## Credits
|
||||
Inspired/built off the great work of the [MeanJS team](https://github.com/mean/) and [Typeform](http://typeform.com)
|
||||
|
||||
|
||||
@ -49,8 +49,10 @@ var config_nev = function () {
|
||||
}
|
||||
}
|
||||
|
||||
}, function(err, options){
|
||||
if(err) throw err;
|
||||
nev.generateTempUserModel(User);
|
||||
});
|
||||
nev.generateTempUserModel(User);
|
||||
};
|
||||
|
||||
config_nev();
|
||||
|
||||
@ -27,7 +27,6 @@ module.exports = function(app) {
|
||||
|
||||
// Setting up the users authentication api
|
||||
if(!config.signupDisabled) {
|
||||
console.log('signupDisabled');
|
||||
app.route('/auth/signup').post(users.signup);
|
||||
}
|
||||
app.route('/auth/signin').post(users.signin);
|
||||
|
||||
5
config/env/production.js
vendored
@ -55,7 +55,10 @@ module.exports = {
|
||||
from: process.env.MAILER_FROM || 'no-reply@tellform.com',
|
||||
options: {
|
||||
service: process.env.MAILER_SERVICE_PROVIDER || '',
|
||||
ssl: true,
|
||||
ssl: false,
|
||||
host: 'smtp.sparkpostmail.com',
|
||||
port: 587,
|
||||
secure: false,
|
||||
auth: {
|
||||
user: process.env.MAILER_EMAIL_ID || '',
|
||||
pass: process.env.MAILER_PASSWORD || ''
|
||||
|
||||
@ -15,8 +15,7 @@ module.exports = function() {
|
||||
* We'll Look for a valid NODE_ENV variable and if one cannot be found load the development NODE_ENV
|
||||
*/
|
||||
var environmentFiles = glob.sync('./config/env/' + process.env.NODE_ENV + '.js');
|
||||
console.log('process.env.MAILER_EMAIL_ID: '+process.env.MAILER_EMAIL_ID );
|
||||
|
||||
|
||||
if (!environmentFiles.length) {
|
||||
if (process.env.NODE_ENV) {
|
||||
console.error(chalk.red('No configuration file found for "' + process.env.NODE_ENV + '" environment using development instead'));
|
||||
|
||||
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 72 KiB |
@ -1,16 +1,19 @@
|
||||
{
|
||||
"apps" : [{
|
||||
"name" : "tellform",
|
||||
"script" : "/usr/local/bin/grunt",
|
||||
}],
|
||||
"name" : "tellform",
|
||||
"script" : "server.js",
|
||||
"instances": "max",
|
||||
"exec_mode": "cluster",
|
||||
"max_memory_restart" : "200M"
|
||||
}],
|
||||
"deploy" : {
|
||||
"stage" : {
|
||||
"user" : "polydaic",
|
||||
"host" : "159.203.42.158",
|
||||
"ref" : "origin/master",
|
||||
"ref" : "origin/stage",
|
||||
"repo" : "git@github.com:whitef0x0/tellform.git",
|
||||
"path" : "/opt/deploy",
|
||||
"post-deploy" : "npm install && bower install && pm2 startOrRestart ecosystem.json --env production",
|
||||
"post-deploy" : "npm install && pm2 startOrGracefulReload ecosystem.json --env production",
|
||||
"env" : {
|
||||
"NODE_ENV": "production",
|
||||
"BASE_URL": "stage.tellform.com"
|
||||
@ -22,7 +25,7 @@
|
||||
"ref" : "origin/master",
|
||||
"repo" : "git@github.com:whitef0x0/tellform.git",
|
||||
"path" : "/opt/deploy",
|
||||
"post-deploy" : "npm install && bower install && pm2 startOrRestart ecosystem.json --env production",
|
||||
"post-deploy" : "npm install && pm2 startOrGracefulReload ecosystem.json --env production",
|
||||
"env" : {
|
||||
"NODE_ENV": "production",
|
||||
"BASE_URL": "admin.tellform.com"
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
"connect-mongo": "~0.8.2",
|
||||
"consolidate": "~0.13.1",
|
||||
"cookie-parser": "~1.4.0",
|
||||
"dotenv": "^2.0.0",
|
||||
"email-verification": "whitef0x0/node-email-verification",
|
||||
"envfile": "^2.0.1",
|
||||
"express": "~4.13.3",
|
||||
|
||||
0
public/dist/.placeholder
vendored
Normal file
166
public/dist/application.js
vendored
2
public/dist/application.min.css
vendored
8
public/dist/application.min.js
vendored
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 10 KiB |
@ -334,7 +334,14 @@ div.config-form .row.field {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
|
||||
/*Override Select2 UI*/
|
||||
.ui-select-choices.ui-select-dropdown {
|
||||
top:2.5em!important;
|
||||
}
|
||||
.ui-select-toggle {
|
||||
box-shadow:none!important;
|
||||
border:none!important;
|
||||
}
|
||||
|
||||
.current-fields .tool-panel > .panel-default:hover {
|
||||
border-color: #9d9d9d;
|
||||
|
||||
@ -6,7 +6,7 @@ function removeDateFieldsFunc(o) {
|
||||
function eachObject(v,k){
|
||||
|
||||
if(k === 'lastModified' || k === 'created'){
|
||||
delete clone[i][k];
|
||||
delete clone[k];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,14 +6,12 @@ angular.module('forms').directive('keyToOption', function(){
|
||||
scope: {
|
||||
field: '='
|
||||
},
|
||||
link: function($scope, $element, $attrs) {
|
||||
link: function($scope, $element, $attrs, $select) {
|
||||
$element.bind('keydown keypress', function(event) {
|
||||
console.log('keypress');
|
||||
|
||||
var keyCode = event.which || event.keyCode;
|
||||
var index = parseInt(String.fromCharCode(keyCode))-1;
|
||||
console.log($scope.field);
|
||||
|
||||
//console.log($scope.field);
|
||||
|
||||
if (index < $scope.field.fieldOptions.length) {
|
||||
event.preventDefault();
|
||||
|
||||
@ -53,25 +53,25 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||
|
||||
if(!$scope.noscroll){
|
||||
//Focus on submit button
|
||||
if( $scope.selected.index === $scope.myform.form_fields.length-1 && $scope.fieldBottom < 200){
|
||||
if( $scope.selected.index === $scope.myform.visible_form_fields.length-1 && $scope.fieldBottom < 200){
|
||||
field_index = $scope.selected.index+1;
|
||||
field_id = 'submit_field';
|
||||
$scope.setActiveField(field_id, field_index, false);
|
||||
}
|
||||
//Focus on field above submit button
|
||||
else if($scope.selected.index === $scope.myform.form_fields.length){
|
||||
else if($scope.selected.index === $scope.myform.visible_form_fields.length){
|
||||
if($scope.fieldTop > 200){
|
||||
field_index = $scope.selected.index-1;
|
||||
field_id = $scope.myform.form_fields[field_index]._id;
|
||||
field_id = $scope.myform.visible_form_fields[field_index]._id;
|
||||
$scope.setActiveField(field_id, field_index, false);
|
||||
}
|
||||
}else if( $scope.fieldBottom < 0){
|
||||
field_index = $scope.selected.index+1;
|
||||
field_id = $scope.myform.form_fields[field_index]._id;
|
||||
field_id = $scope.myform.visible_form_fields[field_index]._id;
|
||||
$scope.setActiveField(field_id, field_index, false);
|
||||
}else if ( $scope.selected.index !== 0 && $scope.fieldTop > 0) {
|
||||
field_index = $scope.selected.index-1;
|
||||
field_id = $scope.myform.form_fields[field_index]._id;
|
||||
field_id = $scope.myform.visible_form_fields[field_index]._id;
|
||||
$scope.setActiveField(field_id, field_index, false);
|
||||
}
|
||||
//console.log('$scope.selected.index: '+$scope.selected.index);
|
||||
@ -80,6 +80,10 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||
}
|
||||
};
|
||||
|
||||
$rootScope.setDropdownOption = function(){
|
||||
console.log('setDropdownOption index: ');
|
||||
};
|
||||
|
||||
/*
|
||||
** Field Controls
|
||||
*/
|
||||
@ -89,8 +93,8 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||
//console.log($scope.selected);
|
||||
return;
|
||||
}
|
||||
console.log('field_id: '+field_id);
|
||||
console.log('field_index: '+field_index);
|
||||
//console.log('field_id: '+field_id);
|
||||
//console.log('field_index: '+field_index);
|
||||
//console.log($scope.selected);
|
||||
|
||||
$scope.selected._id = field_id;
|
||||
@ -103,28 +107,38 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||
$scope.noscroll = false;
|
||||
setTimeout(function() {
|
||||
if (document.querySelectorAll('.activeField .focusOn')[0]) {
|
||||
console.log(document.querySelectorAll('.activeField .focusOn')[0]);
|
||||
//console.log(document.querySelectorAll('.activeField .focusOn')[0]);
|
||||
document.querySelectorAll('.activeField .focusOn')[0].focus();
|
||||
} else {
|
||||
//console.log(document.querySelectorAll('.activeField input')[0]);
|
||||
document.querySelectorAll('.activeField input')[0].focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}else {
|
||||
setTimeout(function() {
|
||||
if (document.querySelectorAll('.activeField .focusOn')[0]) {
|
||||
//console.log(document.querySelectorAll('.activeField .focusOn')[0]);
|
||||
document.querySelectorAll('.activeField .focusOn')[0].focus();
|
||||
} else {
|
||||
document.querySelectorAll('.activeField input')[0].focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$rootScope.nextField = $scope.nextField = function(){
|
||||
//console.log('nextfield');
|
||||
//console.log($scope.selected.index);
|
||||
//console.log($scope.myform.form_fields.length-1);
|
||||
//console.log($scope.myform.visible_form_fields.length-1);
|
||||
var selected_index, selected_id;
|
||||
if($scope.selected.index < $scope.myform.form_fields.length-1){
|
||||
if($scope.selected.index < $scope.myform.visible_form_fields.length-1){
|
||||
selected_index = $scope.selected.index+1;
|
||||
selected_id = $scope.myform.form_fields[selected_index]._id;
|
||||
selected_id = $scope.myform.visible_form_fields[selected_index]._id;
|
||||
$rootScope.setActiveField(selected_id, selected_index, true);
|
||||
} else if($scope.selected.index === $scope.myform.form_fields.length-1) {
|
||||
console.log('Second last element');
|
||||
} else if($scope.selected.index === $scope.myform.visible_form_fields.length-1) {
|
||||
//console.log('Second last element');
|
||||
selected_index = $scope.selected.index+1;
|
||||
selected_id = 'submit_field';
|
||||
$rootScope.setActiveField(selected_id, selected_index, true);
|
||||
@ -134,7 +148,7 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||
$rootScope.prevField = $scope.prevField = function(){
|
||||
if($scope.selected.index > 0){
|
||||
var selected_index = $scope.selected.index - 1;
|
||||
var selected_id = $scope.myform.form_fields[selected_index]._id;
|
||||
var selected_id = $scope.myform.visible_form_fields[selected_index]._id;
|
||||
$scope.setActiveField(selected_id, selected_index, true);
|
||||
}
|
||||
};
|
||||
@ -144,8 +158,8 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||
*/
|
||||
$scope.exitStartPage = function(){
|
||||
$scope.myform.startPage.showStart = false;
|
||||
if($scope.myform.form_fields.length > 0){
|
||||
$scope.selected._id = $scope.myform.form_fields[0]._id;
|
||||
if($scope.myform.visible_form_fields.length > 0){
|
||||
$scope.selected._id = $scope.myform.visible_form_fields[0]._id;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -11,11 +11,10 @@
|
||||
<span class="required-error" ng-show="!field.required">optional</span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="col-xs-12 field-input ">
|
||||
<ui-select ng-model="field.fieldValue"
|
||||
<div class="col-xs-12 field-input">
|
||||
<ui-select ng-model="field.fieldValue"
|
||||
theme="selectize"
|
||||
ng-model-options="{ debounce: 250 }"
|
||||
ng-required="field.required"
|
||||
ng-required="field.required"
|
||||
ng-disabled="field.disabled"
|
||||
ng-change="$root.nextField()">
|
||||
<ui-select-match placeholder="Type or select an option">
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 618 B |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1018 B |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.3 KiB |
@ -174,7 +174,7 @@ var questions = [
|
||||
|
||||
console.log(chalk.green('\n\nHi, welcome to TellForm Setup'));
|
||||
|
||||
console.log(chalk.green('This will only run the first time you run TellForm\n--------------------------------------------------\n\n'));
|
||||
console.log(chalk.green('You should only run this the first time you setup TellForm\n--------------------------------------------------\n\n'));
|
||||
|
||||
inquirer.prompt([questions[0]]).then(function (confirmAns) {
|
||||
if(confirmAns['shouldContinue']) {
|
||||
@ -209,6 +209,9 @@ inquirer.prompt([questions[0]]).then(function (confirmAns) {
|
||||
console.log(chalk.green('Successfully created user'));
|
||||
delete email;
|
||||
delete pass;
|
||||
|
||||
console.log(chalk.green('Have fun using TellForm!'));
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
11
server.js
@ -2,11 +2,16 @@
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
//Load ENV vars from .env
|
||||
require('dotenv').config();
|
||||
|
||||
var init = require('./config/init')(),
|
||||
config = require('./config/config'),
|
||||
mongoose = require('mongoose'),
|
||||
chalk = require('chalk');
|
||||
|
||||
|
||||
/**
|
||||
* Main application entry file.
|
||||
* Please note that the order of loading is important.
|
||||
@ -46,3 +51,9 @@ if (process.env.NODE_ENV === 'secure') {
|
||||
console.log(chalk.green('HTTPs:\t\t\t\ton'));
|
||||
}
|
||||
console.log('--');
|
||||
|
||||
process.on('uncaughtException', function (err) {
|
||||
console.error((new Date).toUTCString() + ' uncaughtException:', err.message);
|
||||
console.error(err.stack);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||