diff --git a/Dockerfile b/Dockerfile index 8db01cf8..25f20cb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,8 @@ ENV PORT 3000 RUN apt-get update -q \ && apt-get install -yqq \ curl \ + ant \ + default-jdk \ git \ gcc \ make \ @@ -47,8 +49,7 @@ WORKDIR /opt/tellform # when the local package.json file changes. # Add npm package.json COPY package.json /opt/tellform/package.json -RUN npm install --production -RUN mv ./node_modules ./node_modules.tmp && mv ./node_modules.tmp ./node_modules && npm install +RUN npm install # Add bower.json COPY bower.json /opt/tellform/bower.json @@ -62,5 +63,8 @@ COPY ./server.js /opt/tellform/server.js COPY ./.env /opt/tellform/.env COPY ./scripts/create_admin.js /opt/tellform/scripts/create_admin.js -# Run TellForm server -CMD npm start +# Run Development TellForm server +COPY ./dev_entrypoint.sh /dev_entrypoint.sh +RUN chmod +x /dev_entrypoint.sh + +ENTRYPOINT ["/dev_entrypoint.sh"] \ No newline at end of file diff --git a/Dockerfile-production b/Dockerfile-production index 59c70d60..9876021d 100644 --- a/Dockerfile-production +++ b/Dockerfile-production @@ -19,6 +19,8 @@ ENV BASE_URL tellform.com RUN apt-get update -q \ && apt-get install -yqq \ curl \ + ant \ + default-jdk \ git \ gcc \ make \ diff --git a/INSTALLATION_INSTRUCTIONS.md b/INSTALLATION_INSTRUCTIONS.md new file mode 100644 index 00000000..7734c284 --- /dev/null +++ b/INSTALLATION_INSTRUCTIONS.md @@ -0,0 +1,174 @@ +TellForm Installation Instructions +================================== + + +## Table of Contents + +- [Local Deployment with Docker](#local-deployment-with-docker) +- [AWS AMI Deployment](#aws-ami-deployment) + + +## Local deployment with Docker + +### Prerequisites + +Make you sure have the following packages and versions on your machine: +``` +"node": ">=6.11.2" +"npm": ">=3.3.6" +"bower": ">=1.8.0" +"grunt-cli": ">=1.2.0" +"grunt": ">=0.4.5" +"docker": ">=17.06.0-ce" +"docker-compose": ">=1.14.0" +``` + +### Install dependencies + +``` +$ npm install +``` + +### Prepare .env file: +Create `.env` file at project root folder. Fill in `MAILER_SERVICE_PROVIDER`, `MAILER_EMAIL_ID`, `MAILER_PASSWORD` and `MAILER_FROM`. +``` +APP_NAME=TellForm +BASE_URL=localhost:3000 +PORT=3000 +DB_PORT_27017_TCP_ADDR=tellform-mongo +REDIS_DB_PORT_6379_TCP_ADDR=tellform-redis +MAILER_SERVICE_PROVIDER= +MAILER_EMAIL_ID= +MAILER_PASSWORD= +MAILER_FROM= +SIGNUP_DISABLED=false +SUBDOMAINS_DISABLED=true +DISABLE_CLUSTER_MODE=true +``` + +### Build docker image + +``` +$ docker-compose build +``` + +### Run docker containers with docker-compose + +Create and start mongo & redis docker container: +``` +$ docker-compose up +``` + +Your application should run on port 3000 or the port you specified in your .env file, so in your browser just go to [http://localhost:3000](http://localhost:3000) + +## AWS AMI Deployment + +### Prerequisites + +Instructions here are tested on an Amazon Linux AMI. First, set up your fresh new AMI by setting the environment variables: + +``` +$ sudo vim /etc/environment + +LANG=en_US.utf-8 +LC_ALL=en_US.utf-8 +``` + +Next, update and install build tools: +``` +$ sudo yum update -y +$ sudo yum groupinstall "Development Tools" -y +``` + +### Install docker + +``` +$ sudo yum install -y docker +$ sudo service docker start +``` + +To ensure docker can be run without `sudo` each time: +``` +$ sudo usermod -a -G docker ec2-user +$ logout +``` + +SSH back in, and test that `docker info` runs successfully. + +### Install docker-compose + +``` +$ sudo -i +$ curl -L https://github.com/docker/compose/releases/download/1.15.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose +$ sudo chmod +x /usr/local/bin/docker-compose +$ logout +``` + +### Clone our repo + +``` +$ git clone https://github.com/datagovsg/formsg.git +``` + +### Prepare .env file + +The `.env` file for remote deployment (or production) is slightly different from that of local deployment. +Create `.env` file at project root folder. Similarly, fill in `MAILER_SERVICE_PROVIDER`, `MAILER_EMAIL_ID`, `MAILER_PASSWORD` and `MAILER_FROM`. Note that now you have to fill in the public IP of your instance in `BASE_URL`. + +``` +APP_NAME=FormSG +APP_DESC= +APP_KEYWORDS= +NODE_ENV=production +BASE_URL= +PORT=4545 +DB_PORT_27017_TCP_ADDR= +REDIS_DB_PORT_6379_TCP_ADDR=formsg-redis +username=formsg_admin +MAILER_SERVICE_PROVIDER= +MAILER_EMAIL_ID= +MAILER_PASSWORD= +MAILER_FROM= +SIGNUP_DISABLED=false +SUBDOMAINS_DISABLED=true +DISABLE_CLUSTER_MODE=true +RAVEN_DSN= +PRERENDER_TOKEN= +COVERALLS_REPO_TOKEN= +``` + +### Install npm, bower and grunt + +``` +$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash +$ . ~/.nvm/nvm.sh +$ nvm install 6.11.2 +$ npm install -g bower +$ npm install -g grunt-cli +$ npm install grunt +``` + +### Install dependencies + +``` +$ npm install --production +``` + +### Build docker image + +``` +$ docker-compose -f docker-compose-production.yml build +``` + +### Run docker containers + +``` +$ docker run -d -p 27017:27017 -v /data/db:/data/db --name formsg-mongo mongo +$ docker-compose -f docker-compose-production.yml up +``` + +Note that unlike dev, mongo container is run separately from compose. Hence `docker-compose down` does not take down the mongo container each time. Your application should run on the default port 80, so in your browser just go to your public IP. + +## Support + +Please contact David Baldwynn (team@tellform.com) for any details. \ No newline at end of file diff --git a/app/models/form.server.model.js b/app/models/form.server.model.js index 58cf9e7c..a7ef5ccb 100644 --- a/app/models/form.server.model.js +++ b/app/models/form.server.model.js @@ -40,6 +40,9 @@ var ButtonSchema = new Schema({ }); var VisitorDataSchema = new Schema({ + socketId: { + type: String + }, referrer: { type: String }, diff --git a/app/sockets/analytics_service.js b/app/sockets/analytics_service.js index 42295909..601d6564 100644 --- a/app/sockets/analytics_service.js +++ b/app/sockets/analytics_service.js @@ -12,14 +12,14 @@ module.exports = function (io, socket) { var visitorsData = {}; var saveVisitorData = function (data, cb){ - Form.findById(data.formId, function(err, form) { if (err) { - console.log(err); + console.error(err); throw new Error(errorHandler.getErrorMessage(err)); } var newVisitor = { + socketId: data.socketId, referrer: data.referrer, lastActiveField: data.lastActiveField, timeElapsed: data.timeElapsed, @@ -37,35 +37,37 @@ module.exports = function (io, socket) { throw new Error(errorHandler.getErrorMessage(formSaveErr)); } - delete visitorsData[socket.id]; - if(cb){ return cb(); } }); }); - }; io.on('connection', function(current_socket) { - // a user has visited our page - add them to the visitorsData object current_socket.on('form-visitor-data', function(data) { - current_socket.id = data.formId; - visitorsData[current_socket.id] = data; - visitorsData[current_socket.id].isSaved = false; - if (data.isSubmitted) { - saveVisitorData(data, function () { - visitorsData[current_socket.id].isSaved = true; - }); - } + visitorsData[current_socket.id] = data; + visitorsData[current_socket.id].socketId = current_socket.id; + visitorsData[current_socket.id].isSaved = false; + if (data.isSubmitted && !data.isSaved) { + visitorsData[current_socket.id].isSaved = true; + saveVisitorData(data, function() { + console.log("\n\n\n\n\ncurrent_socket.id: "+current_socket.id); + current_socket.disconnect(true); + }); + } }); current_socket.on('disconnect', function() { var data = visitorsData[current_socket.id]; if(data && !data.isSubmitted && !data.isSaved) { data.isSaved = true; - saveVisitorData(data); + saveVisitorData(data, function() { + delete visitorsData[current_socket.id]; + }); + } else { + delete visitorsData[current_socket.id]; } }); }); diff --git a/config/env/all.js b/config/env/all.js index 0637dd2a..691880e4 100755 --- a/config/env/all.js +++ b/config/env/all.js @@ -61,7 +61,6 @@ module.exports = { maxAge: 24 * 60 * 60 * 1000 // 24 hours // To set the cookie in a specific domain uncomment the following // setting: - //domain: process.env.COOKIE_SESSION_URL || process.env.BASE_URL || '.tellform.com' }, /* diff --git a/dev_entrypoint.sh b/dev_entrypoint.sh new file mode 100644 index 00000000..823491a0 --- /dev/null +++ b/dev_entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +line=$(head -n 1 /etc/hosts) +echo "$line tellform.dev $(hostname)" >> /etc/hosts + +# Restart sendmail +service sendmail restart + +# Run Server +npm start \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index ea79cb0f..7e016e4d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,22 @@ version: "3" services: tellform: - image: tellform/production:no_subdomains + build: + context: ./ + dockerfile: dockerfile + image: tellform ports: - 3000:3000 - - 8080:80 links: - - redis:redis-db - - mongo:db - environment: - - BASE_URL=localhost - - DB_1_PORT_27017_TCP_ADDR=mongo - - REDIS_DB_PORT_6379_TCP_ADDR=redis - redis: - image: redis:alpine + - tellform-redis:redis-db + - tellform-mongo:db + env_file: + - .env + tellform-redis: + image: redis ports: - 6379 - mongo: - image: mongo:latest + tellform-mongo: + image: mongo ports: - 27017 diff --git a/public/dist/application.js b/public/dist/application.js index 222c8578..a7923944 100644 --- a/public/dist/application.js +++ b/public/dist/application.js @@ -3,8 +3,8 @@ // Init the application configuration module for AngularJS application var ApplicationConfiguration = (function() { // Init module configuration options - var applicationModuleName = 'NodeForm'; - var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'ngSanitize', 'vButton', 'ngResource', 'TellForm.templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate']; + var applicationModuleName = 'TellForm'; + var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'ngSanitize', 'vButton', 'ngResource', 'TellForm.templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate', 'view-form']; // Add a new vertical module var registerModule = function(moduleName, dependencies) { @@ -66,7 +66,7 @@ angular.module('TellForm.templates', []).run(['$templateCache', function($templa $templateCache.put("modules/core/views/header.client.view.html", "
"); $templateCache.put("modules/forms/admin/views/admin-form.client.view.html", - "
{{ 'TELLFORM_URL' | translate }}
{{ 'COPY_AND_PASTE' | translate }}
{{ 'BACKGROUND_COLOR' | translate }}
{{ 'QUESTION_TEXT_COLOR' | translate }}
{{ 'ANSWER_TEXT_COLOR' | translate }}
{{ 'BTN_BACKGROUND_COLOR' | translate }}
{{ 'BTN_TEXT_COLOR' | translate }}
{{ 'TELLFORM_URL' | translate }}
{{ 'COPY_AND_PASTE' | translate }}
"); + "
{{ 'BACKGROUND_COLOR' | translate }}
{{ 'QUESTION_TEXT_COLOR' | translate }}
{{ 'ANSWER_TEXT_COLOR' | translate }}
{{ 'BTN_BACKGROUND_COLOR' | translate }}
{{ 'BTN_TEXT_COLOR' | translate }}
"); $templateCache.put("modules/forms/admin/views/list-forms.client.view.html", "

{{ 'CREATE_A_NEW_FORM' | translate }}
{{ 'NAME' | translate }}
{{ 'LANGUAGE' | translate }}

{{ form.submissions.length }} {{ 'RESPONSES' | translate }}

{{ 'FORM_PAUSED' | translate }}
"); - $templateCache.put("modules/forms/base/views/submit-form.client.view.html", - "
"); $templateCache.put("modules/forms/admin/views/adminTabs/analyze.html", ""); $templateCache.put("modules/forms/admin/views/adminTabs/configure.html", @@ -130,9 +118,9 @@ angular.module('TellForm.templates', []).run(['$templateCache', function($templa $templateCache.put("modules/forms/admin/views/directiveViews/form/configure-form.client.view.html", "
{{ 'FORM_NAME' | translate }}
{{ 'FORM_STATUS' | translate }}
{{ 'LANGUAGE' | translate }}
* {{ 'REQUIRED_FIELD' | translate }}
{{ 'GA_TRACKING_CODE' | translate }}
{{ 'DISPLAY_FOOTER' | translate }}
{{ 'DISPLAY_START_PAGE' | translate }}
{{ 'DISPLAY_END_PAGE' | translate }}
"); $templateCache.put("modules/forms/admin/views/directiveViews/form/edit-form.client.view.html", - "

{{ 'ADD_FIELD_LG' | translate }}

{{ 'ADD_FIELD_MD' | translate }}

{{ 'ADD_FIELD_SM' | translate }}

{{ 'WELCOME_SCREEN' | translate }}


{{field.title}} *

{{ 'CLICK_FIELDS_FOOTER' | translate }}


{{ 'END_SCREEN' | translate }}

"); + "

{{ 'ADD_FIELD_LG' | translate }}

{{ 'ADD_FIELD_MD' | translate }}

{{ 'ADD_FIELD_SM' | translate }}

{{ 'WELCOME_SCREEN' | translate }}


{{field.title}} *

{{ 'CLICK_FIELDS_FOOTER' | translate }}


{{ 'END_SCREEN' | translate }}

"); $templateCache.put("modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html", - "
{{ 'TOTAL_VIEWS' | translate }}
{{ 'RESPONSES' | translate }}
{{ 'COMPLETION_RATE' | translate }}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{myform.analytics.visitors.length}}
{{myform.analytics.submissions}}
{{myform.analytics.conversionRate | number:0}}%
{{ AverageTimeElapsed | secondsToDateTime | date:'mm:ss'}}
{{ 'DESKTOP_AND_LAPTOP' | translate }}
{{ 'TABLETS' | translate }}
{{ 'PHONES' | translate }}
{{ 'OTHER' | translate }}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.desktop.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.other.visits}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.desktop.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.tablet.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.phone.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.other.responses}}
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.desktop.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.tablet.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.phone.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.other.completion}}%
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.desktop.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.tablet.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.phone.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.other.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'FIELD_TITLE' | translate }}
{{ 'FIELD_VIEWS' | translate }}
{{ 'FIELD_RESPONSES' | translate }}
{{ 'FIELD_DROPOFF' | translate }}
{{fieldStats.field.title}}
{{fieldStats.totalViews}}
{{fieldStats.responses}}
{{fieldStats.continueRate}}%

#{{value.title}}{{ 'PERCENTAGE_COMPLETE' | translate }}{{ 'TIME_ELAPSED' | translate }}{{ 'DEVICE' | translate }}{{ 'LOCATION' | translate }}{{ 'IP_ADDRESS' | translate }}{{ 'DATE_SUBMITTED' | translate }} (UTC)
{{$index+1}}{{field.fieldValue}}{{row.percentageComplete}}%{{row.timeElapsed | secondsToDateTime | date:'mm:ss'}}{{row.device.name}}, {{row.device.type}}{{row.geoLocation.City}}, {{row.geoLocation.Country}}{{row.ipAddr}}{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}
"); - $templateCache.put("modules/forms/base/views/directiveViews/entryPage/startPage.html", - "

{{pageData.introTitle}}

{{pageData.introParagraph}}

"); - $templateCache.put("modules/forms/base/views/directiveViews/field/date.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); - $templateCache.put("modules/forms/base/views/directiveViews/field/dropdown.html", - "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); - $templateCache.put("modules/forms/base/views/directiveViews/field/file.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.file.originalname}}
{{ UPLOAD_FILE | translate }}
"); - $templateCache.put("modules/forms/base/views/directiveViews/field/hidden.html", - ""); - $templateCache.put("modules/forms/base/views/directiveViews/field/legal.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}


{{field.description}}


"); - $templateCache.put("modules/forms/base/views/directiveViews/field/radio.html", - "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); - $templateCache.put("modules/forms/base/views/directiveViews/field/rating.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); - $templateCache.put("modules/forms/base/views/directiveViews/field/statement.html", - "

{{field.title}}

{{field.description}}

{{field.description}}


"); - $templateCache.put("modules/forms/base/views/directiveViews/field/textarea.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{ 'NEWLINE' | translate }}

{{field.description}}

{{ 'NEWLINE' | translate }}
{{ 'ENTER' | translate }}
"); - $templateCache.put("modules/forms/base/views/directiveViews/field/textfield.html", - "

{{index+1}} {{field.title}} ({{ 'OPTIONAL' | translate }})

{{field.description}}

{{ 'ENTER' | translate }}
"); - $templateCache.put("modules/forms/base/views/directiveViews/field/yes_no.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); - $templateCache.put("modules/forms/base/views/directiveViews/form/submit-form.client.view.html", - "
{{ 'COMPLETING_NEEDED' | translate:translateAdvancementData }}
{{ 'ENTER' | translate }}

{{ 'ADVANCEMENT' | translate:translateAdvancementData }}

"); + "
{{ 'TOTAL_VIEWS' | translate }}
{{ 'RESPONSES' | translate }}
{{ 'COMPLETION_RATE' | translate }}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{myform.analytics.visitors.length}}
{{myform.analytics.submissions}}
{{myform.analytics.conversionRate | number:0}}%
{{ AverageTimeElapsed | secondsToDateTime | date:'mm:ss'}}
{{ 'DESKTOP_AND_LAPTOP' | translate }}
{{ 'TABLETS' | translate }}
{{ 'PHONES' | translate }}
{{ 'OTHER' | translate }}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.desktop.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.other.visits}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.desktop.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.tablet.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.phone.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.other.responses}}
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.desktop.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.tablet.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.phone.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.other.completion}}%
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.desktop.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.tablet.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.phone.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.other.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'FIELD_TITLE' | translate }}
{{ 'FIELD_VIEWS' | translate }}
{{ 'FIELD_RESPONSES' | translate }}
{{ 'FIELD_DROPOFF' | translate }}
{{fieldStats.field.title}}
{{fieldStats.totalViews}}
{{fieldStats.responses}}
{{fieldStats.continueRate}}%

#{{value.title}}{{ 'PERCENTAGE_COMPLETE' | translate }}{{ 'TIME_ELAPSED' | translate }}{{ 'DEVICE' | translate }}{{ 'LOCATION' | translate }}{{ 'IP_ADDRESS' | translate }}{{ 'DATE_SUBMITTED' | translate }} (UTC)
{{$index+1}}{{field.fieldValue}}{{row.percentageComplete}}%{{row.timeElapsed | secondsToDateTime | date:'mm:ss'}}{{row.device.name}}, {{row.device.type}}{{row.geoLocation.City}}, {{row.geoLocation.Country}}{{row.ipAddr}}{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}
"); $templateCache.put("modules/users/views/authentication/access-denied.client.view.html", "

{{ 'ACCESS_DENIED_TEXT' | translate }}

{{ 'SIGNIN_BTN' | translate }}
"); $templateCache.put("modules/users/views/authentication/signin.client.view.html", @@ -674,6 +621,41 @@ angular.module('TellForm.templates', []).run(['$templateCache', function($templa "
{{error}}

{{ 'VERIFICATION_EMAIL_SENT' | translate }}

{{ 'VERIFICATION_EMAIL_SENT_TO' | translate }} {{username}}.
{{ 'NOT_ACTIVATED_YET' | translate }}

{{ 'CHECK_YOUR_EMAIL' | translate }} polydaic@gmail.com

"); $templateCache.put("modules/users/views/verify/verify-account.client.view.html", "

{{ 'VERIFY_SUCCESS' | translate }}

"); + $templateCache.put("form_modules/forms/base/views/directiveViews/entryPage/startPage.html", + "

{{pageData.introTitle}}

{{pageData.introParagraph}}

"); + $templateCache.put("form_modules/forms/base/views/directiveViews/field/date.html", + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); + $templateCache.put("form_modules/forms/base/views/directiveViews/field/dropdown.html", + "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); + $templateCache.put("form_modules/forms/base/views/directiveViews/field/hidden.html", + ""); + $templateCache.put("form_modules/forms/base/views/directiveViews/field/legal.html", + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}


{{field.description}}


"); + $templateCache.put("form_modules/forms/base/views/directiveViews/field/radio.html", + "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); + $templateCache.put("form_modules/forms/base/views/directiveViews/field/rating.html", + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); + $templateCache.put("form_modules/forms/base/views/directiveViews/field/statement.html", + "

{{field.title}}

{{field.description}}

{{field.description}}


"); + $templateCache.put("form_modules/forms/base/views/directiveViews/field/textarea.html", + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{ 'NEWLINE' | translate }}

{{field.description}}

Press SHIFT+ENTER to add a newline
{{ 'ENTER' | translate }}
"); + $templateCache.put("form_modules/forms/base/views/directiveViews/field/textfield.html", + "

{{index+1}} {{field.title}} ({{ 'OPTIONAL' | translate }})

{{field.description}}

{{ 'ENTER' | translate }}
"); + $templateCache.put("form_modules/forms/base/views/directiveViews/field/yes_no.html", + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); + $templateCache.put("form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html", + "
{{ 'COMPLETING_NEEDED' | translate:translateAdvancementData }}
{{ 'ENTER' | translate }}

{{ 'ADVANCEMENT' | translate:translateAdvancementData }}

"); + $templateCache.put("form_modules/forms/base/views/form-unauthorized.client.view.html", + "

Not Authorized to Access Form

The form you are trying to access is currently private and not accesible publically.
If you are the owner of the form, you can set it to \"Public\" in the \"Configuration\" panel in the form admin.
"); + $templateCache.put("form_modules/forms/base/views/submit-form.client.view.html", + "
"); }]); 'use strict'; @@ -695,530 +677,6 @@ ApplicationConfiguration.registerModule('forms', [ ApplicationConfiguration.registerModule('users'); 'use strict'; -angular.module('forms').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('en', { - - //Configure Form Tab View - ADVANCED_SETTINGS: 'Advanced Settings', - FORM_NAME: 'Form Name', - FORM_STATUS: 'Form Status', - PUBLIC: 'Public', - PRIVATE: 'Private', - GA_TRACKING_CODE: 'Google Analytics Tracking Code', - DISPLAY_FOOTER: 'Display Form Footer?', - SAVE_CHANGES: 'Save Changes', - CANCEL: 'Cancel', - DISPLAY_START_PAGE: 'Display Start Page?', - DISPLAY_END_PAGE: 'Display Custom End Page?', - - //List Forms View - CREATE_A_NEW_FORM: 'Create a new form', - CREATE_FORM: 'Create form', - CREATED_ON: 'Created on', - MY_FORMS: 'My forms', - NAME: 'Name', - LANGUAGE: 'Language', - FORM_PAUSED: 'Form paused', - - //Edit Field Modal - EDIT_FIELD: 'Edit this Field', - SAVE_FIELD: 'Save', - ON: 'ON', - OFF: 'OFF', - REQUIRED_FIELD: 'Required', - LOGIC_JUMP: 'Logic Jump', - SHOW_BUTTONS: 'Additional Buttons', - SAVE_START_PAGE: 'Save', - - //Admin Form View - ARE_YOU_SURE: 'Are you ABSOLUTELY sure?', - READ_WARNING: 'Unexpected bad things will happen if you don’t read this!', - DELETE_WARNING1: 'This action CANNOT be undone. This will permanently delete the "', - DELETE_WARNING2: '" form and remove all associated form submissions.', - DELETE_CONFIRM: 'Please type in the name of the form to confirm.', - I_UNDERSTAND: 'I understand the consequences, delete this form.', - DELETE_FORM_SM: 'Delete', - DELETE_FORM_MD: 'Delete Form', - DELETE: 'Delete', - FORM: 'Form', - VIEW: 'View', - LIVE: 'Live', - PREVIEW: 'Preview', - COPY: 'Copy', - COPY_AND_PASTE: 'Copy and Paste this to add your TellForm to your website', - CHANGE_WIDTH_AND_HEIGHT: 'Change the width and height values to suit you best', - POWERED_BY: 'Powered by', - TELLFORM_URL: 'Your TellForm is permanently at this URL', - - //Edit Form View - DISABLED: 'Disabled', - YES: 'YES', - NO: 'NO', - ADD_LOGIC_JUMP: 'Add Logic Jump', - ADD_FIELD_LG: 'Click to Add New Field', - ADD_FIELD_MD: 'Add New Field', - ADD_FIELD_SM: 'Add Field', - EDIT_START_PAGE: 'Edit Start Page', - EDIT_END_PAGE: 'Edit End Page', - WELCOME_SCREEN: 'Start Page', - END_SCREEN: 'End Page', - INTRO_TITLE: 'Title', - INTRO_PARAGRAPH: 'Paragraph', - INTRO_BTN: 'Start Button', - TITLE: 'Title', - PARAGRAPH: 'Paragraph', - BTN_TEXT: 'Go Back Button', - BUTTONS: 'Buttons', - BUTTON_TEXT: 'Text', - BUTTON_LINK: 'Link', - ADD_BUTTON: 'Add Button', - PREVIEW_FIELD: 'Preview Question', - QUESTION_TITLE: 'Title', - QUESTION_DESCRIPTION: 'Description', - OPTIONS: 'Options', - ADD_OPTION: 'Add Option', - NUM_OF_STEPS: 'Number of Steps', - CLICK_FIELDS_FOOTER: 'Click on fields to add them here', - SHAPE: 'Shape', - IF_THIS_FIELD: 'If this field', - IS_EQUAL_TO: 'is equal to', - IS_NOT_EQUAL_TO: 'is not equal to', - IS_GREATER_THAN: 'is greater than', - IS_GREATER_OR_EQUAL_THAN: 'is greater or equal than', - IS_SMALLER_THAN: 'is_smaller_than', - IS_SMALLER_OR_EQUAL_THAN: 'is smaller or equal than', - CONTAINS: 'contains', - DOES_NOT_CONTAINS: 'does not contain', - ENDS_WITH: 'ends with', - DOES_NOT_END_WITH: 'does not end with', - STARTS_WITH: 'starts with', - DOES_NOT_START_WITH: 'does not start with', - THEN_JUMP_TO: 'then jump to', - - //Edit Submissions View - TOTAL_VIEWS: 'total unique visits', - RESPONSES: 'responses', - COMPLETION_RATE: 'completion rate', - AVERAGE_TIME_TO_COMPLETE: 'avg. completion time', - - DESKTOP_AND_LAPTOP: 'Desktops', - TABLETS: 'Tablets', - PHONES: 'Phones', - OTHER: 'Other', - UNIQUE_VISITS: 'Unique Visits', - - FIELD_TITLE: 'Field Title', - FIELD_VIEWS: 'Field Views', - FIELD_DROPOFF: 'Field Completion', - FIELD_RESPONSES: 'Field Responses', - DELETE_SELECTED: 'Delete Selected', - EXPORT_TO_EXCEL: 'Export to Excel', - EXPORT_TO_CSV: 'Export to CSV', - EXPORT_TO_JSON: 'Export to JSON', - PERCENTAGE_COMPLETE: 'Percentage Complete', - TIME_ELAPSED: 'Time Elapsed', - DEVICE: 'Device', - LOCATION: 'Location', - IP_ADDRESS: 'IP Address', - DATE_SUBMITTED: 'Date Submitted', - GENERATED_PDF: 'Generated PDF', - - //Design View - BACKGROUND_COLOR: 'Background Color', - DESIGN_HEADER: 'Change how your Form Looks', - QUESTION_TEXT_COLOR: 'Question Text Color', - ANSWER_TEXT_COLOR: 'Answer Text Color', - BTN_BACKGROUND_COLOR: 'Button Background Color', - BTN_TEXT_COLOR: 'Button Text Color', - - //Share View - EMBED_YOUR_FORM: 'Embed your form', - SHARE_YOUR_FORM: 'Share your form', - - //Admin Tabs - CREATE_TAB: 'Create', - DESIGN_TAB: 'Design', - CONFIGURE_TAB: 'Configure', - ANALYZE_TAB: 'Analyze', - SHARE_TAB: 'Share', - - //Field Types - SHORT_TEXT: 'Short Text', - EMAIL: 'Email', - MULTIPLE_CHOICE: 'Multiple Choice', - DROPDOWN: 'Dropdown', - DATE: 'Date', - PARAGRAPH_T: 'Paragraph', - YES_NO: 'Yes/No', - LEGAL: 'Legal', - RATING: 'Rating', - NUMBERS: 'Numbers', - SIGNATURE: 'Signature', - FILE_UPLOAD: 'File upload', - OPTION_SCALE: 'Option Scale', - PAYMENT: 'Payment', - STATEMENT: 'Statement', - LINK: 'Link' - }); -}]); - -'use strict'; - -angular.module('forms').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('es', { - - //Configure Form Tab View - ADVANCED_SETTINGS: 'Configuraciones avanzadas', - FORM_NAME: 'Nombre del formulario', - FORM_STATUS: 'Estado del formulario', - PUBLIC: 'Público', - PRIVATE: 'Privado', - GA_TRACKING_CODE: 'Código de Google Analytics', - DISPLAY_FOOTER: '¿Mostrar pie de página?', - SAVE_CHANGES: 'Grabar', - CANCEL: 'Cancelar', - DISPLAY_START_PAGE: '¿Mostrar página de inicio?', - DISPLAY_END_PAGE: '¿Mostrar paǵina de fin?', - - //List Forms View - CREATE_A_NEW_FORM: 'Crear formulario', - CREATE_FORM: 'Crear formulario', - CREATED_ON: 'Creado en', - MY_FORMS: 'Mis formularios', - NAME: 'Nombre', - LANGUAGE: 'Idioma', - FORM_PAUSED: 'Formulario pausado', - - //Edit Field Modal - EDIT_FIELD: 'Editar este campo', - SAVE_FIELD: 'Grabar', - ON: 'ON', - OFF: 'OFF', - REQUIRED_FIELD: 'Requerido', - LOGIC_JUMP: 'Salto lógico', - SHOW_BUTTONS: 'Botones adicionales', - SAVE_START_PAGE: 'Grabar', - - //Admin Form View - ARE_YOU_SURE: '¿Estás absolutamente seguro?', - READ_WARNING: '¡Algo malo ocurrirá si no lees esto!', - DELETE_WARNING1: 'Esta acción no tiene vuelta atrás. Esto borrará permanentemente el "', - DELETE_WARNING2: '" formulario y todos los datos asociados.', - DELETE_CONFIRM: 'Por favor escribí el nombre del formulario para confirmar.', - I_UNDERSTAND: 'Entiendo las consecuencias y quiero borrarlo.', - DELETE_FORM_SM: 'Borrar', - DELETE_FORM_MD: 'Borrar formulario', - DELETE: 'Borrar', - FORM: 'Formulario', - VIEW: 'Vista', - LIVE: 'Online', - PREVIEW: 'Vista previa', - COPY: 'Copiar', - COPY_AND_PASTE: 'Copiar y pegar esto para agregar su TellForm a su sitio web', - CHANGE_WIDTH_AND_HEIGHT: 'Cambie los valores de ancho y altura para adaptar el formulario a sus necesidades', - POWERED_BY: 'Con la tecnlogía de', - TELLFORM_URL: 'Tu TellForm está en esta URL permanente', - - //Edit Form View - DISABLED: 'Deshabilitado', - YES: 'SI', - NO: 'NO', - ADD_LOGIC_JUMP: 'Agregar salto lógico', - ADD_FIELD_LG: 'Click para agregar campo', - ADD_FIELD_MD: 'Agregar nuevo campo', - ADD_FIELD_SM: 'Agregar campo', - EDIT_START_PAGE: 'Editar paǵina de inicio', - EDIT_END_PAGE: 'Editar página de finalización', - WELCOME_SCREEN: 'Comienzo', - END_SCREEN: 'Fin', - INTRO_TITLE: 'Título', - INTRO_PARAGRAPH: 'Parágrafo', - INTRO_BTN: 'Botón de comienzo', - TITLE: 'Título', - PARAGRAPH: 'Paragrafo', - BTN_TEXT: 'Botón para volver atrás', - BUTTONS: 'Botones', - BUTTON_TEXT: 'Texto', - BUTTON_LINK: 'Link', - ADD_BUTTON: 'Agregar Botón', - PREVIEW_FIELD: 'Vista previa Pregunta', - QUESTION_TITLE: 'Título', - QUESTION_DESCRIPTION: 'Descripción', - OPTIONS: 'Opciones', - ADD_OPTION: 'Agregar Opciones', - NUM_OF_STEPS: 'Cantidad de pasos', - CLICK_FIELDS_FOOTER: 'Click en los campos para agregar', - SHAPE: 'Forma', - IF_THIS_FIELD: 'Si este campo', - IS_EQUAL_TO: 'es igual a', - IS_NOT_EQUAL_TO: 'no es igual a', - IS_GREATER_THAN: 'es mayor que', - IS_GREATER_OR_EQUAL_THAN: 'es mayor o igual que', - IS_SMALLER_THAN: 'es menor que', - IS_SMALLER_OR_EQUAL_THAN: 'is menor o igual que', - CONTAINS: 'contiene', - DOES_NOT_CONTAINS: 'no contiene', - ENDS_WITH: 'termina con', - DOES_NOT_END_WITH: 'no termina con', - STARTS_WITH: 'comienza con', - DOES_NOT_START_WITH: 'no comienza con', - THEN_JUMP_TO: 'luego salta a', - - //Edit Submissions View - TOTAL_VIEWS: 'Total de visitas únicas', - RESPONSES: 'respuestas', - COMPLETION_RATE: 'Taza de terminación', - AVERAGE_TIME_TO_COMPLETE: 'Promedio de tiempo de rellenado', - - DESKTOP_AND_LAPTOP: 'Computadora', - TABLETS: 'Tablets', - PHONES: 'Móviles', - OTHER: 'Otros', - UNIQUE_VISITS: 'Visitas únicas', - - FIELD_TITLE: 'Título de campo', - FIELD_VIEWS: 'Vistas de campo', - FIELD_DROPOFF: 'Finalización de campo', - FIELD_RESPONSES: 'Respuestas de campo', - DELETE_SELECTED: 'Borrar selección', - EXPORT_TO_EXCEL: 'Exportar a Excel', - EXPORT_TO_CSV: 'Exportar a CSV', - EXPORT_TO_JSON: 'Exportar a JSON', - PERCENTAGE_COMPLETE: 'Porcentaje de completitud', - TIME_ELAPSED: 'Tiempo usado', - DEVICE: 'Dispositivo', - LOCATION: 'Lugar', - IP_ADDRESS: 'Dirección IP', - DATE_SUBMITTED: 'Fecha de envío', - GENERATED_PDF: 'PDF generado', - - //Design View - BACKGROUND_COLOR: 'Color de fondo', - DESIGN_HEADER: 'Cambiar diseño de formulario', - QUESTION_TEXT_COLOR: 'Color de la pregunta', - ANSWER_TEXT_COLOR: 'Color de la respuesta', - BTN_BACKGROUND_COLOR: 'Color de fondo del botón', - BTN_TEXT_COLOR: 'Color del texto del botón', - - //Share View - EMBED_YOUR_FORM: 'Pone tu formulario', - SHARE_YOUR_FORM: 'Compartí tu formulario', - - //Admin Tabs - CREATE_TAB: 'Crear', - DESIGN_TAB: 'Diseño', - CONFIGURE_TAB: 'Configuración', - ANALYZE_TAB: 'Análisis', - SHARE_TAB: 'Compartir', - - //Field Types - SHORT_TEXT: 'Texto corto', - EMAIL: 'Email', - MULTIPLE_CHOICE: 'Opciones múltiples', - DROPDOWN: 'Desplegable', - DATE: 'Fecha', - PARAGRAPH_T: 'Párrafo', - YES_NO: 'Si/No', - LEGAL: 'Legal', - RATING: 'Puntaje', - NUMBERS: 'Números', - SIGNATURE: 'Firma', - FILE_UPLOAD: 'Subir archivo', - OPTION_SCALE: 'Escala', - PAYMENT: 'Pago', - STATEMENT: 'Declaración', - LINK: 'Enlace' - }); -}]); - -'use strict'; - -angular.module('forms').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('en', { - FORM_SUCCESS: 'Form entry successfully submitted!', - REVIEW: 'Review', - BACK_TO_FORM: 'Go back to Form', - EDIT_FORM: 'Edit this TellForm', - CREATE_FORM: 'Create this TellForm', - ADVANCEMENT: '{{done}} out of {{total}} answered', - CONTINUE_FORM: 'Continue to Form', - REQUIRED: 'required', - COMPLETING_NEEDED: '{{answers_not_completed}} answer(s) need completing', - OPTIONAL: 'optional', - ERROR_EMAIL_INVALID: 'Please enter a valid email address', - ERROR_NOT_A_NUMBER: 'Please enter valid numbers only', - ERROR_URL_INVALID: 'Please a valid url', - OK: 'OK', - ENTER: 'press ENTER', - YES: 'Yes', - NO: 'No', - NEWLINE: 'press SHIFT+ENTER to create a newline', - CONTINUE: 'Continue', - LEGAL_ACCEPT: 'I accept', - LEGAL_NO_ACCEPT: 'I don’t accept', - DELETE: 'Delete', - CANCEL: 'Cancel', - SUBMIT: 'Submit', - UPLOAD_FILE: 'Upload your File', - TYPE_OR_SELECT_OPTION: 'Type or select an option', - ABORT_UPLOAD: 'Abort ongoing upload', - CLEAR_SELECTED_FILES: 'Clear selected files' - }); - -}]); - -'use strict'; - -angular.module('forms').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('fr', { - FORM_SUCCESS: 'Votre formulaire a été enregistré!', - REVIEW: 'Incomplet', - BACK_TO_FORM: 'Retourner au formulaire', - EDIT_FORM: 'Éditer le Tellform', - CREATE_FORM: 'Créer un TellForm', - ADVANCEMENT: '{{done}} complétés sur {{total}}', - CONTINUE_FORM: 'Aller au formulaire', - REQUIRED: 'obligatoire', - COMPLETING_NEEDED: '{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)', - OPTIONAL: 'facultatif', - ERROR_EMAIL_INVALID: 'Merci de rentrer une adresse mail valide', - ERROR_NOT_A_NUMBER: 'Merce de ne rentrer que des nombres', - ERROR_URL_INVALID: 'Merci de rentrer une url valide', - OK: 'OK', - ENTER: 'presser ENTRÉE', - YES: 'Oui', - NO: 'Non', - NEWLINE: 'presser SHIFT+ENTER pour créer une nouvelle ligne', - CONTINUE: 'Continuer', - LEGAL_ACCEPT: 'J’accepte', - LEGAL_NO_ACCEPT: 'Je n’accepte pas', - DELETE: 'Supprimer', - CANCEL: 'Réinitialiser', - SUBMIT: 'Enregistrer', - UPLOAD_FILE: 'Envoyer un fichier', - Y: 'O', - N: 'N' - }); - -}]); - -'use strict'; - -angular.module('forms').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('de', { - FORM_SUCCESS: 'Ihre Angaben wurden gespeichert.', - REVIEW: 'Unvollständig', - BACK_TO_FORM: 'Zurück zum Formular', - EDIT_FORM: 'Bearbeiten Sie diese TellForm', - CREATE_FORM: 'Erstellen Sie eine TellForm', - ADVANCEMENT: '{{done}} von {{total}} beantwortet', - CONTINUE_FORM: 'Zum Formular', - REQUIRED: 'verpflichtend', - COMPLETING_NEEDED: 'Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)', - OPTIONAL: 'fakultativ', - ERROR_EMAIL_INVALID: 'Bitte gültige Mailadresse eingeben', - ERROR_NOT_A_NUMBER: 'Bitte nur Zahlen eingeben', - ERROR_URL_INVALID: 'Bitte eine gültige URL eingeben', - OK: 'Okay', - ENTER: 'Eingabetaste drücken', - YES: 'Ja', - NO: 'Nein', - NEWLINE: 'Für eine neue Zeile SHIFT+ENTER drücken', - CONTINUE: 'Weiter', - LEGAL_ACCEPT: 'Ich akzeptiere', - LEGAL_NO_ACCEPT: 'Ich akzeptiere nicht', - DELETE: 'Entfernen', - CANCEL: 'Canceln', - SUBMIT: 'Speichern', - UPLOAD_FILE: 'Datei versenden', - Y: 'J', - N: 'N' - }); - -}]); - -'use strict'; - -angular.module('forms').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('it', { - FORM_SUCCESS: 'Il formulario è stato inviato con successo!', - REVIEW: 'Incompleto', - BACK_TO_FORM: 'Ritorna al formulario', - EDIT_FORM: 'Modifica questo Tellform', - CREATE_FORM: 'Creare un TellForm', - ADVANCEMENT: '{{done}} su {{total}} completate', - CONTINUE_FORM: 'Vai al formulario', - REQUIRED: 'obbligatorio', - COMPLETING_NEEDED: '{{answers_not_completed}} risposta/e deve/ono essere completata/e', - OPTIONAL: 'opzionale', - ERROR_EMAIL_INVALID: 'Si prega di inserire un indirizzo email valido', - ERROR_NOT_A_NUMBER: 'Si prega di inserire solo numeri', - ERROR_URL_INVALID: 'Grazie per inserire un URL valido', - OK: 'OK', - ENTER: 'premere INVIO', - YES: 'Sì', - NO: 'No', - NEWLINE: 'premere SHIFT+INVIO per creare una nuova linea', - CONTINUE: 'Continua', - LEGAL_ACCEPT: 'Accetto', - LEGAL_NO_ACCEPT: 'Non accetto', - DELETE: 'Cancella', - CANCEL: 'Reset', - SUBMIT: 'Registra', - UPLOAD_FILE: 'Invia un file', - Y: 'S', - N: 'N' - }); - -}]); - -'use strict'; - -angular.module('forms').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('es', { - FORM_SUCCESS: '¡El formulario ha sido enviado con éxito!', - REVIEW: 'Revisar', - BACK_TO_FORM: 'Regresar al formulario', - EDIT_FORM: 'Crear un TellForm', - CREATE_FORM: 'Editar este TellForm', - ADVANCEMENT: '{{done}} de {{total}} contestadas', - CONTINUE_FORM: 'Continuar al formulario', - REQUIRED: 'Información requerida', - COMPLETING_NEEDED: '{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)', - OPTIONAL: 'Opcional', - ERROR_EMAIL_INVALID: 'Favor de proporcionar un correo electrónico válido', - ERROR_NOT_A_NUMBER: 'Por favor, introduzca sólo números válidos', - ERROR_URL_INVALID: 'Favor de proporcionar un url válido', - OK: 'OK', - ENTER: 'pulse INTRO', - YES: 'Si', - NO: 'No', - NEWLINE: 'presione SHIFT+INTRO para crear una nueva línea', - CONTINUE: 'Continuar', - LEGAL_ACCEPT: 'Acepto', - LEGAL_NO_ACCEPT: 'No acepto', - DELETE: 'Eliminar', - CANCEL: 'Cancelar', - SUBMIT: 'Registrar', - UPLOAD_FILE: 'Cargar el archivo', - Y: 'S', - N: 'N', - TYPE_OR_SELECT_OPTION: 'Escriba o seleccione una opción', - ABORT_UPLOAD: 'Cancelar la subida en curso', - CLEAR_SELECTED_FILES: 'Borrar los archivos seleccionados' - }); - -}]); - -'use strict'; - // Setting up route angular.module('core').config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider, Authorization) { @@ -1587,8 +1045,7 @@ angular.module('forms').run(['Menus', return function(seconds) { return new Date(1970, 0, 1).setSeconds(seconds); }; -}]).filter('formValidity', - function(){ +}]).filter('formValidity', [function(){ return function(formObj){ if(formObj && formObj.form_fields && formObj.visible_form_fields){ @@ -1614,7 +1071,12 @@ angular.module('forms').run(['Menus', } return 0; }; -}).config(['$provide', function ($provide){ +}]).filter('trustSrc', ['$sce', function($sce){ + return function(formUrl){ + (' $sce.trustAsResourceUrl(formUrl): '+ $sce.trustAsResourceUrl(formUrl)); + return $sce.trustAsResourceUrl(formUrl); + }; +}]).config(['$provide', function ($provide){ $provide.decorator('accordionDirective', ["$delegate", function($delegate) { var directive = $delegate[0]; directive.replace = true; @@ -1635,15 +1097,20 @@ angular.module('forms').config(['$stateProvider', templateUrl: 'modules/forms/admin/views/list-forms.client.view.html' }).state('submitForm', { url: '/forms/:formId', - templateUrl: 'modules/forms/base/views/submit-form.client.view.html', + templateUrl: '/static/form_modules/forms/base/views/submit-form.client.view.html', data: { hideNav: true }, resolve: { - Forms: 'Forms', - myForm: ["Forms", "$stateParams", function (Forms, $stateParams) { - return Forms.get({formId: $stateParams.formId}).$promise; - }] + Forms: 'GetForms', + myForm: ["GetForms", "$stateParams", "$q", function (GetForms, $stateParams, $q) { + var deferred = $q.defer(); + GetForms.get({formId: $stateParams.formId}, function(resolvedForm){ + deferred.resolve(resolvedForm); + }); + + return deferred.promise; + }] }, controller: 'SubmitFormController', controllerAs: 'ctrl' @@ -1654,9 +1121,14 @@ angular.module('forms').config(['$stateProvider', permissions: [ 'editForm' ] }, resolve: { - Forms: 'Forms', - myForm: ["Forms", "$stateParams", function (Forms, $stateParams) { - return Forms.get({formId: $stateParams.formId}).$promise; + GetForms: 'GetForms', + myForm: ["GetForms", "$stateParams", "$q", function (GetForms, $stateParams, $q) { + var deferred = $q.defer(); + GetForms.get({formId: $stateParams.formId}, function(resolvedForm){ + deferred.resolve(resolvedForm); + }); + + return deferred.promise; }] }, controller: 'AdminFormController' @@ -1676,93 +1148,38 @@ angular.module('forms').config(['$stateProvider', } ]); -(function () { - 'use strict'; - //Dummy Service for Previewing Form - function SendVisitorData() { +'use strict'; - // Create a controller method for sending visitor data - function send(form, lastActiveIndex) { - - } - - function init(){ - } - - var service = { - send: send - }; - - init(); - return service; +//Forms service used for communicating with the forms REST endpoints +angular.module('forms').factory('GetForms', ['$resource', 'FORM_URL', + function($resource, FORM_URL) { + return $resource(FORM_URL, { + formId: '@_id' + }, { + 'query' : { + method: 'GET', + isArray: true + }, + 'get' : { + method: 'GET', + transformResponse: function(data, header) { + var form = angular.fromJson(data); + form.visible_form_fields = _.filter(form.form_fields, function(field){ + return (field.deletePreserved === false); + }); + return form; + } + }, + 'update': { + method: 'PUT' + }, + 'save': { + method: 'POST' + } + }); } - // Create the SendVisitorData service - angular - .module('forms') - .factory('SendVisitorData', SendVisitorData); - - SendVisitorData.$inject = []; -}()); - - -'use strict'; - -angular.module('forms').directive('keyToOption', function(){ - return { - restrict: 'A', - scope: { - field: '=' - }, - link: function($scope, $element, $attrs, $select) { - $element.bind('keydown keypress', function(event) { - - var keyCode = event.which || event.keyCode; - var index = parseInt(String.fromCharCode(keyCode))-1; - //console.log($scope.field); - - if (index < $scope.field.fieldOptions.length) { - event.preventDefault(); - $scope.$apply(function () { - $scope.field.fieldValue = $scope.field.fieldOptions[index].option_value; - }); - } - - }); - } - }; -}); - -'use strict'; - -angular.module('forms').directive('keyToTruthy', ['$rootScope', function($rootScope){ - return { - restrict: 'A', - scope: { - field: '=' - }, - link: function($scope, $element, $attrs) { - $element.bind('keydown keypress', function(event) { - var keyCode = event.which || event.keyCode; - var truthyKeyCode = $attrs.keyCharTruthy.charCodeAt(0) - 32; - var falseyKeyCode = $attrs.keyCharFalsey.charCodeAt(0) - 32; - - if(keyCode === truthyKeyCode ) { - event.preventDefault(); - $scope.$apply(function() { - $scope.field.fieldValue = 'true'; - }); - }else if(keyCode === falseyKeyCode){ - event.preventDefault(); - $scope.$apply(function() { - $scope.field.fieldValue = 'false'; - }); - } - }); - } - }; -}]); - +]); 'use strict'; @@ -1942,6 +1359,11 @@ angular.module('users').controller('AuthenticationController', ['$scope', '$loca }; $scope.signup = function() { + if($scope.credentials === 'admin'){ + $scope.error = 'Username cannot be \'admin\'. Please pick another username.' + return; + } + User.signup($scope.credentials).then( function(response) { $state.go('signup-success'); @@ -2421,12 +1843,8 @@ angular.module('core').config(['$translateProvider', function ($translateProvide 'use strict'; // Forms controller -angular.module('forms').controller('AdminFormController', ['$rootScope', '$window', '$scope', '$stateParams', '$state', 'Forms', 'CurrentForm', '$http', '$uibModal', 'myForm', '$filter', '$sce', - function($rootScope, $window, $scope, $stateParams, $state, Forms, CurrentForm, $http, $uibModal, myForm, $filter, $sce) { - - $scope.trustSrc = function (src) { - return $sce.trustAsResourceUrl(src); - }; +angular.module('forms').controller('AdminFormController', ['$rootScope', '$window', '$scope', '$stateParams', '$state', 'Forms', 'CurrentForm', '$http', '$uibModal', 'myForm', '$filter', + function($rootScope, $window, $scope, $stateParams, $state, Forms, CurrentForm, $http, $uibModal, myForm, $filter) { //Set active tab to Create $scope.activePill = 0; @@ -2442,6 +1860,9 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$windo $rootScope.saveInProgress = false; CurrentForm.setForm($scope.myform); + console.log("$scope.myform"); + console.log($scope.myform); + $scope.formURL = '/#!/forms/' + $scope.myform._id; @@ -2611,8 +2032,8 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$windo 'use strict'; // Forms controller -angular.module('forms').controller('ListFormsController', ['$rootScope', '$scope', '$stateParams', '$state', 'Forms', 'CurrentForm', '$http', '$uibModal', - function($rootScope, $scope, $stateParams, $state, Forms, CurrentForm, $http, $uibModal) { +angular.module('forms').controller('ListFormsController', ['$rootScope', '$scope', '$stateParams', '$state', 'GetForms', 'CurrentForm', '$http', '$uibModal', + function($rootScope, $scope, $stateParams, $state, GetForms, CurrentForm, $http, $uibModal) { $scope = $rootScope; $scope.forms = {}; @@ -2661,7 +2082,7 @@ angular.module('forms').controller('ListFormsController', ['$rootScope', '$scope // Return all user's Forms $scope.findAll = function() { - Forms.query(function(_forms){ + GetForms.query(function(_forms){ $scope.myforms = _forms; }); }; @@ -2702,7 +2123,6 @@ angular.module('forms').controller('ListFormsController', ['$rootScope', '$scope // Create new Form $scope.createNewForm = function(){ - // console.log($scope.forms.createForm); var form = {}; form.title = $scope.forms.createForm.title.$modelValue; @@ -2711,7 +2131,6 @@ angular.module('forms').controller('ListFormsController', ['$rootScope', '$scope if($scope.forms.createForm.$valid && $scope.forms.createForm.$dirty){ $http.post('/forms', {form: form}) .success(function(data, status, headers){ - //console.log('new form created'); // Redirect after save $scope.goToWithId('viewForm.create', data._id+''); }).error(function(errorResponse){ @@ -2728,11 +2147,9 @@ angular.module('forms').controller('ListFormsController', ['$rootScope', '$scope $http.delete('/forms/'+$scope.myforms[form_index]._id) .success(function(data, status, headers){ - //console.log('form deleted successfully'); $scope.myforms.splice(form_index, 1); $scope.cancelDeleteModal(); }).error(function(error){ - //console.log('ERROR: Form could not be deleted.'); console.error(error); }); }; @@ -3105,12 +2522,12 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField }; $scope.duplicateField = function(field_index){ - var currField = _.cloneDeep($scope.myform.form_fields[field_index]); + var currField = angular.copy($scope.myform.form_fields[field_index]); currField._id = 'cloned'+_.uniqueId(); currField.title += ' copy'; //Insert field at selected index - $scope.myform.form_fields.splice(field_index+1, 0, currField); + $scope.myform.form_fields.push(currField); $scope.update(false, $scope.myform, false, true, null); }; @@ -3146,31 +2563,31 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope', rows: [] }; - var submissions = $scope.myform.submissions || []; + var submissions = $scope.myform.submissions || []; - //Iterate through form's submissions - for(var i = 0; i < submissions.length; i++){ - for(var x = 0; x < submissions[i].form_fields.length; x++){ - if(submissions[i].form_fields[x].fieldType === 'dropdown'){ - submissions[i].form_fields[x].fieldValue = submissions[i].form_fields[x].fieldValue.option_value; - } - //var oldValue = submissions[i].form_fields[x].fieldValue || ''; - //submissions[i].form_fields[x] = _.merge(defaultFormFields, submissions[i].form_fields); - //submissions[i].form_fields[x].fieldValue = oldValue; - } - submissions[i].selected = false; + //Iterate through form's submissions + for(var i = 0; i < submissions.length; i++){ + for(var x = 0; x < submissions[i].form_fields.length; x++){ + if(submissions[i].form_fields[x].fieldType === 'dropdown'){ + submissions[i].form_fields[x].fieldValue = submissions[i].form_fields[x].fieldValue.option_value; } + //var oldValue = submissions[i].form_fields[x].fieldValue || ''; + //submissions[i].form_fields[x] = _.merge(defaultFormFields, submissions[i].form_fields); + //submissions[i].form_fields[x].fieldValue = oldValue; + } + submissions[i].selected = false; + } - $scope.table.rows = submissions; + $scope.table.rows = submissions; var initController = function(){ - Forms.get({ - formId: $stateParams.formId - }, function(form){ - $scope.myform = form; + $http({ + method: 'GET', + url: '/someUrl' + }).then(function successCallback(response) { var defaultFormFields = _.cloneDeep($scope.myform.form_fields); - var submissions = $scope.myform.submissions || []; + var submissions = response.data || []; //Iterate through form's submissions for(var i = 0; i < submissions.length; i++){ @@ -3313,7 +2730,6 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope', //Export selected submissions of Form $scope.exportSubmissions = function(type){ - angular.element('#table-submission-data').tableExport({type: type, escape:false}); }; @@ -3422,704 +2838,6 @@ angular.module('forms').factory('Submissions', ['$resource', 'use strict'; -// Configuring the Forms drop-down menus -angular.module('forms').value('supportedFields', [ - 'textfield', - 'textarea', - 'date', - 'dropdown', - 'hidden', - 'password', - 'radio', - 'legal', - 'statement', - 'rating', - 'yes_no', - 'number', - 'natural' -]); - -'use strict'; - -// SubmitForm controller -angular.module('forms').controller('SubmitFormController', [ - '$scope', '$rootScope', '$state', '$translate', 'myForm', 'Auth', - function($scope, $rootScope, $state, $translate, myForm, Auth) { - $scope.authentication = Auth; - $scope.myform = myForm; - - $translate.use(myForm.language); - - if(!$scope.myform.isLive){ - // Show navbar if form is not public AND user IS loggedin - if($scope.authentication.isAuthenticated()){ - $scope.hideNav = $rootScope.hideNav = false; - } - // Redirect if form is not public user IS NOT loggedin - else { - $scope.hideNav = $rootScope.hideNav = true; - $state.go('access_denied'); - } - }else{ - $scope.hideNav = $rootScope.hideNav = true; - } - } -]); - -'use strict'; - -angular.module('forms').directive('fieldIconDirective', function() { - - return { - template: '', - restrict: 'E', - scope: { - typeName: '@' - }, - controller: ["$scope", function($scope){ - var iconTypeMap = { - 'textfield': 'fa fa-pencil-square-o', - 'dropdown': 'fa fa-th-list', - 'date': 'fa fa-calendar', - 'checkbox': 'fa fa-check-square-o', - 'radio': 'fa fa-dot-circle-o', - 'email': 'fa fa-envelope-o', - 'textarea': 'fa fa-pencil-square', - 'legal': 'fa fa-legal', - 'file': 'fa fa-cloud-upload', - 'rating': 'fa fa-star-half-o', - 'link': 'fa fa-link', - 'scale': 'fa fa-sliders', - 'stripe': 'fa fa-credit-card', - 'statement': 'fa fa-quote-left', - 'yes_no': 'fa fa-toggle-on', - 'number': 'fa fa-slack' - }; - $scope.typeIcon = iconTypeMap[$scope.typeName]; - }] - }; -}); - -'use strict'; - -// coffeescript's for in loop -var __indexOf = [].indexOf || function(item) { - for (var i = 0, l = this.length; i < l; i++) { - if (i in this && this[i] === item) return i; - } - return -1; -}; - -angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$rootScope', '$templateCache', 'supportedFields', - function($http, $compile, $rootScope, $templateCache, supportedFields) { - - var getTemplateUrl = function(fieldType) { - var type = fieldType; - - var supported_fields = [ - 'textfield', - 'textarea', - 'file', - 'date', - 'dropdown', - 'hidden', - 'password', - 'radio', - 'legal', - 'statement', - 'rating', - 'yes_no', - 'number', - 'natural' - ]; - - var templateUrl = 'modules/forms/base/views/directiveViews/field/'; - - if (__indexOf.call(supportedFields, type) >= 0) { - templateUrl = templateUrl+type+'.html'; - } - return $templateCache.get(templateUrl); - }; - - return { - template: '
{{field.title}}
', - restrict: 'E', - scope: { - field: '=', - required: '&', - design: '=', - index: '=', - forms: '=' - }, - link: function(scope, element) { - - $rootScope.chooseDefaultOption = scope.chooseDefaultOption = function(type) { - if(type === 'yes_no'){ - scope.field.fieldValue = 'true'; - }else if(type === 'rating'){ - scope.field.fieldValue = 0; - }else if(scope.field.fieldType === 'radio'){ - scope.field.fieldValue = scope.field.fieldOptions[0].option_value; - }else if(type === 'legal'){ - scope.field.fieldValue = 'true'; - $rootScope.nextField(); - } - }; - - scope.setActiveField = $rootScope.setActiveField; - - //Set format only if field is a date - if(scope.field.fieldType === 'date'){ - scope.dateOptions = { - changeYear: true, - changeMonth: true, - altFormat: 'mm/dd/yyyy', - yearRange: '1900:-0', - defaultDate: 0 - }; - } - - var fieldType = scope.field.fieldType; - - if(scope.field.fieldType === 'number' || scope.field.fieldType === 'textfield' || scope.field.fieldType === 'email' || scope.field.fieldType === 'link'){ - switch(scope.field.fieldType){ - case 'textfield': - scope.input_type = 'text'; - break; - case 'email': - scope.input_type = 'email'; - scope.placeholder = 'joesmith@example.com'; - break; - case 'number': - scope.input_type = 'text'; - scope.validateRegex = /^-?\d+$/; - break; - default: - scope.input_type = 'url'; - scope.placeholder = 'http://example.com'; - break; - } - fieldType = 'textfield'; - } - - var template = getTemplateUrl(fieldType); - element.html(template).show(); - var output = $compile(element.contents())(scope); - } - }; -}]); - -'use strict'; - -//TODO: DAVID: Need to refactor this -angular.module('forms').directive('onEnterKey', ['$rootScope', function($rootScope){ - return { - restrict: 'A', - link: function($scope, $element, $attrs) { - $element.bind('keydown keypress', function(event) { - - var keyCode = event.which || event.keyCode; - - var onEnterKeyDisabled = false; - if($attrs.onEnterKeyDisabled !== null) onEnterKeyDisabled = $attrs.onEnterKeyDisabled; - - if(keyCode === 13 && !event.shiftKey && !onEnterKeyDisabled) { - event.preventDefault(); - $rootScope.$apply(function() { - $rootScope.$eval($attrs.onEnterKey); - }); - } - }); - } - }; -}]).directive('onTabKey', ['$rootScope', function($rootScope){ - return { - restrict: 'A', - link: function($scope, $element, $attrs) { - $element.bind('keydown keypress', function(event) { - - var keyCode = event.which || event.keyCode; - - if(keyCode === 9 && !event.shiftKey) { - - event.preventDefault(); - $rootScope.$apply(function() { - $rootScope.$eval($attrs.onTabKey); - }); - } - }); - } - }; -}]).directive('onEnterOrTabKey', ['$rootScope', function($rootScope){ - return { - restrict: 'A', - link: function($scope, $element, $attrs) { - $element.bind('keydown keypress', function(event) { - - var keyCode = event.which || event.keyCode; - - if((keyCode === 13 || keyCode === 9) && !event.shiftKey) { - event.preventDefault(); - $rootScope.$apply(function() { - $rootScope.$eval($attrs.onEnterOrTabKey); - }); - } - }); - } - }; -}]).directive('onTabAndShiftKey', ['$rootScope', function($rootScope){ - return { - restrict: 'A', - link: function($scope, $element, $attrs) { - $element.bind('keydown keypress', function(event) { - - var keyCode = event.which || event.keyCode; - - if(keyCode === 9 && event.shiftKey) { - event.preventDefault(); - $rootScope.$apply(function() { - $rootScope.$eval($attrs.onTabAndShiftKey); - }); - } - }); - } - }; -}]); - -'use strict'; - -angular.module('forms').directive('onFinishRender', ["$rootScope", function ($rootScope) { - return { - restrict: 'A', - link: function (scope, element, attrs) { - - //Don't do anything if we don't have a ng-repeat on the current element - if(!element.attr('ng-repeat') && !element.attr('data-ng-repeat')){ - return; - } - - var broadcastMessage = attrs.onFinishRender || 'ngRepeat'; - - if(scope.$first && !scope.$last) { - scope.$evalAsync(function () { - $rootScope.$broadcast(broadcastMessage+' Started'); - }); - } else if(scope.$last) { - scope.$evalAsync(function () { - $rootScope.$broadcast(broadcastMessage+' Finished'); - }); - } - } - }; -}]); - -'use strict'; - - -angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter', '$filter', '$rootScope', 'Auth', 'SendVisitorData', - function ($http, TimeCounter, $filter, $rootScope, Auth, SendVisitorData) { - return { - templateUrl: 'modules/forms/base/views/directiveViews/form/submit-form.client.view.html', - restrict: 'E', - scope: { - myform:'=' - }, - controller: ["$document", "$window", "$scope", function($document, $window, $scope){ - $scope.authentication = $rootScope.authentication; - $scope.noscroll = false; - $scope.forms = {}; - - var form_fields_count = $scope.myform.visible_form_fields.filter(function(field){ - if(field.fieldType === 'statement' || field.fieldType === 'rating'){ - return false; - } - return true; - }).length; - - var nb_valid = $filter('formValidity')($scope.myform); - $scope.translateAdvancementData = { - done: nb_valid, - total: form_fields_count, - answers_not_completed: form_fields_count - nb_valid - }; - - $scope.reloadForm = function(){ - //Reset Form - $scope.myform.submitted = false; - $scope.myform.form_fields = _.chain($scope.myform.visible_form_fields).map(function(field){ - field.fieldValue = ''; - return field; - }).value(); - - $scope.loading = false; - $scope.error = ''; - - $scope.selected = { - _id: '', - index: 0 - }; - $scope.setActiveField($scope.myform.visible_form_fields[0]._id, 0, false); - - //console.log($scope.selected); - //Reset Timer - TimeCounter.restartClock(); - }; - - //Fire event when window is scrolled - $window.onscroll = function(){ - $scope.scrollPos = document.body.scrollTop || document.documentElement.scrollTop || 0; - var elemBox = document.getElementsByClassName('activeField')[0].getBoundingClientRect(); - $scope.fieldTop = elemBox.top; - $scope.fieldBottom = elemBox.bottom; - - //console.log($scope.forms.myForm); - var field_id; - var field_index; - - if(!$scope.noscroll){ - //Focus on submit button - 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.visible_form_fields.length){ - if($scope.fieldTop > 200){ - field_index = $scope.selected.index-1; - 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.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.visible_form_fields[field_index]._id; - $scope.setActiveField(field_id, field_index, false); - } - //console.log('$scope.selected.index: '+$scope.selected.index); - //console.log('scroll pos: '+$scope.scrollPos+' fieldTop: '+$scope.fieldTop+' fieldBottom: '+$scope.fieldBottom); - $scope.$apply(); - } - }; - - /* - ** Field Controls - */ - var getActiveField = function(){ - if($scope.selected === null){ - console.error('current active field is null'); - throw new Error('current active field is null'); - } - - if($scope.selected._id === 'submit_field') { - return $scope.myform.form_fields.length - 1; - } else { - return $scope.selected.index; - } - }; - - $scope.setActiveField = $rootScope.setActiveField = function(field_id, field_index, animateScroll) { - if($scope.selected === null || $scope.selected._id === field_id){ - //console.log('not scrolling'); - //console.log($scope.selected); - return; - } - //console.log('field_id: '+field_id); - //console.log('field_index: '+field_index); - //console.log($scope.selected); - - $scope.selected._id = field_id; - $scope.selected.index = field_index; - - var nb_valid = $filter('formValidity')($scope.myform); - $scope.translateAdvancementData = { - done: nb_valid, - total: form_fields_count, - answers_not_completed: form_fields_count - nb_valid - }; - - if(animateScroll){ - $scope.noscroll=true; - setTimeout(function() { - $document.scrollToElement(angular.element('.activeField'), -10, 200).then(function() { - $scope.noscroll = false; - setTimeout(function() { - if (document.querySelectorAll('.activeField .focusOn').length) { - //Handle default case - document.querySelectorAll('.activeField .focusOn')[0].focus(); - } else if(document.querySelectorAll('.activeField input').length) { - //Handle case for rating input - document.querySelectorAll('.activeField input')[0].focus(); - } else { - //Handle case for dropdown input - document.querySelectorAll('.activeField .selectize-input')[0].focus(); - } - }); - }); - }); - } else { - setTimeout(function() { - if (document.querySelectorAll('.activeField .focusOn')[0] !== undefined) { - //FIXME: DAVID: Figure out how to set focus without scroll movement in HTML Dom - document.querySelectorAll('.activeField .focusOn')[0].focus(); - } else if(document.querySelectorAll('.activeField input')[0] !== undefined) { - document.querySelectorAll('.activeField input')[0].focus(); - } - }); - } - - - }; - - $rootScope.nextField = $scope.nextField = function(){ - //console.log('nextfield'); - //console.log($scope.selected.index); - //console.log($scope.myform.visible_form_fields.length-1); - var selected_index, selected_id; - if($scope.selected.index < $scope.myform.visible_form_fields.length-1){ - selected_index = $scope.selected.index+1; - selected_id = $scope.myform.visible_form_fields[selected_index]._id; - $rootScope.setActiveField(selected_id, selected_index, true); - } 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); - } - }; - - $rootScope.prevField = $scope.prevField = function(){ - if($scope.selected.index > 0){ - var selected_index = $scope.selected.index - 1; - var selected_id = $scope.myform.visible_form_fields[selected_index]._id; - $scope.setActiveField(selected_id, selected_index, true); - } - }; - - /* - ** Form Display Functions - */ - $scope.exitStartPage = function(){ - $scope.myform.startPage.showStart = false; - if($scope.myform.visible_form_fields.length > 0){ - $scope.selected._id = $scope.myform.visible_form_fields[0]._id; - } - }; - - $rootScope.goToInvalid = $scope.goToInvalid = function() { - document.querySelectorAll('.ng-invalid.focusOn')[0].focus(); - }; - - $rootScope.submitForm = $scope.submitForm = function(cb) { - - var _timeElapsed = TimeCounter.stopClock(); - $scope.loading = true; - - var form = _.cloneDeep($scope.myform); - - form.timeElapsed = _timeElapsed; - - form.percentageComplete = $filter('formValidity')($scope.myform) / $scope.myform.visible_form_fields.length * 100; - delete form.visible_form_fields; - - for(var i=0; i < $scope.myform.form_fields.length; i++){ - if($scope.myform.form_fields[i].fieldType === 'dropdown' && !$scope.myform.form_fields[i].deletePreserved){ - $scope.myform.form_fields[i].fieldValue = $scope.myform.form_fields[i].fieldValue.option_value; - } - } - - setTimeout(function () { - $scope.submitPromise = $http.post('/forms/' + $scope.myform._id, form) - .success(function (data, status, headers) { - $scope.myform.submitted = true; - $scope.loading = false; - SendVisitorData.send($scope.myform, getActiveField(), _timeElapsed); - if(cb){ - cb(); - } - }) - .error(function (error) { - $scope.loading = false; - console.error(error); - $scope.error = error.message; - if(cb){ - cb(error); - } - }); - }, 500); - }; - - //Reload our form - $scope.reloadForm(); - }] - }; - } -]); - -'use strict'; - -//Forms service used for communicating with the forms REST endpoints -angular.module('forms').service('CurrentForm', - function(){ - - //Private variables - var _form = {}; - - //Public Methods - this.getForm = function() { - return _form; - }; - this.setForm = function(form) { - _form = form; - }; - } -); -'use strict'; - -//Forms service used for communicating with the forms REST endpoints -angular.module('forms').factory('Forms', ['$resource', 'FORM_URL', - function($resource, FORM_URL) { - return $resource(FORM_URL, { - formId: '@_id' - }, { - 'query' : { - method: 'GET', - isArray: true - }, - 'get' : { - method: 'GET', - transformResponse: function(data, header) { - var form = angular.fromJson(data); - - form.visible_form_fields = _.filter(form.form_fields, function(field){ - return (field.deletePreserved === false); - }); - return form; - } - }, - 'update': { - method: 'PUT' - }, - 'save': { - method: 'POST' - } - }); - } -]); - -(function () { - 'use strict'; - - - function Socket($timeout, $window) { - - var service; - - // Connect to Socket.io server - function connect(url) { - service.socket = io(url, {'transports': ['websocket', 'polling']}); - } - - // Wrap the Socket.io 'emit' method - function emit(eventName, data) { - if (service.socket) { - service.socket.emit(eventName, data); - } - } - - // Wrap the Socket.io 'on' method - function on(eventName, callback) { - if (service.socket) { - service.socket.on(eventName, function (data) { - $timeout(function () { - callback(data); - }); - }); - } - } - - // Wrap the Socket.io 'removeListener' method - function removeListener(eventName) { - if (service.socket) { - service.socket.removeListener(eventName); - } - } - - service = { - connect: connect, - emit: emit, - on: on, - removeListener: removeListener, - socket: null - }; - - var url = ''; - if($window.socketPort && $window.socketUrl){ - url = $window.socketUrl + ':' + $window.socketPort; - } else if ($window.socketUrl && !$window.socketUrl){ - url = $window.socketUrl; - } else if ($window.socketPort){ - url = window.location.protocol+'//'+window.location.hostname + ':' + $window.socketPort; - } else { - url = window.location.protocol+'//'+window.location.hostname; - } - connect(url); - - return service; - } - - // Create the Socket.io wrapper service - angular.module('forms') - .factory('Socket', Socket); - - Socket.$inject = ['$timeout', '$window']; - -}()); - -'use strict'; - -angular.module('forms').service('TimeCounter', [ - function(){ - var _startTime, _endTime = null, that=this; - - this.timeSpent = 0; - - this.restartClock = function(){ - _startTime = Date.now(); - _endTime = null; - // console.log('Clock Started'); - }; - - this.getTimeElapsed = function(){ - if(_startTime) { - return Math.abs(Date.now().valueOf() - _startTime.valueOf()) / 1000; - } - }; - - this.stopClock = function(){ - if(_startTime && _endTime === null){ - _endTime = Date.now(); - this.timeSpent = Math.abs(_endTime.valueOf() - _startTime.valueOf())/1000; - this._startTime = this._endTime = null; - - return this.timeSpent; - }else{ - return new Error('Clock has not been started'); - } - }; - - this.clockStarted = function(){ - return !!this._startTime; - }; - - } -]); - -'use strict'; - angular.module('users').config(['$translateProvider', function ($translateProvider) { $translateProvider.translations('en', { @@ -4314,3 +3032,1660 @@ angular.module('users').config(['$translateProvider', function ($translateProvid VERIFY_ERROR: 'El link de verificación es inválido o inexistente' }); }]); + +'use strict'; + +angular.module('forms').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('en', { + + //Configure Form Tab View + ADVANCED_SETTINGS: 'Advanced Settings', + FORM_NAME: 'Form Name', + FORM_STATUS: 'Form Status', + PUBLIC: 'Public', + PRIVATE: 'Private', + GA_TRACKING_CODE: 'Google Analytics Tracking Code', + DISPLAY_FOOTER: 'Display Form Footer?', + SAVE_CHANGES: 'Save Changes', + CANCEL: 'Cancel', + DISPLAY_START_PAGE: 'Display Start Page?', + DISPLAY_END_PAGE: 'Display Custom End Page?', + + //List Forms View + CREATE_A_NEW_FORM: 'Create a new form', + CREATE_FORM: 'Create form', + CREATED_ON: 'Created on', + MY_FORMS: 'My forms', + NAME: 'Name', + LANGUAGE: 'Language', + FORM_PAUSED: 'Form paused', + + //Edit Field Modal + EDIT_FIELD: 'Edit this Field', + SAVE_FIELD: 'Save', + ON: 'ON', + OFF: 'OFF', + REQUIRED_FIELD: 'Required', + LOGIC_JUMP: 'Logic Jump', + SHOW_BUTTONS: 'Additional Buttons', + SAVE_START_PAGE: 'Save', + + //Admin Form View + ARE_YOU_SURE: 'Are you ABSOLUTELY sure?', + READ_WARNING: 'Unexpected bad things will happen if you don’t read this!', + DELETE_WARNING1: 'This action CANNOT be undone. This will permanently delete the "', + DELETE_WARNING2: '" form and remove all associated form submissions.', + DELETE_CONFIRM: 'Please type in the name of the form to confirm.', + I_UNDERSTAND: 'I understand the consequences, delete this form.', + DELETE_FORM_SM: 'Delete', + DELETE_FORM_MD: 'Delete Form', + DELETE: 'Delete', + FORM: 'Form', + VIEW: 'View', + LIVE: 'Live', + PREVIEW: 'Preview', + COPY: 'Copy', + COPY_AND_PASTE: 'Copy and Paste this to add your TellForm to your website', + CHANGE_WIDTH_AND_HEIGHT: 'Change the width and height values to suit you best', + POWERED_BY: 'Powered by', + TELLFORM_URL: 'Your TellForm is permanently at this URL', + + //Edit Form View + DISABLED: 'Disabled', + YES: 'YES', + NO: 'NO', + ADD_LOGIC_JUMP: 'Add Logic Jump', + ADD_FIELD_LG: 'Click to Add New Field', + ADD_FIELD_MD: 'Add New Field', + ADD_FIELD_SM: 'Add Field', + EDIT_START_PAGE: 'Edit Start Page', + EDIT_END_PAGE: 'Edit End Page', + WELCOME_SCREEN: 'Start Page', + END_SCREEN: 'End Page', + INTRO_TITLE: 'Title', + INTRO_PARAGRAPH: 'Paragraph', + INTRO_BTN: 'Start Button', + TITLE: 'Title', + PARAGRAPH: 'Paragraph', + BTN_TEXT: 'Go Back Button', + BUTTONS: 'Buttons', + BUTTON_TEXT: 'Text', + BUTTON_LINK: 'Link', + ADD_BUTTON: 'Add Button', + PREVIEW_FIELD: 'Preview Question', + QUESTION_TITLE: 'Title', + QUESTION_DESCRIPTION: 'Description', + OPTIONS: 'Options', + ADD_OPTION: 'Add Option', + NUM_OF_STEPS: 'Number of Steps', + CLICK_FIELDS_FOOTER: 'Click on fields to add them here', + SHAPE: 'Shape', + IF_THIS_FIELD: 'If this field', + IS_EQUAL_TO: 'is equal to', + IS_NOT_EQUAL_TO: 'is not equal to', + IS_GREATER_THAN: 'is greater than', + IS_GREATER_OR_EQUAL_THAN: 'is greater or equal than', + IS_SMALLER_THAN: 'is_smaller_than', + IS_SMALLER_OR_EQUAL_THAN: 'is smaller or equal than', + CONTAINS: 'contains', + DOES_NOT_CONTAINS: 'does not contain', + ENDS_WITH: 'ends with', + DOES_NOT_END_WITH: 'does not end with', + STARTS_WITH: 'starts with', + DOES_NOT_START_WITH: 'does not start with', + THEN_JUMP_TO: 'then jump to', + + //Edit Submissions View + TOTAL_VIEWS: 'total unique visits', + RESPONSES: 'responses', + COMPLETION_RATE: 'completion rate', + AVERAGE_TIME_TO_COMPLETE: 'avg. completion time', + + DESKTOP_AND_LAPTOP: 'Desktops', + TABLETS: 'Tablets', + PHONES: 'Phones', + OTHER: 'Other', + UNIQUE_VISITS: 'Unique Visits', + + FIELD_TITLE: 'Field Title', + FIELD_VIEWS: 'Field Views', + FIELD_DROPOFF: 'Field Completion', + FIELD_RESPONSES: 'Field Responses', + DELETE_SELECTED: 'Delete Selected', + EXPORT_TO_EXCEL: 'Export to Excel', + EXPORT_TO_CSV: 'Export to CSV', + EXPORT_TO_JSON: 'Export to JSON', + PERCENTAGE_COMPLETE: 'Percentage Complete', + TIME_ELAPSED: 'Time Elapsed', + DEVICE: 'Device', + LOCATION: 'Location', + IP_ADDRESS: 'IP Address', + DATE_SUBMITTED: 'Date Submitted', + GENERATED_PDF: 'Generated PDF', + + //Design View + BACKGROUND_COLOR: 'Background Color', + DESIGN_HEADER: 'Change how your Form Looks', + QUESTION_TEXT_COLOR: 'Question Text Color', + ANSWER_TEXT_COLOR: 'Answer Text Color', + BTN_BACKGROUND_COLOR: 'Button Background Color', + BTN_TEXT_COLOR: 'Button Text Color', + + //Share View + EMBED_YOUR_FORM: 'Embed your form', + SHARE_YOUR_FORM: 'Share your form', + + //Admin Tabs + CREATE_TAB: 'Create', + DESIGN_TAB: 'Design', + CONFIGURE_TAB: 'Configure', + ANALYZE_TAB: 'Analyze', + SHARE_TAB: 'Share', + + //Field Types + SHORT_TEXT: 'Short Text', + EMAIL: 'Email', + MULTIPLE_CHOICE: 'Multiple Choice', + DROPDOWN: 'Dropdown', + DATE: 'Date', + PARAGRAPH_T: 'Paragraph', + YES_NO: 'Yes/No', + LEGAL: 'Legal', + RATING: 'Rating', + NUMBERS: 'Numbers', + SIGNATURE: 'Signature', + FILE_UPLOAD: 'File upload', + OPTION_SCALE: 'Option Scale', + PAYMENT: 'Payment', + STATEMENT: 'Statement', + LINK: 'Link', + + //Form Preview + FORM_SUCCESS: 'Form entry successfully submitted!', + REVIEW: 'Review', + BACK_TO_FORM: 'Go back to Form', + EDIT_FORM: 'Edit this TellForm', + ADVANCEMENT: '{{done}} out of {{total}} answered', + CONTINUE_FORM: 'Continue to Form', + REQUIRED: 'required', + COMPLETING_NEEDED: '{{answers_not_completed}} answer(s) need completing', + OPTIONAL: 'optional', + ERROR_EMAIL_INVALID: 'Please enter a valid email address', + ERROR_NOT_A_NUMBER: 'Please enter valid numbers only', + ERROR_URL_INVALID: 'Please a valid url', + OK: 'OK', + ENTER: 'press ENTER', + NEWLINE: 'press SHIFT+ENTER to create a newline', + CONTINUE: 'Continue', + LEGAL_ACCEPT: 'I accept', + LEGAL_NO_ACCEPT: 'I don’t accept', + SUBMIT: 'Submit', + UPLOAD_FILE: 'Upload your File' + }); +}]); + +'use strict'; + +angular.module('forms').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('french', { + FORM_SUCCESS: 'Votre formulaire a été enregistré!', + REVIEW: 'Incomplet', + BACK_TO_FORM: 'Retourner au formulaire', + EDIT_FORM: 'Éditer le Tellform', + CREATE_FORM: 'Créer un TellForm', + ADVANCEMENT: '{{done}} complétés sur {{total}}', + CONTINUE_FORM: 'Aller au formulaire', + REQUIRED: 'obligatoire', + COMPLETING_NEEDED: '{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)', + OPTIONAL: 'facultatif', + ERROR_EMAIL_INVALID: 'Merci de rentrer une adresse mail valide', + ERROR_NOT_A_NUMBER: 'Merce de ne rentrer que des nombres', + ERROR_URL_INVALID: 'Merci de rentrer une url valide', + OK: 'OK', + ENTER: 'presser ENTRÉE', + YES: 'Oui', + NO: 'Non', + NEWLINE: 'presser SHIFT+ENTER pour créer une nouvelle ligne', + CONTINUE: 'Continuer', + LEGAL_ACCEPT: 'J’accepte', + LEGAL_NO_ACCEPT: 'Je n’accepte pas', + DELETE: 'Supprimer', + CANCEL: 'Réinitialiser', + SUBMIT: 'Enregistrer', + UPLOAD_FILE: 'Envoyer un fichier', + Y: 'O', + N: 'N', + }); + +}]); + +'use strict'; + +angular.module('forms').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('german', { + FORM_SUCCESS: 'Ihre Angaben wurden gespeichert.', + REVIEW: 'Unvollständig', + BACK_TO_FORM: 'Zurück zum Formular', + EDIT_FORM: '', + CREATE_FORM: '', + ADVANCEMENT: '{{done}} von {{total}} beantwortet', + CONTINUE_FORM: 'Zum Formular', + REQUIRED: 'verpflichtend', + COMPLETING_NEEDED: 'Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)', + OPTIONAL: 'fakultativ', + ERROR_EMAIL_INVALID: 'Bitte gültige Mailadresse eingeben', + ERROR_NOT_A_NUMBER: 'Bitte nur Zahlen eingeben', + ERROR_URL_INVALID: 'Bitte eine gültige URL eingeben', + OK: 'Okay', + ENTER: 'Eingabetaste drücken', + YES: 'Ja', + NO: 'Nein', + NEWLINE: 'Für eine neue Zeile SHIFT+ENTER drücken', + CONTINUE: 'Weiter', + LEGAL_ACCEPT: 'I accept', + LEGAL_NO_ACCEPT: 'I don’t accept', + DELETE: 'Entfernen', + CANCEL: 'Canceln', + SUBMIT: 'Speichern', + UPLOAD_FILE: 'Datei versenden', + Y: 'J', + N: 'N', + }); + +}]); + +'use strict'; + +angular.module('forms').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('italian', { + FORM_SUCCESS: 'Il formulario è stato inviato con successo!', + REVIEW: 'Incompleto', + BACK_TO_FORM: 'Ritorna al formulario', + EDIT_FORM: '', + CREATE_FORM: '', + ADVANCEMENT: '{{done}} su {{total}} completate', + CONTINUE_FORM: 'Vai al formulario', + REQUIRED: 'obbligatorio', + COMPLETING_NEEDED: '{{answers_not_completed}} risposta/e deve/ono essere completata/e', + OPTIONAL: 'opzionale', + ERROR_EMAIL_INVALID: 'Si prega di inserire un indirizzo email valido', + ERROR_NOT_A_NUMBER: 'Si prega di inserire solo numeri', + ERROR_URL_INVALID: 'Grazie per inserire un URL valido', + OK: 'OK', + ENTER: 'premere INVIO', + YES: 'Sì', + NO: 'No', + NEWLINE: 'premere SHIFT+INVIO per creare una nuova linea', + CONTINUE: 'Continua', + LEGAL_ACCEPT: 'I accept', + LEGAL_NO_ACCEPT: 'I don’t accept', + DELETE: 'Cancella', + CANCEL: 'Reset', + SUBMIT: 'Registra', + UPLOAD_FILE: 'Invia un file', + Y: 'S', + N: 'N', + }); + +}]); + +'use strict'; + +angular.module('forms').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('es', { + + //Configure Form Tab View + ADVANCED_SETTINGS: 'Configuraciones avanzadas', + FORM_NAME: 'Nombre del formulario', + FORM_STATUS: 'Estado del formulario', + PUBLIC: 'Público', + PRIVATE: 'Privado', + GA_TRACKING_CODE: 'Código de Google Analytics', + DISPLAY_FOOTER: '¿Mostrar pie de página?', + SAVE_CHANGES: 'Grabar', + CANCEL: 'Cancelar', + DISPLAY_START_PAGE: '¿Mostrar página de inicio?', + DISPLAY_END_PAGE: '¿Mostrar paǵina de fin?', + + //List Forms View + CREATE_A_NEW_FORM: 'Crear formulario', + CREATE_FORM: 'Crear formulario', + CREATED_ON: 'Creado en', + MY_FORMS: 'Mis formularios', + NAME: 'Nombre', + LANGUAGE: 'Idioma', + FORM_PAUSED: 'Formulario pausado', + + //Edit Field Modal + EDIT_FIELD: 'Editar este campo', + SAVE_FIELD: 'Grabar', + ON: 'ON', + OFF: 'OFF', + REQUIRED_FIELD: 'Requerido', + LOGIC_JUMP: 'Salto lógico', + SHOW_BUTTONS: 'Botones adicionales', + SAVE_START_PAGE: 'Grabar', + + //Admin Form View + ARE_YOU_SURE: '¿Estás absolutamente seguro?', + READ_WARNING: '¡Algo malo ocurrirá si no lees esto!', + DELETE_WARNING1: 'Esta acción no tiene vuelta atrás. Esto borrará permanentemente el "', + DELETE_WARNING2: '" formulario y todos los datos asociados.', + DELETE_CONFIRM: 'Por favor escribí el nombre del formulario para confirmar.', + I_UNDERSTAND: 'Entiendo las consecuencias y quiero borrarlo.', + DELETE_FORM_SM: 'Borrar', + DELETE_FORM_MD: 'Borrar formulario', + DELETE: 'Borrar', + FORM: 'Formulario', + VIEW: 'Vista', + LIVE: 'Online', + PREVIEW: 'Vista previa', + COPY: 'Copiar', + COPY_AND_PASTE: 'Copiar y pegar esto para agregar su TellForm a su sitio web', + CHANGE_WIDTH_AND_HEIGHT: 'Cambie los valores de ancho y altura para adaptar el formulario a sus necesidades', + POWERED_BY: 'Con la tecnlogía de', + TELLFORM_URL: 'Tu TellForm está en esta URL permanente', + + //Edit Form View + DISABLED: 'Deshabilitado', + YES: 'SI', + NO: 'NO', + ADD_LOGIC_JUMP: 'Agregar salto lógico', + ADD_FIELD_LG: 'Click para agregar campo', + ADD_FIELD_MD: 'Agregar nuevo campo', + ADD_FIELD_SM: 'Agregar campo', + EDIT_START_PAGE: 'Editar paǵina de inicio', + EDIT_END_PAGE: 'Editar página de finalización', + WELCOME_SCREEN: 'Comienzo', + END_SCREEN: 'Fin', + INTRO_TITLE: 'Título', + INTRO_PARAGRAPH: 'Parágrafo', + INTRO_BTN: 'Botón de comienzo', + TITLE: 'Título', + PARAGRAPH: 'Paragrafo', + BTN_TEXT: 'Botón para volver atrás', + BUTTONS: 'Botones', + BUTTON_TEXT: 'Texto', + BUTTON_LINK: 'Link', + ADD_BUTTON: 'Agregar Botón', + PREVIEW_FIELD: 'Vista previa Pregunta', + QUESTION_TITLE: 'Título', + QUESTION_DESCRIPTION: 'Descripción', + OPTIONS: 'Opciones', + ADD_OPTION: 'Agregar Opciones', + NUM_OF_STEPS: 'Cantidad de pasos', + CLICK_FIELDS_FOOTER: 'Click en los campos para agregar', + SHAPE: 'Forma', + IF_THIS_FIELD: 'Si este campo', + IS_EQUAL_TO: 'es igual a', + IS_NOT_EQUAL_TO: 'no es igual a', + IS_GREATER_THAN: 'es mayor que', + IS_GREATER_OR_EQUAL_THAN: 'es mayor o igual que', + IS_SMALLER_THAN: 'es menor que', + IS_SMALLER_OR_EQUAL_THAN: 'is menor o igual que', + CONTAINS: 'contiene', + DOES_NOT_CONTAINS: 'no contiene', + ENDS_WITH: 'termina con', + DOES_NOT_END_WITH: 'no termina con', + STARTS_WITH: 'comienza con', + DOES_NOT_START_WITH: 'no comienza con', + THEN_JUMP_TO: 'luego salta a', + + //Edit Submissions View + TOTAL_VIEWS: 'Total de visitas únicas', + RESPONSES: 'respuestas', + COMPLETION_RATE: 'Taza de terminación', + AVERAGE_TIME_TO_COMPLETE: 'Promedio de tiempo de rellenado', + + DESKTOP_AND_LAPTOP: 'Computadora', + TABLETS: 'Tablets', + PHONES: 'Móviles', + OTHER: 'Otros', + UNIQUE_VISITS: 'Visitas únicas', + + FIELD_TITLE: 'Título de campo', + FIELD_VIEWS: 'Vistas de campo', + FIELD_DROPOFF: 'Finalización de campo', + FIELD_RESPONSES: 'Respuestas de campo', + DELETE_SELECTED: 'Borrar selección', + EXPORT_TO_EXCEL: 'Exportar a Excel', + EXPORT_TO_CSV: 'Exportar a CSV', + EXPORT_TO_JSON: 'Exportar a JSON', + PERCENTAGE_COMPLETE: 'Porcentaje de completitud', + TIME_ELAPSED: 'Tiempo usado', + DEVICE: 'Dispositivo', + LOCATION: 'Lugar', + IP_ADDRESS: 'Dirección IP', + DATE_SUBMITTED: 'Fecha de envío', + GENERATED_PDF: 'PDF generado', + + //Design View + BACKGROUND_COLOR: 'Color de fondo', + DESIGN_HEADER: 'Cambiar diseño de formulario', + QUESTION_TEXT_COLOR: 'Color de la pregunta', + ANSWER_TEXT_COLOR: 'Color de la respuesta', + BTN_BACKGROUND_COLOR: 'Color de fondo del botón', + BTN_TEXT_COLOR: 'Color del texto del botón', + + //Share View + EMBED_YOUR_FORM: 'Pone tu formulario', + SHARE_YOUR_FORM: 'Compartí tu formulario', + + //Admin Tabs + CREATE_TAB: 'Crear', + DESIGN_TAB: 'Diseño', + CONFIGURE_TAB: 'Configuración', + ANALYZE_TAB: 'Análisis', + SHARE_TAB: 'Compartir', + + //Field Types + SHORT_TEXT: 'Texto corto', + EMAIL: 'Email', + MULTIPLE_CHOICE: 'Opciones múltiples', + DROPDOWN: 'Desplegable', + DATE: 'Fecha', + PARAGRAPH_T: 'Párrafo', + YES_NO: 'Si/No', + LEGAL: 'Legal', + RATING: 'Puntaje', + NUMBERS: 'Números', + SIGNATURE: 'Firma', + FILE_UPLOAD: 'Subir archivo', + OPTION_SCALE: 'Escala', + PAYMENT: 'Pago', + STATEMENT: 'Declaración', + LINK: 'Enlace', + + FORM_SUCCESS: '¡El formulario ha sido enviado con éxito!', + REVIEW: 'Revisar', + BACK_TO_FORM: 'Regresar al formulario', + ADVANCEMENT: '{{done}} de {{total}} contestadas', + CONTINUE_FORM: 'Continuar al formulario', + REQUIRED: 'Información requerida', + COMPLETING_NEEDED: '{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)', + OPTIONAL: 'Opcional', + ERROR_EMAIL_INVALID: 'Favor de proporcionar un correo electrónico válido', + ERROR_NOT_A_NUMBER: 'Por favor, introduzca sólo números válidos', + ERROR_URL_INVALID: 'Favor de proporcionar un url válido', + OK: 'OK', + ENTER: 'pulse INTRO', + NEWLINE: 'presione SHIFT+INTRO para crear una nueva línea', + CONTINUE: 'Continuar', + LEGAL_ACCEPT: 'Yo acepto', + LEGAL_NO_ACCEPT: 'Yo no acepto', + SUBMIT: 'Registrar', + UPLOAD_FILE: 'Cargar el archivo', + Y: 'S', + N: 'N' + }); +}]); + +'use strict'; + +// Use Application configuration module to register a new module +ApplicationConfiguration.registerModule('view-form', [ + 'ngFileUpload', 'ui.date', 'angular-input-stars' +]); + +(function () { + 'use strict'; + + // Create the SendVisitorData service + angular + .module('view-form') + .factory('SendVisitorData', SendVisitorData); + + SendVisitorData.$inject = ['Socket', '$state']; + + function SendVisitorData(Socket, $state) { + + // Create a controller method for sending visitor data + function send(form, lastActiveIndex, timeElapsed) { + + var lang = window.navigator.userLanguage || window.navigator.language; + lang = lang.slice(0,2); + + var userAgentString = navigator.userAgent; + var md = new MobileDetect(userAgentString); + var deviceType = 'other'; + + if (md.tablet()){ + deviceType = 'tablet'; + } else if (md.mobile()) { + deviceType = 'mobile'; + } else if (!md.is('bot')) { + deviceType = 'desktop'; + } + + $.ajaxSetup( { 'async': false } ); + var geoData = $.getJSON('https://freegeoip.net/json/').responseJSON; + $.ajaxSetup( { 'async': true } ); + + if(!geoData){ + geoData = { + ip: '', + city: '', + country_name: '' + }; + } + + // Create a new message object + var visitorData = { + referrer: document.referrer, + isSubmitted: form.submitted, + formId: form._id, + lastActiveField: form.form_fields[lastActiveIndex]._id, + timeElapsed: timeElapsed, + language: lang, + deviceType: deviceType, + ipAddr: geoData.ip, + geoLocation: { + city: geoData.city, + country: geoData.country_name + } + }; + Socket.emit('form-visitor-data', visitorData); + } + + function init(){ + // Make sure the Socket is connected + if (!Socket.socket) { + Socket.connect(); + } + } + + var service = { + send: send + }; + + init(); + return service; + + } +}()); + + +'use strict'; + +angular.module('view-form').directive('keyToOption', function(){ + return { + restrict: 'A', + scope: { + field: '=' + }, + link: function($scope, $element, $attrs, $select) { + $element.bind('keydown keypress', function(event) { + + var keyCode = event.which || event.keyCode; + var index = parseInt(String.fromCharCode(keyCode))-1; + //console.log($scope.field); + + if (index < $scope.field.fieldOptions.length) { + event.preventDefault(); + $scope.$apply(function () { + $scope.field.fieldValue = $scope.field.fieldOptions[index].option_value; + }); + } + + }); + } + }; +}); + +'use strict'; + +angular.module('view-form').directive('keyToTruthy', ['$rootScope', function($rootScope){ + return { + restrict: 'A', + scope: { + field: '=', + nextField: '&' + }, + link: function($scope, $element, $attrs) { + $element.bind('keydown keypress', function(event) { + var keyCode = event.which || event.keyCode; + var truthyKeyCode = $attrs.keyCharTruthy.charCodeAt(0) - 32; + var falseyKeyCode = $attrs.keyCharFalsey.charCodeAt(0) - 32; + console.log($scope); + if(keyCode === truthyKeyCode ) { + event.preventDefault(); + $scope.$apply(function() { + $scope.field.fieldValue = 'true'; + if($attrs.onValidKey){ + $scope.$root.$eval($attrs.onValidKey); + } + }); + }else if(keyCode === falseyKeyCode){ + event.preventDefault(); + $scope.$apply(function() { + $scope.field.fieldValue = 'false'; + if($attrs.onValidKey){ + $scope.$root.$eval($attrs.onValidKey); + } + }); + } + }); + } + }; +}]); + + +'use strict'; + +// Configuring the Forms drop-down menus +angular.module('view-form') +.filter('formValidity', function(){ + return function(formObj){ + if(formObj && formObj.form_fields && formObj.visible_form_fields){ + + //get keys + var formKeys = Object.keys(formObj); + + //we only care about things that don't start with $ + var fieldKeys = formKeys.filter(function(key){ + return key[0] !== '$'; + }); + + var fields = formObj.form_fields; + + var valid_count = fields.filter(function(field){ + if(typeof field === 'object' && field.fieldType !== 'rating' && field.fieldType !== 'statement'){ + return !!(field.fieldValue); + } else if (field.fieldType === 'rating'){ + return true; + } + + }).length; + return valid_count - (formObj.form_fields.length - formObj.visible_form_fields.length); + } + return 0; + }; +}); + +angular.module('view-form').value('supportedFields', [ + 'textfield', + 'textarea', + 'date', + 'dropdown', + 'hidden', + 'password', + 'radio', + 'legal', + 'statement', + 'rating', + 'yes_no', + 'number', + 'natural' +]); + +angular.module('view-form').constant('VIEW_FORM_URL', '/forms/:formId/render'); + + +'use strict'; + +angular.module('view-form').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('english', { + FORM_SUCCESS: 'Form entry successfully submitted!', + REVIEW: 'Review', + BACK_TO_FORM: 'Go back to Form', + EDIT_FORM: 'Edit this TellForm', + CREATE_FORM: 'Create this TellForm', + ADVANCEMENT: '{{done}} out of {{total}} answered', + CONTINUE_FORM: 'Continue to Form', + REQUIRED: 'required', + COMPLETING_NEEDED: '{{answers_not_completed}} answer(s) need completing', + OPTIONAL: 'optional', + ERROR_EMAIL_INVALID: 'Please enter a valid email address', + ERROR_NOT_A_NUMBER: 'Please enter valid numbers only', + ERROR_URL_INVALID: 'Please a valid url', + OK: 'OK', + ENTER: 'press ENTER', + YES: 'Yes', + NO: 'No', + NEWLINE: 'press SHIFT+ENTER to create a newline', + CONTINUE: 'Continue', + LEGAL_ACCEPT: 'I accept', + LEGAL_NO_ACCEPT: 'I don’t accept', + DELETE: 'Delete', + CANCEL: 'Cancel', + SUBMIT: 'Submit', + UPLOAD_FILE: 'Upload your File', + }); + + $translateProvider.preferredLanguage('english') + .fallbackLanguage('english') + .useSanitizeValueStrategy('escape'); + +}]); + +'use strict'; + +angular.module('view-form').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('french', { + FORM_SUCCESS: 'Votre formulaire a été enregistré!', + REVIEW: 'Incomplet', + BACK_TO_FORM: 'Retourner au formulaire', + EDIT_FORM: 'Éditer le Tellform', + CREATE_FORM: 'Créer un TellForm', + ADVANCEMENT: '{{done}} complétés sur {{total}}', + CONTINUE_FORM: 'Aller au formulaire', + REQUIRED: 'obligatoire', + COMPLETING_NEEDED: '{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)', + OPTIONAL: 'facultatif', + ERROR_EMAIL_INVALID: 'Merci de rentrer une adresse mail valide', + ERROR_NOT_A_NUMBER: 'Merce de ne rentrer que des nombres', + ERROR_URL_INVALID: 'Merci de rentrer une url valide', + OK: 'OK', + ENTER: 'presser ENTRÉE', + YES: 'Oui', + NO: 'Non', + NEWLINE: 'presser SHIFT+ENTER pour créer une nouvelle ligne', + CONTINUE: 'Continuer', + LEGAL_ACCEPT: 'J’accepte', + LEGAL_NO_ACCEPT: 'Je n’accepte pas', + DELETE: 'Supprimer', + CANCEL: 'Réinitialiser', + SUBMIT: 'Enregistrer', + UPLOAD_FILE: 'Envoyer un fichier', + Y: 'O', + N: 'N', + }); + +}]); + +'use strict'; + +angular.module('view-form').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('german', { + FORM_SUCCESS: 'Ihre Angaben wurden gespeichert.', + REVIEW: 'Unvollständig', + BACK_TO_FORM: 'Zurück zum Formular', + EDIT_FORM: '', + CREATE_FORM: '', + ADVANCEMENT: '{{done}} von {{total}} beantwortet', + CONTINUE_FORM: 'Zum Formular', + REQUIRED: 'verpflichtend', + COMPLETING_NEEDED: 'Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)', + OPTIONAL: 'fakultativ', + ERROR_EMAIL_INVALID: 'Bitte gültige Mailadresse eingeben', + ERROR_NOT_A_NUMBER: 'Bitte nur Zahlen eingeben', + ERROR_URL_INVALID: 'Bitte eine gültige URL eingeben', + OK: 'Okay', + ENTER: 'Eingabetaste drücken', + YES: 'Ja', + NO: 'Nein', + NEWLINE: 'Für eine neue Zeile SHIFT+ENTER drücken', + CONTINUE: 'Weiter', + LEGAL_ACCEPT: 'I accept', + LEGAL_NO_ACCEPT: 'I don’t accept', + DELETE: 'Entfernen', + CANCEL: 'Canceln', + SUBMIT: 'Speichern', + UPLOAD_FILE: 'Datei versenden', + Y: 'J', + N: 'N', + }); + +}]); + +'use strict'; + +angular.module('view-form').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('italian', { + FORM_SUCCESS: 'Il formulario è stato inviato con successo!', + REVIEW: 'Incompleto', + BACK_TO_FORM: 'Ritorna al formulario', + EDIT_FORM: '', + CREATE_FORM: '', + ADVANCEMENT: '{{done}} su {{total}} completate', + CONTINUE_FORM: 'Vai al formulario', + REQUIRED: 'obbligatorio', + COMPLETING_NEEDED: '{{answers_not_completed}} risposta/e deve/ono essere completata/e', + OPTIONAL: 'opzionale', + ERROR_EMAIL_INVALID: 'Si prega di inserire un indirizzo email valido', + ERROR_NOT_A_NUMBER: 'Si prega di inserire solo numeri', + ERROR_URL_INVALID: 'Grazie per inserire un URL valido', + OK: 'OK', + ENTER: 'premere INVIO', + YES: 'Sì', + NO: 'No', + NEWLINE: 'premere SHIFT+INVIO per creare una nuova linea', + CONTINUE: 'Continua', + LEGAL_ACCEPT: 'I accept', + LEGAL_NO_ACCEPT: 'I don’t accept', + DELETE: 'Cancella', + CANCEL: 'Reset', + SUBMIT: 'Registra', + UPLOAD_FILE: 'Invia un file', + Y: 'S', + N: 'N', + }); + +}]); + +'use strict'; + +angular.module('view-form').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('spanish', { + FORM_SUCCESS: '¡El formulario ha sido enviado con éxito!', + REVIEW: 'Revisar', + BACK_TO_FORM: 'Regresar al formulario', + EDIT_FORM: '', + CREATE_FORM: '', + ADVANCEMENT: '{{done}} de {{total}} contestadas', + CONTINUE_FORM: 'Continuar al formulario', + REQUIRED: 'Información requerida', + COMPLETING_NEEDED: '{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)', + OPTIONAL: 'Opcional', + ERROR_EMAIL_INVALID: 'Favor de proporcionar un correo electrónico válido', + ERROR_NOT_A_NUMBER: 'Por favor, introduzca sólo números válidos', + ERROR_URL_INVALID: 'Favor de proporcionar un url válido', + OK: 'OK', + ENTER: 'pulse INTRO', + YES: 'Si', + NO: 'No', + NEWLINE: 'presione SHIFT+INTRO para crear una nueva línea', + CONTINUE: 'Continuar', + LEGAL_ACCEPT: 'Yo acepto', + LEGAL_NO_ACCEPT: 'Yo no acepto', + DELETE: 'Eliminar', + CANCEL: 'Cancelar', + SUBMIT: 'Registrar', + UPLOAD_FILE: 'Cargar el archivo', + Y: 'S', + N: 'N' + }); + +}]); + +'use strict'; + +// SubmitForm controller +angular.module('view-form').controller('SubmitFormController', [ + '$scope', '$rootScope', '$state', '$translate', 'myForm', + function($scope, $rootScope, $state, $translate, myForm) { + $scope.myform = myForm; + $translate.use(myForm.language); + } +]); + +'use strict'; + +angular.module('view-form').directive('fieldIconDirective', function() { + + return { + template: '', + restrict: 'E', + scope: { + typeName: '@' + }, + controller: ["$scope", function($scope){ + var iconTypeMap = { + 'textfield': 'fa fa-pencil-square-o', + 'dropdown': 'fa fa-th-list', + 'date': 'fa fa-calendar', + 'checkbox': 'fa fa-check-square-o', + 'radio': 'fa fa-dot-circle-o', + 'email': 'fa fa-envelope-o', + 'textarea': 'fa fa-pencil-square', + 'legal': 'fa fa-legal', + 'file': 'fa fa-cloud-upload', + 'rating': 'fa fa-star-half-o', + 'link': 'fa fa-link', + 'scale': 'fa fa-sliders', + 'stripe': 'fa fa-credit-card', + 'statement': 'fa fa-quote-left', + 'yes_no': 'fa fa-toggle-on', + 'number': 'fa fa-slack' + }; + $scope.typeIcon = iconTypeMap[$scope.typeName]; + }] + }; +}); + +'use strict'; + +// coffeescript's for in loop +var __indexOf = [].indexOf || function(item) { + for (var i = 0, l = this.length; i < l; i++) { + if (i in this && this[i] === item) return i; + } + return -1; + }; + +angular.module('view-form').directive('fieldDirective', ['$http', '$compile', '$rootScope', '$templateCache', 'supportedFields', + function($http, $compile, $rootScope, $templateCache, supportedFields) { + + var getTemplateHtml = function(fieldType) { + var type = fieldType; + + var supported_fields = [ + 'textfield', + 'textarea', + 'date', + 'dropdown', + 'hidden', + 'password', + 'radio', + 'legal', + 'statement', + 'rating', + 'yes_no', + 'number', + 'natural' + ]; + + var templateUrl = 'form_modules/forms/base/views/directiveViews/field/'; + + if (__indexOf.call(supportedFields, type) >= 0) { + templateUrl = templateUrl+type+'.html'; + } + return $templateCache.get(templateUrl); + }; + + return { + template: '
{{field.title}}
', + restrict: 'E', + scope: { + field: '=', + required: '&', + design: '=', + index: '=', + forms: '=' + }, + link: function(scope, element) { + + $rootScope.chooseDefaultOption = scope.chooseDefaultOption = function(type) { + if(type === 'yes_no'){ + scope.field.fieldValue = 'true'; + }else if(type === 'rating'){ + scope.field.fieldValue = 0; + }else if(scope.field.fieldType === 'radio'){ + console.log(scope.field); + scope.field.fieldValue = scope.field.fieldOptions[0].option_value; + console.log(scope.field.fieldValue); + }else if(type === 'legal'){ + scope.field.fieldValue = 'true'; + $rootScope.nextField(); + } + }; + scope.nextField = $rootScope.nextField; + scope.setActiveField = $rootScope.setActiveField; + + //Set format only if field is a date + if(scope.field.fieldType === 'date'){ + scope.dateOptions = { + changeYear: true, + changeMonth: true, + altFormat: 'mm/dd/yyyy', + yearRange: '1900:-0', + defaultDate: 0 + }; + } + + var fieldType = scope.field.fieldType; + + if(scope.field.fieldType === 'number' || scope.field.fieldType === 'textfield' || scope.field.fieldType === 'email' || scope.field.fieldType === 'link'){ + switch(scope.field.fieldType){ + case 'textfield': + scope.input_type = 'text'; + break; + case 'email': + scope.input_type = 'email'; + scope.placeholder = 'joesmith@example.com'; + break; + case 'number': + scope.input_type = 'text'; + scope.validateRegex = /^-?\d+$/; + break; + default: + scope.input_type = 'url'; + scope.placeholder = 'http://example.com'; + break; + } + fieldType = 'textfield'; + } + + var template = getTemplateHtml(fieldType); + element.html(template).show(); + var output = $compile(element.contents())(scope); + } + }; + }]); + +'use strict'; + +//TODO: DAVID: Need to refactor this +angular.module('view-form').directive('onEnterKey', ['$rootScope', function($rootScope){ + return { + restrict: 'A', + link: function($scope, $element, $attrs) { + $element.bind('keydown keypress', function(event) { + + var keyCode = event.which || event.keyCode; + + var onEnterKeyDisabled = false; + if($attrs.onEnterKeyDisabled !== null) onEnterKeyDisabled = $attrs.onEnterKeyDisabled; + + if(keyCode === 13 && !event.shiftKey && !onEnterKeyDisabled) { + event.preventDefault(); + $rootScope.$apply(function() { + $rootScope.$eval($attrs.onEnterKey); + }); + } + }); + } + }; +}]).directive('onTabKey', ['$rootScope', function($rootScope){ + return { + restrict: 'A', + link: function($scope, $element, $attrs) { + $element.bind('keydown keypress', function(event) { + + var keyCode = event.which || event.keyCode; + + if(keyCode === 9 && !event.shiftKey) { + + event.preventDefault(); + $rootScope.$apply(function() { + $rootScope.$eval($attrs.onTabKey); + }); + } + }); + } + }; +}]).directive('onEnterOrTabKey', ['$rootScope', function($rootScope){ + return { + restrict: 'A', + link: function($scope, $element, $attrs) { + $element.bind('keydown keypress', function(event) { + + var keyCode = event.which || event.keyCode; + + if((keyCode === 13 || keyCode === 9) && !event.shiftKey) { + event.preventDefault(); + $rootScope.$apply(function() { + $rootScope.$eval($attrs.onEnterOrTabKey); + }); + } + }); + } + }; +}]).directive('onTabAndShiftKey', ['$rootScope', function($rootScope){ + return { + restrict: 'A', + link: function($scope, $element, $attrs) { + $element.bind('keydown keypress', function(event) { + + var keyCode = event.which || event.keyCode; + + if(keyCode === 9 && event.shiftKey) { + event.preventDefault(); + $rootScope.$apply(function() { + $rootScope.$eval($attrs.onTabAndShiftKey); + }); + } + }); + } + }; +}]); + +'use strict'; + +angular.module('view-form').directive('onFinishRender', ["$rootScope", "$timeout", function ($rootScope, $timeout) { + return { + restrict: 'A', + link: function (scope, element, attrs) { + + //Don't do anything if we don't have a ng-repeat on the current element + if(!element.attr('ng-repeat') && !element.attr('data-ng-repeat')){ + return; + } + + var broadcastMessage = attrs.onFinishRender || 'ngRepeat'; + + if(scope.$first && !scope.$last) { + scope.$evalAsync(function () { + $rootScope.$broadcast(broadcastMessage+' Started'); + }); + }else if(scope.$last) { + scope.$evalAsync(function () { + // console.log(broadcastMessage+'Finished'); + $rootScope.$broadcast(broadcastMessage+' Finished'); + }); + } + } + }; +}]); + +'use strict'; + +//FIXME: Should find an appropriate place for this +//Setting up jsep +jsep.addBinaryOp('contains', 10); +jsep.addBinaryOp('!contains', 10); +jsep.addBinaryOp('begins', 10); +jsep.addBinaryOp('!begins', 10); +jsep.addBinaryOp('ends', 10); +jsep.addBinaryOp('!ends', 10); + +angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCounter', '$filter', '$rootScope', 'SendVisitorData', '$translate', + function ($http, TimeCounter, $filter, $rootScope, SendVisitorData, $translate) { + return { + templateUrl: 'form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html', + restrict: 'E', + scope: { + myform:'=', + ispreview: '=' + }, + controller: ["$document", "$window", "$scope", function($document, $window, $scope){ + $scope.noscroll = false; + $scope.forms = {}; + + //Don't start timer if we are looking at a design preview + if($scope.ispreview){ + TimeCounter.restartClock(); + } + + var form_fields_count = $scope.myform.visible_form_fields.filter(function(field){ + return field.fieldType !== 'statement'; + }).length; + + var nb_valid = $filter('formValidity')($scope.myform); + $scope.translateAdvancementData = { + done: nb_valid, + total: form_fields_count, + answers_not_completed: form_fields_count - nb_valid + }; + + $scope.reloadForm = function(){ + //Reset Form + $scope.myform.submitted = false; + $scope.myform.form_fields = _.chain($scope.myform.visible_form_fields).map(function(field){ + field.fieldValue = ''; + return field; + }).value(); + + $scope.loading = false; + $scope.error = ''; + + $scope.selected = { + _id: '', + index: 0 + }; + $scope.setActiveField($scope.myform.visible_form_fields[0]._id, 0, false); + + //Reset Timer + TimeCounter.restartClock(); + }; + + //Fire event when window is scrolled + $window.onscroll = function(){ + $scope.scrollPos = document.body.scrollTop || document.documentElement.scrollTop || 0; + var elemBox = document.getElementsByClassName('activeField')[0].getBoundingClientRect(); + $scope.fieldTop = elemBox.top; + $scope.fieldBottom = elemBox.bottom; + + //console.log($scope.forms.myForm); + var field_id; + var field_index; + + if(!$scope.noscroll){ + //Focus on submit button + 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.visible_form_fields.length){ + if($scope.fieldTop > 200){ + field_index = $scope.selected.index-1; + 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.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.visible_form_fields[field_index]._id; + $scope.setActiveField(field_id, field_index, false); + } + //console.log('$scope.selected.index: '+$scope.selected.index); + //console.log('scroll pos: '+$scope.scrollPos+' fieldTop: '+$scope.fieldTop+' fieldBottom: '+$scope.fieldBottom); + $scope.$apply(); + } + }; + + /* + ** Field Controls + */ + var evaluateLogicJump = function(field){ + var logicJump = field.logicJump; + + if (logicJump.expressionString && logicJump.valueB && field.fieldValue) { + var parse_tree = jsep(logicJump.expressionString); + var left, right; + + if(parse_tree.left.name === 'field'){ + left = field.fieldValue; + right = logicJump.valueB; + } else { + left = logicJump.valueB; + right = field.fieldValue; + } + + if(field.fieldType === 'number' || field.fieldType === 'scale' || field.fieldType === 'rating'){ + switch(parse_tree.operator) { + case '==': + return (parseInt(left) === parseInt(right)); + case '!==': + return (parseInt(left) !== parseInt(right)); + case '>': + return (parseInt(left) > parseInt(right)); + case '>=': + return (parseInt(left) > parseInt(right)); + case '<': + return (parseInt(left) < parseInt(right)); + case '<=': + return (parseInt(left) <= parseInt(right)); + default: + return false; + } + } else { + switch(parse_tree.operator) { + case '==': + return (left === right); + case '!==': + return (left !== right); + case 'contains': + return (left.indexOf(right) > -1); + case '!contains': + /* jshint -W018 */ + return !(left.indexOf(right) > -1); + case 'begins': + return left.startsWith(right); + case '!begins': + return !left.startsWith(right); + case 'ends': + return left.endsWith(right); + case '!ends': + return left.endsWith(right); + default: + return false; + } + } + } + }; + + var getActiveField = function(){ + if($scope.selected === null){ + console.error('current active field is null'); + throw new Error('current active field is null'); + } + + if($scope.selected._id === 'submit_field') { + return $scope.myform.form_fields.length - 1; + } + return $scope.selected.index; + + }; + + $scope.setActiveField = $rootScope.setActiveField = function(field_id, field_index, animateScroll) { + if($scope.selected === null || $scope.selected._id === field_id){ + //console.log('not scrolling'); + //console.log($scope.selected); + return; + } + //console.log('field_id: '+field_id); + //console.log('field_index: '+field_index); + //console.log($scope.selected); + + $scope.selected._id = field_id; + $scope.selected.index = field_index; + if(!field_index){ + for(var i=0; i<$scope.myform.visible_form_fields.length; i++){ + var currField = $scope.myform.visible_form_fields[i]; + if(field_id === currField._id){ + $scope.selected.index = i; + break; + } + } + } + + var nb_valid = $filter('formValidity')($scope.myform); + $scope.translateAdvancementData = { + done: nb_valid, + total: form_fields_count, + answers_not_completed: form_fields_count - nb_valid + }; + + if(animateScroll){ + $scope.noscroll=true; + setTimeout(function() { + $document.scrollToElement(angular.element('.activeField'), -10, 200).then(function() { + $scope.noscroll = false; + setTimeout(function() { + if (document.querySelectorAll('.activeField .focusOn').length) { + //Handle default case + document.querySelectorAll('.activeField .focusOn')[0].focus(); + } else if(document.querySelectorAll('.activeField input').length) { + //Handle case for rating input + document.querySelectorAll('.activeField input')[0].focus(); + } else { + //Handle case for dropdown input + document.querySelectorAll('.activeField .selectize-input')[0].focus(); + } + }); + }); + }); + }else { + setTimeout(function() { + if (document.querySelectorAll('.activeField .focusOn')[0]) { + //FIXME: DAVID: Figure out how to set focus without scroll movement in HTML Dom + document.querySelectorAll('.activeField .focusOn')[0].focus(); + } else if (document.querySelectorAll('.activeField input')[0]){ + document.querySelectorAll('.activeField input')[0].focus(); + } + }); + } + + SendVisitorData.send($scope.myform, getActiveField(), TimeCounter.getTimeElapsed()); + }; + + $rootScope.nextField = $scope.nextField = function(){ + var currField = $scope.myform.visible_form_fields[$scope.selected.index]; + + if($scope.selected && $scope.selected.index > -1){ + //Jump to logicJump's destination if it is true + if(currField.logicJump && evaluateLogicJump(currField)){ + $rootScope.setActiveField(currField.logicJump.jumpTo, null, true); + } else { + var selected_index, selected_id; + if($scope.selected.index < $scope.myform.visible_form_fields.length-1){ + selected_index = $scope.selected.index+1; + selected_id = $scope.myform.visible_form_fields[selected_index]._id; + $rootScope.setActiveField(selected_id, selected_index, true); + } else if($scope.selected.index === $scope.myform.visible_form_fields.length-1) { + selected_index = $scope.selected.index+1; + selected_id = 'submit_field'; + $rootScope.setActiveField(selected_id, selected_index, true); + } + } + } + + }; + + $rootScope.prevField = $scope.prevField = function(){ + if($scope.selected.index > 0){ + var selected_index = $scope.selected.index - 1; + var selected_id = $scope.myform.visible_form_fields[selected_index]._id; + $scope.setActiveField(selected_id, selected_index, true); + } + }; + + /* + ** Form Display Functions + */ + $scope.exitStartPage = function(){ + $scope.myform.startPage.showStart = false; + if($scope.myform.visible_form_fields.length > 0){ + $scope.selected._id = $scope.myform.visible_form_fields[0]._id; + } + }; + + $rootScope.goToInvalid = $scope.goToInvalid = function() { + document.querySelectorAll('.ng-invalid.focusOn')[0].focus(); + }; + + var getDeviceData = function(){ + var md = new MobileDetect(window.navigator.userAgent); + var deviceType = 'other'; + + if (md.tablet()){ + deviceType = 'tablet'; + } else if (md.mobile()) { + deviceType = 'mobile'; + } else if (!md.is('bot')) { + deviceType = 'desktop'; + } + + return { + type: deviceType, + name: window.navigator.platform + }; + }; + + var getIpAndGeo = function(){ + //Get Ip Address and GeoLocation Data + $.ajaxSetup( { 'async': false } ); + var geoData = $.getJSON('https://freegeoip.net/json/').responseJSON; + $.ajaxSetup( { 'async': true } ); + + if(!geoData || !geoData.ip){ + geoData = { + ip: 'Adblocker' + }; + } + + return { + ipAddr: geoData.ip, + geoLocation: { + City: geoData.city, + Country: geoData.country_name + } + }; + }; + + $rootScope.submitForm = $scope.submitForm = function() { + + var _timeElapsed = TimeCounter.stopClock(); + $scope.loading = true; + + var form = _.cloneDeep($scope.myform); + + var deviceData = getDeviceData(); + form.device = deviceData; + + var geoData = getIpAndGeo(); + form.ipAddr = geoData.ipAddr; + form.geoLocation = geoData.geoLocation; + + form.timeElapsed = _timeElapsed; + form.percentageComplete = $filter('formValidity')($scope.myform) / $scope.myform.visible_form_fields.length * 100; + delete form.visible_form_fields; + + for(var i=0; i < $scope.myform.form_fields.length; i++){ + if($scope.myform.form_fields[i].fieldType === 'dropdown' && !$scope.myform.form_fields[i].deletePreserved){ + $scope.myform.form_fields[i].fieldValue = $scope.myform.form_fields[i].fieldValue.option_value; + } + } + + setTimeout(function () { + $scope.submitPromise = $http.post('/forms/' + $scope.myform._id, form) + .success(function (data, status) { + $scope.myform.submitted = true; + $scope.loading = false; + SendVisitorData.send($scope.myform, getActiveField(), _timeElapsed); + }) + .error(function (error) { + $scope.loading = false; + console.error(error); + $scope.error = error.message; + }); + }, 500); + }; + + //Reload our form + $scope.reloadForm(); + }] + }; + } +]); + +'use strict'; + +//Forms service used for communicating with the forms REST endpoints +angular.module('view-form').service('CurrentForm', + function(){ + //Private variables + var _form = {}; + + //Public Methods + this.getForm = function() { + return _form; + }; + this.setForm = function(form) { + _form = form; + }; + } +); + +'use strict'; + +//Forms service used for communicating with the forms REST endpoints +angular.module('view-form').factory('Forms', ['$resource', 'VIEW_FORM_URL', + function($resource, VIEW_FORM_URL) { + return $resource(VIEW_FORM_URL, { + formId: '@_id' + }, { + 'get' : { + method: 'GET', + transformResponse: function(data, header) { + var form = angular.fromJson(data); + + form.visible_form_fields = _.filter(form.form_fields, function(field){ + return (field.deletePreserved === false); + }); + return form; + } + }, + 'update': { + method: 'PUT' + }, + 'save': { + method: 'POST' + } + }); + } +]); + +(function () { + 'use strict'; + + // Create the Socket.io wrapper service + function Socket($timeout, $window) { + + var service; + + // Connect to Socket.io server + function connect(url) { + service.socket = io(url, {'transports': ['websocket', 'polling']}); + } + + // Wrap the Socket.io 'emit' method + function emit(eventName, data) { + if (service.socket) { + service.socket.emit(eventName, data); + } + } + + // Wrap the Socket.io 'on' method + function on(eventName, callback) { + if (service.socket) { + service.socket.on(eventName, function (data) { + $timeout(function () { + callback(data); + }); + }); + } + } + + // Wrap the Socket.io 'removeListener' method + function removeListener(eventName) { + if (service.socket) { + service.socket.removeListener(eventName); + } + } + + service = { + connect: connect, + emit: emit, + on: on, + removeListener: removeListener, + socket: null + }; + + console.log($window.socketUrl); + var url = ''; + if($window.socketUrl && $window.socketPort){ + url = window.location.protocol + '//' + $window.socketUrl + ':' + $window.socketPort; + } else if ($window.socketUrl){ + url = window.location.protocol + '//' + $window.socketUrl; + } else if ($window.socketPort){ + url = window.location.protocol + '//' + window.location.hostname + ':' + $window.socketPort; + } else { + url = window.location.protocol + '//' + window.location.hostname; + } + connect(url); + + return service; + } + + angular + .module('view-form') + .factory('Socket', Socket); + + Socket.$inject = ['$timeout', '$window']; + +}()); + +'use strict'; + +angular.module('view-form').service('TimeCounter', [ + function(){ + var _startTime, _endTime = null; + + this.timeSpent = 0; + + this.restartClock = function(){ + _startTime = Date.now(); + _endTime = null; + // console.log('Clock Started'); + }; + + this.getTimeElapsed = function(){ + if(_startTime) { + return Math.abs(Date.now().valueOf() - _startTime.valueOf()) / 1000; + } + }; + + this.stopClock = function(){ + if(_startTime && _endTime === null){ + _endTime = Date.now(); + this.timeSpent = Math.abs(_endTime.valueOf() - _startTime.valueOf())/1000; + this._startTime = this._endTime = null; + + return this.timeSpent; + } + return new Error('Clock has not been started'); + }; + + this.clockStarted = function(){ + return !!this._startTime; + }; + + } +]); diff --git a/public/dist/application.min.css b/public/dist/application.min.css index 38bdd01c..6176fa9e 100644 --- a/public/dist/application.min.css +++ b/public/dist/application.min.css @@ -1,4 +1,4 @@ -.btn-rounded,.field-title-row,section.auth .btn{text-transform:uppercase}.navbar,.navbar-nav,.navbar-nav>li{min-height:60px}.image-background,.opacity-background{position:fixed;height:100%;width:100%;top:0;left:0}.form-item .title-row>.list-group-item-heading{color:#34628a}.form-item.paused .title-row>.list-group-item-heading,.form-item:hover .title-row>.list-group-item-heading{color:#fff}.form-item:hover .title-row{text-decoration:none}body{overflow-x:hidden;font-family:'Source Sans Pro',sans-serif;font-size:16px}.vcenter{display:inline-block;vertical-align:middle;float:none}.btn-rounded{border-radius:100px;font-size:14px;padding:10px 28px;margin:1em 2px 0;text-decoration:none!important}.admin-form .panel-heading a:hover,.current-fields .tool-panel>.panel-default .panel-heading a:hover,.footer-basic-centered .footer-links a,.undecorated-link:hover{text-decoration:none}.btn-secondary{background:#DDD;color:#4c4c4c;border:2px solid #4c4c4c}.btn-secondary:hover{background:#cacaca;border-color:#cacaca}.navbar{padding:10px 0}.navbar-inverse{background-color:#3FA2F7;border:0;color:#fff!important}.navbar .navbar-brand{min-height:60px;padding:10px}.navbar-nav>li>a{padding-top:20px;color:#fff}.navbar-nav>li.active,.navbar-nav>li:hover{background-color:#4b7096}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{background-color:transparent;color:inherit;border:none}.navbar-inverse .navbar-nav>li>a{color:#fff}.navbar li.dropdown a.dropdown-toggle:hover>*{color:#f9f9f9}.navbar-inverse .navbar-toggle{border:none}.ng-cloak,.x-ng-cloak,[data-ng-cloak],[ng-cloak],[ng\:cloak],[x-ng-cloak]{display:none!important}.dropdown-menu>li>a{color:#515151}section.hero-section{width:100%}section.hero-section .jumbotron{background-color:transparent;color:#fff}.image-background{z-index:-98;background-image:url(http://yourplaceandmine.ie/wp-content/uploads/2014/09/Daingean-meeting-048_13-1080x675.jpg);background-repeat:no-repeat;background-position:0 50%;background-size:cover}.opacity-background{background-color:#000;background-color:rgba(0,0,0,.5);z-index:-97}section.hero-section .jumbotron .signup-btn{background-color:#FA787E;border:none;font-size:2em;padding:.3em .9em;color:#fff}.footer-basic-centered{background-color:#292c2f;box-shadow:0 1px 1px 0 rgba(0,0,0,.12);box-sizing:border-box;width:100%;text-align:center;font:400 18px sans-serif;padding:45px;margin-top:80px}.footer-basic-centered .footer-company-motto{color:#8d9093;font-size:24px;margin:0}.footer-basic-centered .footer-company-name{color:#8f9296;font-size:14px;margin:0}.footer-basic-centered .footer-links{list-style:none;font-weight:700;color:#fff;padding:35px 0 23px;margin:0}.footer-basic-centered .footer-links a{display:inline-block;color:inherit}@media (max-width:600px){.footer-basic-centered{padding:35px}.footer-basic-centered .footer-company-motto{font-size:18px}.footer-basic-centered .footer-company-name{font-size:12px}.footer-basic-centered .footer-links{font-size:14px;padding:25px 0 20px}.footer-basic-centered .footer-links a{line-height:1.8}}/*! +.navbar,.navbar-nav,.navbar-nav>li{min-height:60px}.image-background,.opacity-background{position:fixed;height:100%;width:100%;top:0;left:0}.btn-rounded,.field-title-row,section.auth .btn{text-transform:uppercase}.form-item .title-row>.list-group-item-heading{color:#34628a}.form-item.paused .title-row>.list-group-item-heading,.form-item:hover .title-row>.list-group-item-heading{color:#fff}.form-item:hover .title-row{text-decoration:none}body{overflow-x:hidden;font-family:'Source Sans Pro',sans-serif;font-size:16px}.vcenter{display:inline-block;vertical-align:middle;float:none}.btn-rounded{border-radius:100px;font-size:14px;padding:10px 28px;margin:1em 2px 0;text-decoration:none!important}.current-fields .panel-heading a:hover,.current-fields .tool-panel.panel .panel-heading a:hover,.footer-basic-centered .footer-links a,.undecorated-link:hover{text-decoration:none}.btn-secondary{background:#DDD;color:#4c4c4c;border:2px solid #4c4c4c}.btn-secondary:hover{background:#cacaca;border-color:#cacaca}.navbar{padding:10px 0}.navbar-inverse{background-color:#3FA2F7;border:0;color:#fff!important}.navbar .navbar-brand{min-height:60px;padding:10px}.navbar-nav>li>a{padding-top:20px;color:#fff}.navbar-nav>li.active,.navbar-nav>li:hover{background-color:#4b7096}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{background-color:transparent;color:inherit;border:none}.navbar-inverse .navbar-nav>li>a{color:#fff}.navbar li.dropdown a.dropdown-toggle:hover>*{color:#f9f9f9}.navbar-inverse .navbar-toggle{border:none}.ng-cloak,.x-ng-cloak,[data-ng-cloak],[ng-cloak],[ng\:cloak],[x-ng-cloak]{display:none!important}.dropdown-menu>li>a{color:#515151}section.hero-section{width:100%}section.hero-section .jumbotron{background-color:transparent;color:#fff}.image-background{z-index:-98;background-image:url(http://yourplaceandmine.ie/wp-content/uploads/2014/09/Daingean-meeting-048_13-1080x675.jpg);background-repeat:no-repeat;background-position:0 50%;background-size:cover}.opacity-background{background-color:#000;background-color:rgba(0,0,0,.5);z-index:-97}section.hero-section .jumbotron .signup-btn{background-color:#FA787E;border:none;font-size:2em;padding:.3em .9em;color:#fff}.footer-basic-centered{background-color:#292c2f;box-shadow:0 1px 1px 0 rgba(0,0,0,.12);box-sizing:border-box;width:100%;text-align:center;font:400 18px sans-serif;padding:45px;margin-top:80px}.footer-basic-centered .footer-company-motto{color:#8d9093;font-size:24px;margin:0}.footer-basic-centered .footer-company-name{color:#8f9296;font-size:14px;margin:0}.footer-basic-centered .footer-links{list-style:none;font-weight:700;color:#fff;padding:35px 0 23px;margin:0}.footer-basic-centered .footer-links a{display:inline-block;color:inherit}@media (max-width:600px){.footer-basic-centered{padding:35px}.footer-basic-centered .footer-company-motto{font-size:18px}.footer-basic-centered .footer-company-name{font-size:12px}.footer-basic-centered .footer-links{font-size:14px;padding:25px 0 20px}.footer-basic-centered .footer-links a{line-height:1.8}}/*! * "Fork me on GitHub" CSS ribbon v0.1.1 | MIT License * https://github.com/simonwhitaker/github-fork-ribbon-css -*/.github-fork-ribbon{position:absolute;padding:2px 0;background-color:#a00;background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,.15)));background-image:-webkit-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:linear-gradient(to bottom,rgba(0,0,0,0),rgba(0,0,0,.15));-webkit-box-shadow:0 2px 3px 0 rgba(0,0,0,.5);-moz-box-shadow:0 2px 3px 0 rgba(0,0,0,.5);box-shadow:0 2px 3px 0 rgba(0,0,0,.5);font:700 13px "Helvetica Neue",Helvetica,Arial,sans-serif;z-index:9999;pointer-events:auto}.github-fork-ribbon a,.github-fork-ribbon a:hover{color:#fff;text-decoration:none;text-shadow:0 -1px rgba(0,0,0,.5);text-align:center;width:200px;line-height:20px;display:inline-block;padding:2px 0;border-width:1px 0;border-style:dotted;border-color:#fff;border-color:rgba(255,255,255,.7)}.github-fork-ribbon-wrapper{width:150px;height:150px;position:absolute;overflow:hidden;top:0;z-index:9998;pointer-events:none}.github-fork-ribbon-wrapper.fixed{position:fixed}.github-fork-ribbon-wrapper.left{left:0}.github-fork-ribbon-wrapper.right{right:0}.github-fork-ribbon-wrapper.left-bottom{position:fixed;top:inherit;bottom:0;left:0}.github-fork-ribbon-wrapper.right-bottom{position:fixed;top:inherit;bottom:0;right:0}.github-fork-ribbon-wrapper.right .github-fork-ribbon{top:42px;right:-43px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.github-fork-ribbon-wrapper.left .github-fork-ribbon{top:42px;left:-43px;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.github-fork-ribbon-wrapper.left-bottom .github-fork-ribbon{top:80px;left:-43px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.github-fork-ribbon-wrapper.right-bottom .github-fork-ribbon{top:80px;right:-43px;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.custom-select{position:relative;display:block;padding:0}.custom-select select{width:100%;margin:0;background:0 0;border:1px solid transparent;border-radius:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;font-size:1em;font-family:helvetica,sans-serif;font-weight:700;color:#444;padding:.6em 1.9em .5em .8em;line-height:1.3}.custom-select option,.modal-header{font-weight:400}.custom-select::after{content:"";position:absolute;width:9px;height:8px;top:50%;right:1em;margin-top:-4px;background-image:url(http://filamentgroup.com/files/select-arrow.png);background-repeat:no-repeat;background-size:100%;z-index:2;pointer-events:none}.nav.nav-pills.nav-stacked,div.tab-content{position:relative;min-height:1px;float:left}.container.admin-form,section.content>section>section.container{margin-top:70px}.custom-select:hover{border:1px solid #888}.custom-select select:focus{outline:0;box-shadow:0 0 1px 3px rgba(180,222,250,1);background-color:transparent;color:#222;border:1px solid #aaa}.custom-select::after,x:-o-prefocus{display:none}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.custom-select select::-ms-expand{display:none}.custom-select select:focus::-ms-value{background:0 0;color:#222}}.custom-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 #000}.edit-modal-window .modal-dialog{width:90%}.edit-modal-window .modal-body{padding:0}.edit-modal-window .edit-panel{background-color:#F1F1F1;padding:0 35px}.edit-modal-window .preview-field-panel{display:flex;flex-direction:column;justify-content:center}.edit-modal-window .preview-field-panel form{padding-right:20px}.edit-modal-window .preview-field{resize:vertical}.admin-form .ui-sortable-placeholder{visibility:visible!important;border:none;padding:1px;background:rgba(0,0,0,.5)!important}.analytics .header-title{font-size:1em;color:#bab8b8}.analytics .header-numbers{font-size:4em;padding-bottom:.1em;margin-bottom:.5em;border-bottom:#fafafa solid 1px}.analytics .detailed-title{font-size:1.8em;margin-bottom:1.1em}.analytics .detailed-row{padding-bottom:.8em}.analytics .detailed-row .row{font-size:1.2em}.analytics .detailed-row .row.header{font-size:.8em;color:#bab8b8;text-transform:uppercase}.field-title-row{padding-top:2em;padding-bottom:1em;border-top:#fafafa solid 1px;font-size:1.2em;color:#bab8b8}.field-detailed-row{font-size:1.2em;padding-bottom:.3em}.table-tools{border-top:#fafafa solid 1px;padding-top:2.5em}.nav.nav-pills.nav-stacked{width:16.66666667%;padding-right:15px}div.tab-content{width:83.33333333%;padding-top:0!important}.panel-default.startPage{border-style:dashed;border-color:#a9a9a9;border-width:3px}.busy-updating-wrapper{text-align:center;font-size:20px;position:fixed;bottom:0;right:55px;z-index:1}.busy-submitting-wrapper{position:fixed;top:50%;left:0;right:0;bottom:0}.dropzone h4.panel-title{height:17px;overflow:hidden}.public-form input,.public-form textarea{background-color:#000;background-color:rgba(0,0,0,0);border:2px dashed #ddd!important}.public-form input:focus,.public-form textarea:focus{border:2px dashed #ddd!important;outline:0}.public-form input.ng-valid,.public-form textarea.ng-valid{border-color:#20FF20!important;border-style:solid!important;border-width:3px!important}.public-form input.ng-invalid.ng-dirty,.public-form textarea.ng-invalid.ng-dirty{border-color:#FA787E!important;border-style:solid!important;border-width:3px!important}section.content p.breakwords{word-break:break-all}.public-form .btn{border:1px solid #c6c6c6}.public-form .btn[type=submit]{font-size:1.5em;padding:.35em 1.2em}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;font-size:18px}.public-form .input-block{display:block;width:100%}.modal-footer input[type=text]{min-height:34px;padding:7px 8px;font-size:13px;color:#333;vertical-align:middle;background-color:#fff;background-repeat:no-repeat;background-position:right 8px center;border:1px solid #ccc;border-radius:3px;box-shadow:inset 0 1px 2px rgba(0,0,0,.075)}.modal-body>.modal-body-alert{color:#796620;background-color:#f8eec7;border-color:#f2e09a;margin:-16px -15px 15px;padding:10px 15px;border-style:solid;border-width:1px 0}div.form-fields{position:relative;padding-top:35vh}.public-form .letter{position:relative;display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;width:16px;padding:0;height:17px;font-size:12px;line-height:19px;border:1px solid #000;border:1px solid rgba(0,0,0,.2);margin-right:7px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;text-align:center;font-weight:700}div.form-submitted>.field.row{padding-bottom:2%;margin-top:35vh}div.form-submitted>.field.row>div{font-size:1.7em}form .accordion-edit{width:inherit}.ui-datepicker.ui-widget{z-index:99!important}form .row.field .field-number{margin-right:.5em}form .row.field{padding:1em 0 0;width:inherit}form .row.field>.field-title{margin-top:.5em;font-size:1.2em;padding-bottom:1.8em;width:inherit}form .row.field>.field-input{font-size:1.4em;color:#777}form.submission-form .row.field.statement>.field-title{font-size:1.7em}form.submission-form .row.field.statement>.field-input{font-size:1em;color:#ddd}form.submission-form .select.radio>.field-input input,form.submission-form .select>.field-input input{width:20%}form.submission-form .field.row.radio .btn.activeBtn{background-color:#000!important;background-color:rgba(0,0,0,.7)!important;color:#fff}form.submission-form .field.row.radio .btn{margin-right:1.2em}form.submission-form .select>.field-input .btn{text-align:left;margin-bottom:.7em}form.submission-form .select>.field-input .btn>span{font-size:1.1em}form .field-input>textarea{padding:.45em .9em;width:100%;line-height:160%}form .field-input>input.hasDatepicker{padding:.45em .9em;width:50%;line-height:160%}form .field-input>input.text-field-input{padding:.45em .9em;width:100%;line-height:160%}form .required-error{color:#ddd;font-size:.8em}form .row.field.dropdown>.field-input input{min-height:34px;border-width:0 0 2px;border-radius:5px}form .row.field.dropdown>.field-input input:focus{border:none}form .dropdown>.field-input .ui-select-choices-row-inner{border-radius:3px;margin:5px;padding:10px;background-color:#000;background-color:rgba(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:#000;background-color:rgba(0,0,0,.1)}.config-form{max-width:100%}.config-form>.row{padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}div.config-form .row.field{padding-top:1.5em}div.config-form>.row>.container:nth-of-type(odd){border-right:1px #ddd solid}div.config-form.design>.row>.container:nth-of-type(odd){border-right:none}div.config-form .row>.field-input{padding-left:.1em}div.config-form .row>.field-input label{padding-left:1.3em;display:block}.admin-form>.page-header{padding-bottom:0;margin-bottom:40px}.admin-form>.page-header h1{margin-bottom:0;margin-top:0}.admin-form>.page-header>.col-xs-3{padding-top:1.4em}.admin-form .form-controls .row{padding:5px}.admin-form .page-header{border:none;margin-top:none;margin-bottom:none}.admin-form .tab-content{padding-top:3em}.admin-form .panel-heading{background-color:#f1f1f1;position:relative!important}.admin-form .panel-heading:hover{background-color:#fff;cursor:pointer}.current-fields .panel-body .row.description textarea,.current-fields .panel-body .row.question input[type=text]{width:100%}.current-fields .panel-body .row.options input[type=text]{width:80%}.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;cursor:pointer}.current-fields .tool-panel>.panel-default .panel-heading{background-color:#fff;color:#9d9d9d!important}.current-fields .tool-panel>.panel-default .panel-heading:hover{background-color:#eee;color:#000!important;cursor:pointer}.current-fields .tool-panel>.panel-default .panel-heading a{color:inherit}.submissions-table .table-outer.row{margin:1.5em 0 2em!important}.submissions-table .table-outer .col-xs-12{padding-left:0!important;border:1px solid #ddd;overflow-x:scroll;border-radius:3px}.submissions-table .table>thead>tr>th{min-width:8em}.submissions-table .table>tbody>tr.selected{background-color:#efefef}.admin-form .add-field{background-color:#ddd;padding:0 2%;border-radius:3px}.admin-form .add-field .col-xs-6{padding:.25em .4em}.admin-form .add-field .col-xs-6 .panel-heading{border-width:1px;border-style:solid;border-color:#bbb;border-radius:4px}.admin-form .oscar-field-select{margin:10px 0}.view-form-btn.span{padding-right:.6em}.status-light.status-light-off{color:#BE0000}.status-light.status-light-on{color:#3C0}section.public-form{padding:0 10%}section.public-form .form-submitted{height:100vh}section.public-form .btn{border:1px solid}.form-item{border-radius:5px;text-align:center;width:180px;position:relative;height:215px;margin-bottom:45px}.form-item.paused{background-color:red;color:#fff}.form-item.paused:hover{background-color:#8b0000;color:#fff}.form-item.create-new input[type=text]{width:inherit;color:#000;border:none}.form-item.create-new{background-color:#3FA2F7;color:#fff}.form-item.create-new.new-form{background-color:#ff8383;z-index:11}.form-item.create-new.new-form:hover{background-color:#3079b5}.form-item.new-form input[type=text]{margin-top:.2em;width:inherit;color:#000;border:none;padding:.3em .6em}.form-item.new-form .custom-select{margin-top:.2em}.form-item.new-form .custom-select select{background-color:#fff}.form-item.new-form .details-row{margin-top:1em}.form-item.new-form .details-row.submit{margin-top:1.7em}.form-item.new-form .details-row.submit .btn{font-size:.95em}.form-item.new-form .title-row{margin-top:1em;top:0}.overlay{position:fixed;top:0;left:0;height:100%;width:100%;background-color:#000;background-color:rgba(0,0,0,.5);z-index:10}.overlay.submitform{background-color:#fff;background-color:rgba(256,256,256,.8)}.activeField,.activeField input{background-color:transparent}.field-directive{z-index:9;padding:10% 10% 10% 0;border:25px solid transparent;position:relative}.activeField{z-index:11;position:relative}.activeField.field-directive{display:inline-block;border-radius:7px;width:100%;border:25px solid transparent}h3.forms-list-title{color:#3FA2F7;font-weight:600;margin-bottom:3em}.form-item{color:#71AADD;background-color:#E4F1FD}.form-item:hover{background-color:#3FA2F7;color:#23527C}.form-item.create-new:hover{color:#fff;background-color:#515151}.form-item>.row.footer{position:absolute;bottom:0;left:30%}.form-item .title-row{position:relative;top:15px;padding-top:3em;padding-bottom:1em}.form-item .title-row h4{font-size:1.3em}.form-item.create-new .title-row{padding:0}.form-item.create-new .title-row h4{font-size:7em}.form-item .details-row{margin-top:3.2em}.form-item .details-row small{font-size:.6em}.form-item.create-new .details-row small{font-size:.95em}section.auth{padding:70px 0;position:absolute;min-height:100%;top:0;left:0;width:100%;color:#fff;background-color:#50B5C1;background:-moz-linear-gradient(137deg,#50B5C1 0,#6450A0 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#50B5C1),color-stop(100%,#6450A0));background:-webkit-linear-gradient(137deg,#50B5C1 0,#6450A0 100%);background:-o-linear-gradient(137deg,#50B5C1 0,#6450A0 100%);background:-ms-linear-gradient(137deg,#50B5C1 0,#6450A0 100%)}section.auth>h3{font-size:2em;font-weight:500}.valign-wrapper{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.valign-wrapper .valign{display:block;width:100%}section.auth a{color:#fff;text-decoration:underline}section.auth.signup-view>h3{font-size:3em;padding-bottom:.5em}section.auth form .field-input select{padding:.45em .9em;width:100%;background:0 0;font-size:16px;border:1px solid #ccc;min-height:34px}section.auth input{color:#4c4c4c}section.auth .btn{border-radius:100px;font-size:14px;padding:12px 28px;margin-top:1em}.btn-rounded.btn-signup{background-color:#FFD747;color:#896D0B;border:2px solid #FFD747}.btn-rounded.btn-signup:hover{color:#FFD747;background-color:#896D0B;border:2px solid #896D0B}.btn-rounded.btn-default{background-color:transparent;color:#fff;border:2px solid #fff}.btn-rounded.btn-default:focus,.btn-rounded.btn-default:hover{color:#6450A0;background-color:#fff;border-color:#fff}@media (min-width:992px){.nav-users{position:fixed}}.remove-account-container{display:inline-block;position:relative}.btn-remove-account{top:10px;right:10px;position:absolute}section.auth input.form-control{min-height:30px!important;border:none}input.form-control{height:auto;border-radius:4px;box-shadow:none;font-size:18px;padding:20px 10px}.btn{border:none} \ No newline at end of file +*/.github-fork-ribbon{position:absolute;padding:2px 0;background-color:#a00;background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,.15)));background-image:-webkit-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.15));background-image:linear-gradient(to bottom,rgba(0,0,0,0),rgba(0,0,0,.15));-webkit-box-shadow:0 2px 3px 0 rgba(0,0,0,.5);-moz-box-shadow:0 2px 3px 0 rgba(0,0,0,.5);box-shadow:0 2px 3px 0 rgba(0,0,0,.5);font:700 13px "Helvetica Neue",Helvetica,Arial,sans-serif;z-index:9999;pointer-events:auto}.github-fork-ribbon a,.github-fork-ribbon a:hover{color:#fff;text-decoration:none;text-shadow:0 -1px rgba(0,0,0,.5);text-align:center;width:200px;line-height:20px;display:inline-block;padding:2px 0;border-width:1px 0;border-style:dotted;border-color:#fff;border-color:rgba(255,255,255,.7)}.github-fork-ribbon-wrapper{width:150px;height:150px;position:absolute;overflow:hidden;top:0;z-index:9998;pointer-events:none}.github-fork-ribbon-wrapper.fixed{position:fixed}.github-fork-ribbon-wrapper.left{left:0}.github-fork-ribbon-wrapper.right{right:0}.github-fork-ribbon-wrapper.left-bottom{position:fixed;top:inherit;bottom:0;left:0}.github-fork-ribbon-wrapper.right-bottom{position:fixed;top:inherit;bottom:0;right:0}.github-fork-ribbon-wrapper.right .github-fork-ribbon{top:42px;right:-43px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.github-fork-ribbon-wrapper.left .github-fork-ribbon{top:42px;left:-43px;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.github-fork-ribbon-wrapper.left-bottom .github-fork-ribbon{top:80px;left:-43px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.github-fork-ribbon-wrapper.right-bottom .github-fork-ribbon{top:80px;right:-43px;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.custom-select{position:relative;display:block;padding:0}.custom-select select{width:100%;margin:0;background:0 0;border:1px solid transparent;border-radius:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;font-size:1em;font-family:helvetica,sans-serif;font-weight:700;color:#444;padding:.6em 1.9em .5em .8em;line-height:1.3}.custom-select option,.modal-header{font-weight:400}.custom-select::after{content:"";position:absolute;width:9px;height:8px;top:50%;right:1em;margin-top:-4px;background-image:url(http://filamentgroup.com/files/select-arrow.png);background-repeat:no-repeat;background-size:100%;z-index:2;pointer-events:none}.custom-select:hover{border:1px solid #888}.custom-select select:focus{outline:0;box-shadow:0 0 1px 3px rgba(180,222,250,1);background-color:transparent;color:#222;border:1px solid #aaa}.custom-select::after,x:-o-prefocus{display:none}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.custom-select select::-ms-expand{display:none}.custom-select select:focus::-ms-value{background:0 0;color:#222}}.custom-select select:-moz-focusring{color:transparent;text-shadow:0 0 0 #000}.pull-top{display:inline-block;vertical-align:top;float:none}.nav.nav-pills.nav-stacked,div.tab-content{position:relative;min-height:1px;float:left}.box{padding:0 5px!important}.current-fields .field-row{padding:5px 0}.current-fields .panel{background-color:#f1f1f1;margin-top:0!important}.current-fields .panel:hover{background-color:#fff;cursor:pointer}.current-fields .panel.tool-panel{background-color:#fff}.current-fields .panel-heading{background-color:#f1f1f1;position:relative}.current-fields .panel-heading:hover{background-color:#fff;cursor:pointer}.current-fields .tool-panel.panel:hover{border-color:#9d9d9d;background-color:#eee;cursor:pointer}.current-fields .tool-panel.panel:hover .panel-heading{background-color:inherit;color:#000;cursor:pointer}.current-fields .tool-panel.panel .panel-heading{background-color:#fff;color:#9d9d9d}.current-fields .tool-panel.panel .panel-heading a{color:inherit}.nav.nav-pills.nav-stacked{width:16.66666667%;padding-right:15px}div.tab-content{width:83.33333333%;padding-top:0!important}.panel-default.startPage{border-style:dashed;border-color:#a9a9a9;border-width:3px}.busy-updating-wrapper{text-align:center;font-size:20px;position:fixed;bottom:0;right:55px;z-index:1}.busy-submitting-wrapper{position:fixed;top:50%;left:0;right:0;bottom:0}.dropzone h4.panel-title{height:17px;overflow:hidden}.container.admin-form{margin-top:70px}.edit-modal-window .modal-dialog{width:90%}.edit-modal-window .modal-body{padding:0}.edit-modal-window .edit-panel{background-color:#F1F1F1;padding:0 35px}.edit-modal-window .preview-field-panel{display:flex;flex-direction:column;justify-content:center}.edit-modal-window .preview-field-panel form{padding-right:20px}.edit-modal-window .preview-field{resize:vertical}.admin-form .ui-sortable-placeholder{visibility:visible!important;border:none;padding:1px;background:rgba(0,0,0,.5)!important}.config-form{max-width:100%}.config-form>.row{padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}div.config-form .row.field{padding-top:1.5em}div.config-form>.row>.container:nth-of-type(odd){border-right:1px #ddd solid}div.config-form.design>.row>.container:nth-of-type(odd){border-right:none}div.config-form .row>.field-input{padding-left:.1em}div.config-form .row>.field-input label{padding-left:1.3em;display:block}.admin-form>.page-header{padding-bottom:0;margin-bottom:40px}.admin-form>.page-header h1{margin-bottom:0;margin-top:0}.admin-form>.page-header>.col-xs-3{padding-top:1.4em}.admin-form .form-controls .row{padding:5px}.admin-form .page-header{border:none;margin-top:none;margin-bottom:none}.admin-form .tab-content{padding-top:3em}.submissions-table .table-outer.row{margin:1.5em 0 2em!important}.submissions-table .table-outer .col-xs-12{padding-left:0!important;border:1px solid #ddd;overflow-x:scroll;border-radius:3px}.submissions-table .table>thead>tr>th{min-width:8em}.submissions-table .table>tbody>tr.selected{background-color:#efefef}.admin-form .add-field{background-color:#ddd;padding:0 2%;border-radius:3px}.admin-form .add-field .col-xs-6{padding:.25em .4em}.admin-form .add-field .col-xs-6 .panel-heading{border-width:1px;border-style:solid;border-color:#bbb;border-radius:4px}.admin-form .oscar-field-select{margin:10px 0}.view-form-btn.span{padding-right:.6em}.status-light.status-light-off{color:#BE0000}.status-light.status-light-on{color:#3C0}.analytics .header-title{font-size:1em;color:#bab8b8}.analytics .header-numbers{font-size:4em;padding-bottom:.1em;margin-bottom:.5em;border-bottom:#fafafa solid 1px}.analytics .detailed-title{font-size:1.8em;margin-bottom:1.1em}.analytics .detailed-row{padding-bottom:.8em}.analytics .detailed-row .row{font-size:1.2em}.analytics .detailed-row .row.header{font-size:.8em;color:#bab8b8;text-transform:uppercase}.field-title-row{padding-top:2em;padding-bottom:1em;border-top:#fafafa solid 1px;font-size:1.2em;color:#bab8b8}.field-detailed-row{font-size:1.2em;padding-bottom:.3em}.table-tools{border-top:#fafafa solid 1px;padding-top:2.5em}.public-form.preview{border:none;box-shadow:0 0 10px 0 grey;overflow-y:scroll;overflow-x:hidden;height:400px;width:90%;position:absolute}.public-form input,.public-form textarea{background-color:#000;background-color:rgba(0,0,0,0);border:2px dashed #ddd!important}.public-form input:focus,.public-form textarea:focus{border:2px dashed #ddd!important;outline:0}.public-form input.ng-valid,.public-form textarea.ng-valid{border-color:#20FF20!important;border-style:solid!important;border-width:3px!important}.public-form input.ng-invalid.ng-dirty,.public-form textarea.ng-invalid.ng-dirty{border-color:#FA787E!important;border-style:solid!important;border-width:3px!important}section.content p.breakwords{word-break:break-all}.public-form .btn{border:1px solid #c6c6c6}.public-form .btn[type=submit]{font-size:1.5em;padding:.35em 1.2em}section.content>section>section.container{margin-top:70px}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;font-size:18px}.public-form .input-block{display:block;width:100%}.modal-footer input[type=text]{min-height:34px;padding:7px 8px;font-size:13px;color:#333;vertical-align:middle;background-color:#fff;background-repeat:no-repeat;background-position:right 8px center;border:1px solid #ccc;border-radius:3px;box-shadow:inset 0 1px 2px rgba(0,0,0,.075)}.modal-body>.modal-body-alert{color:#796620;background-color:#f8eec7;border-color:#f2e09a;margin:-16px -15px 15px;padding:10px 15px;border-style:solid;border-width:1px 0}div.form-fields{position:relative;padding-top:10%}.public-form .letter{position:relative;display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;width:16px;padding:0;height:17px;font-size:12px;line-height:19px;border:1px solid #000;border:1px solid rgba(0,0,0,.2);margin-right:7px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;text-align:center;font-weight:700}div.form-submitted>.field.row{padding-bottom:2%;margin-top:10%}div.form-submitted>.field.row>div{font-size:1.7em}form .accordion-edit{width:inherit}.ui-datepicker.ui-widget{z-index:99!important}form .row.field .field-number{margin-right:.5em}form .row.field{padding:1em 0 0;width:inherit}form .row.field>.field-title{margin-top:.5em;font-size:1.2em;padding-bottom:1.8em;width:inherit}form .row.field>.field-input{font-size:1.4em;color:#777}form.submission-form .row.field.statement>.field-title{font-size:1.7em}form.submission-form .row.field.statement>.field-input{font-size:1em;color:#ddd}form.submission-form .select.radio>.field-input input,form.submission-form .select>.field-input input{width:20%}form.submission-form .field.row.radio .btn.activeBtn{background-color:#000!important;background-color:rgba(0,0,0,.7)!important;color:#fff}form.submission-form .field.row.radio .btn{margin-right:1.2em}form.submission-form .select>.field-input .btn{text-align:left;margin-bottom:.7em}form.submission-form .select>.field-input .btn>span{font-size:1.1em}form .field-input>textarea{padding:.45em .9em;width:100%;line-height:160%}form .field-input>input.hasDatepicker{padding:.45em .9em;width:50%;line-height:160%}form .field-input>input.text-field-input{padding:.45em .9em;width:100%;line-height:160%}form .required-error{color:#ddd;font-size:.8em}form .row.field.dropdown>.field-input input{min-height:34px;border-width:0 0 2px;border-radius:5px}form .row.field.dropdown>.field-input input:focus{border:none}form .dropdown>.field-input .ui-select-choices-row-inner{border-radius:3px;margin:5px;padding:10px;background-color:#000;background-color:rgba(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:#000;background-color:rgba(0,0,0,.1)}.current-fields .panel-body .row.description textarea,.current-fields .panel-body .row.question input[type=text]{width:100%}.current-fields .panel-body .row.options input[type=text]{width:80%}.ui-select-choices.ui-select-dropdown{top:2.5em!important}.ui-select-toggle{box-shadow:none!important;border:none!important}section.public-form{padding:0 10%}section.public-form .form-submitted{height:100%}section.public-form .btn{border:1px solid}.form-item{border-radius:5px;text-align:center;width:180px;position:relative;height:215px;margin-bottom:45px}.form-item.paused{background-color:red;color:#fff}.form-item.paused:hover{background-color:#8b0000;color:#fff}.form-item.create-new input[type=text]{width:inherit;color:#000;border:none}.form-item.create-new{background-color:#3FA2F7;color:#fff}.form-item.create-new.new-form{background-color:#ff8383;z-index:11}.form-item.create-new.new-form:hover{background-color:#3079b5}.form-item.new-form input[type=text]{margin-top:.2em;width:inherit;color:#000;border:none;padding:.3em .6em}.form-item.new-form .custom-select{margin-top:.2em}.form-item.new-form .custom-select select{background-color:#fff}.form-item.new-form .details-row{margin-top:1em}.form-item.new-form .details-row.submit{margin-top:1.7em}.form-item.new-form .details-row.submit .btn{font-size:.95em}.form-item.new-form .title-row{margin-top:1em;top:0}.overlay{position:fixed;top:0;left:0;height:100%;width:100%;background-color:#000;background-color:rgba(0,0,0,.5);z-index:10}.overlay.submitform{background-color:#fff;background-color:rgba(256,256,256,.8)}.activeField,.activeField input{background-color:transparent}.field-directive{z-index:9;padding:10% 10% 10% 0;border:25px solid transparent;position:relative}.activeField{z-index:11;position:relative}.activeField.field-directive{display:inline-block;border-radius:7px;width:100%;border:25px solid transparent}h3.forms-list-title{color:#3FA2F7;font-weight:600;margin-bottom:3em}.form-item{color:#71AADD;background-color:#E4F1FD}.form-item:hover{background-color:#3FA2F7;color:#23527C}.form-item.create-new:hover{color:#fff;background-color:#515151}.form-item>.row.footer{position:absolute;bottom:0;left:30%}.form-item .title-row{position:relative;top:15px;padding-top:3em;padding-bottom:1em}.form-item .title-row h4{font-size:1.3em}.form-item.create-new .title-row{padding:0}.form-item.create-new .title-row h4{font-size:7em}.form-item .details-row{margin-top:3.2em}.form-item .details-row small{font-size:.6em}.form-item.create-new .details-row small{font-size:.95em}section.auth{padding:70px 0;position:absolute;min-height:100%;top:0;left:0;width:100%;color:#fff;background-color:#50B5C1;background:-moz-linear-gradient(137deg,#50B5C1 0,#6450A0 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#50B5C1),color-stop(100%,#6450A0));background:-webkit-linear-gradient(137deg,#50B5C1 0,#6450A0 100%);background:-o-linear-gradient(137deg,#50B5C1 0,#6450A0 100%);background:-ms-linear-gradient(137deg,#50B5C1 0,#6450A0 100%)}section.auth>h3{font-size:2em;font-weight:500}.valign-wrapper{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.valign-wrapper .valign{display:block;width:100%}section.auth a{color:#fff;text-decoration:underline}section.auth.signup-view>h3{font-size:3em;padding-bottom:.5em}section.auth form .field-input select{padding:.45em .9em;width:100%;background:0 0;font-size:16px;border:1px solid #ccc;min-height:34px}section.auth input{color:#4c4c4c}section.auth .btn{border-radius:100px;font-size:14px;padding:12px 28px;margin-top:1em}.btn-rounded.btn-signup{background-color:#FFD747;color:#896D0B;border:2px solid #FFD747}.btn-rounded.btn-signup:hover{color:#FFD747;background-color:#896D0B;border:2px solid #896D0B}.btn-rounded.btn-default{background-color:transparent;color:#fff;border:2px solid #fff}.btn-rounded.btn-default:focus,.btn-rounded.btn-default:hover{color:#6450A0;background-color:#fff;border-color:#fff}@media (min-width:992px){.nav-users{position:fixed}}.remove-account-container{display:inline-block;position:relative}.btn-remove-account{top:10px;right:10px;position:absolute}section.auth input.form-control{min-height:30px!important;border:none}input.form-control{height:auto;border-radius:4px;box-shadow:none;font-size:18px;padding:20px 10px}.btn{border:none} \ No newline at end of file diff --git a/public/dist/application.min.js b/public/dist/application.min.js index 5f894dad..3754455e 100644 --- a/public/dist/application.min.js +++ b/public/dist/application.min.js @@ -1,5 +1,5 @@ -"use strict";var ApplicationConfiguration=function(){var a="NodeForm",b=["duScroll","ui.select","ngSanitize","vButton","ngResource","TellForm.templates","ui.router","ui.bootstrap","ui.utils","pascalprecht.translate"],c=function(b,c){angular.module(b,c||[]),angular.module(a).requires.push(b)};return{applicationModuleName:a,applicationModuleVendorDependencies:b,registerModule:c}}();angular.module(ApplicationConfiguration.applicationModuleName,ApplicationConfiguration.applicationModuleVendorDependencies),angular.module(ApplicationConfiguration.applicationModuleName).config(["$locationProvider",function(a){a.hashPrefix("!")}]),angular.module(ApplicationConfiguration.applicationModuleName).constant("APP_PERMISSIONS",{viewAdminSettings:"viewAdminSettings",editAdminSettings:"editAdminSettings",editForm:"editForm",viewPrivateForm:"viewPrivateForm"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("USER_ROLES",{admin:"admin",normal:"user",superuser:"superuser"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("FORM_URL","/forms/:formId"),angular.element(document).ready(function(){"#_=_"===window.location.hash&&(window.location.hash="#!"),angular.bootstrap(document,[ApplicationConfiguration.applicationModuleName])}),angular.module("TellForm.templates",[]).run(["$templateCache",function(a){a.put("modules/core/views/header.client.view.html",''),a.put("modules/forms/admin/views/admin-form.client.view.html",'
{{ \'TELLFORM_URL\' | translate }}
{{ \'COPY_AND_PASTE\' | translate }}
{{ \'BACKGROUND_COLOR\' | translate }}
{{ \'QUESTION_TEXT_COLOR\' | translate }}
{{ \'ANSWER_TEXT_COLOR\' | translate }}
{{ \'BTN_BACKGROUND_COLOR\' | translate }}
{{ \'BTN_TEXT_COLOR\' | translate }}
{{ \'TELLFORM_URL\' | translate }}
{{ \'COPY_AND_PASTE\' | translate }}
'),a.put("modules/forms/admin/views/list-forms.client.view.html",'

{{ \'CREATE_A_NEW_FORM\' | translate }}
{{ \'NAME\' | translate }}
{{ \'LANGUAGE\' | translate }}

{{ form.submissions.length }} {{ \'RESPONSES\' | translate }}

{{ \'FORM_PAUSED\' | translate }}
'),a.put("modules/forms/base/views/submit-form.client.view.html","
"),a.put("modules/forms/admin/views/adminTabs/analyze.html",""),a.put("modules/forms/admin/views/adminTabs/configure.html",""),a.put("modules/forms/admin/views/adminTabs/create.html",""),a.put("modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",'
{{ \'FORM_NAME\' | translate }}
{{ \'FORM_STATUS\' | translate }}
{{ \'LANGUAGE\' | translate }}
* {{ \'REQUIRED_FIELD\' | translate }}
{{ \'GA_TRACKING_CODE\' | translate }}
{{ \'DISPLAY_FOOTER\' | translate }}
{{ \'DISPLAY_START_PAGE\' | translate }}
{{ \'DISPLAY_END_PAGE\' | translate }}
'),a.put("modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",'

{{ \'WELCOME_SCREEN\' | translate }}


{{field.title}} *

{{ \'CLICK_FIELDS_FOOTER\' | translate }}


{{ \'END_SCREEN\' | translate }}

'), -a.put("modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html","
{{ 'TOTAL_VIEWS' | translate }}
{{ 'RESPONSES' | translate }}
{{ 'COMPLETION_RATE' | translate }}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{myform.analytics.visitors.length}}
{{myform.analytics.submissions}}
{{myform.analytics.conversionRate | number:0}}%
{{ AverageTimeElapsed | secondsToDateTime | date:'mm:ss'}}
{{ 'DESKTOP_AND_LAPTOP' | translate }}
{{ 'TABLETS' | translate }}
{{ 'PHONES' | translate }}
{{ 'OTHER' | translate }}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.desktop.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.other.visits}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.desktop.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.tablet.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.phone.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.other.responses}}
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.desktop.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.tablet.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.phone.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.other.completion}}%
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.desktop.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.tablet.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.phone.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.other.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'FIELD_TITLE' | translate }}
{{ 'FIELD_VIEWS' | translate }}
{{ 'FIELD_RESPONSES' | translate }}
{{ 'FIELD_DROPOFF' | translate }}
{{fieldStats.field.title}}
{{fieldStats.totalViews}}
{{fieldStats.responses}}
{{fieldStats.continueRate}}%

#{{value.title}}{{ 'PERCENTAGE_COMPLETE' | translate }}{{ 'TIME_ELAPSED' | translate }}{{ 'DEVICE' | translate }}{{ 'LOCATION' | translate }}{{ 'IP_ADDRESS' | translate }}{{ 'DATE_SUBMITTED' | translate }} (UTC)
{{$index+1}}{{field.fieldValue}}{{row.percentageComplete}}%{{row.timeElapsed | secondsToDateTime | date:'mm:ss'}}{{row.device.name}}, {{row.device.type}}{{row.geoLocation.City}}, {{row.geoLocation.Country}}{{row.ipAddr}}{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}
"),a.put("modules/forms/base/views/directiveViews/entryPage/startPage.html",'

{{pageData.introTitle}}

{{pageData.introParagraph}}

'),a.put("modules/forms/base/views/directiveViews/field/date.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("modules/forms/base/views/directiveViews/field/dropdown.html",'
'),a.put("modules/forms/base/views/directiveViews/field/file.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.file.originalname}}
{{ UPLOAD_FILE | translate }}
'),a.put("modules/forms/base/views/directiveViews/field/hidden.html",''),a.put("modules/forms/base/views/directiveViews/field/legal.html",'
'),a.put("modules/forms/base/views/directiveViews/field/radio.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("modules/forms/base/views/directiveViews/field/rating.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("modules/forms/base/views/directiveViews/field/statement.html",'

{{field.title}}

{{field.description}}

{{field.description}}


'),a.put("modules/forms/base/views/directiveViews/field/textarea.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{ \'NEWLINE\' | translate }}

{{field.description}}

{{ \'NEWLINE\' | translate }}
'),a.put("modules/forms/base/views/directiveViews/field/textfield.html",'

{{index+1}} {{field.title}} ({{ \'OPTIONAL\' | translate }})

{{field.description}}

'),a.put("modules/forms/base/views/directiveViews/field/yes_no.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("modules/forms/base/views/directiveViews/form/submit-form.client.view.html",'
{{ \'COMPLETING_NEEDED\' | translate:translateAdvancementData }}
'),a.put("modules/users/views/authentication/access-denied.client.view.html","

{{ 'ACCESS_DENIED_TEXT' | translate }}

{{ 'SIGNIN_BTN' | translate }}
"),a.put("modules/users/views/authentication/signin.client.view.html",'
'),a.put("modules/users/views/authentication/signup-success.client.view.html",''),a.put("modules/users/views/authentication/signup.client.view.html",''), -a.put("modules/users/views/password/forgot-password.client.view.html",'
{{error}}
{{success}}
'),a.put("modules/users/views/password/reset-password-invalid.client.view.html","

{{ 'PASSWORD_RESET_INVALID' | translate }}

{{ 'ASK_FOR_NEW_PASSWORD' | translate }}
"),a.put("modules/users/views/password/reset-password-success.client.view.html","

{{ 'PASSWORD_RESET_SUCCESS' | translate }}

{{ 'CONTINUE_TO_LOGIN' | translate }}
"),a.put("modules/users/views/password/reset-password.client.view.html",'

{{ \'RESET_PASSWORD\' | translate }}

'),a.put("modules/users/views/settings/change-password.client.view.html",'

{{ \'CHANGE_PASSWORD\' | translate }}

'),a.put("modules/users/views/settings/edit-profile.client.view.html",'

{{ \'EDIT_PROFILE\' | translate }}

'),a.put("modules/users/views/settings/social-accounts.client.view.html",'

{{ \'CONNECTED_SOCIAL_ACCOUNTS\' | translate }}:

{{ \'CONNECT_OTHER_SOCIAL_ACCOUNTS\' | translate }}

'),a.put("modules/users/views/verify/resend-verify-email.client.view.html",'
{{error}}

{{ \'VERIFICATION_EMAIL_SENT\' | translate }}

{{ \'VERIFICATION_EMAIL_SENT_TO\' | translate }} {{username}}.
{{ \'NOT_ACTIVATED_YET\' | translate }}

{{ \'CHECK_YOUR_EMAIL\' | translate }} polydaic@gmail.com

'),a.put("modules/users/views/verify/verify-account.client.view.html",'

{{ \'VERIFY_SUCCESS\' | translate }}

')}]),ApplicationConfiguration.registerModule("core",["users"]),ApplicationConfiguration.registerModule("forms",["ngFileUpload","ui.router.tabs","ui.date","ui.sortable","angular-input-stars","users","ngclipboard"]),ApplicationConfiguration.registerModule("users"),angular.module("forms").config(["$translateProvider",function(a){a.translations("en",{ADVANCED_SETTINGS:"Advanced Settings",FORM_NAME:"Form Name",FORM_STATUS:"Form Status",PUBLIC:"Public",PRIVATE:"Private",GA_TRACKING_CODE:"Google Analytics Tracking Code",DISPLAY_FOOTER:"Display Form Footer?",SAVE_CHANGES:"Save Changes",CANCEL:"Cancel",DISPLAY_START_PAGE:"Display Start Page?",DISPLAY_END_PAGE:"Display Custom End Page?",CREATE_A_NEW_FORM:"Create a new form",CREATE_FORM:"Create form",CREATED_ON:"Created on",MY_FORMS:"My forms",NAME:"Name",LANGUAGE:"Language",FORM_PAUSED:"Form paused",EDIT_FIELD:"Edit this Field",SAVE_FIELD:"Save",ON:"ON",OFF:"OFF",REQUIRED_FIELD:"Required",LOGIC_JUMP:"Logic Jump",SHOW_BUTTONS:"Additional Buttons",SAVE_START_PAGE:"Save",ARE_YOU_SURE:"Are you ABSOLUTELY sure?",READ_WARNING:"Unexpected bad things will happen if you don’t read this!",DELETE_WARNING1:'This action CANNOT be undone. This will permanently delete the "',DELETE_WARNING2:'" form and remove all associated form submissions.',DELETE_CONFIRM:"Please type in the name of the form to confirm.",I_UNDERSTAND:"I understand the consequences, delete this form.",DELETE_FORM_SM:"Delete",DELETE_FORM_MD:"Delete Form",DELETE:"Delete",FORM:"Form",VIEW:"View",LIVE:"Live",PREVIEW:"Preview",COPY:"Copy",COPY_AND_PASTE:"Copy and Paste this to add your TellForm to your website",CHANGE_WIDTH_AND_HEIGHT:"Change the width and height values to suit you best",POWERED_BY:"Powered by",TELLFORM_URL:"Your TellForm is permanently at this URL",DISABLED:"Disabled",YES:"YES",NO:"NO",ADD_LOGIC_JUMP:"Add Logic Jump",ADD_FIELD_LG:"Click to Add New Field",ADD_FIELD_MD:"Add New Field",ADD_FIELD_SM:"Add Field",EDIT_START_PAGE:"Edit Start Page",EDIT_END_PAGE:"Edit End Page",WELCOME_SCREEN:"Start Page",END_SCREEN:"End Page",INTRO_TITLE:"Title",INTRO_PARAGRAPH:"Paragraph",INTRO_BTN:"Start Button",TITLE:"Title",PARAGRAPH:"Paragraph",BTN_TEXT:"Go Back Button",BUTTONS:"Buttons",BUTTON_TEXT:"Text",BUTTON_LINK:"Link",ADD_BUTTON:"Add Button",PREVIEW_FIELD:"Preview Question",QUESTION_TITLE:"Title",QUESTION_DESCRIPTION:"Description",OPTIONS:"Options",ADD_OPTION:"Add Option",NUM_OF_STEPS:"Number of Steps",CLICK_FIELDS_FOOTER:"Click on fields to add them here",SHAPE:"Shape",IF_THIS_FIELD:"If this field",IS_EQUAL_TO:"is equal to",IS_NOT_EQUAL_TO:"is not equal to",IS_GREATER_THAN:"is greater than",IS_GREATER_OR_EQUAL_THAN:"is greater or equal than",IS_SMALLER_THAN:"is_smaller_than",IS_SMALLER_OR_EQUAL_THAN:"is smaller or equal than",CONTAINS:"contains",DOES_NOT_CONTAINS:"does not contain",ENDS_WITH:"ends with",DOES_NOT_END_WITH:"does not end with",STARTS_WITH:"starts with",DOES_NOT_START_WITH:"does not start with",THEN_JUMP_TO:"then jump to",TOTAL_VIEWS:"total unique visits",RESPONSES:"responses",COMPLETION_RATE:"completion rate",AVERAGE_TIME_TO_COMPLETE:"avg. completion time",DESKTOP_AND_LAPTOP:"Desktops",TABLETS:"Tablets",PHONES:"Phones",OTHER:"Other",UNIQUE_VISITS:"Unique Visits",FIELD_TITLE:"Field Title",FIELD_VIEWS:"Field Views",FIELD_DROPOFF:"Field Completion",FIELD_RESPONSES:"Field Responses",DELETE_SELECTED:"Delete Selected",EXPORT_TO_EXCEL:"Export to Excel",EXPORT_TO_CSV:"Export to CSV",EXPORT_TO_JSON:"Export to JSON",PERCENTAGE_COMPLETE:"Percentage Complete",TIME_ELAPSED:"Time Elapsed",DEVICE:"Device",LOCATION:"Location",IP_ADDRESS:"IP Address",DATE_SUBMITTED:"Date Submitted",GENERATED_PDF:"Generated PDF",BACKGROUND_COLOR:"Background Color",DESIGN_HEADER:"Change how your Form Looks",QUESTION_TEXT_COLOR:"Question Text Color",ANSWER_TEXT_COLOR:"Answer Text Color",BTN_BACKGROUND_COLOR:"Button Background Color",BTN_TEXT_COLOR:"Button Text Color",EMBED_YOUR_FORM:"Embed your form",SHARE_YOUR_FORM:"Share your form",CREATE_TAB:"Create",DESIGN_TAB:"Design",CONFIGURE_TAB:"Configure",ANALYZE_TAB:"Analyze",SHARE_TAB:"Share",SHORT_TEXT:"Short Text",EMAIL:"Email",MULTIPLE_CHOICE:"Multiple Choice",DROPDOWN:"Dropdown",DATE:"Date",PARAGRAPH_T:"Paragraph",YES_NO:"Yes/No",LEGAL:"Legal",RATING:"Rating",NUMBERS:"Numbers",SIGNATURE:"Signature",FILE_UPLOAD:"File upload",OPTION_SCALE:"Option Scale",PAYMENT:"Payment",STATEMENT:"Statement",LINK:"Link"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("es",{ADVANCED_SETTINGS:"Configuraciones avanzadas",FORM_NAME:"Nombre del formulario",FORM_STATUS:"Estado del formulario",PUBLIC:"Público",PRIVATE:"Privado",GA_TRACKING_CODE:"Código de Google Analytics",DISPLAY_FOOTER:"¿Mostrar pie de página?",SAVE_CHANGES:"Grabar",CANCEL:"Cancelar",DISPLAY_START_PAGE:"¿Mostrar página de inicio?",DISPLAY_END_PAGE:"¿Mostrar paǵina de fin?",CREATE_A_NEW_FORM:"Crear formulario",CREATE_FORM:"Crear formulario",CREATED_ON:"Creado en",MY_FORMS:"Mis formularios",NAME:"Nombre",LANGUAGE:"Idioma",FORM_PAUSED:"Formulario pausado",EDIT_FIELD:"Editar este campo",SAVE_FIELD:"Grabar",ON:"ON",OFF:"OFF",REQUIRED_FIELD:"Requerido",LOGIC_JUMP:"Salto lógico",SHOW_BUTTONS:"Botones adicionales",SAVE_START_PAGE:"Grabar",ARE_YOU_SURE:"¿Estás absolutamente seguro?",READ_WARNING:"¡Algo malo ocurrirá si no lees esto!",DELETE_WARNING1:'Esta acción no tiene vuelta atrás. Esto borrará permanentemente el "',DELETE_WARNING2:'" formulario y todos los datos asociados.',DELETE_CONFIRM:"Por favor escribí el nombre del formulario para confirmar.",I_UNDERSTAND:"Entiendo las consecuencias y quiero borrarlo.",DELETE_FORM_SM:"Borrar",DELETE_FORM_MD:"Borrar formulario",DELETE:"Borrar",FORM:"Formulario",VIEW:"Vista",LIVE:"Online",PREVIEW:"Vista previa",COPY:"Copiar",COPY_AND_PASTE:"Copiar y pegar esto para agregar su TellForm a su sitio web",CHANGE_WIDTH_AND_HEIGHT:"Cambie los valores de ancho y altura para adaptar el formulario a sus necesidades",POWERED_BY:"Con la tecnlogía de",TELLFORM_URL:"Tu TellForm está en esta URL permanente",DISABLED:"Deshabilitado",YES:"SI",NO:"NO",ADD_LOGIC_JUMP:"Agregar salto lógico",ADD_FIELD_LG:"Click para agregar campo",ADD_FIELD_MD:"Agregar nuevo campo",ADD_FIELD_SM:"Agregar campo",EDIT_START_PAGE:"Editar paǵina de inicio",EDIT_END_PAGE:"Editar página de finalización",WELCOME_SCREEN:"Comienzo",END_SCREEN:"Fin",INTRO_TITLE:"Título",INTRO_PARAGRAPH:"Parágrafo",INTRO_BTN:"Botón de comienzo",TITLE:"Título",PARAGRAPH:"Paragrafo",BTN_TEXT:"Botón para volver atrás",BUTTONS:"Botones",BUTTON_TEXT:"Texto",BUTTON_LINK:"Link",ADD_BUTTON:"Agregar Botón",PREVIEW_FIELD:"Vista previa Pregunta",QUESTION_TITLE:"Título",QUESTION_DESCRIPTION:"Descripción",OPTIONS:"Opciones",ADD_OPTION:"Agregar Opciones",NUM_OF_STEPS:"Cantidad de pasos",CLICK_FIELDS_FOOTER:"Click en los campos para agregar",SHAPE:"Forma",IF_THIS_FIELD:"Si este campo",IS_EQUAL_TO:"es igual a",IS_NOT_EQUAL_TO:"no es igual a",IS_GREATER_THAN:"es mayor que",IS_GREATER_OR_EQUAL_THAN:"es mayor o igual que",IS_SMALLER_THAN:"es menor que",IS_SMALLER_OR_EQUAL_THAN:"is menor o igual que",CONTAINS:"contiene",DOES_NOT_CONTAINS:"no contiene",ENDS_WITH:"termina con",DOES_NOT_END_WITH:"no termina con",STARTS_WITH:"comienza con",DOES_NOT_START_WITH:"no comienza con",THEN_JUMP_TO:"luego salta a",TOTAL_VIEWS:"Total de visitas únicas",RESPONSES:"respuestas",COMPLETION_RATE:"Taza de terminación",AVERAGE_TIME_TO_COMPLETE:"Promedio de tiempo de rellenado",DESKTOP_AND_LAPTOP:"Computadora",TABLETS:"Tablets",PHONES:"Móviles",OTHER:"Otros",UNIQUE_VISITS:"Visitas únicas",FIELD_TITLE:"Título de campo",FIELD_VIEWS:"Vistas de campo",FIELD_DROPOFF:"Finalización de campo",FIELD_RESPONSES:"Respuestas de campo",DELETE_SELECTED:"Borrar selección",EXPORT_TO_EXCEL:"Exportar a Excel",EXPORT_TO_CSV:"Exportar a CSV",EXPORT_TO_JSON:"Exportar a JSON",PERCENTAGE_COMPLETE:"Porcentaje de completitud",TIME_ELAPSED:"Tiempo usado",DEVICE:"Dispositivo",LOCATION:"Lugar",IP_ADDRESS:"Dirección IP",DATE_SUBMITTED:"Fecha de envío",GENERATED_PDF:"PDF generado",BACKGROUND_COLOR:"Color de fondo",DESIGN_HEADER:"Cambiar diseño de formulario",QUESTION_TEXT_COLOR:"Color de la pregunta",ANSWER_TEXT_COLOR:"Color de la respuesta",BTN_BACKGROUND_COLOR:"Color de fondo del botón",BTN_TEXT_COLOR:"Color del texto del botón",EMBED_YOUR_FORM:"Pone tu formulario",SHARE_YOUR_FORM:"Compartí tu formulario",CREATE_TAB:"Crear",DESIGN_TAB:"Diseño",CONFIGURE_TAB:"Configuración",ANALYZE_TAB:"Análisis",SHARE_TAB:"Compartir",SHORT_TEXT:"Texto corto",EMAIL:"Email",MULTIPLE_CHOICE:"Opciones múltiples",DROPDOWN:"Desplegable",DATE:"Fecha",PARAGRAPH_T:"Párrafo",YES_NO:"Si/No",LEGAL:"Legal",RATING:"Puntaje",NUMBERS:"Números",SIGNATURE:"Firma",FILE_UPLOAD:"Subir archivo",OPTION_SCALE:"Escala",PAYMENT:"Pago",STATEMENT:"Declaración",LINK:"Enlace"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("en",{FORM_SUCCESS:"Form entry successfully submitted!",REVIEW:"Review",BACK_TO_FORM:"Go back to Form",EDIT_FORM:"Edit this TellForm",CREATE_FORM:"Create this TellForm",ADVANCEMENT:"{{done}} out of {{total}} answered",CONTINUE_FORM:"Continue to Form",REQUIRED:"required",COMPLETING_NEEDED:"{{answers_not_completed}} answer(s) need completing",OPTIONAL:"optional",ERROR_EMAIL_INVALID:"Please enter a valid email address",ERROR_NOT_A_NUMBER:"Please enter valid numbers only",ERROR_URL_INVALID:"Please a valid url",OK:"OK",ENTER:"press ENTER",YES:"Yes",NO:"No",NEWLINE:"press SHIFT+ENTER to create a newline",CONTINUE:"Continue",LEGAL_ACCEPT:"I accept",LEGAL_NO_ACCEPT:"I don’t accept",DELETE:"Delete",CANCEL:"Cancel",SUBMIT:"Submit",UPLOAD_FILE:"Upload your File",TYPE_OR_SELECT_OPTION:"Type or select an option",ABORT_UPLOAD:"Abort ongoing upload",CLEAR_SELECTED_FILES:"Clear selected files"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("fr",{FORM_SUCCESS:"Votre formulaire a été enregistré!",REVIEW:"Incomplet",BACK_TO_FORM:"Retourner au formulaire",EDIT_FORM:"Éditer le Tellform",CREATE_FORM:"Créer un TellForm",ADVANCEMENT:"{{done}} complétés sur {{total}}",CONTINUE_FORM:"Aller au formulaire",REQUIRED:"obligatoire",COMPLETING_NEEDED:"{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)",OPTIONAL:"facultatif",ERROR_EMAIL_INVALID:"Merci de rentrer une adresse mail valide",ERROR_NOT_A_NUMBER:"Merce de ne rentrer que des nombres",ERROR_URL_INVALID:"Merci de rentrer une url valide",OK:"OK",ENTER:"presser ENTRÉE",YES:"Oui",NO:"Non",NEWLINE:"presser SHIFT+ENTER pour créer une nouvelle ligne",CONTINUE:"Continuer",LEGAL_ACCEPT:"J’accepte",LEGAL_NO_ACCEPT:"Je n’accepte pas",DELETE:"Supprimer",CANCEL:"Réinitialiser",SUBMIT:"Enregistrer",UPLOAD_FILE:"Envoyer un fichier",Y:"O",N:"N"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("de",{FORM_SUCCESS:"Ihre Angaben wurden gespeichert.",REVIEW:"Unvollständig",BACK_TO_FORM:"Zurück zum Formular",EDIT_FORM:"Bearbeiten Sie diese TellForm",CREATE_FORM:"Erstellen Sie eine TellForm",ADVANCEMENT:"{{done}} von {{total}} beantwortet",CONTINUE_FORM:"Zum Formular",REQUIRED:"verpflichtend",COMPLETING_NEEDED:"Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)",OPTIONAL:"fakultativ",ERROR_EMAIL_INVALID:"Bitte gültige Mailadresse eingeben",ERROR_NOT_A_NUMBER:"Bitte nur Zahlen eingeben",ERROR_URL_INVALID:"Bitte eine gültige URL eingeben",OK:"Okay",ENTER:"Eingabetaste drücken",YES:"Ja",NO:"Nein",NEWLINE:"Für eine neue Zeile SHIFT+ENTER drücken",CONTINUE:"Weiter",LEGAL_ACCEPT:"Ich akzeptiere",LEGAL_NO_ACCEPT:"Ich akzeptiere nicht",DELETE:"Entfernen",CANCEL:"Canceln",SUBMIT:"Speichern",UPLOAD_FILE:"Datei versenden",Y:"J",N:"N"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("it",{FORM_SUCCESS:"Il formulario è stato inviato con successo!",REVIEW:"Incompleto",BACK_TO_FORM:"Ritorna al formulario",EDIT_FORM:"Modifica questo Tellform",CREATE_FORM:"Creare un TellForm",ADVANCEMENT:"{{done}} su {{total}} completate",CONTINUE_FORM:"Vai al formulario",REQUIRED:"obbligatorio",COMPLETING_NEEDED:"{{answers_not_completed}} risposta/e deve/ono essere completata/e",OPTIONAL:"opzionale",ERROR_EMAIL_INVALID:"Si prega di inserire un indirizzo email valido",ERROR_NOT_A_NUMBER:"Si prega di inserire solo numeri",ERROR_URL_INVALID:"Grazie per inserire un URL valido",OK:"OK",ENTER:"premere INVIO",YES:"Sì",NO:"No",NEWLINE:"premere SHIFT+INVIO per creare una nuova linea",CONTINUE:"Continua",LEGAL_ACCEPT:"Accetto",LEGAL_NO_ACCEPT:"Non accetto",DELETE:"Cancella",CANCEL:"Reset",SUBMIT:"Registra",UPLOAD_FILE:"Invia un file",Y:"S",N:"N"})}]),angular.module("forms").config(["$translateProvider",function(a){a.translations("es",{FORM_SUCCESS:"¡El formulario ha sido enviado con éxito!",REVIEW:"Revisar",BACK_TO_FORM:"Regresar al formulario",EDIT_FORM:"Crear un TellForm",CREATE_FORM:"Editar este TellForm",ADVANCEMENT:"{{done}} de {{total}} contestadas",CONTINUE_FORM:"Continuar al formulario",REQUIRED:"Información requerida",COMPLETING_NEEDED:"{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)",OPTIONAL:"Opcional",ERROR_EMAIL_INVALID:"Favor de proporcionar un correo electrónico válido",ERROR_NOT_A_NUMBER:"Por favor, introduzca sólo números válidos",ERROR_URL_INVALID:"Favor de proporcionar un url válido",OK:"OK",ENTER:"pulse INTRO",YES:"Si",NO:"No",NEWLINE:"presione SHIFT+INTRO para crear una nueva línea",CONTINUE:"Continuar",LEGAL_ACCEPT:"Acepto",LEGAL_NO_ACCEPT:"No acepto",DELETE:"Eliminar",CANCEL:"Cancelar",SUBMIT:"Registrar",UPLOAD_FILE:"Cargar el archivo",Y:"S",N:"N",TYPE_OR_SELECT_OPTION:"Escriba o seleccione una opción",ABORT_UPLOAD:"Cancelar la subida en curso",CLEAR_SELECTED_FILES:"Borrar los archivos seleccionados"})}]),angular.module("core").config(["$stateProvider","$urlRouterProvider",function(a,b,c){b.otherwise("/forms")}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","$state","$stateParams",function(a,b,c,d){a.$state=c,a.$stateParams=d,a.$on("$stateChangeSuccess",function(a,d,e,f){c.previous=f;var g=["home","signin","resendVerifyEmail","verify","signup","signup-success","forgot","reset-invalid","reset","reset-success"];g.indexOf(d.name)>0?b.isAuthenticated()&&(a.preventDefault(),c.go("listForms")):"access_denied"===d.name||b.isAuthenticated()||"submitForm"===d.name||(a.preventDefault(),c.go("listForms"))})}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","User","Authorizer","$state","$stateParams",function(a,b,c,d,e,f){a.$on("$stateChangeStart",function(a,f){var g,h,i;h=f&&f.data&&f.data.permissions?f.data.permissions:null,b.ensureHasCurrentUser(c),i=b.currentUser,i&&(g=new d(i),null!==h&&(g.canAccess(h)||(a.preventDefault(),e.go("access_denied"))))})}]),angular.module("core").controller("HeaderController",["$rootScope","$scope","Menus","$state","Auth","User","$window","$translate","$locale",function(a,b,c,d,e,f,g,h,i){a.signupDisabled=g.signupDisabled,b.user=a.user=e.ensureHasCurrentUser(f),b.authentication=a.authentication=e,a.languages=b.languages=["en","fr","es","it","de"],b.authentication.isAuthenticated()?a.language=b.user.language:a.language=i.id.substring(0,2),h.use(a.language),b.isCollapsed=!1,a.hideNav=!1,b.menu=c.getMenu("topbar"),b.signout=function(){var c=f.logout();c.then(function(){e.logout(),e.ensureHasCurrentUser(f),b.user=a.user=null,d.go("listForms"),d.reload()},function(a){console.error("Logout Failed: "+a)})},b.toggleCollapsibleMenu=function(){b.isCollapsed=!b.isCollapsed},b.$on("$stateChangeSuccess",function(c,d,e,f,g){b.isCollapsed=!1,a.hideNav=!1,angular.isDefined(d.data)&&angular.isDefined(d.data.hideNav)&&(a.hideNav=d.data.hideNav)})}]),angular.module("core").service("Menus",[function(){this.defaultRoles=["*"],this.menus={};var a=function(a){if(a){if(~this.roles.indexOf("*"))return!0;for(var b in a.roles)for(var c in this.roles)if(this.roles[c]===a.roles[b])return!0;return!1}return this.isPublic};this.validateMenuExistance=function(a){if(a&&a.length){if(this.menus[a])return!0;throw new Error("Menu does not exists")}throw new Error("MenuId was not provided")},this.getMenu=function(a){return this.validateMenuExistance(a),this.menus[a]},this.addMenu=function(b,c,d){return this.menus[b]={isPublic:c||!1,roles:d||this.defaultRoles,items:[],shouldRender:a},this.menus[b]},this.removeMenu=function(a){this.validateMenuExistance(a),delete this.menus[a]},this.addMenuItem=function(b,c,d,e,f,g,h,i){return this.validateMenuExistance(b),this.menus[b].items.push({title:c,link:d,menuItemType:e||"item",menuItemClass:e,uiRoute:f||"/"+d,isPublic:null===g||"undefined"==typeof g?this.menus[b].isPublic:g,roles:null===h||"undefined"==typeof h?this.menus[b].roles:h,position:i||0,items:[],shouldRender:a}),this.menus[b]},this.addSubMenuItem=function(b,c,d,e,f,g,h,i){this.validateMenuExistance(b);for(var j in this.menus[b].items)this.menus[b].items[j].link===c&&this.menus[b].items[j].items.push({title:d,link:e,uiRoute:f||"/"+e,isPublic:null===g||"undefined"==typeof g?this.menus[b].items[j].isPublic:g,roles:null===h||"undefined"==typeof h?this.menus[b].items[j].roles:h,position:i||0,shouldRender:a});return this.menus[b]},this.removeMenuItem=function(a,b){this.validateMenuExistance(a);for(var c in this.menus[a].items)this.menus[a].items[c].link===b&&this.menus[a].items.splice(c,1);return this.menus[a]},this.removeSubMenuItem=function(a,b){this.validateMenuExistance(a);for(var c in this.menus[a].items)for(var d in this.menus[a].items[c].items)this.menus[a].items[c].items[d].link===b&&this.menus[a].items[c].items.splice(d,1);return this.menus[a]},this.addMenu("topbar",!1,["*"]),this.addMenu("bottombar",!1,["*"])}]),function(){function a(a,b){function c(a){g.socket=io(a,{transports:["websocket","polling"]})}function d(a,b){g.socket&&g.socket.emit(a,b)}function e(b,c){g.socket&&g.socket.on(b,function(b){a(function(){c(b)})})}function f(a){g.socket&&g.socket.removeListener(a)}var g={connect:c,emit:d,on:e,removeListener:f,socket:null};return c(window.location.protocol+"//"+window.location.hostname),g}angular.module("core").factory("Socket",a),a.$inject=["$timeout","$window"]}(),angular.module("core").factory("subdomain",["$location",function(a){var b=a.host();return b.indexOf(".")<0?null:b.split(".")[0]}]),angular.module("forms").run(["Menus",function(a){a.addMenuItem("topbar","My Forms","forms","","/forms",!1)}]).filter("secondsToDateTime",[function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}]).filter("formValidity",function(){return function(a){if(a&&a.form_fields&&a.visible_form_fields){var b=Object.keys(a),c=(b.filter(function(a){return"$"!==a[0]}),a.form_fields),d=c.filter(function(a){return"object"==typeof a&&"statement"!==a.fieldType&&"rating"!==a.fieldType?!!a.fieldValue:"rating"===a.fieldType||void 0}).length;return d-(a.form_fields.length-a.visible_form_fields.length)}return 0}}).config(["$provide",function(a){a.decorator("accordionDirective",["$delegate",function(a){var b=a[0];return b.replace=!0,a}])}]),angular.module("forms").config(["$stateProvider",function(a){a.state("listForms",{url:"/forms",templateUrl:"modules/forms/admin/views/list-forms.client.view.html"}).state("submitForm",{url:"/forms/:formId",templateUrl:"modules/forms/base/views/submit-form.client.view.html",data:{hideNav:!0},resolve:{Forms:"Forms",myForm:["Forms","$stateParams",function(a,b){return a.get({formId:b.formId}).$promise}]},controller:"SubmitFormController",controllerAs:"ctrl"}).state("viewForm",{url:"/forms/:formId/admin",templateUrl:"modules/forms/admin/views/admin-form.client.view.html",data:{permissions:["editForm"]},resolve:{Forms:"Forms",myForm:["Forms","$stateParams",function(a,b){return a.get({formId:b.formId}).$promise}]},controller:"AdminFormController"}).state("viewForm.configure",{url:"/configure",templateUrl:"modules/forms/admin/views/adminTabs/configure.html"}).state("viewForm.design",{url:"/design",templateUrl:"modules/forms/admin/views/adminTabs/design.html"}).state("viewForm.analyze",{url:"/analyze",templateUrl:"modules/forms/admin/views/adminTabs/analyze.html"}).state("viewForm.create",{url:"/create",templateUrl:"modules/forms/admin/views/adminTabs/create.html"})}]),function(){function a(){function a(a,b){}function b(){}var c={send:a};return b(),c}angular.module("forms").factory("SendVisitorData",a),a.$inject=[]}(),angular.module("forms").directive("keyToOption",function(){return{restrict:"A",scope:{field:"="},link:function(a,b,c,d){b.bind("keydown keypress",function(b){var c=b.which||b.keyCode,d=parseInt(String.fromCharCode(c))-1;d-1;case a.viewPrivateForm:case a.editForm:return c.roles.indexOf(b.admin)>-1||c.roles.indexOf(b.normal)>-1}}return!1}}}}]),angular.module("users").factory("User",["$window","$q","$timeout","$http","$state",function(a,b,c,d,e){var f={getCurrent:function(){var a=b.defer();return d.get("/users/me").success(function(b){a.resolve(b)}).error(function(){a.reject("User's session has expired")}),a.promise},login:function(a){var c=b.defer();return d.post("/auth/signin",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},logout:function(){var a=b.defer();return d.get("/auth/signout").then(function(b){a.resolve(null)},function(b){a.reject(b.data.message||b.data)}),a.promise},signup:function(a){var c=b.defer();return d.post("/auth/signup",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},resendVerifyEmail:function(a){var c=b.defer();return d.post("/auth/verify",{email:a}).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},validateVerifyToken:function(a){var c=/^([A-Za-z0-9]{48})$/g;if(!c.test(a))throw new Error("Error token: "+a+" is not a valid verification token");var e=b.defer();return d.get("/auth/verify/"+a).then(function(a){e.resolve(a.data)},function(a){e.reject(a.data)}),e.promise},resetPassword:function(a,c){var e=b.defer();return d.post("/auth/reset/"+c,a).then(function(a){e.resolve(a)},function(a){e.reject(a.data.message||a.data)}),e.promise},askForPasswordReset:function(a){var c=b.defer();return d.post("/auth/forgot",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise}};return f}]),angular.module("users").factory("Users",["$resource",function(a){return a("users",{},{update:{method:"PUT"}})}]),angular.module("core").config(["$translateProvider",function(a){a.translations("en",{MENU:"MENU",SIGNUP_TAB:"Sign Up",SIGNIN_TAB:"Sign In",SIGNOUT_TAB:"Signout",EDIT_PROFILE:"Edit Profile",MY_FORMS:"My Forms",MY_SETTINGS:"My Settings",CHANGE_PASSWORD:"Change Password"}),a.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("core").config(["$translateProvider",function(a){a.translations("fr",{MENU:"MENU",SIGNUP_TAB:"Créer un Compte",SIGNIN_TAB:"Connexion",SIGNOUT_TAB:"Créer un compte",EDIT_PROFILE:"Modifier Mon Profil",MY_FORMS:"Mes Formulaires",MY_SETTINGS:"Mes Paramètres",CHANGE_PASSWORD:"Changer mon Mot de Pass"})}]),angular.module("core").config(["$translateProvider",function(a){a.translations("es",{MENU:"MENU",SIGNUP_TAB:"Registrarse",SIGNIN_TAB:"Entrar",SIGNOUT_TAB:"Salir",EDIT_PROFILE:"Editar Perfil",MY_FORMS:"Mis formularios",MY_SETTINGS:"Mis configuraciones",CHANGE_PASSWORD:"Cambiar contraseña"})}]),angular.module("forms").controller("AdminFormController",["$rootScope","$window","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal","myForm","$filter","$sce",function(a,b,c,d,e,f,g,h,i,j,k,l){c.trustSrc=function(a){return l.trustAsResourceUrl(a)},c.activePill=0,c.copied=!1,c.onCopySuccess=function(a){c.copied=!0},c=a,c.animationsEnabled=!0,c.myform=j,a.saveInProgress=!1,g.setForm(c.myform),c.formURL="/#!/forms/"+c.myform._id,c.myform.isLive?b.subdomainsDisabled===!0?c.actualFormURL=window.location.protocol+"//"+window.location.host+"/view"+c.formURL:window.location.host.split(".").length<3?c.actualFormURL=window.location.protocol+"//"+c.myform.admin.username+"."+window.location.host+c.formURL:c.actualFormURL=window.location.protocol+"//"+c.myform.admin.username+"."+window.location.host.split(".").slice(1,3).join(".")+c.formURL:c.actualFormURL=window.location.protocol+"//"+window.location.host+c.formURL;var m=c.refreshFrame=function(){document.getElementById("iframe")&&document.getElementById("iframe").contentWindow.location.reload()};c.tabData=[{heading:k("translate")("CONFIGURE_TAB"),templateName:"configure"}],c.setForm=function(a){c.myform=a},a.resetForm=function(){c.myform=f.get({formId:d.formId})},c.openDeleteModal=function(){c.deleteModal=i.open({animation:c.animationsEnabled,templateUrl:"formDeleteModal.html",controller:"AdminFormController",resolve:{myForm:function(){return c.myform}}}),c.deleteModal.result.then(function(a){c.selected=a},function(){console.log("Modal dismissed at: "+new Date)})},c.cancelDeleteModal=function(){c.deleteModal&&c.deleteModal.dismiss("cancel")},c.removeCurrentForm=function(){if(c.deleteModal&&c.deleteModal.opened){c.deleteModal.close();var a=c.myform._id;if(!a)throw new Error("Error - removeCurrentForm(): $scope.myform._id does not exist");h["delete"]("/forms/"+a).then(function(a){console.log("form deleted successfully"),e.go("listForms",{},{reload:!0})},function(a){console.log("ERROR: Form could not be deleted."),console.error(a)})}},c.update=a.update=function(b,d,e,f,g){m();var i=!0;if(b||(i=!a.saveInProgress),i){var j=null;if(b||(a.saveInProgress=!0),e)c.updatePromise=h.put("/forms/"+c.myform._id,{changes:d}).then(function(b){f&&(a.myform=c.myform=b.data)})["catch"](function(a){console.log("Error occured during form UPDATE.\n"),j=a.data})["finally"](function(){if(b||(a.saveInProgress=!1),"function"==typeof g)return g(j)});else{var k=d;k.analytics&&k.analytics.visitors&&delete k.analytics.visitors,k.submissions&&delete k.submissions,c.updatePromise=h.put("/forms/"+c.myform._id,{form:k}).then(function(b){f&&(a.myform=c.myform=b.data)})["catch"](function(a){console.log("Error occured during form UPDATE.\n"),j=a.data})["finally"](function(){if(b||(a.saveInProgress=!1),"function"==typeof g)return g(j)})}}}}]),angular.module("forms").controller("ListFormsController",["$rootScope","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal",function(a,b,c,d,e,f,g,h){b=a,b.forms={},b.showCreateModal=!1,a.languageRegExp={regExp:/[@!#$%^&*()\-+={}\[\]|\\/'";:`.,~№?<>]+/i,test:function(a){return!this.regExp.test(a)}},b.openDeleteModal=function(a){b.deleteModal=h.open({animation:b.animationsEnabled,templateUrl:"deleteModalListForms.html",controller:["$uibModalInstance","items","$scope",function(a,b,c){c.content=b,c.cancel=c.cancelDeleteModal,c.deleteForm=function(){c.$parent.removeForm(b.formIndex)}}],resolve:{items:function(){return{currFormTitle:b.myforms[a].title,formIndex:a}}}})},b.cancelDeleteModal=function(){b.deleteModal&&b.deleteModal.dismiss("cancel")},b.findAll=function(){e.query(function(a){b.myforms=a})},b.openCreateModal=function(){b.showCreateModal||(b.showCreateModal=!0)},b.closeCreateModal=function(){b.showCreateModal&&(b.showCreateModal=!1)},b.setForm=function(a){b.myform=a},b.goToWithId=function(a,b){d.go(a,{formId:b},{reload:!0})},b.duplicateForm=function(a){var c=_.cloneDeep(b.myforms[a]);delete c._id,g.post("/forms",{form:c}).success(function(c,d,e){b.myforms.splice(a+1,0,c)}).error(function(a){console.error(a),null===a&&(b.error=a.data.message)})},b.createNewForm=function(){var a={};a.title=b.forms.createForm.title.$modelValue,a.language=b.forms.createForm.language.$modelValue,b.forms.createForm.$valid&&b.forms.createForm.$dirty&&g.post("/forms",{form:a}).success(function(a,c,d){b.goToWithId("viewForm.create",a._id+"")}).error(function(a){console.error(a),b.error=a.data.message})},b.removeForm=function(a){if(a>=b.myforms.length||a<0)throw new Error("Error: form_index in removeForm() must be between 0 and "+b.myforms.length-1);g["delete"]("/forms/"+b.myforms[a]._id).success(function(c,d,e){b.myforms.splice(a,1),b.cancelDeleteModal()}).error(function(a){console.error(a)})}}]),angular.module("forms").directive("configureFormDirective",["$rootScope","$http","Upload","CurrentForm",function(a,b,c,d){return{templateUrl:"modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",restrict:"E",scope:{myform:"=",user:"=",pdfFields:"@",formFields:"@"},controller:["$scope",function(b){b.log="",b.languages=a.languages,b.resetForm=a.resetForm,b.update=a.update}]}}]),angular.module("forms").directive("editFormDirective",["$rootScope","FormFields","$uibModal",function(a,b,c){return{templateUrl:"modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",restrict:"E",transclude:!0,scope:{myform:"="},controller:["$scope",function(d){var e;d.sortableOptions={appendTo:".dropzone",forceHelperSize:!0,forcePlaceholderSize:!0,update:function(a,b){d.update(!1,d.myform,!1,!1,function(a){})}},d.openEditModal=function(a){d.editFieldModal=c.open({animation:!0,templateUrl:"editFieldModal.html",windowClass:"edit-modal-window",controller:["$uibModalInstance","$scope",function(b,c){c.field=a,c.showLogicJump=!1,c.showAddOptions=function(a){return"dropdown"===a.fieldType||"checkbox"===a.fieldType||"radio"===a.fieldType},c.validShapes=["Heart","Star","thumbs-up","thumbs-down","Circle","Square","Check Circle","Smile Outlined","Hourglass","bell","Paper Plane","Comment","Trash"],c.addOption=function(a){if("checkbox"===a.fieldType||"dropdown"===a.fieldType||"radio"===a.fieldType){a.fieldOptions||(a.fieldOptions=[]);var b=a.fieldOptions.length+1,c={option_id:Math.floor(1e5*Math.random()),option_title:"Option "+b,option_value:"Option "+b};a.fieldOptions.push(c)}},c.deleteOption=function(a,b){if("checkbox"===a.fieldType||"dropdown"===a.fieldType||"radio"===a.fieldType)for(var c=0;c',restrict:"E",scope:{typeName:"@"},controller:["$scope",function(a){var b={textfield:"fa fa-pencil-square-o",dropdown:"fa fa-th-list",date:"fa fa-calendar",checkbox:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",email:"fa fa-envelope-o",textarea:"fa fa-pencil-square",legal:"fa fa-legal",file:"fa fa-cloud-upload",rating:"fa fa-star-half-o",link:"fa fa-link",scale:"fa fa-sliders",stripe:"fa fa-credit-card",statement:"fa fa-quote-left",yes_no:"fa fa-toggle-on",number:"fa fa-slack"};a.typeIcon=b[a.typeName]}]}});var __indexOf=[].indexOf||function(a){for(var b=0,c=this.length;b=0&&(c=c+b+".html"),d.get(c)};return{template:"
{{field.title}}
",restrict:"E",scope:{field:"=",required:"&",design:"=",index:"=",forms:"="},link:function(a,d){c.chooseDefaultOption=a.chooseDefaultOption=function(b){"yes_no"===b?a.field.fieldValue="true":"rating"===b?a.field.fieldValue=0:"radio"===a.field.fieldType?a.field.fieldValue=a.field.fieldOptions[0].option_value:"legal"===b&&(a.field.fieldValue="true",c.nextField())},a.setActiveField=c.setActiveField,"date"===a.field.fieldType&&(a.dateOptions={changeYear:!0,changeMonth:!0,altFormat:"mm/dd/yyyy",yearRange:"1900:-0",defaultDate:0});var e=a.field.fieldType;if("number"===a.field.fieldType||"textfield"===a.field.fieldType||"email"===a.field.fieldType||"link"===a.field.fieldType){switch(a.field.fieldType){case"textfield":a.input_type="text";break;case"email":a.input_type="email",a.placeholder="joesmith@example.com";break;case"number":a.input_type="text",a.validateRegex=/^-?\d+$/;break;default:a.input_type="url",a.placeholder="http://example.com"}e="textfield"}var g=f(e);d.html(g).show();b(d.contents())(a)}}}]),angular.module("forms").directive("onEnterKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode,e=!1;null!==d.onEnterKeyDisabled&&(e=d.onEnterKeyDisabled),13!==c||b.shiftKey||e||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterKey)}))})}}}]).directive("onTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabKey)}))})}}}]).directive("onEnterOrTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;13!==c&&9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterOrTabKey)}))})}}}]).directive("onTabAndShiftKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9===c&&b.shiftKey&&(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabAndShiftKey)}))})}}}]),angular.module("forms").directive("onFinishRender",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){if(c.attr("ng-repeat")||c.attr("data-ng-repeat")){var e=d.onFinishRender||"ngRepeat";b.$first&&!b.$last?b.$evalAsync(function(){a.$broadcast(e+" Started")}):b.$last&&b.$evalAsync(function(){a.$broadcast(e+" Finished")})}}}}]),angular.module("forms").directive("submitFormDirective",["$http","TimeCounter","$filter","$rootScope","Auth","SendVisitorData",function(a,b,c,d,e,f){return{templateUrl:"modules/forms/base/views/directiveViews/form/submit-form.client.view.html",restrict:"E",scope:{myform:"="},controller:["$document","$window","$scope",function(e,g,h){h.authentication=d.authentication,h.noscroll=!1,h.forms={};var i=h.myform.visible_form_fields.filter(function(a){return"statement"!==a.fieldType&&"rating"!==a.fieldType}).length,j=c("formValidity")(h.myform);h.translateAdvancementData={done:j,total:i,answers_not_completed:i-j},h.reloadForm=function(){h.myform.submitted=!1,h.myform.form_fields=_.chain(h.myform.visible_form_fields).map(function(a){return a.fieldValue="",a}).value(),h.loading=!1,h.error="",h.selected={_id:"",index:0},h.setActiveField(h.myform.visible_form_fields[0]._id,0,!1),b.restartClock()},g.onscroll=function(){h.scrollPos=document.body.scrollTop||document.documentElement.scrollTop||0;var a=document.getElementsByClassName("activeField")[0].getBoundingClientRect();h.fieldTop=a.top,h.fieldBottom=a.bottom;var b,c;h.noscroll||(h.selected.index===h.myform.visible_form_fields.length-1&&h.fieldBottom<200?(c=h.selected.index+1,b="submit_field",h.setActiveField(b,c,!1)):h.selected.index===h.myform.visible_form_fields.length?h.fieldTop>200&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):h.fieldBottom<0?(c=h.selected.index+1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):0!==h.selected.index&&h.fieldTop>0&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)),h.$apply())};var k=function(){if(null===h.selected)throw console.error("current active field is null"),new Error("current active field is null");return"submit_field"===h.selected._id?h.myform.form_fields.length-1:h.selected.index};h.setActiveField=d.setActiveField=function(a,b,d){if(null!==h.selected&&h.selected._id!==a){h.selected._id=a,h.selected.index=b;var f=c("formValidity")(h.myform);h.translateAdvancementData={done:f,total:i,answers_not_completed:i-f},d?(h.noscroll=!0,setTimeout(function(){e.scrollToElement(angular.element(".activeField"),-10,200).then(function(){h.noscroll=!1,setTimeout(function(){document.querySelectorAll(".activeField .focusOn").length?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input").length?document.querySelectorAll(".activeField input")[0].focus():document.querySelectorAll(".activeField .selectize-input")[0].focus()})})})):setTimeout(function(){void 0!==document.querySelectorAll(".activeField .focusOn")[0]?document.querySelectorAll(".activeField .focusOn")[0].focus():void 0!==document.querySelectorAll(".activeField input")[0]&&document.querySelectorAll(".activeField input")[0].focus()})}},d.nextField=h.nextField=function(){var a,b;h.selected.index0){var a=h.selected.index-1,b=h.myform.visible_form_fields[a]._id;h.setActiveField(b,a,!0)}},h.exitStartPage=function(){h.myform.startPage.showStart=!1,h.myform.visible_form_fields.length>0&&(h.selected._id=h.myform.visible_form_fields[0]._id)},d.goToInvalid=h.goToInvalid=function(){document.querySelectorAll(".ng-invalid.focusOn")[0].focus()},d.submitForm=h.submitForm=function(d){var e=b.stopClock();h.loading=!0;var g=_.cloneDeep(h.myform);g.timeElapsed=e,g.percentageComplete=c("formValidity")(h.myform)/h.myform.visible_form_fields.length*100,delete g.visible_form_fields;for(var i=0;i'),a.put("modules/forms/admin/views/admin-form.client.view.html",'
{{ \'TELLFORM_URL\' | translate }}
{{ \'COPY_AND_PASTE\' | translate }}
{{ \'BACKGROUND_COLOR\' | translate }}
{{ \'QUESTION_TEXT_COLOR\' | translate }}
{{ \'ANSWER_TEXT_COLOR\' | translate }}
{{ \'BTN_BACKGROUND_COLOR\' | translate }}
{{ \'BTN_TEXT_COLOR\' | translate }}
'),a.put("modules/forms/admin/views/list-forms.client.view.html",'

{{ \'CREATE_A_NEW_FORM\' | translate }}
{{ \'NAME\' | translate }}
{{ \'LANGUAGE\' | translate }}

{{ form.submissions.length }} {{ \'RESPONSES\' | translate }}

{{ \'FORM_PAUSED\' | translate }}
'),a.put("modules/forms/admin/views/adminTabs/analyze.html",""),a.put("modules/forms/admin/views/adminTabs/configure.html",""),a.put("modules/forms/admin/views/adminTabs/create.html",""),a.put("modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",'
{{ \'FORM_NAME\' | translate }}
{{ \'FORM_STATUS\' | translate }}
{{ \'LANGUAGE\' | translate }}
* {{ \'REQUIRED_FIELD\' | translate }}
{{ \'GA_TRACKING_CODE\' | translate }}
{{ \'DISPLAY_FOOTER\' | translate }}
{{ \'DISPLAY_START_PAGE\' | translate }}
{{ \'DISPLAY_END_PAGE\' | translate }}
'),a.put("modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",'

{{ \'WELCOME_SCREEN\' | translate }}


{{field.title}} *

{{ \'CLICK_FIELDS_FOOTER\' | translate }}


{{ \'END_SCREEN\' | translate }}

'), +a.put("modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html","
{{ 'TOTAL_VIEWS' | translate }}
{{ 'RESPONSES' | translate }}
{{ 'COMPLETION_RATE' | translate }}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{myform.analytics.visitors.length}}
{{myform.analytics.submissions}}
{{myform.analytics.conversionRate | number:0}}%
{{ AverageTimeElapsed | secondsToDateTime | date:'mm:ss'}}
{{ 'DESKTOP_AND_LAPTOP' | translate }}
{{ 'TABLETS' | translate }}
{{ 'PHONES' | translate }}
{{ 'OTHER' | translate }}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.desktop.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.tablet.visits}}
{{ 'UNIQUE_VISITS' | translate }}
{{DeviceStatistics.other.visits}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.desktop.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.tablet.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.phone.responses}}
{{ 'RESPONSES' | translate }}
{{DeviceStatistics.other.responses}}
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.desktop.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.tablet.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.phone.completion}}%
{{ 'COMPLETION_RATE' | translate }}
{{DeviceStatistics.other.completion}}%
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.desktop.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.tablet.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.phone.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}
{{DeviceStatistics.other.average_time | secondsToDateTime | date:'mm:ss'}}
{{ 'FIELD_TITLE' | translate }}
{{ 'FIELD_VIEWS' | translate }}
{{ 'FIELD_RESPONSES' | translate }}
{{ 'FIELD_DROPOFF' | translate }}
{{fieldStats.field.title}}
{{fieldStats.totalViews}}
{{fieldStats.responses}}
{{fieldStats.continueRate}}%

#{{value.title}}{{ 'PERCENTAGE_COMPLETE' | translate }}{{ 'TIME_ELAPSED' | translate }}{{ 'DEVICE' | translate }}{{ 'LOCATION' | translate }}{{ 'IP_ADDRESS' | translate }}{{ 'DATE_SUBMITTED' | translate }} (UTC)
{{$index+1}}{{field.fieldValue}}{{row.percentageComplete}}%{{row.timeElapsed | secondsToDateTime | date:'mm:ss'}}{{row.device.name}}, {{row.device.type}}{{row.geoLocation.City}}, {{row.geoLocation.Country}}{{row.ipAddr}}{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}
"),a.put("modules/users/views/authentication/access-denied.client.view.html","

{{ 'ACCESS_DENIED_TEXT' | translate }}

{{ 'SIGNIN_BTN' | translate }}
"),a.put("modules/users/views/authentication/signin.client.view.html",'
'),a.put("modules/users/views/authentication/signup-success.client.view.html",''),a.put("modules/users/views/authentication/signup.client.view.html",''),a.put("modules/users/views/password/forgot-password.client.view.html",'
{{error}}
{{success}}
'),a.put("modules/users/views/password/reset-password-invalid.client.view.html","

{{ 'PASSWORD_RESET_INVALID' | translate }}

{{ 'ASK_FOR_NEW_PASSWORD' | translate }}
"),a.put("modules/users/views/password/reset-password-success.client.view.html","

{{ 'PASSWORD_RESET_SUCCESS' | translate }}

{{ 'CONTINUE_TO_LOGIN' | translate }}
"),a.put("modules/users/views/password/reset-password.client.view.html",'

{{ \'RESET_PASSWORD\' | translate }}

'),a.put("modules/users/views/settings/change-password.client.view.html",'

{{ \'CHANGE_PASSWORD\' | translate }}

'),a.put("modules/users/views/settings/edit-profile.client.view.html",'

{{ \'EDIT_PROFILE\' | translate }}

'),a.put("modules/users/views/settings/social-accounts.client.view.html",'

{{ \'CONNECTED_SOCIAL_ACCOUNTS\' | translate }}:

{{ \'CONNECT_OTHER_SOCIAL_ACCOUNTS\' | translate }}

'),a.put("modules/users/views/verify/resend-verify-email.client.view.html",'
{{error}}

{{ \'VERIFICATION_EMAIL_SENT\' | translate }}

{{ \'VERIFICATION_EMAIL_SENT_TO\' | translate }} {{username}}.
{{ \'NOT_ACTIVATED_YET\' | translate }}

{{ \'CHECK_YOUR_EMAIL\' | translate }} polydaic@gmail.com

'),a.put("modules/users/views/verify/verify-account.client.view.html",'

{{ \'VERIFY_SUCCESS\' | translate }}

'),a.put("form_modules/forms/base/views/directiveViews/entryPage/startPage.html",'

{{pageData.introTitle}}

{{pageData.introParagraph}}

'),a.put("form_modules/forms/base/views/directiveViews/field/date.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("form_modules/forms/base/views/directiveViews/field/dropdown.html",'
'),a.put("form_modules/forms/base/views/directiveViews/field/hidden.html",""),a.put("form_modules/forms/base/views/directiveViews/field/legal.html",'
'),a.put("form_modules/forms/base/views/directiveViews/field/radio.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/field/rating.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("form_modules/forms/base/views/directiveViews/field/statement.html",'

{{field.title}}

{{field.description}}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/field/textarea.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{ \'NEWLINE\' | translate }}

{{field.description}}

Press SHIFT+ENTER to add a newline
{{ \'ENTER\' | translate }}
'),a.put("form_modules/forms/base/views/directiveViews/field/textfield.html",'

{{index+1}} {{field.title}} ({{ \'OPTIONAL\' | translate }})

{{field.description}}

{{ \'ENTER\' | translate }}
'), +a.put("form_modules/forms/base/views/directiveViews/field/yes_no.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html",'
{{ \'COMPLETING_NEEDED\' | translate:translateAdvancementData }}
'),a.put("form_modules/forms/base/views/form-unauthorized.client.view.html",'

Not Authorized to Access Form

The form you are trying to access is currently private and not accesible publically.
If you are the owner of the form, you can set it to "Public" in the "Configuration" panel in the form admin.
'),a.put("form_modules/forms/base/views/submit-form.client.view.html","
")}]),ApplicationConfiguration.registerModule("core",["users"]),ApplicationConfiguration.registerModule("forms",["ngFileUpload","ui.router.tabs","ui.date","ui.sortable","angular-input-stars","users","ngclipboard"]),ApplicationConfiguration.registerModule("users"),angular.module("core").config(["$stateProvider","$urlRouterProvider",function(a,b,c){b.otherwise("/forms")}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","$state","$stateParams",function(a,b,c,d){a.$state=c,a.$stateParams=d,a.$on("$stateChangeSuccess",function(a,d,e,f){c.previous=f;var g=["home","signin","resendVerifyEmail","verify","signup","signup-success","forgot","reset-invalid","reset","reset-success"];g.indexOf(d.name)>0?b.isAuthenticated()&&(a.preventDefault(),c.go("listForms")):"access_denied"===d.name||b.isAuthenticated()||"submitForm"===d.name||(a.preventDefault(),c.go("listForms"))})}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","User","Authorizer","$state","$stateParams",function(a,b,c,d,e,f){a.$on("$stateChangeStart",function(a,f){var g,h,i;h=f&&f.data&&f.data.permissions?f.data.permissions:null,b.ensureHasCurrentUser(c),i=b.currentUser,i&&(g=new d(i),null!==h&&(g.canAccess(h)||(a.preventDefault(),e.go("access_denied"))))})}]),angular.module("core").controller("HeaderController",["$rootScope","$scope","Menus","$state","Auth","User","$window","$translate","$locale",function(a,b,c,d,e,f,g,h,i){a.signupDisabled=g.signupDisabled,b.user=a.user=e.ensureHasCurrentUser(f),b.authentication=a.authentication=e,a.languages=b.languages=["en","fr","es","it","de"],b.authentication.isAuthenticated()?a.language=b.user.language:a.language=i.id.substring(0,2),h.use(a.language),b.isCollapsed=!1,a.hideNav=!1,b.menu=c.getMenu("topbar"),b.signout=function(){var c=f.logout();c.then(function(){e.logout(),e.ensureHasCurrentUser(f),b.user=a.user=null,d.go("listForms"),d.reload()},function(a){console.error("Logout Failed: "+a)})},b.toggleCollapsibleMenu=function(){b.isCollapsed=!b.isCollapsed},b.$on("$stateChangeSuccess",function(c,d,e,f,g){b.isCollapsed=!1,a.hideNav=!1,angular.isDefined(d.data)&&angular.isDefined(d.data.hideNav)&&(a.hideNav=d.data.hideNav)})}]),angular.module("core").service("Menus",[function(){this.defaultRoles=["*"],this.menus={};var a=function(a){if(a){if(~this.roles.indexOf("*"))return!0;for(var b in a.roles)for(var c in this.roles)if(this.roles[c]===a.roles[b])return!0;return!1}return this.isPublic};this.validateMenuExistance=function(a){if(a&&a.length){if(this.menus[a])return!0;throw new Error("Menu does not exists")}throw new Error("MenuId was not provided")},this.getMenu=function(a){return this.validateMenuExistance(a),this.menus[a]},this.addMenu=function(b,c,d){return this.menus[b]={isPublic:c||!1,roles:d||this.defaultRoles,items:[],shouldRender:a},this.menus[b]},this.removeMenu=function(a){this.validateMenuExistance(a),delete this.menus[a]},this.addMenuItem=function(b,c,d,e,f,g,h,i){return this.validateMenuExistance(b),this.menus[b].items.push({title:c,link:d,menuItemType:e||"item",menuItemClass:e,uiRoute:f||"/"+d,isPublic:null===g||"undefined"==typeof g?this.menus[b].isPublic:g,roles:null===h||"undefined"==typeof h?this.menus[b].roles:h,position:i||0,items:[],shouldRender:a}),this.menus[b]},this.addSubMenuItem=function(b,c,d,e,f,g,h,i){this.validateMenuExistance(b);for(var j in this.menus[b].items)this.menus[b].items[j].link===c&&this.menus[b].items[j].items.push({title:d,link:e,uiRoute:f||"/"+e,isPublic:null===g||"undefined"==typeof g?this.menus[b].items[j].isPublic:g,roles:null===h||"undefined"==typeof h?this.menus[b].items[j].roles:h,position:i||0,shouldRender:a});return this.menus[b]},this.removeMenuItem=function(a,b){this.validateMenuExistance(a);for(var c in this.menus[a].items)this.menus[a].items[c].link===b&&this.menus[a].items.splice(c,1);return this.menus[a]},this.removeSubMenuItem=function(a,b){this.validateMenuExistance(a);for(var c in this.menus[a].items)for(var d in this.menus[a].items[c].items)this.menus[a].items[c].items[d].link===b&&this.menus[a].items[c].items.splice(d,1);return this.menus[a]},this.addMenu("topbar",!1,["*"]),this.addMenu("bottombar",!1,["*"])}]),function(){function a(a,b){function c(a){g.socket=io(a,{transports:["websocket","polling"]})}function d(a,b){g.socket&&g.socket.emit(a,b)}function e(b,c){g.socket&&g.socket.on(b,function(b){a(function(){c(b)})})}function f(a){g.socket&&g.socket.removeListener(a)}var g={connect:c,emit:d,on:e,removeListener:f,socket:null};return c(window.location.protocol+"//"+window.location.hostname),g}angular.module("core").factory("Socket",a),a.$inject=["$timeout","$window"]}(),angular.module("core").factory("subdomain",["$location",function(a){var b=a.host();return b.indexOf(".")<0?null:b.split(".")[0]}]),angular.module("forms").run(["Menus",function(a){a.addMenuItem("topbar","My Forms","forms","","/forms",!1)}]).filter("secondsToDateTime",[function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}]).filter("formValidity",[function(){return function(a){if(a&&a.form_fields&&a.visible_form_fields){var b=Object.keys(a),c=(b.filter(function(a){return"$"!==a[0]}),a.form_fields),d=c.filter(function(a){return"object"==typeof a&&"statement"!==a.fieldType&&"rating"!==a.fieldType?!!a.fieldValue:"rating"===a.fieldType||void 0}).length;return d-(a.form_fields.length-a.visible_form_fields.length)}return 0}}]).filter("trustSrc",["$sce",function(a){return function(b){return" $sce.trustAsResourceUrl(formUrl): "+a.trustAsResourceUrl(b),a.trustAsResourceUrl(b)}}]).config(["$provide",function(a){a.decorator("accordionDirective",["$delegate",function(a){var b=a[0];return b.replace=!0,a}])}]),angular.module("forms").config(["$stateProvider",function(a){a.state("listForms",{url:"/forms",templateUrl:"modules/forms/admin/views/list-forms.client.view.html"}).state("submitForm",{url:"/forms/:formId",templateUrl:"/static/form_modules/forms/base/views/submit-form.client.view.html",data:{hideNav:!0},resolve:{Forms:"GetForms",myForm:["GetForms","$stateParams","$q",function(a,b,c){var d=c.defer();return a.get({formId:b.formId},function(a){d.resolve(a)}),d.promise}]},controller:"SubmitFormController",controllerAs:"ctrl"}).state("viewForm",{url:"/forms/:formId/admin",templateUrl:"modules/forms/admin/views/admin-form.client.view.html",data:{permissions:["editForm"]},resolve:{GetForms:"GetForms",myForm:["GetForms","$stateParams","$q",function(a,b,c){var d=c.defer();return a.get({formId:b.formId},function(a){d.resolve(a)}),d.promise}]},controller:"AdminFormController"}).state("viewForm.configure",{url:"/configure",templateUrl:"modules/forms/admin/views/adminTabs/configure.html"}).state("viewForm.design",{url:"/design",templateUrl:"modules/forms/admin/views/adminTabs/design.html"}).state("viewForm.analyze",{url:"/analyze",templateUrl:"modules/forms/admin/views/adminTabs/analyze.html"}).state("viewForm.create",{url:"/create",templateUrl:"modules/forms/admin/views/adminTabs/create.html"})}]),angular.module("forms").factory("GetForms",["$resource","FORM_URL",function(a,b){return a(b,{formId:"@_id"},{query:{method:"GET",isArray:!0},get:{method:"GET",transformResponse:function(a,b){var c=angular.fromJson(a);return c.visible_form_fields=_.filter(c.form_fields,function(a){return a.deletePreserved===!1}),c}},update:{method:"PUT"},save:{method:"POST"}})}]),angular.module("users").config(["$httpProvider",function(a){a.interceptors.push(["$q","$location",function(a,b){return{responseError:function(c){return"/users/me"!==b.path()&&c.config&&"/users/me"!==c.config.url&&(console.log("intercepted rejection of ",c.config.url,c.status),401===c.status?(console.log(b.path()),b.nextAfterLogin=b.path(),b.path("/signin")):403===c.status&&b.path("/access_denied")),a.reject(c)}}}])}]),angular.module("users").config(["$stateProvider",function(a){var b=function(a,b,c,d,e){var f=a.defer();return e.currentUser&&e.currentUser.email?b(f.resolve):e.currentUser=d.getCurrent(function(){e.login(),b(f.resolve())},function(){e.logout(),b(f.reject()),c.go("signin",{reload:!0})}),f.promise};b.$inject=["$q","$timeout","$state","User","Auth"];var c=function(a,b,c){var d=c.defer();return b(a.signupDisabled?d.reject():d.resolve()),d.promise};c.$inject=["$window","$timeout","$q"],a.state("profile",{resolve:{loggedin:b},url:"/settings/profile",templateUrl:"modules/users/views/settings/edit-profile.client.view.html"}).state("password",{resolve:{loggedin:b},url:"/settings/password",templateUrl:"modules/users/views/settings/change-password.client.view.html"}).state("accounts",{resolve:{loggedin:b},url:"/settings/accounts",templateUrl:"modules/users/views/settings/social-accounts.client.view.html"}).state("signup",{resolve:{isDisabled:c},url:"/signup",templateUrl:"modules/users/views/authentication/signup.client.view.html"}).state("signup-success",{resolve:{isDisabled:c},url:"/signup-success",templateUrl:"modules/users/views/authentication/signup-success.client.view.html"}).state("signin",{url:"/signin",templateUrl:"modules/users/views/authentication/signin.client.view.html"}).state("access_denied",{url:"/access_denied",templateUrl:"modules/users/views/authentication/access-denied.client.view.html"}).state("verify",{resolve:{isDisabled:c},url:"/verify/:token",templateUrl:"modules/users/views/verify/verify-account.client.view.html"}).state("resendVerifyEmail",{resolve:{isDisabled:c},url:"/verify",templateUrl:"modules/users/views/verify/resend-verify-email.client.view.html"}).state("forgot",{url:"/password/forgot",templateUrl:"modules/users/views/password/forgot-password.client.view.html"}).state("reset-invalid",{url:"/password/reset/invalid",templateUrl:"modules/users/views/password/reset-password-invalid.client.view.html"}).state("reset-success",{url:"/password/reset/success",templateUrl:"modules/users/views/password/reset-password-success.client.view.html"}).state("reset",{url:"/password/reset/:token",templateUrl:"modules/users/views/password/reset-password.client.view.html"})}]),angular.module("users").controller("AuthenticationController",["$scope","$location","$state","$rootScope","User","Auth",function(a,b,c,d,e,f){a=d,a.credentials={},a.error="",a.signin=function(){e.login(a.credentials).then(function(b){f.login(b),a.user=d.user=f.ensureHasCurrentUser(e),"home"!==c.previous.name&&"verify"!==c.previous.name&&""!==c.previous.name?c.go(c.previous.name):c.go("listForms")},function(b){d.user=f.ensureHasCurrentUser(e),a.user=d.user,a.error=b,console.error("loginError: "+b)})},a.signup=function(){return"admin"===a.credentials?void(a.error="Username cannot be 'admin'. Please pick another username."):void e.signup(a.credentials).then(function(a){c.go("signup-success")},function(b){console.error(b),b?(a.error=b,console.error(b)):console.error("No response received")})}}]),angular.module("users").controller("PasswordController",["$scope","$stateParams","$state","User",function(a,b,c,d){a.error="",a.askForPasswordReset=function(){d.askForPasswordReset(a.credentials).then(function(b){a.success=b.message,a.credentials=null},function(b){a.error=b,a.credentials=null})},a.resetUserPassword=function(){a.success=a.error=null,d.resetPassword(a.passwordDetails,b.token).then(function(b){console.log(b),a.success=b.message,a.passwordDetails=null,c.go("reset-success")},function(b){a.error=b.message||b,a.passwordDetails=null})}}]),angular.module("users").controller("SettingsController",["$scope","$rootScope","$http","$state","Users","Auth",function(a,b,c,d,e,f){a.user=f.currentUser,a.hasConnectedAdditionalSocialAccounts=function(b){for(var c in a.user.additionalProvidersData)return!0;return!1},a.cancel=function(){a.user=f.currentUser},a.isConnectedSocialAccount=function(b){return a.user.provider===b||a.user.additionalProvidersData&&a.user.additionalProvidersData[b]},a.removeUserSocialAccount=function(b){a.success=a.error=null,c["delete"]("/users/accounts",{params:{provider:b}}).success(function(b){a.success=!0,a.user=b}).error(function(b){a.error=b.message})},a.updateUserProfile=function(b){if(b){a.success=a.error=null;var c=new e(a.user);c.$update(function(b){a.success=!0,a.user=b},function(b){a.error=b.data.message})}else a.submitted=!0},a.changeUserPassword=function(){a.success=a.error=null,c.post("/users/password",a.passwordDetails).success(function(b){a.success=!0,a.passwordDetails=null}).error(function(b){a.error=b.message})}}]),angular.module("users").controller("VerifyController",["$scope","$state","$rootScope","User","Auth","$stateParams",function(a,b,c,d,e,f){a.isResetSent=!1,a.credentials={},a.error="",a.resendVerifyEmail=function(){d.resendVerifyEmail(a.credentials.email).then(function(b){console.log(b),a.success=b.message,a.credentials=null,a.isResetSent=!0},function(b){a.error=b,a.credentials.email=null,a.isResetSent=!1})},a.validateVerifyToken=function(){f.token&&(console.log(f.token),d.validateVerifyToken(f.token).then(function(b){console.log("Success: "+b.message),a.success=b.message,a.isResetSent=!0,a.credentials.email=null},function(b){console.log("Error: "+b.message),a.isResetSent=!1,a.error=b,a.credentials.email=null}))}}]),angular.module("users").factory("Auth",["$window",function(a){var b={isLoggedIn:!1},c={_currentUser:null,get currentUser(){return this._currentUser},ensureHasCurrentUser:function(d){return c._currentUser&&c._currentUser.username?c._currentUser:a.user?(c._currentUser=a.user,c._currentUser):void d.getCurrent().then(function(d){return c._currentUser=d,b.isLoggedIn=!0,a.user=c._currentUser,c._currentUser},function(d){return b.isLoggedIn=!1,c._currentUser=null,a.user=null,console.log("User.getCurrent() err",d),null})},isAuthenticated:function(){return!!c._currentUser},getUserState:function(){return b},login:function(a){b.isLoggedIn=!0,c._currentUser=a},logout:function(){a.user=null,b.isLoggedIn=!1,c._currentUser=null}};return c}]),angular.module("users").service("Authorizer",["APP_PERMISSIONS","USER_ROLES",function(a,b){return function(c){return{canAccess:function(d){var e,f,g;for(angular.isArray(d)||(d=[d]),e=0,f=d.length;e-1;case a.viewPrivateForm:case a.editForm:return c.roles.indexOf(b.admin)>-1||c.roles.indexOf(b.normal)>-1}}return!1}}}}]),angular.module("users").factory("User",["$window","$q","$timeout","$http","$state",function(a,b,c,d,e){var f={getCurrent:function(){var a=b.defer();return d.get("/users/me").success(function(b){a.resolve(b)}).error(function(){a.reject("User's session has expired")}),a.promise},login:function(a){var c=b.defer();return d.post("/auth/signin",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},logout:function(){var a=b.defer();return d.get("/auth/signout").then(function(b){a.resolve(null)},function(b){a.reject(b.data.message||b.data)}),a.promise},signup:function(a){var c=b.defer();return d.post("/auth/signup",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},resendVerifyEmail:function(a){var c=b.defer();return d.post("/auth/verify",{email:a}).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise},validateVerifyToken:function(a){var c=/^([A-Za-z0-9]{48})$/g;if(!c.test(a))throw new Error("Error token: "+a+" is not a valid verification token");var e=b.defer();return d.get("/auth/verify/"+a).then(function(a){e.resolve(a.data)},function(a){e.reject(a.data)}),e.promise},resetPassword:function(a,c){var e=b.defer();return d.post("/auth/reset/"+c,a).then(function(a){e.resolve(a)},function(a){e.reject(a.data.message||a.data)}),e.promise},askForPasswordReset:function(a){var c=b.defer();return d.post("/auth/forgot",a).then(function(a){c.resolve(a.data)},function(a){c.reject(a.data.message||a.data)}),c.promise}};return f}]),angular.module("users").factory("Users",["$resource",function(a){return a("users",{},{update:{method:"PUT"}})}]),angular.module("core").config(["$translateProvider",function(a){a.translations("en",{MENU:"MENU",SIGNUP_TAB:"Sign Up",SIGNIN_TAB:"Sign In",SIGNOUT_TAB:"Signout",EDIT_PROFILE:"Edit Profile",MY_FORMS:"My Forms",MY_SETTINGS:"My Settings",CHANGE_PASSWORD:"Change Password"}),a.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("core").config(["$translateProvider",function(a){a.translations("fr",{MENU:"MENU",SIGNUP_TAB:"Créer un Compte",SIGNIN_TAB:"Connexion",SIGNOUT_TAB:"Créer un compte",EDIT_PROFILE:"Modifier Mon Profil",MY_FORMS:"Mes Formulaires",MY_SETTINGS:"Mes Paramètres",CHANGE_PASSWORD:"Changer mon Mot de Pass"})}]),angular.module("core").config(["$translateProvider",function(a){a.translations("es",{MENU:"MENU",SIGNUP_TAB:"Registrarse",SIGNIN_TAB:"Entrar",SIGNOUT_TAB:"Salir",EDIT_PROFILE:"Editar Perfil",MY_FORMS:"Mis formularios",MY_SETTINGS:"Mis configuraciones",CHANGE_PASSWORD:"Cambiar contraseña"})}]),angular.module("forms").controller("AdminFormController",["$rootScope","$window","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal","myForm","$filter",function(a,b,c,d,e,f,g,h,i,j,k){c.activePill=0,c.copied=!1,c.onCopySuccess=function(a){c.copied=!0},c=a,c.animationsEnabled=!0,c.myform=j,a.saveInProgress=!1,g.setForm(c.myform),console.log("$scope.myform"),console.log(c.myform),c.formURL="/#!/forms/"+c.myform._id,c.myform.isLive?b.subdomainsDisabled===!0?c.actualFormURL=window.location.protocol+"//"+window.location.host+"/view"+c.formURL:window.location.host.split(".").length<3?c.actualFormURL=window.location.protocol+"//"+c.myform.admin.username+"."+window.location.host+c.formURL:c.actualFormURL=window.location.protocol+"//"+c.myform.admin.username+"."+window.location.host.split(".").slice(1,3).join(".")+c.formURL:c.actualFormURL=window.location.protocol+"//"+window.location.host+c.formURL;var l=c.refreshFrame=function(){document.getElementById("iframe")&&document.getElementById("iframe").contentWindow.location.reload()};c.tabData=[{heading:k("translate")("CONFIGURE_TAB"),templateName:"configure"}],c.setForm=function(a){c.myform=a},a.resetForm=function(){c.myform=f.get({formId:d.formId})},c.openDeleteModal=function(){c.deleteModal=i.open({animation:c.animationsEnabled,templateUrl:"formDeleteModal.html",controller:"AdminFormController",resolve:{myForm:function(){return c.myform}}}),c.deleteModal.result.then(function(a){c.selected=a},function(){console.log("Modal dismissed at: "+new Date)})},c.cancelDeleteModal=function(){c.deleteModal&&c.deleteModal.dismiss("cancel")},c.removeCurrentForm=function(){if(c.deleteModal&&c.deleteModal.opened){c.deleteModal.close();var a=c.myform._id;if(!a)throw new Error("Error - removeCurrentForm(): $scope.myform._id does not exist");h["delete"]("/forms/"+a).then(function(a){console.log("form deleted successfully"),e.go("listForms",{},{reload:!0})},function(a){console.log("ERROR: Form could not be deleted."),console.error(a)})}},c.update=a.update=function(b,d,e,f,g){l();var i=!0;if(b||(i=!a.saveInProgress),i){var j=null;if(b||(a.saveInProgress=!0),e)c.updatePromise=h.put("/forms/"+c.myform._id,{changes:d}).then(function(b){f&&(a.myform=c.myform=b.data)})["catch"](function(a){console.log("Error occured during form UPDATE.\n"),j=a.data})["finally"](function(){if(b||(a.saveInProgress=!1),"function"==typeof g)return g(j)});else{var k=d;k.analytics&&k.analytics.visitors&&delete k.analytics.visitors,k.submissions&&delete k.submissions,c.updatePromise=h.put("/forms/"+c.myform._id,{form:k}).then(function(b){f&&(a.myform=c.myform=b.data)})["catch"](function(a){console.log("Error occured during form UPDATE.\n"),j=a.data})["finally"](function(){if(b||(a.saveInProgress=!1),"function"==typeof g)return g(j)})}}}}]),angular.module("forms").controller("ListFormsController",["$rootScope","$scope","$stateParams","$state","GetForms","CurrentForm","$http","$uibModal",function(a,b,c,d,e,f,g,h){b=a,b.forms={},b.showCreateModal=!1,a.languageRegExp={regExp:/[@!#$%^&*()\-+={}\[\]|\\/'";:`.,~№?<>]+/i,test:function(a){return!this.regExp.test(a)}},b.openDeleteModal=function(a){b.deleteModal=h.open({animation:b.animationsEnabled,templateUrl:"deleteModalListForms.html",controller:["$uibModalInstance","items","$scope",function(a,b,c){c.content=b,c.cancel=c.cancelDeleteModal,c.deleteForm=function(){c.$parent.removeForm(b.formIndex)}}],resolve:{items:function(){return{currFormTitle:b.myforms[a].title,formIndex:a}}}})},b.cancelDeleteModal=function(){b.deleteModal&&b.deleteModal.dismiss("cancel")},b.findAll=function(){e.query(function(a){b.myforms=a})},b.openCreateModal=function(){b.showCreateModal||(b.showCreateModal=!0)},b.closeCreateModal=function(){b.showCreateModal&&(b.showCreateModal=!1)},b.setForm=function(a){b.myform=a},b.goToWithId=function(a,b){d.go(a,{formId:b},{reload:!0})},b.duplicateForm=function(a){var c=_.cloneDeep(b.myforms[a]);delete c._id,g.post("/forms",{form:c}).success(function(c,d,e){b.myforms.splice(a+1,0,c)}).error(function(a){console.error(a),null===a&&(b.error=a.data.message)})},b.createNewForm=function(){var a={};a.title=b.forms.createForm.title.$modelValue,a.language=b.forms.createForm.language.$modelValue,b.forms.createForm.$valid&&b.forms.createForm.$dirty&&g.post("/forms",{form:a}).success(function(a,c,d){b.goToWithId("viewForm.create",a._id+"")}).error(function(a){console.error(a),b.error=a.data.message})},b.removeForm=function(a){if(a>=b.myforms.length||a<0)throw new Error("Error: form_index in removeForm() must be between 0 and "+b.myforms.length-1);g["delete"]("/forms/"+b.myforms[a]._id).success(function(c,d,e){b.myforms.splice(a,1),b.cancelDeleteModal()}).error(function(a){console.error(a)})}}]),angular.module("forms").directive("configureFormDirective",["$rootScope","$http","Upload","CurrentForm",function(a,b,c,d){return{templateUrl:"modules/forms/admin/views/directiveViews/form/configure-form.client.view.html", +restrict:"E",scope:{myform:"=",user:"=",pdfFields:"@",formFields:"@"},controller:["$scope",function(b){b.log="",b.languages=a.languages,b.resetForm=a.resetForm,b.update=a.update}]}}]),angular.module("forms").directive("editFormDirective",["$rootScope","FormFields","$uibModal",function(a,b,c){return{templateUrl:"modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",restrict:"E",transclude:!0,scope:{myform:"="},controller:["$scope",function(d){var e;d.sortableOptions={appendTo:".dropzone",forceHelperSize:!0,forcePlaceholderSize:!0,update:function(a,b){d.update(!1,d.myform,!1,!1,function(a){})}},d.openEditModal=function(a){d.editFieldModal=c.open({animation:!0,templateUrl:"editFieldModal.html",windowClass:"edit-modal-window",controller:["$uibModalInstance","$scope",function(b,c){c.field=a,c.showLogicJump=!1,c.showAddOptions=function(a){return"dropdown"===a.fieldType||"checkbox"===a.fieldType||"radio"===a.fieldType},c.validShapes=["Heart","Star","thumbs-up","thumbs-down","Circle","Square","Check Circle","Smile Outlined","Hourglass","bell","Paper Plane","Comment","Trash"],c.addOption=function(a){if("checkbox"===a.fieldType||"dropdown"===a.fieldType||"radio"===a.fieldType){a.fieldOptions||(a.fieldOptions=[]);var b=a.fieldOptions.length+1,c={option_id:Math.floor(1e5*Math.random()),option_title:"Option "+b,option_value:"Option "+b};a.fieldOptions.push(c)}},c.deleteOption=function(a,b){if("checkbox"===a.fieldType||"dropdown"===a.fieldType||"radio"===a.fieldType)for(var c=0;c',restrict:"E",scope:{typeName:"@"},controller:["$scope",function(a){var b={textfield:"fa fa-pencil-square-o",dropdown:"fa fa-th-list",date:"fa fa-calendar",checkbox:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",email:"fa fa-envelope-o",textarea:"fa fa-pencil-square",legal:"fa fa-legal",file:"fa fa-cloud-upload",rating:"fa fa-star-half-o",link:"fa fa-link",scale:"fa fa-sliders",stripe:"fa fa-credit-card",statement:"fa fa-quote-left",yes_no:"fa fa-toggle-on",number:"fa fa-slack"};a.typeIcon=b[a.typeName]}]}});var __indexOf=[].indexOf||function(a){for(var b=0,c=this.length;b=0&&(c=c+b+".html"),d.get(c)};return{template:"
{{field.title}}
",restrict:"E",scope:{field:"=",required:"&",design:"=",index:"=",forms:"="},link:function(a,d){c.chooseDefaultOption=a.chooseDefaultOption=function(b){"yes_no"===b?a.field.fieldValue="true":"rating"===b?a.field.fieldValue=0:"radio"===a.field.fieldType?(console.log(a.field),a.field.fieldValue=a.field.fieldOptions[0].option_value,console.log(a.field.fieldValue)):"legal"===b&&(a.field.fieldValue="true",c.nextField())},a.nextField=c.nextField,a.setActiveField=c.setActiveField,"date"===a.field.fieldType&&(a.dateOptions={changeYear:!0,changeMonth:!0,altFormat:"mm/dd/yyyy",yearRange:"1900:-0",defaultDate:0});var e=a.field.fieldType;if("number"===a.field.fieldType||"textfield"===a.field.fieldType||"email"===a.field.fieldType||"link"===a.field.fieldType){switch(a.field.fieldType){case"textfield":a.input_type="text";break;case"email":a.input_type="email",a.placeholder="joesmith@example.com";break;case"number":a.input_type="text",a.validateRegex=/^-?\d+$/;break;default:a.input_type="url",a.placeholder="http://example.com"}e="textfield"}var g=f(e);d.html(g).show();b(d.contents())(a)}}}]),angular.module("view-form").directive("onEnterKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode,e=!1;null!==d.onEnterKeyDisabled&&(e=d.onEnterKeyDisabled),13!==c||b.shiftKey||e||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterKey)}))})}}}]).directive("onTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabKey)}))})}}}]).directive("onEnterOrTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;13!==c&&9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterOrTabKey)}))})}}}]).directive("onTabAndShiftKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9===c&&b.shiftKey&&(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabAndShiftKey)}))})}}}]),angular.module("view-form").directive("onFinishRender",["$rootScope","$timeout",function(a,b){return{restrict:"A",link:function(b,c,d){if(c.attr("ng-repeat")||c.attr("data-ng-repeat")){var e=d.onFinishRender||"ngRepeat";b.$first&&!b.$last?b.$evalAsync(function(){a.$broadcast(e+" Started")}):b.$last&&b.$evalAsync(function(){a.$broadcast(e+" Finished")})}}}}]),jsep.addBinaryOp("contains",10),jsep.addBinaryOp("!contains",10),jsep.addBinaryOp("begins",10),jsep.addBinaryOp("!begins",10),jsep.addBinaryOp("ends",10),jsep.addBinaryOp("!ends",10),angular.module("view-form").directive("submitFormDirective",["$http","TimeCounter","$filter","$rootScope","SendVisitorData","$translate",function(a,b,c,d,e,f){return{templateUrl:"form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html",restrict:"E",scope:{myform:"=",ispreview:"="},controller:["$document","$window","$scope",function(f,g,h){h.noscroll=!1,h.forms={},h.ispreview&&b.restartClock();var i=h.myform.visible_form_fields.filter(function(a){return"statement"!==a.fieldType}).length,j=c("formValidity")(h.myform);h.translateAdvancementData={done:j,total:i,answers_not_completed:i-j},h.reloadForm=function(){h.myform.submitted=!1,h.myform.form_fields=_.chain(h.myform.visible_form_fields).map(function(a){return a.fieldValue="",a}).value(),h.loading=!1,h.error="",h.selected={_id:"",index:0},h.setActiveField(h.myform.visible_form_fields[0]._id,0,!1),b.restartClock()},g.onscroll=function(){h.scrollPos=document.body.scrollTop||document.documentElement.scrollTop||0;var a=document.getElementsByClassName("activeField")[0].getBoundingClientRect();h.fieldTop=a.top,h.fieldBottom=a.bottom;var b,c;h.noscroll||(h.selected.index===h.myform.visible_form_fields.length-1&&h.fieldBottom<200?(c=h.selected.index+1,b="submit_field",h.setActiveField(b,c,!1)):h.selected.index===h.myform.visible_form_fields.length?h.fieldTop>200&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):h.fieldBottom<0?(c=h.selected.index+1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):0!==h.selected.index&&h.fieldTop>0&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)),h.$apply())};var k=function(a){var b=a.logicJump;if(b.expressionString&&b.valueB&&a.fieldValue){var c,d,e=jsep(b.expressionString);if("field"===e.left.name?(c=a.fieldValue,d=b.valueB):(c=b.valueB,d=a.fieldValue),"number"===a.fieldType||"scale"===a.fieldType||"rating"===a.fieldType)switch(e.operator){case"==":return parseInt(c)===parseInt(d);case"!==":return parseInt(c)!==parseInt(d);case">":return parseInt(c)>parseInt(d);case">=":return parseInt(c)>parseInt(d);case"<":return parseInt(c)-1;case"!contains":return!(c.indexOf(d)>-1);case"begins":return c.startsWith(d);case"!begins":return!c.startsWith(d);case"ends":return c.endsWith(d);case"!ends":return c.endsWith(d);default:return!1}}},l=function(){if(null===h.selected)throw console.error("current active field is null"),new Error("current active field is null");return"submit_field"===h.selected._id?h.myform.form_fields.length-1:h.selected.index};h.setActiveField=d.setActiveField=function(a,d,g){if(null!==h.selected&&h.selected._id!==a){if(h.selected._id=a,h.selected.index=d,!d)for(var j=0;j-1)if(a.logicJump&&k(a))d.setActiveField(a.logicJump.jumpTo,null,!0);else{var b,c;h.selected.index0){var a=h.selected.index-1,b=h.myform.visible_form_fields[a]._id;h.setActiveField(b,a,!0)}},h.exitStartPage=function(){h.myform.startPage.showStart=!1,h.myform.visible_form_fields.length>0&&(h.selected._id=h.myform.visible_form_fields[0]._id)},d.goToInvalid=h.goToInvalid=function(){document.querySelectorAll(".ng-invalid.focusOn")[0].focus()};var m=function(){var a=new MobileDetect(window.navigator.userAgent),b="other";return a.tablet()?b="tablet":a.mobile()?b="mobile":a.is("bot")||(b="desktop"),{type:b,name:window.navigator.platform}},n=function(){$.ajaxSetup({async:!1});var a=$.getJSON("https://freegeoip.net/json/").responseJSON;return $.ajaxSetup({async:!0}),a&&a.ip||(a={ip:"Adblocker"}),{ipAddr:a.ip,geoLocation:{City:a.city,Country:a.country_name}}};d.submitForm=h.submitForm=function(){var d=b.stopClock();h.loading=!0;var f=_.cloneDeep(h.myform),g=m();f.device=g;var i=n();f.ipAddr=i.ipAddr,f.geoLocation=i.geoLocation,f.timeElapsed=d,f.percentageComplete=c("formValidity")(h.myform)/h.myform.visible_form_fields.length*100,delete f.visible_form_fields;for(var j=0;j

{{pageData.introTitle}}

{{pageData.introParagraph}}

"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/date.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/dropdown.html", - "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); + "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/hidden.html", - ""); + ""); $templateCache.put("form_modules/forms/base/views/directiveViews/field/legal.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}


{{field.description}}


"); + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}


{{field.description}}


"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/radio.html", - "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); + "
0\">

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/rating.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}

"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/statement.html", "

{{field.title}}

{{field.description}}

{{field.description}}


"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/textarea.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{ 'NEWLINE' | translate }}

{{field.description}}

Press SHIFT+ENTER to add a newline
{{ 'ENTER' | translate }}
"); + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{ 'NEWLINE' | translate }}

{{field.description}}

Press SHIFT+ENTER to add a newline
{{ 'ENTER' | translate }}
"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/textfield.html", - "

{{index+1}} {{field.title}} ({{ 'OPTIONAL' | translate }})

{{field.description}}

{{ 'ENTER' | translate }}
"); + "

{{index+1}} {{field.title}} ({{ 'OPTIONAL' | translate }})

{{field.description}}

{{ 'ENTER' | translate }}
"); $templateCache.put("form_modules/forms/base/views/directiveViews/field/yes_no.html", - "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); + "

{{index+1}} {{field.title}} {{ 'OPTIONAL' | translate }}

{{field.description}}


"); $templateCache.put("form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html", - "
{{ 'COMPLETING_NEEDED' | translate:translateAdvancementData }}
{{ 'ENTER' | translate }}

{{ 'ADVANCEMENT' | translate:translateAdvancementData }}

"); + "
{{ 'COMPLETING_NEEDED' | translate:translateAdvancementData }}
{{ 'ENTER' | translate }}

{{ 'ADVANCEMENT' | translate:translateAdvancementData }}

"); }]); 'use strict'; @@ -109,188 +109,6 @@ ApplicationConfiguration.registerModule('view-form', [ 'use strict'; -angular.module('view-form').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('english', { - FORM_SUCCESS: 'Form entry successfully submitted!', - REVIEW: 'Review', - BACK_TO_FORM: 'Go back to Form', - EDIT_FORM: 'Edit this TellForm', - CREATE_FORM: 'Create this TellForm', - ADVANCEMENT: '{{done}} out of {{total}} answered', - CONTINUE_FORM: 'Continue to Form', - REQUIRED: 'required', - COMPLETING_NEEDED: '{{answers_not_completed}} answer(s) need completing', - OPTIONAL: 'optional', - ERROR_EMAIL_INVALID: 'Please enter a valid email address', - ERROR_NOT_A_NUMBER: 'Please enter valid numbers only', - ERROR_URL_INVALID: 'Please a valid url', - OK: 'OK', - ENTER: 'press ENTER', - YES: 'Yes', - NO: 'No', - NEWLINE: 'press SHIFT+ENTER to create a newline', - CONTINUE: 'Continue', - LEGAL_ACCEPT: 'I accept', - LEGAL_NO_ACCEPT: 'I don’t accept', - DELETE: 'Delete', - CANCEL: 'Cancel', - SUBMIT: 'Submit', - UPLOAD_FILE: 'Upload your File', - }); - - $translateProvider.preferredLanguage('english') - .fallbackLanguage('english') - .useSanitizeValueStrategy('escape'); - -}]); - -'use strict'; - -angular.module('view-form').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('french', { - FORM_SUCCESS: 'Votre formulaire a été enregistré!', - REVIEW: 'Incomplet', - BACK_TO_FORM: 'Retourner au formulaire', - EDIT_FORM: 'Éditer le Tellform', - CREATE_FORM: 'Créer un TellForm', - ADVANCEMENT: '{{done}} complétés sur {{total}}', - CONTINUE_FORM: 'Aller au formulaire', - REQUIRED: 'obligatoire', - COMPLETING_NEEDED: '{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)', - OPTIONAL: 'facultatif', - ERROR_EMAIL_INVALID: 'Merci de rentrer une adresse mail valide', - ERROR_NOT_A_NUMBER: 'Merce de ne rentrer que des nombres', - ERROR_URL_INVALID: 'Merci de rentrer une url valide', - OK: 'OK', - ENTER: 'presser ENTRÉE', - YES: 'Oui', - NO: 'Non', - NEWLINE: 'presser SHIFT+ENTER pour créer une nouvelle ligne', - CONTINUE: 'Continuer', - LEGAL_ACCEPT: 'J’accepte', - LEGAL_NO_ACCEPT: 'Je n’accepte pas', - DELETE: 'Supprimer', - CANCEL: 'Réinitialiser', - SUBMIT: 'Enregistrer', - UPLOAD_FILE: 'Envoyer un fichier', - Y: 'O', - N: 'N', - }); - -}]); - -'use strict'; - -angular.module('view-form').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('german', { - FORM_SUCCESS: 'Ihre Angaben wurden gespeichert.', - REVIEW: 'Unvollständig', - BACK_TO_FORM: 'Zurück zum Formular', - EDIT_FORM: '', - CREATE_FORM: '', - ADVANCEMENT: '{{done}} von {{total}} beantwortet', - CONTINUE_FORM: 'Zum Formular', - REQUIRED: 'verpflichtend', - COMPLETING_NEEDED: 'Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)', - OPTIONAL: 'fakultativ', - ERROR_EMAIL_INVALID: 'Bitte gültige Mailadresse eingeben', - ERROR_NOT_A_NUMBER: 'Bitte nur Zahlen eingeben', - ERROR_URL_INVALID: 'Bitte eine gültige URL eingeben', - OK: 'Okay', - ENTER: 'Eingabetaste drücken', - YES: 'Ja', - NO: 'Nein', - NEWLINE: 'Für eine neue Zeile SHIFT+ENTER drücken', - CONTINUE: 'Weiter', - LEGAL_ACCEPT: 'I accept', - LEGAL_NO_ACCEPT: 'I don’t accept', - DELETE: 'Entfernen', - CANCEL: 'Canceln', - SUBMIT: 'Speichern', - UPLOAD_FILE: 'Datei versenden', - Y: 'J', - N: 'N', - }); - -}]); - -'use strict'; - -angular.module('view-form').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('italian', { - FORM_SUCCESS: 'Il formulario è stato inviato con successo!', - REVIEW: 'Incompleto', - BACK_TO_FORM: 'Ritorna al formulario', - EDIT_FORM: '', - CREATE_FORM: '', - ADVANCEMENT: '{{done}} su {{total}} completate', - CONTINUE_FORM: 'Vai al formulario', - REQUIRED: 'obbligatorio', - COMPLETING_NEEDED: '{{answers_not_completed}} risposta/e deve/ono essere completata/e', - OPTIONAL: 'opzionale', - ERROR_EMAIL_INVALID: 'Si prega di inserire un indirizzo email valido', - ERROR_NOT_A_NUMBER: 'Si prega di inserire solo numeri', - ERROR_URL_INVALID: 'Grazie per inserire un URL valido', - OK: 'OK', - ENTER: 'premere INVIO', - YES: 'Sì', - NO: 'No', - NEWLINE: 'premere SHIFT+INVIO per creare una nuova linea', - CONTINUE: 'Continua', - LEGAL_ACCEPT: 'I accept', - LEGAL_NO_ACCEPT: 'I don’t accept', - DELETE: 'Cancella', - CANCEL: 'Reset', - SUBMIT: 'Registra', - UPLOAD_FILE: 'Invia un file', - Y: 'S', - N: 'N', - }); - -}]); - -'use strict'; - -angular.module('view-form').config(['$translateProvider', function ($translateProvider) { - - $translateProvider.translations('spanish', { - FORM_SUCCESS: '¡El formulario ha sido enviado con éxito!', - REVIEW: 'Revisar', - BACK_TO_FORM: 'Regresar al formulario', - EDIT_FORM: '', - CREATE_FORM: '', - ADVANCEMENT: '{{done}} de {{total}} contestadas', - CONTINUE_FORM: 'Continuar al formulario', - REQUIRED: 'Información requerida', - COMPLETING_NEEDED: '{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)', - OPTIONAL: 'Opcional', - ERROR_EMAIL_INVALID: 'Favor de proporcionar un correo electrónico válido', - ERROR_NOT_A_NUMBER: 'Por favor, introduzca sólo números válidos', - ERROR_URL_INVALID: 'Favor de proporcionar un url válido', - OK: 'OK', - ENTER: 'pulse INTRO', - YES: 'Si', - NO: 'No', - NEWLINE: 'presione SHIFT+INTRO para crear una nueva línea', - CONTINUE: 'Continuar', - LEGAL_ACCEPT: 'Yo acepto', - LEGAL_NO_ACCEPT: 'Yo no acepto', - DELETE: 'Eliminar', - CANCEL: 'Cancelar', - SUBMIT: 'Registrar', - UPLOAD_FILE: 'Cargar el archivo', - Y: 'S', - N: 'N' - }); - -}]); - -'use strict'; - // Setting up route angular.module('view-form').config(['$stateProvider', function($stateProvider) { @@ -577,7 +395,7 @@ var __indexOf = [].indexOf || function(item) { angular.module('view-form').directive('fieldDirective', ['$http', '$compile', '$rootScope', '$templateCache', 'supportedFields', function($http, $compile, $rootScope, $templateCache, supportedFields) { - var getTemplateUrl = function(fieldType) { + var getTemplateHtml = function(fieldType) { var type = fieldType; var supported_fields = [ @@ -667,7 +485,7 @@ angular.module('view-form').directive('fieldDirective', ['$http', '$compile', '$ fieldType = 'textfield'; } - var template = getTemplateUrl(fieldType); + var template = getTemplateHtml(fieldType); element.html(template).show(); var output = $compile(element.contents())(scope); } @@ -790,32 +608,34 @@ jsep.addBinaryOp('!begins', 10); jsep.addBinaryOp('ends', 10); jsep.addBinaryOp('!ends', 10); -angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCounter', '$filter', '$rootScope', 'SendVisitorData', - function ($http, TimeCounter, $filter, $rootScope, SendVisitorData) { +angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCounter', '$filter', '$rootScope', 'SendVisitorData', '$translate', + function ($http, TimeCounter, $filter, $rootScope, SendVisitorData, $translate) { return { templateUrl: 'form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html', restrict: 'E', scope: { - myform:'=' + myform:'=', + ispreview: '=' }, controller: ["$document", "$window", "$scope", function($document, $window, $scope){ $scope.noscroll = false; $scope.forms = {}; - TimeCounter.restartClock(); + + //Don't start timer if we are looking at a design preview + if($scope.ispreview){ + TimeCounter.restartClock(); + } - var form_fields_count = $scope.myform.visible_form_fields.filter(function(field){ - if(field.fieldType === 'statement'){ - return false; - } - return true; - }).length; + var form_fields_count = $scope.myform.visible_form_fields.filter(function(field){ + return field.fieldType !== 'statement'; + }).length; - var nb_valid = $filter('formValidity')($scope.myform); - $scope.translateAdvancementData = { - done: nb_valid, - total: form_fields_count, - answers_not_completed: form_fields_count - nb_valid - }; + var nb_valid = $filter('formValidity')($scope.myform); + $scope.translateAdvancementData = { + done: nb_valid, + total: form_fields_count, + answers_not_completed: form_fields_count - nb_valid + }; $scope.reloadForm = function(){ //Reset Form @@ -1005,7 +825,7 @@ angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCoun if (document.querySelectorAll('.activeField .focusOn')[0]) { //FIXME: DAVID: Figure out how to set focus without scroll movement in HTML Dom document.querySelectorAll('.activeField .focusOn')[0].focus(); - } else { + } else if (document.querySelectorAll('.activeField input')[0]){ document.querySelectorAll('.activeField input')[0].focus(); } }); @@ -1111,7 +931,6 @@ angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCoun var geoData = getIpAndGeo(); form.ipAddr = geoData.ipAddr; form.geoLocation = geoData.geoLocation; - console.log(geoData); form.timeElapsed = _timeElapsed; form.percentageComplete = $filter('formValidity')($scope.myform) / $scope.myform.visible_form_fields.length * 100; @@ -1139,7 +958,7 @@ angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCoun }; //Reload our form - $scope.reloadForm(); + $scope.reloadForm(); }] }; } @@ -1299,3 +1118,185 @@ angular.module('view-form').service('TimeCounter', [ } ]); + +'use strict'; + +angular.module('view-form').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('english', { + FORM_SUCCESS: 'Form entry successfully submitted!', + REVIEW: 'Review', + BACK_TO_FORM: 'Go back to Form', + EDIT_FORM: 'Edit this TellForm', + CREATE_FORM: 'Create this TellForm', + ADVANCEMENT: '{{done}} out of {{total}} answered', + CONTINUE_FORM: 'Continue to Form', + REQUIRED: 'required', + COMPLETING_NEEDED: '{{answers_not_completed}} answer(s) need completing', + OPTIONAL: 'optional', + ERROR_EMAIL_INVALID: 'Please enter a valid email address', + ERROR_NOT_A_NUMBER: 'Please enter valid numbers only', + ERROR_URL_INVALID: 'Please a valid url', + OK: 'OK', + ENTER: 'press ENTER', + YES: 'Yes', + NO: 'No', + NEWLINE: 'press SHIFT+ENTER to create a newline', + CONTINUE: 'Continue', + LEGAL_ACCEPT: 'I accept', + LEGAL_NO_ACCEPT: 'I don’t accept', + DELETE: 'Delete', + CANCEL: 'Cancel', + SUBMIT: 'Submit', + UPLOAD_FILE: 'Upload your File', + }); + + $translateProvider.preferredLanguage('english') + .fallbackLanguage('english') + .useSanitizeValueStrategy('escape'); + +}]); + +'use strict'; + +angular.module('view-form').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('french', { + FORM_SUCCESS: 'Votre formulaire a été enregistré!', + REVIEW: 'Incomplet', + BACK_TO_FORM: 'Retourner au formulaire', + EDIT_FORM: 'Éditer le Tellform', + CREATE_FORM: 'Créer un TellForm', + ADVANCEMENT: '{{done}} complétés sur {{total}}', + CONTINUE_FORM: 'Aller au formulaire', + REQUIRED: 'obligatoire', + COMPLETING_NEEDED: '{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)', + OPTIONAL: 'facultatif', + ERROR_EMAIL_INVALID: 'Merci de rentrer une adresse mail valide', + ERROR_NOT_A_NUMBER: 'Merce de ne rentrer que des nombres', + ERROR_URL_INVALID: 'Merci de rentrer une url valide', + OK: 'OK', + ENTER: 'presser ENTRÉE', + YES: 'Oui', + NO: 'Non', + NEWLINE: 'presser SHIFT+ENTER pour créer une nouvelle ligne', + CONTINUE: 'Continuer', + LEGAL_ACCEPT: 'J’accepte', + LEGAL_NO_ACCEPT: 'Je n’accepte pas', + DELETE: 'Supprimer', + CANCEL: 'Réinitialiser', + SUBMIT: 'Enregistrer', + UPLOAD_FILE: 'Envoyer un fichier', + Y: 'O', + N: 'N', + }); + +}]); + +'use strict'; + +angular.module('view-form').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('german', { + FORM_SUCCESS: 'Ihre Angaben wurden gespeichert.', + REVIEW: 'Unvollständig', + BACK_TO_FORM: 'Zurück zum Formular', + EDIT_FORM: '', + CREATE_FORM: '', + ADVANCEMENT: '{{done}} von {{total}} beantwortet', + CONTINUE_FORM: 'Zum Formular', + REQUIRED: 'verpflichtend', + COMPLETING_NEEDED: 'Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)', + OPTIONAL: 'fakultativ', + ERROR_EMAIL_INVALID: 'Bitte gültige Mailadresse eingeben', + ERROR_NOT_A_NUMBER: 'Bitte nur Zahlen eingeben', + ERROR_URL_INVALID: 'Bitte eine gültige URL eingeben', + OK: 'Okay', + ENTER: 'Eingabetaste drücken', + YES: 'Ja', + NO: 'Nein', + NEWLINE: 'Für eine neue Zeile SHIFT+ENTER drücken', + CONTINUE: 'Weiter', + LEGAL_ACCEPT: 'I accept', + LEGAL_NO_ACCEPT: 'I don’t accept', + DELETE: 'Entfernen', + CANCEL: 'Canceln', + SUBMIT: 'Speichern', + UPLOAD_FILE: 'Datei versenden', + Y: 'J', + N: 'N', + }); + +}]); + +'use strict'; + +angular.module('view-form').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('italian', { + FORM_SUCCESS: 'Il formulario è stato inviato con successo!', + REVIEW: 'Incompleto', + BACK_TO_FORM: 'Ritorna al formulario', + EDIT_FORM: '', + CREATE_FORM: '', + ADVANCEMENT: '{{done}} su {{total}} completate', + CONTINUE_FORM: 'Vai al formulario', + REQUIRED: 'obbligatorio', + COMPLETING_NEEDED: '{{answers_not_completed}} risposta/e deve/ono essere completata/e', + OPTIONAL: 'opzionale', + ERROR_EMAIL_INVALID: 'Si prega di inserire un indirizzo email valido', + ERROR_NOT_A_NUMBER: 'Si prega di inserire solo numeri', + ERROR_URL_INVALID: 'Grazie per inserire un URL valido', + OK: 'OK', + ENTER: 'premere INVIO', + YES: 'Sì', + NO: 'No', + NEWLINE: 'premere SHIFT+INVIO per creare una nuova linea', + CONTINUE: 'Continua', + LEGAL_ACCEPT: 'I accept', + LEGAL_NO_ACCEPT: 'I don’t accept', + DELETE: 'Cancella', + CANCEL: 'Reset', + SUBMIT: 'Registra', + UPLOAD_FILE: 'Invia un file', + Y: 'S', + N: 'N', + }); + +}]); + +'use strict'; + +angular.module('view-form').config(['$translateProvider', function ($translateProvider) { + + $translateProvider.translations('spanish', { + FORM_SUCCESS: '¡El formulario ha sido enviado con éxito!', + REVIEW: 'Revisar', + BACK_TO_FORM: 'Regresar al formulario', + EDIT_FORM: '', + CREATE_FORM: '', + ADVANCEMENT: '{{done}} de {{total}} contestadas', + CONTINUE_FORM: 'Continuar al formulario', + REQUIRED: 'Información requerida', + COMPLETING_NEEDED: '{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)', + OPTIONAL: 'Opcional', + ERROR_EMAIL_INVALID: 'Favor de proporcionar un correo electrónico válido', + ERROR_NOT_A_NUMBER: 'Por favor, introduzca sólo números válidos', + ERROR_URL_INVALID: 'Favor de proporcionar un url válido', + OK: 'OK', + ENTER: 'pulse INTRO', + YES: 'Si', + NO: 'No', + NEWLINE: 'presione SHIFT+INTRO para crear una nueva línea', + CONTINUE: 'Continuar', + LEGAL_ACCEPT: 'Yo acepto', + LEGAL_NO_ACCEPT: 'Yo no acepto', + DELETE: 'Eliminar', + CANCEL: 'Cancelar', + SUBMIT: 'Registrar', + UPLOAD_FILE: 'Cargar el archivo', + Y: 'S', + N: 'N' + }); + +}]); diff --git a/public/dist/form-application.min.js b/public/dist/form-application.min.js index 723c05d4..fab26961 100644 --- a/public/dist/form-application.min.js +++ b/public/dist/form-application.min.js @@ -1,2 +1,2 @@ -"use strict";var ApplicationConfiguration=function(){var a="TellForm-Form",b=["duScroll","ui.select","ngSanitize","vButton","ngResource","TellForm-Form.form_templates","ui.router","ui.bootstrap","pascalprecht.translate"],c=function(b,c){angular.module(b,c||[]),angular.module(a).requires.push(b)};return{applicationModuleName:a,applicationModuleVendorDependencies:b,registerModule:c}}();angular.module(ApplicationConfiguration.applicationModuleName,ApplicationConfiguration.applicationModuleVendorDependencies),angular.module(ApplicationConfiguration.applicationModuleName).config(["$locationProvider",function(a){a.hashPrefix("!")}]),angular.module(ApplicationConfiguration.applicationModuleName).constant("APP_PERMISSIONS",{viewAdminSettings:"viewAdminSettings",editAdminSettings:"editAdminSettings",editForm:"editForm",viewPrivateForm:"viewPrivateForm"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("USER_ROLES",{admin:"admin",normal:"user",superuser:"superuser"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("FORM_URL","/forms/:formId"),angular.element(document).ready(function(){"#_=_"===window.location.hash&&(window.location.hash="#!"),angular.bootstrap(document,[ApplicationConfiguration.applicationModuleName])}),angular.module("TellForm-Form.form_templates",[]).run(["$templateCache",function(a){a.put("form_modules/forms/base/views/form-unauthorized.client.view.html",'

Not Authorized to Access Form

The form you are trying to access is currently private and not accesible publically.
If you are the owner of the form, you can set it to "Public" in the "Configuration" panel in the form admin.
'),a.put("form_modules/forms/base/views/submit-form.client.view.html","
"),a.put("form_modules/forms/base/views/directiveViews/entryPage/startPage.html",'

{{pageData.introTitle}}

{{pageData.introParagraph}}

'),a.put("form_modules/forms/base/views/directiveViews/field/date.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("form_modules/forms/base/views/directiveViews/field/dropdown.html",'
'),a.put("form_modules/forms/base/views/directiveViews/field/hidden.html",''),a.put("form_modules/forms/base/views/directiveViews/field/legal.html",'
'),a.put("form_modules/forms/base/views/directiveViews/field/radio.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/field/rating.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("form_modules/forms/base/views/directiveViews/field/statement.html",'

{{field.title}}

{{field.description}}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/field/textarea.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{ \'NEWLINE\' | translate }}

{{field.description}}

Press SHIFT+ENTER to add a newline
'),a.put("form_modules/forms/base/views/directiveViews/field/textfield.html",'

{{index+1}} {{field.title}} ({{ \'OPTIONAL\' | translate }})

{{field.description}}

'),a.put("form_modules/forms/base/views/directiveViews/field/yes_no.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html",'
{{ \'COMPLETING_NEEDED\' | translate:translateAdvancementData }}
')}]),ApplicationConfiguration.registerModule("view-form",["ngFileUpload","ui.date","angular-input-stars"]),angular.module("view-form").config(["$translateProvider",function(a){a.translations("english",{FORM_SUCCESS:"Form entry successfully submitted!",REVIEW:"Review",BACK_TO_FORM:"Go back to Form",EDIT_FORM:"Edit this TellForm",CREATE_FORM:"Create this TellForm",ADVANCEMENT:"{{done}} out of {{total}} answered",CONTINUE_FORM:"Continue to Form",REQUIRED:"required",COMPLETING_NEEDED:"{{answers_not_completed}} answer(s) need completing",OPTIONAL:"optional",ERROR_EMAIL_INVALID:"Please enter a valid email address",ERROR_NOT_A_NUMBER:"Please enter valid numbers only",ERROR_URL_INVALID:"Please a valid url",OK:"OK",ENTER:"press ENTER",YES:"Yes",NO:"No",NEWLINE:"press SHIFT+ENTER to create a newline",CONTINUE:"Continue",LEGAL_ACCEPT:"I accept",LEGAL_NO_ACCEPT:"I don’t accept",DELETE:"Delete",CANCEL:"Cancel",SUBMIT:"Submit",UPLOAD_FILE:"Upload your File"}),a.preferredLanguage("english").fallbackLanguage("english").useSanitizeValueStrategy("escape")}]),angular.module("view-form").config(["$translateProvider",function(a){a.translations("french",{FORM_SUCCESS:"Votre formulaire a été enregistré!",REVIEW:"Incomplet",BACK_TO_FORM:"Retourner au formulaire",EDIT_FORM:"Éditer le Tellform",CREATE_FORM:"Créer un TellForm",ADVANCEMENT:"{{done}} complétés sur {{total}}",CONTINUE_FORM:"Aller au formulaire",REQUIRED:"obligatoire",COMPLETING_NEEDED:"{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)",OPTIONAL:"facultatif",ERROR_EMAIL_INVALID:"Merci de rentrer une adresse mail valide",ERROR_NOT_A_NUMBER:"Merce de ne rentrer que des nombres",ERROR_URL_INVALID:"Merci de rentrer une url valide",OK:"OK",ENTER:"presser ENTRÉE",YES:"Oui",NO:"Non",NEWLINE:"presser SHIFT+ENTER pour créer une nouvelle ligne",CONTINUE:"Continuer",LEGAL_ACCEPT:"J’accepte",LEGAL_NO_ACCEPT:"Je n’accepte pas",DELETE:"Supprimer",CANCEL:"Réinitialiser",SUBMIT:"Enregistrer",UPLOAD_FILE:"Envoyer un fichier",Y:"O",N:"N"})}]),angular.module("view-form").config(["$translateProvider",function(a){a.translations("german",{FORM_SUCCESS:"Ihre Angaben wurden gespeichert.",REVIEW:"Unvollständig",BACK_TO_FORM:"Zurück zum Formular",EDIT_FORM:"",CREATE_FORM:"",ADVANCEMENT:"{{done}} von {{total}} beantwortet",CONTINUE_FORM:"Zum Formular",REQUIRED:"verpflichtend",COMPLETING_NEEDED:"Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)",OPTIONAL:"fakultativ",ERROR_EMAIL_INVALID:"Bitte gültige Mailadresse eingeben",ERROR_NOT_A_NUMBER:"Bitte nur Zahlen eingeben",ERROR_URL_INVALID:"Bitte eine gültige URL eingeben",OK:"Okay",ENTER:"Eingabetaste drücken",YES:"Ja",NO:"Nein",NEWLINE:"Für eine neue Zeile SHIFT+ENTER drücken",CONTINUE:"Weiter",LEGAL_ACCEPT:"I accept",LEGAL_NO_ACCEPT:"I don’t accept",DELETE:"Entfernen",CANCEL:"Canceln",SUBMIT:"Speichern",UPLOAD_FILE:"Datei versenden",Y:"J",N:"N"})}]),angular.module("view-form").config(["$translateProvider",function(a){a.translations("italian",{FORM_SUCCESS:"Il formulario è stato inviato con successo!",REVIEW:"Incompleto",BACK_TO_FORM:"Ritorna al formulario",EDIT_FORM:"",CREATE_FORM:"",ADVANCEMENT:"{{done}} su {{total}} completate",CONTINUE_FORM:"Vai al formulario",REQUIRED:"obbligatorio",COMPLETING_NEEDED:"{{answers_not_completed}} risposta/e deve/ono essere completata/e",OPTIONAL:"opzionale",ERROR_EMAIL_INVALID:"Si prega di inserire un indirizzo email valido",ERROR_NOT_A_NUMBER:"Si prega di inserire solo numeri",ERROR_URL_INVALID:"Grazie per inserire un URL valido",OK:"OK",ENTER:"premere INVIO",YES:"Sì",NO:"No",NEWLINE:"premere SHIFT+INVIO per creare una nuova linea",CONTINUE:"Continua",LEGAL_ACCEPT:"I accept",LEGAL_NO_ACCEPT:"I don’t accept",DELETE:"Cancella",CANCEL:"Reset",SUBMIT:"Registra",UPLOAD_FILE:"Invia un file",Y:"S",N:"N"})}]),angular.module("view-form").config(["$translateProvider",function(a){a.translations("spanish",{FORM_SUCCESS:"¡El formulario ha sido enviado con éxito!",REVIEW:"Revisar",BACK_TO_FORM:"Regresar al formulario",EDIT_FORM:"",CREATE_FORM:"",ADVANCEMENT:"{{done}} de {{total}} contestadas",CONTINUE_FORM:"Continuar al formulario",REQUIRED:"Información requerida",COMPLETING_NEEDED:"{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)",OPTIONAL:"Opcional",ERROR_EMAIL_INVALID:"Favor de proporcionar un correo electrónico válido",ERROR_NOT_A_NUMBER:"Por favor, introduzca sólo números válidos",ERROR_URL_INVALID:"Favor de proporcionar un url válido",OK:"OK",ENTER:"pulse INTRO",YES:"Si",NO:"No",NEWLINE:"presione SHIFT+INTRO para crear una nueva línea",CONTINUE:"Continuar",LEGAL_ACCEPT:"Yo acepto",LEGAL_NO_ACCEPT:"Yo no acepto",DELETE:"Eliminar",CANCEL:"Cancelar",SUBMIT:"Registrar",UPLOAD_FILE:"Cargar el archivo",Y:"S",N:"N"})}]),angular.module("view-form").config(["$stateProvider",function(a){a.state("submitForm",{url:"/forms/:formId",templateUrl:"/static/form_modules/forms/base/views/submit-form.client.view.html",resolve:{Forms:"Forms",myForm:["Forms","$q","$state","$stateParams",function(a,b,c,d){var e=b.defer();return console.log(a.get({formId:d.formId}).$promise),a.get({formId:d.formId}).$promise.then(function(a){return console.log(a),a},function(a){return console.log(a),c.go("unauthorizedFormAccess"),e.reject({redirectTo:"unauthorizedFormAccess"})})}]},controller:"SubmitFormController",controllerAs:"ctrl"}).state("unauthorizedFormAccess",{url:"/forms/unauthorized",templateUrl:"/static/form_modules/forms/base/views/form-unauthorized.client.view.html"})}]),function(){function a(a,b){function c(b,c,d){var e=window.navigator.userLanguage||window.navigator.language;e=e.slice(0,2);var f=navigator.userAgent,g=new MobileDetect(f),h="other";g.tablet()?h="tablet":g.mobile()?h="mobile":g.is("bot")||(h="desktop"),$.ajaxSetup({async:!1});var i=$.getJSON("https://freegeoip.net/json/").responseJSON;$.ajaxSetup({async:!0}),i||(i={ip:"",city:"",country_name:""});var j={referrer:document.referrer,isSubmitted:b.submitted,formId:b._id,lastActiveField:b.form_fields[c]._id,timeElapsed:d,language:e,deviceType:h,ipAddr:i.ip,geoLocation:{city:i.city,country:i.country_name}};a.emit("form-visitor-data",j)}function d(){a.socket||a.connect()}var e={send:c};return d(),e}angular.module("view-form").factory("SendVisitorData",a),a.$inject=["Socket","$state"]}(),angular.module("view-form").directive("keyToOption",function(){return{restrict:"A",scope:{field:"="},link:function(a,b,c,d){b.bind("keydown keypress",function(b){var c=b.which||b.keyCode,d=parseInt(String.fromCharCode(c))-1;d',restrict:"E",scope:{typeName:"@"},controller:["$scope",function(a){var b={textfield:"fa fa-pencil-square-o",dropdown:"fa fa-th-list",date:"fa fa-calendar",checkbox:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",email:"fa fa-envelope-o",textarea:"fa fa-pencil-square",legal:"fa fa-legal",file:"fa fa-cloud-upload",rating:"fa fa-star-half-o",link:"fa fa-link",scale:"fa fa-sliders",stripe:"fa fa-credit-card", -statement:"fa fa-quote-left",yes_no:"fa fa-toggle-on",number:"fa fa-slack"};a.typeIcon=b[a.typeName]}]}});var __indexOf=[].indexOf||function(a){for(var b=0,c=this.length;b=0&&(c=c+b+".html"),d.get(c)};return{template:"
{{field.title}}
",restrict:"E",scope:{field:"=",required:"&",design:"=",index:"=",forms:"="},link:function(a,d){c.chooseDefaultOption=a.chooseDefaultOption=function(b){"yes_no"===b?a.field.fieldValue="true":"rating"===b?a.field.fieldValue=0:"radio"===a.field.fieldType?(console.log(a.field),a.field.fieldValue=a.field.fieldOptions[0].option_value,console.log(a.field.fieldValue)):"legal"===b&&(a.field.fieldValue="true",c.nextField())},a.nextField=c.nextField,a.setActiveField=c.setActiveField,"date"===a.field.fieldType&&(a.dateOptions={changeYear:!0,changeMonth:!0,altFormat:"mm/dd/yyyy",yearRange:"1900:-0",defaultDate:0});var e=a.field.fieldType;if("number"===a.field.fieldType||"textfield"===a.field.fieldType||"email"===a.field.fieldType||"link"===a.field.fieldType){switch(a.field.fieldType){case"textfield":a.input_type="text";break;case"email":a.input_type="email",a.placeholder="joesmith@example.com";break;case"number":a.input_type="text",a.validateRegex=/^-?\d+$/;break;default:a.input_type="url",a.placeholder="http://example.com"}e="textfield"}var g=f(e);d.html(g).show();b(d.contents())(a)}}}]),angular.module("view-form").directive("onEnterKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode,e=!1;null!==d.onEnterKeyDisabled&&(e=d.onEnterKeyDisabled),13!==c||b.shiftKey||e||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterKey)}))})}}}]).directive("onTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabKey)}))})}}}]).directive("onEnterOrTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;13!==c&&9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterOrTabKey)}))})}}}]).directive("onTabAndShiftKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9===c&&b.shiftKey&&(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabAndShiftKey)}))})}}}]),angular.module("view-form").directive("onFinishRender",["$rootScope","$timeout",function(a,b){return{restrict:"A",link:function(b,c,d){if(c.attr("ng-repeat")||c.attr("data-ng-repeat")){var e=d.onFinishRender||"ngRepeat";b.$first&&!b.$last?b.$evalAsync(function(){a.$broadcast(e+" Started")}):b.$last&&b.$evalAsync(function(){a.$broadcast(e+" Finished")})}}}}]),jsep.addBinaryOp("contains",10),jsep.addBinaryOp("!contains",10),jsep.addBinaryOp("begins",10),jsep.addBinaryOp("!begins",10),jsep.addBinaryOp("ends",10),jsep.addBinaryOp("!ends",10),angular.module("view-form").directive("submitFormDirective",["$http","TimeCounter","$filter","$rootScope","SendVisitorData",function(a,b,c,d,e){return{templateUrl:"form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html",restrict:"E",scope:{myform:"="},controller:["$document","$window","$scope",function(f,g,h){h.noscroll=!1,h.forms={},b.restartClock();var i=h.myform.visible_form_fields.filter(function(a){return"statement"!==a.fieldType}).length,j=c("formValidity")(h.myform);h.translateAdvancementData={done:j,total:i,answers_not_completed:i-j},h.reloadForm=function(){h.myform.submitted=!1,h.myform.form_fields=_.chain(h.myform.visible_form_fields).map(function(a){return a.fieldValue="",a}).value(),h.loading=!1,h.error="",h.selected={_id:"",index:0},h.setActiveField(h.myform.visible_form_fields[0]._id,0,!1),b.restartClock()},g.onscroll=function(){h.scrollPos=document.body.scrollTop||document.documentElement.scrollTop||0;var a=document.getElementsByClassName("activeField")[0].getBoundingClientRect();h.fieldTop=a.top,h.fieldBottom=a.bottom;var b,c;h.noscroll||(h.selected.index===h.myform.visible_form_fields.length-1&&h.fieldBottom<200?(c=h.selected.index+1,b="submit_field",h.setActiveField(b,c,!1)):h.selected.index===h.myform.visible_form_fields.length?h.fieldTop>200&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):h.fieldBottom<0?(c=h.selected.index+1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):0!==h.selected.index&&h.fieldTop>0&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)),h.$apply())};var k=function(a){var b=a.logicJump;if(b.expressionString&&b.valueB&&a.fieldValue){var c,d,e=jsep(b.expressionString);if("field"===e.left.name?(c=a.fieldValue,d=b.valueB):(c=b.valueB,d=a.fieldValue),"number"===a.fieldType||"scale"===a.fieldType||"rating"===a.fieldType)switch(e.operator){case"==":return parseInt(c)===parseInt(d);case"!==":return parseInt(c)!==parseInt(d);case">":return parseInt(c)>parseInt(d);case">=":return parseInt(c)>parseInt(d);case"<":return parseInt(c)-1;case"!contains":return!(c.indexOf(d)>-1);case"begins":return c.startsWith(d);case"!begins":return!c.startsWith(d);case"ends":return c.endsWith(d);case"!ends":return c.endsWith(d);default:return!1}}},l=function(){if(null===h.selected)throw console.error("current active field is null"),new Error("current active field is null");return"submit_field"===h.selected._id?h.myform.form_fields.length-1:h.selected.index};h.setActiveField=d.setActiveField=function(a,d,g){if(null!==h.selected&&h.selected._id!==a){if(h.selected._id=a,h.selected.index=d,!d)for(var j=0;j-1)if(a.logicJump&&k(a))d.setActiveField(a.logicJump.jumpTo,null,!0);else{var b,c;h.selected.index0){var a=h.selected.index-1,b=h.myform.visible_form_fields[a]._id;h.setActiveField(b,a,!0)}},h.exitStartPage=function(){h.myform.startPage.showStart=!1,h.myform.visible_form_fields.length>0&&(h.selected._id=h.myform.visible_form_fields[0]._id)},d.goToInvalid=h.goToInvalid=function(){document.querySelectorAll(".ng-invalid.focusOn")[0].focus()};var m=function(){var a=new MobileDetect(window.navigator.userAgent),b="other";return a.tablet()?b="tablet":a.mobile()?b="mobile":a.is("bot")||(b="desktop"),{type:b,name:window.navigator.platform}},n=function(){$.ajaxSetup({async:!1});var a=$.getJSON("https://freegeoip.net/json/").responseJSON;return $.ajaxSetup({async:!0}),a&&a.ip||(a={ip:"Adblocker"}),{ipAddr:a.ip,geoLocation:{City:a.city,Country:a.country_name}}};d.submitForm=h.submitForm=function(){var d=b.stopClock();h.loading=!0;var f=_.cloneDeep(h.myform),g=m();f.device=g;var i=n();f.ipAddr=i.ipAddr,f.geoLocation=i.geoLocation,console.log(i),f.timeElapsed=d,f.percentageComplete=c("formValidity")(h.myform)/h.myform.visible_form_fields.length*100,delete f.visible_form_fields;for(var j=0;j

Not Authorized to Access Form

The form you are trying to access is currently private and not accesible publically.
If you are the owner of the form, you can set it to "Public" in the "Configuration" panel in the form admin.
'),a.put("form_modules/forms/base/views/submit-form.client.view.html","
"),a.put("form_modules/forms/base/views/directiveViews/entryPage/startPage.html",'

{{pageData.introTitle}}

{{pageData.introParagraph}}

'),a.put("form_modules/forms/base/views/directiveViews/field/date.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("form_modules/forms/base/views/directiveViews/field/dropdown.html",'
'),a.put("form_modules/forms/base/views/directiveViews/field/hidden.html",""),a.put("form_modules/forms/base/views/directiveViews/field/legal.html",'
'),a.put("form_modules/forms/base/views/directiveViews/field/radio.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/field/rating.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("form_modules/forms/base/views/directiveViews/field/statement.html",'

{{field.title}}

{{field.description}}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/field/textarea.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{ \'NEWLINE\' | translate }}

{{field.description}}

Press SHIFT+ENTER to add a newline
{{ \'ENTER\' | translate }}
'),a.put("form_modules/forms/base/views/directiveViews/field/textfield.html",'

{{index+1}} {{field.title}} ({{ \'OPTIONAL\' | translate }})

{{field.description}}

{{ \'ENTER\' | translate }}
'),a.put("form_modules/forms/base/views/directiveViews/field/yes_no.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html",'
{{ \'COMPLETING_NEEDED\' | translate:translateAdvancementData }}
')}]),ApplicationConfiguration.registerModule("view-form",["ngFileUpload","ui.date","angular-input-stars"]),angular.module("view-form").config(["$stateProvider",function(a){a.state("submitForm",{url:"/forms/:formId",templateUrl:"/static/form_modules/forms/base/views/submit-form.client.view.html",resolve:{Forms:"Forms",myForm:["Forms","$q","$state","$stateParams",function(a,b,c,d){var e=b.defer();return console.log(a.get({formId:d.formId}).$promise),a.get({formId:d.formId}).$promise.then(function(a){return console.log(a),a},function(a){return console.log(a),c.go("unauthorizedFormAccess"),e.reject({redirectTo:"unauthorizedFormAccess"})})}]},controller:"SubmitFormController",controllerAs:"ctrl"}).state("unauthorizedFormAccess",{url:"/forms/unauthorized",templateUrl:"/static/form_modules/forms/base/views/form-unauthorized.client.view.html"})}]),function(){function a(a,b){function c(b,c,d){var e=window.navigator.userLanguage||window.navigator.language;e=e.slice(0,2);var f=navigator.userAgent,g=new MobileDetect(f),h="other";g.tablet()?h="tablet":g.mobile()?h="mobile":g.is("bot")||(h="desktop"),$.ajaxSetup({async:!1});var i=$.getJSON("https://freegeoip.net/json/").responseJSON;$.ajaxSetup({async:!0}),i||(i={ip:"",city:"",country_name:""});var j={referrer:document.referrer,isSubmitted:b.submitted,formId:b._id,lastActiveField:b.form_fields[c]._id,timeElapsed:d,language:e,deviceType:h,ipAddr:i.ip,geoLocation:{city:i.city,country:i.country_name}};a.emit("form-visitor-data",j)}function d(){a.socket||a.connect()}var e={send:c};return d(),e}angular.module("view-form").factory("SendVisitorData",a),a.$inject=["Socket","$state"]}(),angular.module("view-form").directive("keyToOption",function(){return{restrict:"A",scope:{field:"="},link:function(a,b,c,d){b.bind("keydown keypress",function(b){var c=b.which||b.keyCode,d=parseInt(String.fromCharCode(c))-1;d',restrict:"E",scope:{typeName:"@"},controller:["$scope",function(a){var b={textfield:"fa fa-pencil-square-o",dropdown:"fa fa-th-list",date:"fa fa-calendar",checkbox:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",email:"fa fa-envelope-o",textarea:"fa fa-pencil-square",legal:"fa fa-legal",file:"fa fa-cloud-upload",rating:"fa fa-star-half-o",link:"fa fa-link",scale:"fa fa-sliders",stripe:"fa fa-credit-card",statement:"fa fa-quote-left",yes_no:"fa fa-toggle-on",number:"fa fa-slack"};a.typeIcon=b[a.typeName]}]}});var __indexOf=[].indexOf||function(a){for(var b=0,c=this.length;b=0&&(c=c+b+".html"),d.get(c)};return{template:"
{{field.title}}
",restrict:"E",scope:{field:"=",required:"&",design:"=",index:"=",forms:"="},link:function(a,d){c.chooseDefaultOption=a.chooseDefaultOption=function(b){"yes_no"===b?a.field.fieldValue="true":"rating"===b?a.field.fieldValue=0:"radio"===a.field.fieldType?(console.log(a.field),a.field.fieldValue=a.field.fieldOptions[0].option_value,console.log(a.field.fieldValue)):"legal"===b&&(a.field.fieldValue="true",c.nextField())},a.nextField=c.nextField,a.setActiveField=c.setActiveField,"date"===a.field.fieldType&&(a.dateOptions={changeYear:!0,changeMonth:!0,altFormat:"mm/dd/yyyy",yearRange:"1900:-0",defaultDate:0});var e=a.field.fieldType;if("number"===a.field.fieldType||"textfield"===a.field.fieldType||"email"===a.field.fieldType||"link"===a.field.fieldType){switch(a.field.fieldType){case"textfield":a.input_type="text";break;case"email":a.input_type="email",a.placeholder="joesmith@example.com";break;case"number":a.input_type="text",a.validateRegex=/^-?\d+$/;break;default:a.input_type="url",a.placeholder="http://example.com"}e="textfield"}var g=f(e);d.html(g).show();b(d.contents())(a)}}}]),angular.module("view-form").directive("onEnterKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode,e=!1;null!==d.onEnterKeyDisabled&&(e=d.onEnterKeyDisabled),13!==c||b.shiftKey||e||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterKey)}))})}}}]).directive("onTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabKey)}))})}}}]).directive("onEnterOrTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;13!==c&&9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterOrTabKey)}))})}}}]).directive("onTabAndShiftKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9===c&&b.shiftKey&&(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabAndShiftKey)}))})}}}]),angular.module("view-form").directive("onFinishRender",["$rootScope","$timeout",function(a,b){return{restrict:"A",link:function(b,c,d){if(c.attr("ng-repeat")||c.attr("data-ng-repeat")){var e=d.onFinishRender||"ngRepeat";b.$first&&!b.$last?b.$evalAsync(function(){a.$broadcast(e+" Started")}):b.$last&&b.$evalAsync(function(){a.$broadcast(e+" Finished")})}}}}]),jsep.addBinaryOp("contains",10),jsep.addBinaryOp("!contains",10),jsep.addBinaryOp("begins",10),jsep.addBinaryOp("!begins",10),jsep.addBinaryOp("ends",10),jsep.addBinaryOp("!ends",10),angular.module("view-form").directive("submitFormDirective",["$http","TimeCounter","$filter","$rootScope","SendVisitorData","$translate",function(a,b,c,d,e,f){return{templateUrl:"form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html",restrict:"E",scope:{myform:"=",ispreview:"="},controller:["$document","$window","$scope",function(f,g,h){h.noscroll=!1,h.forms={},h.ispreview&&b.restartClock();var i=h.myform.visible_form_fields.filter(function(a){return"statement"!==a.fieldType}).length,j=c("formValidity")(h.myform);h.translateAdvancementData={done:j,total:i,answers_not_completed:i-j},h.reloadForm=function(){h.myform.submitted=!1,h.myform.form_fields=_.chain(h.myform.visible_form_fields).map(function(a){return a.fieldValue="",a}).value(),h.loading=!1,h.error="",h.selected={_id:"",index:0},h.setActiveField(h.myform.visible_form_fields[0]._id,0,!1),b.restartClock()},g.onscroll=function(){h.scrollPos=document.body.scrollTop||document.documentElement.scrollTop||0;var a=document.getElementsByClassName("activeField")[0].getBoundingClientRect();h.fieldTop=a.top,h.fieldBottom=a.bottom;var b,c;h.noscroll||(h.selected.index===h.myform.visible_form_fields.length-1&&h.fieldBottom<200?(c=h.selected.index+1,b="submit_field",h.setActiveField(b,c,!1)):h.selected.index===h.myform.visible_form_fields.length?h.fieldTop>200&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):h.fieldBottom<0?(c=h.selected.index+1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)):0!==h.selected.index&&h.fieldTop>0&&(c=h.selected.index-1,b=h.myform.visible_form_fields[c]._id,h.setActiveField(b,c,!1)),h.$apply())};var k=function(a){var b=a.logicJump;if(b.expressionString&&b.valueB&&a.fieldValue){ +var c,d,e=jsep(b.expressionString);if("field"===e.left.name?(c=a.fieldValue,d=b.valueB):(c=b.valueB,d=a.fieldValue),"number"===a.fieldType||"scale"===a.fieldType||"rating"===a.fieldType)switch(e.operator){case"==":return parseInt(c)===parseInt(d);case"!==":return parseInt(c)!==parseInt(d);case">":return parseInt(c)>parseInt(d);case">=":return parseInt(c)>parseInt(d);case"<":return parseInt(c)-1;case"!contains":return!(c.indexOf(d)>-1);case"begins":return c.startsWith(d);case"!begins":return!c.startsWith(d);case"ends":return c.endsWith(d);case"!ends":return c.endsWith(d);default:return!1}}},l=function(){if(null===h.selected)throw console.error("current active field is null"),new Error("current active field is null");return"submit_field"===h.selected._id?h.myform.form_fields.length-1:h.selected.index};h.setActiveField=d.setActiveField=function(a,d,g){if(null!==h.selected&&h.selected._id!==a){if(h.selected._id=a,h.selected.index=d,!d)for(var j=0;j-1)if(a.logicJump&&k(a))d.setActiveField(a.logicJump.jumpTo,null,!0);else{var b,c;h.selected.index0){var a=h.selected.index-1,b=h.myform.visible_form_fields[a]._id;h.setActiveField(b,a,!0)}},h.exitStartPage=function(){h.myform.startPage.showStart=!1,h.myform.visible_form_fields.length>0&&(h.selected._id=h.myform.visible_form_fields[0]._id)},d.goToInvalid=h.goToInvalid=function(){document.querySelectorAll(".ng-invalid.focusOn")[0].focus()};var m=function(){var a=new MobileDetect(window.navigator.userAgent),b="other";return a.tablet()?b="tablet":a.mobile()?b="mobile":a.is("bot")||(b="desktop"),{type:b,name:window.navigator.platform}},n=function(){$.ajaxSetup({async:!1});var a=$.getJSON("https://freegeoip.net/json/").responseJSON;return $.ajaxSetup({async:!0}),a&&a.ip||(a={ip:"Adblocker"}),{ipAddr:a.ip,geoLocation:{City:a.city,Country:a.country_name}}};d.submitForm=h.submitForm=function(){var d=b.stopClock();h.loading=!0;var f=_.cloneDeep(h.myform),g=m();f.device=g;var i=n();f.ipAddr=i.ipAddr,f.geoLocation=i.geoLocation,f.timeElapsed=d,f.percentageComplete=c("formValidity")(h.myform)/h.myform.visible_form_fields.length*100,delete f.visible_form_fields;for(var j=0;j{{ 'BACKGROUND_COLOR' | translate }}
- +
@@ -133,7 +136,7 @@
- +
@@ -143,7 +146,7 @@
- +
@@ -155,6 +158,7 @@
@@ -166,6 +170,7 @@