readded modification for multichoice and rating inputs
This commit is contained in:
parent
fcfea416e8
commit
d02573cc0a
|
@ -5,8 +5,7 @@
|
|||
*/
|
||||
var mongoose = require('mongoose'),
|
||||
Schema = mongoose.Schema,
|
||||
_ = require('lodash'),
|
||||
math = require('mathjs');
|
||||
_ = require('lodash');
|
||||
|
||||
var schemaOptions = {
|
||||
toObject: {
|
||||
|
|
|
@ -32,19 +32,14 @@
|
|||
|
||||
<!-- Fav Icon -->
|
||||
<link href="/static/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="/static/lib/font-awesome/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="/static/lib/bootstrap/dist/css/bootstrap.min.css">
|
||||
<!--Bower CSS dependencies-->
|
||||
{% for bowerCssFile in bowerCssFiles %}
|
||||
<link rel="stylesheet" href="{{bowerCssFile}}">
|
||||
{% endfor %}
|
||||
<link rel="stylesheet" href="/static/lib/angular-input-stars/angular-input-stars.css">
|
||||
<link rel="stylesheet" href="/static/lib/jquery-ui/themes/flick/jquery-ui.css"/>
|
||||
<link rel="stylesheet" href="/static/modules/core/css/github-fork-ribbon.css"/>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<link rel="stylesheet" href="gh-fork-ribbon.ie.css">
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" href="/static/lib/jquery-ui/themes/flick/jquery-ui.min.css"/>
|
||||
<!-- end Bower CSS dependencies-->
|
||||
|
||||
<!--Application CSS Files-->
|
||||
|
@ -61,11 +56,7 @@
|
|||
</head>
|
||||
|
||||
<body ng-cloak>
|
||||
<!--<div class="github-fork-ribbon-wrapper right-bottom hidden-xs">
|
||||
<div class="github-fork-ribbon">
|
||||
<a href="https://github.com/whitef0x0/tellform">Fork me on GitHub</a>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<section class="content">
|
||||
<section ui-view></section>
|
||||
</section>
|
||||
|
@ -83,7 +74,7 @@
|
|||
</script>
|
||||
|
||||
<!--Socket.io Client Dependency-->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.js"></script>
|
||||
<script src="/static/lib/socket.io-client/dist/socket.io.min.js"></script>
|
||||
|
||||
<!--Bower JS dependencies-->
|
||||
{% for bowerJSFile in bowerJSFiles %}
|
||||
|
|
|
@ -41,12 +41,9 @@
|
|||
<link rel="stylesheet" href="{{bowerCssFile}}">
|
||||
{% endfor %}
|
||||
<link rel="stylesheet" href="/static/lib/angular-input-stars/angular-input-stars.css">
|
||||
<link rel="stylesheet" href="/static//lib/jquery-ui/themes/flick/jquery-ui.css"/>
|
||||
<link rel="stylesheet" href="/static//lib/jquery-ui/themes/flick/jquery-ui.mdcss"/>
|
||||
<link rel="stylesheet" href="/static/modules/core/css/github-fork-ribbon.css"/>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<link rel="stylesheet" href="gh-fork-ribbon.ie.css">
|
||||
<![endif]-->
|
||||
<!-- end Bower CSS dependencies-->
|
||||
|
||||
<!--Application CSS Files-->
|
||||
|
@ -63,11 +60,6 @@
|
|||
</head>
|
||||
|
||||
<body ng-cloak>
|
||||
<!--<div class="github-fork-ribbon-wrapper right-bottom hidden-xs">
|
||||
<div class="github-fork-ribbon">
|
||||
<a href="https://github.com/whitef0x0/tellform">Fork me on GitHub</a>
|
||||
</div>
|
||||
</div>-->
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<script src="/static/lib/file-saver.js/FileSaver.js" type="text/javascript"></script>
|
||||
|
|
|
@ -36,15 +36,14 @@
|
|||
"js-yaml": "^3.6.1",
|
||||
"angular-ui-select": "https://github.com/whitef0x0/ui-select.git#compiled",
|
||||
"angular-translate": "~2.11.0",
|
||||
"ng-device-detector": "^3.0.1",
|
||||
"ng-translate": "*",
|
||||
"deep-diff": "^0.3.4",
|
||||
"mathjs": "^3.4.1",
|
||||
"jsep": "^0.3.1",
|
||||
"ngclipboard": "^1.1.1",
|
||||
"mobile-detect": "^1.3.3",
|
||||
"socket.io-client": "^1.7.2",
|
||||
"css-toggle-switch": "^4.0.2"
|
||||
"css-toggle-switch": "^4.0.2",
|
||||
"angular-strap": "^2.3.12"
|
||||
},
|
||||
"resolutions": {
|
||||
"angular-bootstrap": "^0.14.0",
|
||||
|
|
1
config/env/production.js
vendored
1
config/env/production.js
vendored
|
@ -19,6 +19,7 @@ module.exports = {
|
|||
domain: process.env.BASE_URL || 'tellform.com'
|
||||
},
|
||||
assets: {
|
||||
bower_js: 'public/dist/vendor.min.js',
|
||||
css: 'public/dist/application.min.css',
|
||||
js: 'public/dist/application.min.js',
|
||||
form_js: 'public/dist/form-application.min.js'
|
||||
|
|
|
@ -93,7 +93,8 @@ module.exports = function(grunt) {
|
|||
uglify: {
|
||||
production: {
|
||||
options: {
|
||||
mangle: false
|
||||
mangle: false,
|
||||
compress: true
|
||||
},
|
||||
files: {
|
||||
'public/dist/application.min.js': 'public/dist/application.js',
|
||||
|
|
|
@ -65,8 +65,6 @@
|
|||
"jit-grunt": "^0.9.1",
|
||||
"lodash": "^2.4.1",
|
||||
"main-bower-files": "~2.9.0",
|
||||
"math": "0.0.3",
|
||||
"mathjs": "^3.4.1",
|
||||
"method-override": "~2.3.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"mongoose": "~4.4.19",
|
||||
|
@ -103,6 +101,7 @@
|
|||
"grunt-execute": "^0.2.2",
|
||||
"grunt-mocha-istanbul": "^3.0.1",
|
||||
"grunt-mocha-test": "~0.12.1",
|
||||
"grunt-wiredep": "^3.0.1",
|
||||
"istanbul": "^0.4.0",
|
||||
"jasmine-core": "^2.4.1",
|
||||
"karma": "~0.13.14",
|
||||
|
@ -123,6 +122,7 @@
|
|||
"selenium-server": "^3.0.1",
|
||||
"should": "~7.1.1",
|
||||
"supertest": "~1.2.0",
|
||||
"supertest-session": "~2.0.1"
|
||||
"supertest-session": "~2.0.1",
|
||||
"wiredep": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
var ApplicationConfiguration = (function() {
|
||||
// Init module configuration options
|
||||
var applicationModuleName = 'NodeForm';
|
||||
var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource', 'NodeForm.templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate', 'ng.deviceDetector'];
|
||||
var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource', 'NodeForm.templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate'];
|
||||
|
||||
// Add a new vertical module
|
||||
var registerModule = function(moduleName, dependencies) {
|
||||
|
|
60
public/dist/application.js
vendored
60
public/dist/application.js
vendored
|
@ -4,7 +4,7 @@
|
|||
var ApplicationConfiguration = (function() {
|
||||
// Init module configuration options
|
||||
var applicationModuleName = 'NodeForm';
|
||||
var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource', 'NodeForm.templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate', 'ng.deviceDetector'];
|
||||
var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource', 'NodeForm.templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate'];
|
||||
|
||||
// Add a new vertical module
|
||||
var registerModule = function(moduleName, dependencies) {
|
||||
|
@ -1028,7 +1028,7 @@ angular.module('core').service('Menus', [
|
|||
socket: null
|
||||
};
|
||||
|
||||
connect(window.location.protocol+'//'+window.location.hostname+':'+$window.socketPort);
|
||||
connect(window.location.protocol+'//'+window.location.hostname);
|
||||
|
||||
return service;
|
||||
|
||||
|
@ -1181,9 +1181,9 @@ angular.module('forms').config(['$stateProvider',
|
|||
.module('forms')
|
||||
.factory('SendVisitorData', SendVisitorData);
|
||||
|
||||
SendVisitorData.$inject = ['Socket', '$state', '$http', 'deviceDetector'];
|
||||
SendVisitorData.$inject = ['Socket', '$state', '$http'];
|
||||
|
||||
function SendVisitorData(Socket, $state, $http, deviceDetector) {
|
||||
function SendVisitorData(Socket, $state, $http) {
|
||||
|
||||
// Create a controller method for sending visitor data
|
||||
function send(form, lastActiveIndex, timeElapsed) {
|
||||
|
@ -2457,6 +2457,24 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
|
|||
$scope.field = curr_field;
|
||||
$scope.showLogicJump = false;
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showAddOptions = function (field){
|
||||
if(field.fieldType === 'dropdown' || field.fieldType === 'checkbox' || field.fieldType === 'radio'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showRatingOptions = function (field){
|
||||
if(field.fieldType === 'rating'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.saveField = function(){
|
||||
|
||||
$scope.myform.form_fields.push(curr_field);
|
||||
|
@ -2568,6 +2586,24 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
|
|||
$scope.openEditModal(newField);
|
||||
};
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showAddOptions = function (field){
|
||||
if(field.fieldType === 'dropdown' || field.fieldType === 'checkbox' || field.fieldType === 'radio'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showRatingOptions = function (field){
|
||||
if(field.fieldType === 'rating'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Delete particular field on button click
|
||||
$scope.deleteField = function (field_index) {
|
||||
$scope.myform.form_fields.splice(field_index, 1);
|
||||
|
@ -2657,23 +2693,7 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
|
|||
}
|
||||
};
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showAddOptions = function (field){
|
||||
if(field.fieldType === 'dropdown' || field.fieldType === 'checkbox' || field.fieldType === 'radio'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showRatingOptions = function (field){
|
||||
if(field.fieldType === 'rating'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}]
|
||||
};
|
||||
}
|
||||
|
|
8
public/dist/application.min.js
vendored
8
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
6
public/dist/form-application.js
vendored
6
public/dist/form-application.js
vendored
|
@ -4,7 +4,7 @@
|
|||
var ApplicationConfiguration = (function() {
|
||||
// Init module configuration options
|
||||
var applicationModuleName = 'NodeForm';
|
||||
var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource', 'NodeForm.templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate', 'ng.deviceDetector'];
|
||||
var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource', 'NodeForm.templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate'];
|
||||
|
||||
// Add a new vertical module
|
||||
var registerModule = function(moduleName, dependencies) {
|
||||
|
@ -1176,16 +1176,12 @@ angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCoun
|
|||
** Field Controls
|
||||
*/
|
||||
var evaluateLogicJump = function(field){
|
||||
console.log('evaluateLogicJump');
|
||||
console.log(field.fieldValue);
|
||||
var logicJump = field.logicJump;
|
||||
|
||||
if (logicJump.expressionString && logicJump.valueB && field.fieldValue) {
|
||||
var parse_tree = jsep(logicJump.expressionString);
|
||||
var left, right;
|
||||
|
||||
console.log(parse_tree);
|
||||
|
||||
if(parse_tree.left.name === 'field'){
|
||||
left = field.fieldValue;
|
||||
right = logicJump.valueB
|
||||
|
|
6
public/dist/form-application.min.js
vendored
6
public/dist/form-application.min.js
vendored
File diff suppressed because one or more lines are too long
61
public/dist/vendor.min.js
vendored
Normal file
61
public/dist/vendor.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -128,16 +128,12 @@ angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCoun
|
|||
** Field Controls
|
||||
*/
|
||||
var evaluateLogicJump = function(field){
|
||||
console.log('evaluateLogicJump');
|
||||
console.log(field.fieldValue);
|
||||
var logicJump = field.logicJump;
|
||||
|
||||
if (logicJump.expressionString && logicJump.valueB && field.fieldValue) {
|
||||
var parse_tree = jsep(logicJump.expressionString);
|
||||
var left, right;
|
||||
|
||||
console.log(parse_tree);
|
||||
|
||||
if(parse_tree.left.name === 'field'){
|
||||
left = field.fieldValue;
|
||||
right = logicJump.valueB
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
socket: null
|
||||
};
|
||||
|
||||
connect(window.location.protocol+'//'+window.location.hostname+':'+$window.socketPort);
|
||||
connect(window.location.protocol+'//'+window.location.hostname);
|
||||
|
||||
return service;
|
||||
|
||||
|
|
|
@ -43,6 +43,24 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
|
|||
$scope.field = curr_field;
|
||||
$scope.showLogicJump = false;
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showAddOptions = function (field){
|
||||
if(field.fieldType === 'dropdown' || field.fieldType === 'checkbox' || field.fieldType === 'radio'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showRatingOptions = function (field){
|
||||
if(field.fieldType === 'rating'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.saveField = function(){
|
||||
|
||||
$scope.myform.form_fields.push(curr_field);
|
||||
|
@ -154,6 +172,24 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
|
|||
$scope.openEditModal(newField);
|
||||
};
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showAddOptions = function (field){
|
||||
if(field.fieldType === 'dropdown' || field.fieldType === 'checkbox' || field.fieldType === 'radio'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showRatingOptions = function (field){
|
||||
if(field.fieldType === 'rating'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Delete particular field on button click
|
||||
$scope.deleteField = function (field_index) {
|
||||
$scope.myform.form_fields.splice(field_index, 1);
|
||||
|
@ -243,23 +279,7 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
|
|||
}
|
||||
};
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showAddOptions = function (field){
|
||||
if(field.fieldType === 'dropdown' || field.fieldType === 'checkbox' || field.fieldType === 'radio'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// decides whether field options block will be shown (true for dropdown and radio fields)
|
||||
$scope.showRatingOptions = function (field){
|
||||
if(field.fieldType === 'rating'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
.module('forms')
|
||||
.factory('SendVisitorData', SendVisitorData);
|
||||
|
||||
SendVisitorData.$inject = ['Socket', '$state', '$http', 'deviceDetector'];
|
||||
SendVisitorData.$inject = ['Socket', '$state', '$http'];
|
||||
|
||||
function SendVisitorData(Socket, $state, $http, deviceDetector) {
|
||||
function SendVisitorData(Socket, $state, $http) {
|
||||
|
||||
// Create a controller method for sending visitor data
|
||||
function send(form, lastActiveIndex, timeElapsed) {
|
||||
|
|
Loading…
Reference in a new issue