tellform/public/dist/application.min.js

5 lines
135 KiB
JavaScript
Raw Normal View History

2016-06-18 21:01:02 +00:00
"use strict";function removeDateFieldsFunc(o){function eachObject(v,k){"lastModified"!==k&&"created"!==k||delete clone[k]}for(var clone=_.clone(o),i=0;i<clone.length;i++)_.each(clone[i],eachObject);return clone}var ApplicationConfiguration=function(){var applicationModuleName="NodeForm",applicationModuleVendorDependencies=["duScroll","ui.select","cgBusy","ngSanitize","vButton","ngResource","NodeForm.templates","ui.router","ui.bootstrap","ui.utils","pascalprecht.translate","ng.deviceDetector"],registerModule=function(moduleName,dependencies){angular.module(moduleName,dependencies||[]),angular.module(applicationModuleName).requires.push(moduleName)};return{applicationModuleName:applicationModuleName,applicationModuleVendorDependencies:applicationModuleVendorDependencies,registerModule:registerModule}}();angular.module(ApplicationConfiguration.applicationModuleName,ApplicationConfiguration.applicationModuleVendorDependencies),angular.module(ApplicationConfiguration.applicationModuleName).config(["$locationProvider",function($locationProvider){$locationProvider.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.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","$state","$stateParams",function($rootScope,Auth,$state,$stateParams){$rootScope.$state=$state,$rootScope.$stateParams=$stateParams,$rootScope.$on("$stateChangeSuccess",function(event,toState,toParams,fromState){$state.previous=fromState;var statesToIgnore=["home","signin","resendVerifyEmail","verify","signup","signup-success","forgot","reset-invalid","reset","reset-success"];statesToIgnore.indexOf(toState.name)>0?Auth.isAuthenticated()&&(event.preventDefault(),$state.go("listForms")):"access_denied"===toState.name||Auth.isAuthenticated()||"submitForm"===toState.name||(console.log("go to signup"),event.preventDefault(),$state.go("listForms"))})}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","User","Authorizer","$state","$stateParams",function($rootScope,Auth,User,Authorizer,$state,$stateParams){$rootScope.$on("$stateChangeStart",function(event,next){var authenticator,permissions,user;permissions=next&&next.data&&next.data.permissions?next.data.permissions:null,Auth.ensureHasCurrentUser(User),user=Auth.currentUser,user&&(authenticator=new Authorizer(user),null!=permissions&&(authenticator.canAccess(permissions)||(event.preventDefault(),$state.go("access_denied"))))})}]),angular.element(document).ready(function(){"#_=_"===window.location.hash&&(window.location.hash="#!"),angular.bootstrap(document,[ApplicationConfiguration.applicationModuleName])}),angular.module("NodeForm.templates",[]).run(["$templateCache",function($templateCache){$templateCache.put("../public/modules/core/views/header.client.view.html",'<section class="navbar navbar-fixed-top 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 class=icon-bar></span> <span class=icon-bar></span> <span class=icon-bar></span></button> <a href="https://www.tellform.com/#!/" class=navbar-brand><i class="fa fa-archive" style="padding-right: 0.3em"></i>Tell<span>Form</span></a></div><nav class="collapse navbar-collapse" collapse=!isCollapsed role=navigation><ul class="nav navbar-nav" data-ng-if=authentication.isAuthenticated()><li data-ng-repeat="item in menu.items | orderBy: \'position\'" data-ng-if=item.shouldRender(authentication.isAuthenticated()); ng-switch=item.menuItemType ui-route={{item.uiRoute}} class={{item.menuItemClass}}
$templateCache.put("../public/modules/forms/views/directiveViews/form/edit-form.client.view.html",'<form class="row container" name=editForm auto-save-form auto-save-watch=myform auto-save-callback=update><div class="col-xs-2 col-sm-4 col-md-5 add-field"><div class="row add-field-title"><h3 class="col-md-12 hidden-sm hidden-xs">Click to Add New Field</h3><h4 class="col-sm-12 hidden-xs hidden-md hidden-lg">Add New Field</h4><h5 class="col-sm-12 hidden-sm hidden-md hidden-lg">Add Field</h5></div><div class="panel-group row" class=draggable ng-model=addField.types><div class="col-xs-12 col-sm-12 col-md-6" ng-repeat="type in addField.types" style=padding-top:7.5px><div class="panel panel-default" style=background-color:#f5f5f5><div class=panel-heading ng-click="addNewField(true, type.name)" style="cursor: pointer; font-size:14px"><span><field-icon-directive type-name={{type.name}}></field-icon-directive></span> <span class=hidden-xs style=padding-left:0.3em>{{type.value}}</span></div></div></div></div></div><div class="col-xs-10 col-sm-8 col-md-7 current-fields container"><div class=row><div class="col-sm-12 col-md-10"><div class="panel panel-default startPage"><div class="panel-heading accordion-toggle collapsed" data-toggle=collapse data-target=#collapseStart><h4 class=text-center>Start Page <span class=pull-right><i class="fa fa-chevron-right" ng-hide=startPage.isOpen></i> <i class="fa fa-chevron-down" ng-show=startPage.isOpen></i></span></h4></div><div id=collapseStart class="panel-collapse collapse"><div class=panel-body><div class="row hidden-sm hidden-xs"><div class=col-md-12><h4>Preview Start Page</h4></div><ul class="col-md-12 container" style="list-style:none;border:2px lightgray solid"><div class="field row"><div class="col-xs-12 text-center" style="overflow-wrap: break-word"><h1>{{myform.startPage.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-left" style="overflow-wrap: break-word"><p style=color:#ddd>{{myform.startPage.introParagraph}}</p></div></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in myform.startPage.buttons" class=text-center style=display:inline><button class="btn btn-info" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none; color: inherit">{{button.text}}</a></button></p></div><div class="row form-actions"><button ng-click=exitStartPage() class="btn btn-info btn btn-info col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3" type=button><span style="color:white; font-size: 1.6em; text-decoration: none">{{myform.startPage.introButtonText}}</span></button></div></ul></div><div class=row><div class=col-xs-12><h4>Edit Start Page</h4><br></div></div><div class="row question"><div class="col-md-4 col-sm-12">Intro Title:</div><div class="col-md-8 col-sm-12"><input ng-model=myform.startPage.introTitle name=introTitleStartPage value={{myform.startPage.introTitle}} required></div></div><div class="row question"><div class="col-md-4 col-sm-12">Intro Paragraph:</div><div class="col-md-8 col-sm-12"><textarea type=text ng-model=myform.startPage.introParagraph name="introParagraphStartPage">\n </div>\n </div>\n \n <div class="row question">\n <div class="col-md-4 col-sm-12">Intro Button:</div>\n <div class="col-md-8 col-sm-12">\n <input ng-model=myform.startPage.introButtonText name=introButtonText value={{myform.startPage.introButtonText}} required>\n </div>\n </div>\n\n <div class=row><br><br></div>\n\n <div class="row options buttons">\n <div class="col-md-3 col-xs-12">Buttons:</div>\n <div class="col-md-9 col-xs-12">\n <di
$templateCache.put("../public/modules/users/views/settings/edit-profile.client.view.html",'<section class="row auth" data-ng-controller=SettingsController><h3 class="col-xs-offset-1 col-xs-10 text-center">Edit your profile</h3><div class="col-xs-offset-3 col-xs-6"><form name=userForm data-ng-submit=updateUserProfile(userForm.$valid) class="signin form-horizontal" autocomplete=off><fieldset><div data-ng-show=success class="text-center text-success"><strong>Profile Saved Successfully</strong></div><div data-ng-show=error class="text-center text-danger">Couldn\'t Save Your Profile.<br>Error: <strong data-ng-bind=error></strong></div><div class="form-group row"><div class="col-xs-7 field-title"><b>First Name</b></div><div class="col-xs-12 field-input"><input id=firstName name=firstName class=form-control data-ng-model=user.firstName placeholder="First Name" ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class="form-group row"><div class="col-xs-7 field-title"><b>Last Name</b></div><div class="col-xs-12 field-input"><input id=lastName name=lastName class=form-control data-ng-model=user.lastName placeholder="Last Name" ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class=row><hr></div><div class="row form-group"><div class="col-xs-7 field-title"><b>Language</b></div><div class="col-xs-12 field-input"><select ng-model=user.language required><option ng-repeat="language in languages" ng-selected="language == user.language" value={{language}}>{{language}}</option></select></div></div><div class="row form-group"><div class="col-xs-7 field-title"><b>Email</b> <small>(also your username)</small></div><div class="col-xs-12 field-input"><input type=email id=email name=email class=form-control data-ng-model=user.email placeholder=Email></div></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary" style=font-size:1.6em>Update Profile</button></div></fieldset></form></div></section>'),$templateCache.put("../public/modules/users/views/settings/social-accounts.client.view.html",'<section class="row auth" data-ng-controller=SettingsController><h3 class="col-md-12 text-center" data-ng-show=hasConnectedAdditionalSocialAccounts()>Connected social accounts:</h3><div class="col-md-12 text-center"><div data-ng-repeat="(providerName, providerData) in user.additionalProvidersData" class=remove-account-container><img ng-src=/modules/users/img/buttons/{{providerName}}.png> <a class="btn btn-danger btn-remove-account" data-ng-click=removeUserSocialAccount(providerName)><i class="glyphicon glyphicon-trash"></i></a></div></div><h3 class="col-md-12 text-center">Connect other social accounts:</h3><div class="col-md-12 text-center"><a href=/auth/facebook data-ng-hide="isConnectedSocialAccount(\'facebook\')" class=undecorated-link><img src=/modules/users/img/buttons/facebook.png></a> <a href=/auth/twitter data-ng-hide="isConnectedSocialAccount(\'twitter\')" class=undecorated-link><img src=/modules/users/img/buttons/twitter.png></a> <a href=/auth/google data-ng-hide="isConnectedSocialAccount(\'google\')" class=undecorated-link><img src=/modules/users/img/buttons/google.png></a> <a href=/auth/linkedin data-ng-hide="isConnectedSocialAccount(\'linkedin\')" class=undecorated-link><img src=/modules/users/img/buttons/linkedin.png></a> <a href=/auth/github data-ng-hide="isConnectedSocialAccount(\'github\')" class=undecorated-link><img src=/modules/users/img/buttons/github.png></a></div></section>'),$templateCache.put("../public/modules/users/views/verify/resend-verify-email.client.view.html",'<section class="auth row" data-ng-controller=VerifyController><section ng-if=!isResetSent><h3 class="col-md-12 text-center">Resend your account verification email</h3><p class="small text-center">Enter your account email.</p><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=resendVerifyEmail() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><input id=username name=email class=
deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},logout:function(){var deferred=$q.defer();return $http.get("/auth/signout").success(function(response){deferred.resolve(null)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},signup:function(credentials){var deferred=$q.defer();return $http.post("/auth/signup",credentials).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},resendVerifyEmail:function(_email){var deferred=$q.defer();return $http.post("/auth/verify",{email:_email}).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},validateVerifyToken:function(token){var validTokenRe=/^([A-Za-z0-9]{48})$/g;if(!validTokenRe.test(token))throw new Error("Error token: "+token+" is not a valid verification token");var deferred=$q.defer();return $http.get("/auth/verify/"+token).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error)}),deferred.promise},resetPassword:function(passwordDetails,token){var deferred=$q.defer();return $http.get("/auth/password/"+token,passwordDetails).success(function(response){deferred.resolve()}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},askForPasswordReset:function(credentials){var deferred=$q.defer();return $http.post("/auth/forgot",credentials).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise}};return userService}]),angular.module("users").factory("Users",["$resource",function($resource){return $resource("users",{},{update:{method:"PUT"}})}]),angular.module("core").config(["$translateProvider",function($translateProvider){$translateProvider.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"}),$translateProvider.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("core").config(["$translateProvider",function($translateProvider){$translateProvider.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("forms").controller("AdminFormController",["$rootScope","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal","myForm","$filter",function($rootScope,$scope,$stateParams,$state,Forms,CurrentForm,$http,$uibModal,myForm,$filter){$scope=$rootScope,$scope.animationsEnabled=!0,$scope.myform=myForm,$rootScope.saveInProgress=!1,CurrentForm.setForm($scope.myform),$scope.tabData=[{heading:$filter("translate")("CREATE_TAB"),route:"viewForm.create"},{heading:$filter("translate")("DESIGN_TAB"),route:"viewForm.design"},{heading:$filter("translate")("CONFIGURE_TAB"),route:"viewForm.configure"},{heading:$filter("translate")("ANALYZE_TAB"),route:"viewForm.analyze"}],$scope.setForm=function(form){$scope.myform=form},$rootScope.resetForm=function(){$scope.myform=Forms.get({formId:$stateParams.formId})},$scope.openDeleteModal=function(){$scope.deleteModal=$uibModal.open({animation:$scope.animationsEnabled,templateUrl:"myModalContent.html",controller:"AdminFormController",resolve:{myForm:function(){return $scope.myform}}}),$scope.deleteModal.result.then(function(selectedItem){$scope.selected=selectedItem},function(){console.log("Modal dismissed at: "+new Date)})},$scope.cancelDeleteModal=function(){$scope.deleteModal&&$scope.deleteModal.dismiss("cancel")},$scope.removeCurrentForm=function(){if($scope.deleteModal&&$scope.deleteModal.opened){$scope.deleteModal.close();var form_id=$scope.myform._id;if(!form_id)throw new Error("Error - removeCurrentForm(): $scope.myform._id does
SUCCESS_HEADER:"Signup Successful",SUCCESS_TEXT:"You've successfully registered an account at TellForm.",VERIFICATION_EMAIL_SENT:"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 don't 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",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",CONTINUE_TO_LOGIN:"Continue to login page",VERIFY_SUCCESS:"Account successfully activated",VERIFY_ERROR:"Verification link is invalid or has expired"}),$translateProvider.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("users").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{ACCESS_DENIED_TEXT:"Vouz est pas autorisé pour accese cete page.",USERNAME_LABEL:"Nom de Compte",PASSWORD_LABEL:"Mot de Pass",CURRENT_PASSWORD_LABEL:"Current Password",NEW_PASSWORD_LABEL:"Nouveau Mot de Pass Password",VERIFY_PASSWORD_LABEL:"Verify Password",UPDATE_PASSWORD_LABEL:"Update Password",FIRST_NAME_LABEL:"Premiere Nom Name",LAST_NAME_LABEL:"Surnom",LANGUAGE_LABEL:"Language",EMAIL_LABEL:"Email",UPDATE_PROFILE_BTN:"Modifier Profile",PROFILE_SAVE_SUCCESS:"Profile saved successfully",PROFILE_SAVE_ERROR:"Erreur: On peux pas enregistré votre Profile.",FORGOT_PASSWORD_LINK:"Oublier votre mot de pass?",REVERIFY_ACCOUNT_LINK:"Re-envoyez ton email de verification",SIGNIN_BTN:"Connexion",SIGNUP_BTN:"Créer un compte",SAVE_PASSWORD_BTN:"Enregistreé ton nouveau Mot de Pass",SUCCESS_HEADER:"Votre Compte a été enregistré!",SUCCESS_TEXT:"Vouz a enregistré un compte a TellForm.",VERIFICATION_EMAIL_SENT:"Un email de verification a été envoyer a",NOT_ACTIVATED_YET:"Mais votre compte n'est pas activé",BEFORE_YOU_CONTINUE:"Plutôt que vouz continué, vouz devrez voire ton inbox pour notre message de verification. Si tu receivoir-pas un message de verification dan le prochaine 24h, contactez nous a ",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",PASSWORD_RESTORE_HEADER:"Restore your password",ENTER_YOUR_EMAIL:"Entrer votre email de compte",SUBMIT_BTN:"Enregistrer",ASK_FOR_NEW_PASSWORD:"Demander un nouveau mot de pass ",PASSWORD_RESET_INVALID:"Password reset is invalid",PASSWORD_RESET_SUCCESS:"Passport successfully reset",PASSWORD_CHANGE_SUCCESS:"Passport successfully changed",CONTINUE_TO_LOGIN:"Allez au page de connexion",VERIFY_SUCCESS:"Compte est activé!",VERIFY_ERROR:"Le fléche de verification est invalid ou expireé"})}]);