tellform/public/dist/application.min.js

5 lines
146 KiB
JavaScript
Raw Normal View History

2017-07-31 21:30:55 +00:00
"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","<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="myform.title !=
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
2017-07-31 21:30:55 +00:00
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
a.field.fieldValue=a.field.fieldOptions[d].option_value}))})}}}),angular.module("forms").directive("keyToTruthy",["$rootScope",function(a){return{restrict:"A",scope:{field:"="},link:function(a,b,c){b.bind("keydown keypress",function(b){var d=b.which||b.keyCode,e=c.keyCharTruthy.charCodeAt(0)-32,f=c.keyCharFalsey.charCodeAt(0)-32;d===e?(b.preventDefault(),a.$apply(function(){a.field.fieldValue="true"})):d===f&&(b.preventDefault(),a.$apply(function(){a.field.fieldValue="false"}))})}}}]),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(){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=
}var g;g={connect:c,emit:d,on:e,removeListener:f,socket:null};var h="";return h=b.socketPort&&b.socketUrl?b.socketUrl+":"+b.socketPort:b.socketUrl&&!b.socketUrl?b.socketUrl:b.socketPort?window.location.protocol+"//"+window.location.hostname+":"+b.socketPort:window.location.protocol+"//"+window.location.hostname,c(h),g}angular.module("forms").factory("Socket",a),a.$inject=["$timeout","$window"]}(),angular.module("forms").service("TimeCounter",[function(){var a,b=null;this.timeSpent=0,this.restartClock=function(){a=Date.now(),b=null},this.getTimeElapsed=function(){if(a)return Math.abs(Date.now().valueOf()-a.valueOf())/1e3},this.stopClock=function(){return a&&null===b?(b=Date.now(),this.timeSpent=Math.abs(b.valueOf()-a.valueOf())/1e3,this._startTime=this._endTime=null,this.timeSpent):new Error("Clock has not been started")},this.clockStarted=function(){return!!this._startTime}}]),angular.module("users").config(["$translateProvider",function(a){a.translations("en",{ACCESS_DENIED_TEXT:"You need to be logged in to access this page",USERNAME_OR_EMAIL_LABEL:"Username or Email",USERNAME_LABEL:"Username",PASSWORD_LABEL:"Password",CURRENT_PASSWORD_LABEL:"Current Password",NEW_PASSWORD_LABEL:"New Password",VERIFY_PASSWORD_LABEL:"Verify Password",UPDATE_PASSWORD_LABEL:"Update Password",FIRST_NAME_LABEL:"First Name",LAST_NAME_LABEL:"Last Name",LANGUAGE_LABEL:"Language",EMAIL_LABEL:"Email",SIGNUP_ACCOUNT_LINK:"Don't have an account? Sign up here",SIGN_IN_ACCOUNT_LINK:"Already have an account? Sign in here",SIGNUP_HEADER_TEXT:"Sign up",SIGNIN_HEADER_TEXT:"Sign in",SIGNUP_ERROR_TEXT:"Couldn't complete registration due to errors",ENTER_ACCOUNT_EMAIL:"Enter your account email.",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",SAVE_CHANGES:"Save Changes",CANCEL_BTN:"Cancel",EDIT_PROFILE:"Edit your profile",UPDATE_PROFILE_BTN:"Update Profile",PROFILE_SAVE_SUCCESS:"Profile saved successfully",PROFILE_SAVE_ERROR:"Could't Save Your Profile.",CONNECTED_SOCIAL_ACCOUNTS:"Connected social accounts",CONNECT_OTHER_SOCIAL_ACCOUNTS:"Connect other social accounts",FORGOT_PASSWORD_LINK:"Forgot your password?",REVERIFY_ACCOUNT_LINK:"Resend your verification email",SIGNIN_BTN:"Sign in",SIGNUP_BTN:"Sign up",SAVE_PASSWORD_BTN:"Save Password",SUCCESS_HEADER:"Signup Successful",SUCCESS_TEXT:"Youve successfully registered an account at TellForm.",VERIFICATION_EMAIL_SENT:"Verification Email has been Sent",VERIFICATION_EMAIL_SENT_TO:"A verification email has been sent to",NOT_ACTIVATED_YET:"But your account is not activated yet",BEFORE_YOU_CONTINUE:"Before you continue, make sure to check your email for our verification. If you dont receive it within 24h drop us a line at ",CHECK_YOUR_EMAIL:"Check your email and click on the activation link to activate your account. If you have any questions drop us a line at",CONTINUE:"Continue",PASSWORD_RESTORE_HEADER:"Restore your password",ENTER_YOUR_EMAIL:"Enter your account email.",SUBMIT_BTN:"Submit",ASK_FOR_NEW_PASSWORD:"Ask for new password reset",PASSWORD_RESET_INVALID:"Password reset is invalid",PASSWORD_RESET_SUCCESS:"Passport successfully reset",PASSWORD_CHANGE_SUCCESS:"Passport successfully changed",RESET_PASSWORD:"Reset your password",CHANGE_PASSWORD:"Change your password",CONTINUE_TO_LOGIN:"Continue to login page",VERIFY_SUCCESS:"Account successfully activated",VERIFY_ERROR:"Verification link is invalid or has expired"}),a.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("users").config(["$translateProvider",function(a){a.translations("fr",{ACCESS_DENIED_TEXT:"Vouz nêtes pas autorisé à accéder à cette page.",USERNAME_LABEL:"Nom dutilisateur",PASSWORD_LABEL:"Mot de Passe",CURRENT_PASSWORD_LABEL:"Mot de passe actuel",NEW_PASSWORD_LABEL:"Nouveau Mot de Passe",VERIFY_PASSWORD_LABEL:"Vérifier le mot de passe",UPDATE_PASSWORD_LABEL:"Mettre à jour le mot de passe",FIRST_NAME_LABEL:"Prénom",LAST_NAME_LABEL:"Nom",LANGUAGE_LABEL:"Langue",EMAIL_LABEL:"Email",UPDATE_PROFILE_BTN:"Modifier le Profil",PROFILE_SAVE_SUCCESS:"Profil enregistré avec succè