From 70801dfd968936c056b5289e027a0a9aefcf517d Mon Sep 17 00:00:00 2001 From: David Baldwynn Date: Tue, 14 Nov 2017 02:45:08 -0500 Subject: [PATCH 01/93] got working for server --- app/controllers/forms.server.controller.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/controllers/forms.server.controller.js b/app/controllers/forms.server.controller.js index 28d2c3f4..3ba7a214 100644 --- a/app/controllers/forms.server.controller.js +++ b/app/controllers/forms.server.controller.js @@ -463,15 +463,20 @@ exports.list = function(req, res) { }); } - const result_ids = results.map(function(result){ return result._id.id }); + const result_ids = results.map(function(result){ return ''+result._id }); var currIndex = -1; for(var i=0; i -1){ + currIndex = result_ids.indexOf(forms[i]._id+'') + console.log("forms[i]: ") + console.log(forms[i]); + + console.log(result_ids); + + console.log("currIndex: "+currIndex); + if(currIndex > -1){ forms[i].submissionNum = results[currIndex].responses; } else { forms[i].submissionNum = 0; From 758eb5a7869ba61376521e92200c2f0e9d9240e1 Mon Sep 17 00:00:00 2001 From: David Baldwynn Date: Tue, 14 Nov 2017 23:26:47 -0800 Subject: [PATCH 02/93] got textAngular to semi-work with template variables --- app/libs/constants.js | 4 +-- app/libs/send-email-notifications.js | 2 -- app/views/index.server.view.pug | 2 ++ bower.json | 3 +- .../modules/core/config/core.client.routes.js | 2 +- .../controllers/header.client.controller.js | 19 ++++++++++ .../forms/admin/css/edit-form-configure.css | 31 ---------------- public/modules/forms/admin/css/ta-theme.css | 36 +++++++++++++++++++ .../configure-form.client.directive.js | 24 ------------- .../adminTabs/configureTabs/general.html | 6 ++-- .../respondent-notifications.html | 5 +-- .../configureTabs/self-notifications.html | 12 +++++-- .../form/configure-form.client.view.html | 1 - .../forms/config/forms.client.config.js | 19 ++++++---- .../controllers/password.client.controller.js | 1 - .../settings/edit-profile.client.view.html | 32 +++++++++-------- .../settings/social-accounts.client.view.html | 31 ---------------- 17 files changed, 108 insertions(+), 122 deletions(-) create mode 100644 public/modules/forms/admin/css/ta-theme.css delete mode 100755 public/modules/users/views/settings/social-accounts.client.view.html diff --git a/app/libs/constants.js b/app/libs/constants.js index 96b6610c..96a05966 100644 --- a/app/libs/constants.js +++ b/app/libs/constants.js @@ -74,8 +74,6 @@ module.exports = { url: /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/, hexCode: /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/, email: /^(([^<>()\[\]\\.,;:\s@']+(\.[^<>()\[\]\\.,;:\s@']+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, - templateVariable: /(.|\n)*?<\/var>/g }, - - varFormat: [']+)id=["\']{1}field:', '["\']{1}>([^<>]+)*?<\/var>'], + varFormat: [']+)class=["\']{1}.*field-', '["\']{1}.*>([^<>]+)*?<\/var>'], }; \ No newline at end of file diff --git a/app/libs/send-email-notifications.js b/app/libs/send-email-notifications.js index 30af3aad..0cf9590a 100644 --- a/app/libs/send-email-notifications.js +++ b/app/libs/send-email-notifications.js @@ -12,9 +12,7 @@ module.exports = { html: parsedTemplate }; - console.log('HERE'); smtpTransport.sendMail(mailOptions, function(){ - console.log('THERE'); cb(); }); }, diff --git a/app/views/index.server.view.pug b/app/views/index.server.view.pug index 0d0c17fc..38052644 100644 --- a/app/views/index.server.view.pug +++ b/app/views/index.server.view.pug @@ -44,6 +44,8 @@ block content script(type='text/javascript', src='https://cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.8/angular-strap.min.js') + //script(src='http://textangular.com/dist/textAngular.min.js') + //Application JavaScript Files each jsFile in jsFiles script(type='text/javascript', src=jsFile) diff --git a/bower.json b/bower.json index 4336c3ac..5d191560 100755 --- a/bower.json +++ b/bower.json @@ -44,7 +44,8 @@ "textAngular": "^1.5.16", "angular-ui-select": "^0.19.8", "angular-bootstrap-switch": "^0.5.2", - "jquery": "^3.2.1" + "jquery": "^3.2.1", + "ng-quill": "https://github.com/KillerCodeMonkey/ng-quill" }, "resolutions": { "angular-bootstrap": "^0.14.0", diff --git a/public/modules/core/config/core.client.routes.js b/public/modules/core/config/core.client.routes.js index 01930695..4133bf0d 100755 --- a/public/modules/core/config/core.client.routes.js +++ b/public/modules/core/config/core.client.routes.js @@ -35,7 +35,6 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope' event.preventDefault(); // stop current execution $state.go('listForms'); // go to listForms page } - }); } @@ -45,6 +44,7 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope' angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope', 'Auth', 'User', 'Authorizer', '$state', '$stateParams', function($rootScope, Auth, User, Authorizer, $state, $stateParams) { $rootScope.$on('$stateChangeStart', function(event, next) { + console.log('$stateChangeStart'); var authenticator, permissions, user; permissions = next && next.data && next.data.permissions ? next.data.permissions : null; diff --git a/public/modules/core/controllers/header.client.controller.js b/public/modules/core/controllers/header.client.controller.js index a0c9054d..0281bd74 100755 --- a/public/modules/core/controllers/header.client.controller.js +++ b/public/modules/core/controllers/header.client.controller.js @@ -19,6 +19,25 @@ angular.module('core').controller('HeaderController', ['$rootScope', '$scope', ' $rootScope.hideNav = false; $scope.menu = Menus.getMenu('topbar'); + $rootScope.languages = ['en', 'fr', 'es', 'it', 'de']; + + $rootScope.langCodeToWord = { + 'en': 'English', + 'fr': 'Français', + 'es': 'Español', + 'it': 'Italiàno', + 'de': 'Deutsch' + }; + + $rootScope.wordToLangCode = { + 'English': 'en', + 'Français': 'fr', + 'Español': 'es', + 'Italiàno': 'it', + 'Deutsch': 'de' + }; + + $scope.signout = function() { var promise = User.logout(); promise.then(function() { diff --git a/public/modules/forms/admin/css/edit-form-configure.css b/public/modules/forms/admin/css/edit-form-configure.css index afe5b2b2..6e16af14 100644 --- a/public/modules/forms/admin/css/edit-form-configure.css +++ b/public/modules/forms/admin/css/edit-form-configure.css @@ -1,34 +1,3 @@ -.tag { - background-color: #999; - border-radius: 3px 3px 3px 3px; - border: 0; - color: #FFFFFF; - font-style: inherit; - font-size: 11px; - padding: 4px 5px; - margin: 0 2px 2px 2px; - font-family: inherit; - white-space: nowrap; - vertical-align: middle; - cursor: pointer !important; - pointer-events: none; -} - -.email-subject.ta-root .ta-editor.ta-html, .email-subject .ta-scroll-window.form-control { - min-height: 0; - overflow: hidden; - height: auto; - border-radius: 4px; - box-shadow: none; - font-size: 18px; - padding-top: 10px; -} - -.email-subject.ta-root .ta-scroll-window > .ta-bind { - min-height: 0; - outline: 0; -} - .ui-select input.form-control { height: 34px; padding: 6px; diff --git a/public/modules/forms/admin/css/ta-theme.css b/public/modules/forms/admin/css/ta-theme.css new file mode 100644 index 00000000..def3a72c --- /dev/null +++ b/public/modules/forms/admin/css/ta-theme.css @@ -0,0 +1,36 @@ +.ta-editor > div.ta-bind p { + display: inline-block; + min-width: 1px; +} + +.tag { + background-color: #999; + border-radius: 3px 3px 3px 3px; + border: 0; + color: #FFFFFF; + font-style: inherit; + font-size: 11px; + padding: 4px 5px; + margin: 0 2px 2px 2px; + font-family: inherit; + white-space: nowrap; + vertical-align: middle; + cursor: pointer !important; + display: inline!important; + width: 100%; +} + +.email-subject.ta-root .ta-editor.ta-html, .email-subject .ta-scroll-window.form-control { + min-height: 0; + overflow: hidden; + height: auto; + border-radius: 4px; + box-shadow: none; + font-size: 18px; + padding-top: 10px; +} + +.email-subject.ta-root .ta-scroll-window > .ta-bind { + min-height: 0; + outline: 0; +} \ No newline at end of file diff --git a/public/modules/forms/admin/directives/configure-form.client.directive.js b/public/modules/forms/admin/directives/configure-form.client.directive.js index 0d206f3c..d04f6293 100644 --- a/public/modules/forms/admin/directives/configure-form.client.directive.js +++ b/public/modules/forms/admin/directives/configure-form.client.directive.js @@ -14,30 +14,6 @@ angular.module('forms').directive('configureFormDirective', ['$rootScope', '$fil $scope.resetForm = $rootScope.resetForm; $scope.update = $rootScope.update; - console.log($scope.myform); - - $scope.$evalAsync(function() { - angular.element('.tag') - }); - - $scope.languages = ['en', 'fr', 'es', 'it', 'de']; - - $scope.langCodeToWord = { - 'en': 'English', - 'fr': 'Français', - 'es': 'Español', - 'it': 'Italiàno', - 'de': 'Deutsch' - }; - - $scope.wordToLangCode = { - 'English': 'en', - 'Français': 'fr', - 'Español': 'es', - 'Italiàno': 'it', - 'Deutsch': 'de' - }; - $scope.configureTabs = [ { heading: $filter('translate')('GENERAL_TAB'), diff --git a/public/modules/forms/admin/views/adminTabs/configureTabs/general.html b/public/modules/forms/admin/views/adminTabs/configureTabs/general.html index bc228506..acbf3298 100644 --- a/public/modules/forms/admin/views/adminTabs/configureTabs/general.html +++ b/public/modules/forms/admin/views/adminTabs/configureTabs/general.html @@ -22,10 +22,10 @@
- {{ langCodeToWord[$select.selected] }} + {{ $root.langCodeToWord[$select.selected] }} - - + + diff --git a/public/modules/forms/admin/views/adminTabs/configureTabs/respondent-notifications.html b/public/modules/forms/admin/views/adminTabs/configureTabs/respondent-notifications.html index 545532af..09b0915c 100644 --- a/public/modules/forms/admin/views/adminTabs/configureTabs/respondent-notifications.html +++ b/public/modules/forms/admin/views/adminTabs/configureTabs/respondent-notifications.html @@ -74,9 +74,10 @@
-
diff --git a/public/modules/forms/admin/views/adminTabs/configureTabs/self-notifications.html b/public/modules/forms/admin/views/adminTabs/configureTabs/self-notifications.html index adc03dbd..1ca61f0d 100644 --- a/public/modules/forms/admin/views/adminTabs/configureTabs/self-notifications.html +++ b/public/modules/forms/admin/views/adminTabs/configureTabs/self-notifications.html @@ -56,8 +56,11 @@
- + -->
@@ -67,8 +70,13 @@
- + +
+ +
\ No newline at end of file diff --git a/public/modules/forms/admin/views/directiveViews/form/configure-form.client.view.html b/public/modules/forms/admin/views/directiveViews/form/configure-form.client.view.html index 1120e475..685045e4 100644 --- a/public/modules/forms/admin/views/directiveViews/form/configure-form.client.view.html +++ b/public/modules/forms/admin/views/directiveViews/form/configure-form.client.view.html @@ -1,5 +1,4 @@
-
diff --git a/public/modules/forms/config/forms.client.config.js b/public/modules/forms/config/forms.client.config.js index bbf01063..52b790fa 100644 --- a/public/modules/forms/config/forms.client.config.js +++ b/public/modules/forms/config/forms.client.config.js @@ -56,21 +56,28 @@ angular.module('forms').run(['Menus', return $delegate; }); }]).config(['$provide', function ($provide){ - $provide.decorator('taOptions', ['$delegate', 'taRegisterTool', '$translate', '$window', function(taOptions, taRegisterTool, $translate, $window) { + $provide.decorator('taOptions', ['$delegate', 'taRegisterTool', '$translate', '$window', 'taSelection', function(taOptions, taRegisterTool, $translate, $window, taSelection) { taRegisterTool('insertField', { - display: '