tellform/public/dist/application.min.js

5 lines
154 KiB
JavaScript
Raw Normal View History

2017-09-21 01:54:23 +00:00
"use strict";var ApplicationConfiguration=function(){var a="TellForm",b=["duScroll","ui.select","ngSanitize","vButton","ngResource","TellForm.templates","ui.router","ui.bootstrap","ui.utils","pascalprecht.translate","view-form"],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","<section class=\"navbar navbar-inverse\" data-ng-controller=HeaderController ng-hide=hideNav><div class=container><div class=navbar-header><button class=navbar-toggle type=button data-ng-click=toggleCollapsibleMenu()><span class=sr-only>Toggle navigation</span> <span>{{ 'MENU_BTN' | translate }}</span></button> <a href=/#!/ class=navbar-brand><img src=/static/modules/core/img/logo_white.svg height=100%></a></div><nav class=\"collapse navbar-collapse\" collapse=!isCollapsed role=navigation><ul class=\"nav navbar-nav navbar-right\" data-ng-hide=authentication.isAuthenticated()><li ng-hide=$root.signupDisabled ui-route=/signup ng-class=\"{active: $uiRoute}\"><a href=/#!/signup>{{ 'SIGNUP_TAB' | translate }}</a></li><li class=divider-vertical></li><li ui-route=/signin ng-class=\"{active: $uiRoute}\"><a href=/#!/signin>{{ 'SIGNIN_TAB' | translate }}</a></li></ul><ul class=\"nav navbar-nav navbar-right\" data-ng-show=authentication.isAuthenticated()><li class=dropdown uib-dropdown><a href=# class=dropdown-toggle data-toggle=dropdown dropdown-toggle><span>{{ 'MY_SETTINGS' | translate }}</span> <b class=caret></b></a><ul class=dropdown-menu><li><a href=/#!/settings/profile>{{ 'EDIT_PROFILE' | translate }}</a></li><li class=divider></li><li><a href=/#!/settings/password>{{ 'CHANGE_PASSWORD' | translate }}</a></li></ul></li><li><a href=/ ng-click=signout()>{{ 'SIGNOUT_TAB' | translate }}</a></li></ul></nav></div></section>"),a.put("modules/forms/admin/views/admin-form.client.view.html",'<header data-ng-include="\'/static/modules/core/views/header.client.view.html\'"></header><div class=container></div><section class=admin-form><script type=text/ng-template id=formDeleteModal.html><div class="modal-header">\n <h2 class="modal-title hidden-md hidden-lg">{{ \'ARE_YOU_SURE\' | translate }}</h2>\n <h3 class="modal-title hidden-xs hidden-sm">{{ \'ARE_YOU_SURE\' | translate }}</h3>\n </div>\n <div class="modal-body">\n \t<div class="modal-body-alert">\n\t\t\t\t{{ \'READ_WARNING\' | translate }}\n\t\t\t</div>\n \t\t<p class="hidden-xs hidden-sm">\n \t\t \t{{ \'DELETE_WARNING1\' | translate }} <strong>{{myform.title}}</strong> {{ \'DELETE_WARNING2\' | translate }}\n \t\t</p>\n <p>{{ \'DELETE_CONFIRM\' | translate }}</p>\n </div>\n <div class="modal-footer">\n\t\t\t<input type="text" style="width:100%" data-ng-model="deleteConfirm" class="input-block" autofocus required aria-label="Type in the name of the form to confirm that you want to delete this form.">\n <button type="submit" ng-click="removeCurrentForm()" class="btn btn-block btn-danger" ng-disabled="myf
a.put("modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html","<div class=\"submissions-table container\"><div class=\"row text-center analytics\"><div class=\"col-xs-12 header-title\"><div class=col-xs-3>{{ 'TOTAL_VIEWS' | translate }}</div><div class=col-xs-3>{{ 'RESPONSES' | translate }}</div><div class=col-xs-3>{{ 'COMPLETION_RATE' | translate }}</div><div class=col-xs-3>{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}</div></div><div class=\"col-xs-12 header-numbers\"><div class=col-xs-3>{{myform.analytics.visitors.length}}</div><div class=col-xs-3>{{myform.analytics.submissions}}</div><div class=col-xs-3>{{myform.analytics.conversionRate | number:0}}%</div><div class=col-xs-3>{{ AverageTimeElapsed | secondsToDateTime | date:'mm:ss'}}</div></div><div class=\"col-xs-12 detailed-title\"><div class=col-xs-3>{{ 'DESKTOP_AND_LAPTOP' | translate }}</div><div class=col-xs-3>{{ 'TABLETS' | translate }}</div><div class=col-xs-3>{{ 'PHONES' | translate }}</div><div class=col-xs-3>{{ 'OTHER' | translate }}</div></div><div class=\"col-xs-12 detailed-row\"><div class=col-xs-3><div class=\"row header\">{{ 'UNIQUE_VISITS' | translate }}</div><div class=row>{{DeviceStatistics.desktop.visits}}</div></div><div class=col-xs-3><div class=\"row header\">{{ 'UNIQUE_VISITS' | translate }}</div><div class=row>{{DeviceStatistics.tablet.visits}}</div></div><div class=col-xs-3><div class=\"row header\">{{ 'UNIQUE_VISITS' | translate }}</div><div class=row>{{DeviceStatistics.tablet.visits}}</div></div><div class=col-xs-3><div class=\"row header\">{{ 'UNIQUE_VISITS' | translate }}</div><div class=row>{{DeviceStatistics.other.visits}}</div></div></div><div class=\"col-xs-12 detailed-row\"><div class=col-xs-3><div class=\"row header\">{{ 'RESPONSES' | translate }}</div><div class=row>{{DeviceStatistics.desktop.responses}}</div></div><div class=col-xs-3><div class=\"row header\">{{ 'RESPONSES' | translate }}</div><div class=row>{{DeviceStatistics.tablet.responses}}</div></div><div class=col-xs-3><div class=\"row header\">{{ 'RESPONSES' | translate }}</div><div class=row>{{DeviceStatistics.phone.responses}}</div></div><div class=col-xs-3><div class=\"row header\">{{ 'RESPONSES' | translate }}</div><div class=row>{{DeviceStatistics.other.responses}}</div></div></div><div class=\"col-xs-12 detailed-row\"><div class=col-xs-3><div class=\"row header\">{{ 'COMPLETION_RATE' | translate }}</div><div class=row>{{DeviceStatistics.desktop.completion}}%</div></div><div class=col-xs-3><div class=\"row header\">{{ 'COMPLETION_RATE' | translate }}</div><div class=row>{{DeviceStatistics.tablet.completion}}%</div></div><div class=col-xs-3><div class=\"row header\">{{ 'COMPLETION_RATE' | translate }}</div><div class=row>{{DeviceStatistics.phone.completion}}%</div></div><div class=col-xs-3><div class=\"row header\">{{ 'COMPLETION_RATE' | translate }}</div><div class=row>{{DeviceStatistics.other.completion}}%</div></div></div><div class=\"col-xs-12 detailed-row\"><div class=col-xs-3><div class=\"row header\">{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}</div><div class=row>{{DeviceStatistics.desktop.average_time | secondsToDateTime | date:'mm:ss'}}</div></div><div class=col-xs-3><div class=\"row header\">{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}</div><div class=row>{{DeviceStatistics.tablet.average_time | secondsToDateTime | date:'mm:ss'}}</div></div><div class=col-xs-3><div class=\"row header\">{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}</div><div class=row>{{DeviceStatistics.phone.average_time | secondsToDateTime | date:'mm:ss'}}</div></div><div class=col-xs-3><div class=\"row header\">{{ 'AVERAGE_TIME_TO_COMPLETE' | translate }}</div><div class=row>{{DeviceStatistics.other.average_time | secondsToDateTime | date:'mm:ss'}}</div></div></div><div class=\"col-xs-12 field-title-row\"><div class=col-xs-3><strong>{{ 'FIELD_TITLE' | translate }}</strong></div><div class=col-xs-3><strong>{{ 'FIELD_VIEWS' | translate }}</strong></div><div class=col-xs-3><strong>{{ 'FIELD_RESPONSES' | translate }}</strong></div><div class=col-xs-3><strong>{{ 'F
a.put("modules/users/views/password/forgot-password.client.view.html",'<section class="auth valign-wrapper" data-ng-controller=PasswordController><div class="row valign"><div class="col-md-4 col-md-offset-4"><div class="col-md-12 text-center" style="padding-bottom: 50px"><img src=/static/modules/core/img/logo_white.svg height=100px></div><div class=col-md-12><form data-ng-submit=askForPasswordReset() autocomplete=off><fieldset><div class=form-group><input id=username name=username class=form-control data-ng-model=credentials.username placeholder="{{ \'USERNAME_OR_EMAIL_LABEL\' | translate }}"></div><div class="text-center form-group"><button type=submit class="btn btn-signup btn-rounded btn-block">{{ \'PASSWORD_RESTORE_HEADER\' | translate }}</button></div><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div data-ng-show=success class="text-center text-success"><strong>{{success}}</strong></div></fieldset></form></div></div></div></section>'),a.put("modules/users/views/password/reset-password-invalid.client.view.html","<section class=\"row text-center\"><h3 class=col-md-12>{{ 'PASSWORD_RESET_INVALID' | translate }}</h3><a href=/#!/password/forgot class=col-md-12>{{ 'ASK_FOR_NEW_PASSWORD' | translate }}</a></section>"),a.put("modules/users/views/password/reset-password-success.client.view.html","<section class=\"row text-center\"><h3 class=col-md-12>{{ 'PASSWORD_RESET_SUCCESS' | translate }}</h3><a href=/#!/ class=col-md-12>{{ 'CONTINUE_TO_LOGIN' | translate }}</a></section>"),a.put("modules/users/views/password/reset-password.client.view.html",'<section class="row auth" data-ng-controller=PasswordController><h3 class="col-md-12 text-center">{{ \'RESET_PASSWORD\' | translate }}</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=resetUserPassword() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><label for=newPassword>{{ \'NEW_PASSWORD_LABEL\' | translate }}</label><input type=password id=newPassword name=newPassword class=form-control data-ng-model=passwordDetails.newPassword placeholder="{{ \'NEW_PASSWORD_LABEL\' | translate }}"></div><div class=form-group><label for=verifyPassword>{{ \'VERIFY_PASSWORD_LABEL\' | translate }}</label><input type=password id=verifyPassword name=verifyPassword class=form-control data-ng-model=passwordDetails.verifyPassword placeholder="{{ \'VERIFY_PASSWORD_LABEL\' | translate }}"></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary">{{ \'UPDATE_PASSWORD_LABEL\' | translate }}</button></div><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div data-ng-show=success class="text-center text-success"><strong>{{success}}</strong></div></fieldset></form></div></section>'),a.put("modules/users/views/settings/change-password.client.view.html",'<header data-ng-include="\'/static/modules/core/views/header.client.view.html\'"></header><section class=row data-ng-controller=SettingsController><h3 class="col-md-12 text-center">{{ \'CHANGE_PASSWORD\' | translate }}</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=changeUserPassword() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><label for=currentPassword>{{ \'CURRENT_PASSWORD_LABEL\' | translate }}</label><input type=password id=currentPassword name=currentPassword class=form-control data-ng-model=passwordDetails.currentPassword placeholder="{{ \'CURRENT_PASSWORD_LABEL\' | translate }}"></div><hr><div class=form-group><label for=newPassword>{{ \'NEW_PASSWORD_LABEL\' | translate }}</label><input type=password id=newPassword name=newPassword class=form-control data-ng-model=passwordDetails.newPassword placeholder="{{ \'NEW_PASSWORD_LABEL\' | translate }}"></div><div class=form-group><label for=verifyPassword>{{ \'VERIFY_PASSWORD_LABEL\' | translate }}</label><input type=password id=verifyPassword name=verifyPassword class=form-control data-ng-model=passwordDetails.verifyPassword placeholder="{{ \'VE
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<a.fieldOptions.length;c++)if(a.fieldOptions[c].option_id===b.option_id){a.fieldOptions.splice(c,1);break}},c.select2FA={Heart:"Heart",Star:"Star","thumbs-up":"Thumbs Up","thumbs-down":"Thumbs Down",Circle:"Circle",Square:"Square","Check Circle":"Checkmark","Smile Outlined":"Smile",Hourglass:"Hourglass",bell:"Bell","Paper Plane":"Paper Plane",Comment:"Chat Bubble",Trash:"Trash Can"},c.showRatingOptions=function(a){return"rating"===a.fieldType},c.saveField=function(){c.myform.form_fields.push(a),c.$parent.update(!1,c.$parent.myform,!1,!0,function(){b.close()})},c.cancel=function(){b.close()}}]})},d.openEditStartPageModal=function(){d.editStartPageModal=c.open({animation:!0,templateUrl:"editStartPageModal.html",windowClass:"edit-modal-window",controller:["$uibModalInstance","$scope",function(a,b){b.showButtons=!1,b.lastButtonID=0,b.addButton=function(){var a={};a.bgColor="#ddd",a.color="#ffffff",a.text="Button",a._id=Math.floor(1e5*Math.random()),b.myform.startPage.buttons.push(a)},b.deleteButton=function(a){for(var c,d=0;d<b.myform.startPage.buttons.length;d++)if(c=b.myform.startPage.buttons[d]._id,c===a._id){b.myform.startPage.buttons.splice(d,1);break}},b.saveStartPage=function(){b.$parent.update(!1,b.$parent.myform,!1,!0,funct
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 dont 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:"Jaccepte",LEGAL_NO_ACCEPT:"Je naccepte 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 dont 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 dont 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:"{{