2 lines
44 KiB
JavaScript
2 lines
44 KiB
JavaScript
"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",'<section class="auth sigin-view valign-wrapper"><div class="row valign"><h3 class="col-md-12 text-center">Not Authorized to Access Form</h3><div class="col-md-4 col-md-offset-4"><div class="col-md-12 text-center" style="padding-bottom: 50px">The form you are trying to access is currently private and not accesible publically.<br>If you are the owner of the form, you can set it to "Public" in the "Configuration" panel in the form admin.</div></div></div></section>'),a.put("form_modules/forms/base/views/submit-form.client.view.html","<section class=public-form ng-style=\"{ 'background-color': myform.design.colors.backgroundColor }\"><submit-form-directive myform=myform></submit-form-directive></section><script ng-if=myform.analytics.gaCode>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t\t\t\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\t\t\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\t})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n\tga('create', '{{myform.analytics.gaCode}}', 'auto');\n\tga('send', 'pageview');</script>"),a.put("form_modules/forms/base/views/directiveViews/entryPage/startPage.html",'<div class="field row text-center"><div class="col-xs-12 text-center"><h1>{{pageData.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-left"><p style=color:#ddd>{{pageData.introParagraph}}</p></div></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in pageData.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"><p class="col-xs-3 col-xs-offset-3 text-center"><button class="btn btn-info" type=button><a ng-click=exitpageData() style="color:white; font-size: 1.6em; text-decoration: none">{{ \'CONTINUE_FORM\' | translate }}</a></button></p></div>'),a.put("form_modules/forms/base/views/directiveViews/field/date.html",'<div class="field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i> </small>{{field.title}} <span class=required-error ng-show="!field.required && !field.fieldValue">{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><div class="control-group input-append"><input class=focusOn ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" ng-class="{ \'no-border\': !!field.fieldValue }" ui-date=dateOptions ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled placeholder=MM/DD/YYYY ng-focus="setActiveField(field._id, index, true)" on-tab-key=nextField() on-tab-and-shift-key=prevField() ng-change=$root.nextField()></div></div></div>'),a.put("form_modules/forms/base/views/directiveViews/field/dropdown.html",'<div class="field row dropdown" ng-if="field.fieldOptions.length > 0"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i> </small>{{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><ui-select ng-model=field.fieldValue theme=selectize search-enabled=true search-by=option_value set-search-to-answer=true ng-required=field.required ng-disabled=field.disabled on-tab-and-shift-key=prevField() on-tab-key=nextField() ng-change=$root.nextField()><ui-select-match placeholder="Type or select an option"></ui-select-match><ui-select-choices repeat="option in field.fieldOptions | filter: $select.search" ng-class="{\'active\': option.option_value === field.fieldValue }"><span ng-bind-html="option.option_value | highlight: $select.search"></span></ui-select-choices></ui-select></div></div><br>'),a.put("form_modules/forms/base/views/directiveViews/field/file.html",'<div class="field row" ng-if=form.autofillPDFs ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i> </small>{{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3></div><div class="col-sm-8 field-input"><div class=input-group><div tabindex=-1 class="form-control file-caption"><span class=file-caption-ellipsis ng-if=!form.pdf>…</span><div class=file-caption-name ng-if=form.pdf>{{field.file.originalname}}</div></div><div class=input-group-btn><button type=button ng-if=field.file ng-click=removeFile(field); title="Clear selected files" class="btn btn-danger fileinput-remove fileinput-remove-button"><i class="glyphicon glyphicon-trash"></i> {{ \'DELETE\' | translate }}</button> <button type=button ng-if=field.fileLoading title="Abort ongoing upload" class="btn btn-default" ng-click=cancelFileUpload(field)><i class="glyphicon glyphicon-ban-circle"></i> {{ \'CANCEL\' | translate }}</button><div class="btn btn-success btn-file" ngf-select ngf-change=uploadPDF($files) ng-if=!field.file><i class="glyphicon glyphicon-upload"></i> {{ UPLOAD_FILE | translate }}</div></div></div></div></div>'),a.put("form_modules/forms/base/views/directiveViews/field/hidden.html",'<input ng-focus="setActiveField(field._id, index, true)" ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=hidden ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" value={{field.fieldValue}} ng-disabled=field.disabled>'),a.put("form_modules/forms/base/views/directiveViews/field/legal.html",'<div class="field row radio legal" on-enter-or-tab-key=nextField() key-to-truthy key-char-truthy=y key-char-falsey=n field=field><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i> </small>{{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><br><p class=col-xs-12>{{field.description}}</p></div><div class="col-xs-12 field-input container"><div class=row-fluid on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField()><label class="btn col-md-5 col-xs-12" ng-class="{activeBtn: field.fieldValue == \'true\'}"><input class=focusOn ng-focus="setActiveField(field._id, index, true)" ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=radio value=true ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change=$root.nextField()><div class=letter style=float:left>Y</div><span>{{ \'LEGAL_ACCEPT\' | translate }}</span></label><label class="btn col-md-5 col-md-offset-1 col-xs-12" ng-class="{activeBtn: field.fieldValue == \'false\'}"><input class=focusOn ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=radio value=false ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change=$root.nextField()><div class=letter style=float:left>N</div><span>{{ \'LEGAL_NO_ACCEPT\' | translate }}</span></label></div></div></div><br>'),a.put("form_modules/forms/base/views/directiveViews/field/radio.html",'<div class="field row radio" on-enter-or-tab-key=nextField() key-to-option field=field ng-if="field.fieldOptions.length > 0"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i> </small>{{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><div ng-repeat="option in field.fieldOptions" class=row-fluid><label class="btn col-md-4 col-xs-12 col-sm-12" style="margin: 0.5em; padding-left:30px" ng-class="{activeBtn: field.fieldValue == field.fieldOptions[$index].option_value}"><div class=letter style=float:left>{{$index+1}}</div><input ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=radio class=focusOn ng-focus="setActiveField(field._id, index, true)" value={{option.option_value}} ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change=$root.nextField()> <span ng-bind=option.option_value></span></label></div></div></div><br>'),a.put("form_modules/forms/base/views/directiveViews/field/rating.html",'<div class="textfield field row" on-enter-or-tab-key=nextField()><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i> </small>{{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><input-stars max={{field.ratingOptions.steps}} ng-init="field.fieldValue = 1" on-star-click=$root.nextField() icon-full={{field.ratingOptions.shape}} icon-base="fa fa-3x" icon-empty={{field.ratingOptions.shape}} ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-focus="setActiveField(field._id, index, true)" class="angular-input-stars focusOn"></input-stars></div></div>'),a.put("form_modules/forms/base/views/directiveViews/field/statement.html",'<div class="statement field row" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-focus="setActiveField(field._id, index, true)"><div class="row field-title field-title"><div class=col-xs-1><i class="fa fa-quote-left fa-1"></i></div><h2 class="text-left col-xs-9">{{field.title}}</h2><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="row field-title field-input"><p class=col-xs-12 ng-if=field.description.length>{{field.description}}</p><br><div class="col-xs-offset-1 col-xs-11"><button class="btn focusOn" ng-style="{\'font-size\': \'1.3em\', \'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-focused="setActiveField(field._id, index, true)" ng-click=$root.nextField()>{{ \'CONTINUE\' | translate }}</button></div></div></div>'),a.put("form_modules/forms/base/views/directiveViews/field/textarea.html",'<div class="field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i> </small>{{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><small>{{ \'NEWLINE\' | translate }}</small><p><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><small style=font-size:0.6em>Press SHIFT+ENTER to add a newline</small><textarea class="textarea focusOn" type=text ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-class="{ \'no-border\': !!field.fieldValue }" value={{field.fieldValue}} ng-required=field.required ng-disabled=field.disabled ng-focus="setActiveField(field._id, index, true)" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() style="border: none; border-left: lightgrey dashed 2px">\n\t\t</textarea></div></div><div><div class="btn btn-lg btn-default col-xs-12 col-sm-4 hidden-xs" style="padding: 4px; margin-top:8px; background: rgba(255,255,255,0.5)"><button ng-disabled="!field.fieldValue || forms.myForm.{{field.fieldType}}{{$index}}.$invalid" ng-style="{\'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-click=$root.nextField() class="btn col-sm-5 col-xs-5">{{ \'OK\' | translate }} <i class="fa fa-check"></i></button><div class="col-sm-3 col-xs-6" style=margin-top:0.2em><small style="color:#ddd; font-size:70%">{{ \'ENTER\' | translate }}</small></div></div></div>'),a.put("form_modules/forms/base/views/directiveViews/field/textfield.html",'<div class="textfield field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title row-fluid" ng-style="{\'color\': design.colors.questionColor}"><h3 class=col-xs-12><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i> </small>{{field.title}} <span class=required-error ng-show=!field.required>({{ \'OPTIONAL\' | translate }})</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><input ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" name={{field.fieldType}}{{index}} type={{input_type}} ng-pattern=validateRegex placeholder={{placeholder}} ng-class="{ \'no-border\': !!field.fieldValue }" class="focusOn text-field-input" ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" value=field.fieldValue ng-focus="setActiveField(field._id, index, true)" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-required=field.required ng-disabled=field.disabled aria-describedby=inputError2Status></div><div class=col-xs-12><div ng-show="forms.myForm.{{field.fieldType}}{{index}}.$invalid && !!forms.myForm.{{field.fieldType}}{{index}}.$viewValue " class="alert alert-danger" role=alert><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>Error:</span> <span ng-if="field.fieldType == \'email\'">{{ \'ERROR_EMAIL_INVALID\' | translate }} </span><span ng-if=field.validateRegex>{{ \'ERROR_NOT_A_NUMBER\' | translate }} </span><span ng-if="field.fieldType == \'link\'">{{ \'ERROR_URL_INVALID\' | translate }}</span></div></div></div><div><div class="btn btn-lg btn-default col-xs-12 col-sm-4 hidden-xs" style="padding: 4px; margin-top:8px; background: rgba(255,255,255,0.5)"><button ng-disabled="!field.fieldValue || forms.myForm.{{field.fieldType}}{{$index}}.$invalid" ng-style="{\'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-click=nextField() class="btn col-sm-5 col-xs-5">{{ \'OK\' | translate }} <i class="fa fa-check"></i></button><div class="col-xs-6 col-sm-3" style=margin-top:0.2em><small style="color:#ddd; font-size:70%">{{ \'ENTER\' | translate }}</small></div></div></div>'),a.put("form_modules/forms/base/views/directiveViews/field/yes_no.html",'<div class="field row radio" ng-click="setActiveField(field._id, index, true)" on-tab-and-shift-key=prevField() key-to-truthy key-char-truthy=y key-char-falsey=n field=field><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3 class=row><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i> </small>{{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=row>{{field.description}}</p></div><div class="col-xs-12 field-input"><div class=row><label class="btn btn-default col-md-2 col-sm-3 col-xs-7" style="background: rgba(0,0,0,0.1); text-align:left"><input type=radio value=true class=focusOn style="opacity: 0; margin-left: 0px" ng-model=field.fieldValue ng-focus="setActiveField(field._id, index, true)" ng-model-options="{ debounce: 250 }" ng-required=field.required ng-change=$root.nextField() ng-disabled=field.disabled><div class=letter>{{ \'Y\' | translate }}</div><span>{{ \'YES\' | translate }}</span> <i ng-show="field.fieldValue === \'true\'" class="fa fa-check" aria-hidden=true></i></label></div><div class=row style="margin-top: 10px"><label class="btn btn-default col-md-2 col-sm-3 col-xs-7" style="background: rgba(0,0,0,0.1); text-align:left"><input type=radio value=false style="opacity:0; margin-left:0px" ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-change=$root.nextField() ng-disabled=field.disabled><div class=letter>{{ \'N\' | translate }}</div><span>{{ \'NO\' | translate }}</span> <i ng-show="field.fieldValue === \'false\'" class="fa fa-check" aria-hidden=true></i></label></div></div></div><br>'),a.put("form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html",'<section class="overlay submitform" ng-if="loading || (!myform.submitted && !myform.startPage.showStart)"></section><div ng-show="!myform.submitted && myform.startPage.showStart" class=form-submitted style="padding-top: 35vh"><div class=row><div class="col-xs-12 text-center" style="overflow-wrap: break-word"><h1 style="font-weight: 400; nont-size: 25px">{{myform.startPage.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-center" style="overflow-wrap: break-word"><p style="color: grey; font-weight: 100; font-size: 16px">{{myform.startPage.introParagraph}}</p></div></div><div class="row form-actions text-center" style="padding: 5px 25px 5px 25px"><button ng-click=exitStartPage() class=btn type=button ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}"><span style="font-size: 1.6em">{{myform.startPage.introButtonText}}</span></button></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 style="background-color:rgb(156, 226, 235)" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none" ng-style="{\'color\':button.color}">{{button.text}}</a></button></p></div></div><div class=form-fields ng-show="!myform.submitted && !myform.startPage.showStart" ng-style="{ \'border-color\': myform.design.colors.buttonTextColor }"><div class=row><form name=forms.myForm novalidate class="submission-form col-sm-12 col-md-offset-1 col-md-10"><div ng-repeat="field in myform.form_fields" ng-if=!field.deletePreserved data-index={{$index}} data-id={{field._id}} ng-class="{activeField: selected._id == field._id }" class="row field-directive"><field-directive field=field design=myform.design index=$index forms=forms></field-directive></div></form></div><div class="row form-actions" id=submit_field ng-class="{activeField: selected._id == \'submit_field\' }" ng-style="{ \'background-color\':myform.design.colors.buttonColor}" style="border-top: 1px solid #ddd; margin-right: -13%; margin-left: -13%; margin-top: 30vh; height: 100vh"><div class="col-xs-12 text-left" style="background-color:#990000; color:white" ng-if=forms.myForm.$invalid>{{ \'COMPLETING_NEEDED\' | translate:translateAdvancementData }}</div><button ng-if=!forms.myForm.$invalid class="Button btn col-sm-2 col-xs-8 focusOn" v-busy=loading v-busy-label="Please wait" v-pressable ng-disabled="loading || forms.myForm.$invalid" ng-click=submitForm() on-enter-key=submitForm() on-enter-key-disabled="loading || forms.myForm.$invalid" ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" style="font-size: 1.6em; margin-left: 1em; margin-top: 1em">{{ \'SUBMIT\' | translate }}</button> <button ng-if=forms.myForm.$invalid class="Button btn col-sm-2 col-xs-8 focusOn" ng-click=goToInvalid() on-enter-key=goToInvalid() on-enter-key-disabled=!forms.myForm.$invalid style="font-size: 1.6em; margin-left: 1em; margin-top: 1em; background-color:#990000; color:white">{{ \'REVIEW\' | translate }}</button><div class="col-sm-2 hidden-xs" style="font-size: 75%; margin-top:3.25em"><small>{{ \'ENTER\' | translate }}</small></div></div><section ng-if=!myform.hideFooter class="navbar navbar-fixed-bottom" ng-style="{ \'background-color\':myform.design.colors.buttonColor, \'padding-top\': \'15px\', \'border-top\': \'2px \'+ myform.design.colors.buttonTextColor +\' solid\', \'color\':myform.design.colors.buttonTextColor}"><div class=container-fluid><div class=row><div class="col-sm-5 col-md-6 col-xs-5" ng-show=!myform.submitted><p class=lead>{{ \'ADVANCEMENT\' | translate:translateAdvancementData }}</p></div><div class="col-md-6 col-md-offset-0 col-sm-offset-2 col-sm-3 col-xs-offset-1 col-xs-6 row"><div class="col-md-4 col-md-offset-2 hidden-sm hidden-xs"><a href=/#!/forms class=btn ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}">{{ \'CREATE_FORM\' | translate }}</a></div><div class="col-md-4 col-sm-10 col-md-offset-0 col-sm-offset-2 col-xs-12 row"><button class="btn btn-lg col-xs-6" id=focusDownButton ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" ng-click=nextField() ng-disabled="selected.index > myform.form_fields.length-1"><i class="fa fa-chevron-down"></i></button> <button class="btn btn-lg col-xs-6" id=focusUpButton ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" ng-click=prevField() ng-disabled="selected.index == 0"><i class="fa fa-chevron-up"></i></button></div></div></div></div></section></div><div ng-if="myform.submitted && !loading && !myform.endPage.showEnd" class=form-submitted ng-style="{\'color\':myform.design.colors.buttonTextColor}" style="padding-top: 5vh"><div class="field row text-center"><div class="col-xs-12 col-sm-12 col-md-6 col-md-offset-3 text-center">{{ \'FORM_SUCCESS\' | translate }}</div></div><div class="row form-actions"><p class=text-center><button ng-click=reloadForm() class=btn type=button ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}"><span style="font-size: 1.6em">{{ \'BACK_TO_FORM\' | translate }}</span></button></p></div></div><div ng-if="myform.submitted && !loading && myform.endPage.showEnd" class=form-submitted ng-style="{\'color\':myform.design.colors.buttonTextColor}" style="padding-top: 5vh"><div class=row><div class="col-xs-12 text-center" style="overflow-wrap: break-word"><h1 style="font-weight: 400; nont-size: 25px">{{myform.endPage.title}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-center" style="overflow-wrap: break-word"><p style="color: grey; font-weight: 100; font-size: 16px">{{myform.endPage.paragraph}}</p></div></div><div class="row form-actions text-center" style="padding: 5px 25px 5px 25px"><button ng-click=reloadForm() class=btn type=button ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}"><span style="font-size: 1.6em">{{myform.endPage.buttonText}}</span></button></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in myform.endPage.buttons" class=text-center style=display:inline><button class=btn style="background-color:rgb(156, 226, 235)" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none" ng-style="{\'color\':button.color}">{{button.text}}</a></button></p></div></div>')}]),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<a.field.fieldOptions.length&&(b.preventDefault(),a.$apply(function(){a.field.fieldValue=a.field.fieldOptions[d].option_value}))})}}}),angular.module("view-form").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("view-form").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&&"rating"!==a.fieldType&&"statement"!==a.fieldType?!!a.fieldValue:"rating"===a.fieldType||void 0}).length;return d-(a.form_fields.length-a.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"),angular.module("view-form").controller("SubmitFormController",["$scope","$rootScope","$state","$translate","myForm",function(a,b,c,d,e){a.myform=e,d.use(e.language)}]),angular.module("view-form").directive("fieldIconDirective",function(){return{template:'<i class="{{typeIcon}}"></i>',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<c;b++)if(b in this&&this[b]===a)return b;return-1};angular.module("view-form").directive("fieldDirective",["$http","$compile","$rootScope","$templateCache","supportedFields",function(a,b,c,d,e){var f=function(a){var b=a,c="form_modules/forms/base/views/directiveViews/field/";return __indexOf.call(e,b)>=0&&(c=c+b+".html"),d.get(c)};return{template:"<div>{{field.title}}</div>",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.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)<parseInt(d);case"<=":return parseInt(c)<=parseInt(d);default:return!1}else switch(e.operator){case"==":return c===d;case"!==":return c!==d;case"contains":return c.indexOf(d)>-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<h.myform.visible_form_fields.length;j++){var k=h.myform.visible_form_fields[j];if(a===k._id){h.selected.index=j;break}}var m=c("formValidity")(h.myform);h.translateAdvancementData={done:m,total:i,answers_not_completed:i-m},g?(h.noscroll=!0,setTimeout(function(){f.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(){document.querySelectorAll(".activeField .focusOn")[0]?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input")[0].focus()}),e.send(h.myform,l(),b.getTimeElapsed())}},d.nextField=h.nextField=function(){var a=h.myform.visible_form_fields[h.selected.index];if(h.selected&&h.selected.index>-1)if(a.logicJump&&k(a))d.setActiveField(a.logicJump.jumpTo,null,!0);else{var b,c;h.selected.index<h.myform.visible_form_fields.length-1?(b=h.selected.index+1,c=h.myform.visible_form_fields[b]._id,d.setActiveField(c,b,!0)):h.selected.index===h.myform.visible_form_fields.length-1&&(b=h.selected.index+1,c="submit_field",d.setActiveField(c,b,!0))}},d.prevField=h.prevField=function(){if(h.selected.index>0){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<h.myform.form_fields.length;j++)"dropdown"!==h.myform.form_fields[j].fieldType||h.myform.form_fields[j].deletePreserved||(h.myform.form_fields[j].fieldValue=h.myform.form_fields[j].fieldValue.option_value);setTimeout(function(){h.submitPromise=a.post("/forms/"+h.myform._id,f).success(function(a,b){h.myform.submitted=!0,h.loading=!1,e.send(h.myform,l(),d)}).error(function(a){h.loading=!1,console.error(a),h.error=a.message})},500)},h.reloadForm()}]}}]),angular.module("view-form").service("CurrentForm",function(){var a={};this.getForm=function(){return a},this.setForm=function(b){a=b}}),angular.module("view-form").factory("Forms",["$resource","VIEW_FORM_URL",function(a,b){return a(b,{formId:"@_id"},{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"}})}]),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;g={connect:c,emit:d,on:e,removeListener:f,socket:null};var h="";return h=b.socketUrl&&b.socketPort?window.location.protocol+"//"+b.socketUrl+":"+b.socketPort:b.socketUrl&&!b.socketPort?window.location.protocol+"//"+b.socketUrl:b.socketPort?window.location.protocol+"//"+window.location.hostname+":"+b.socketPort:window.location.protocol+"//"+window.location.hostname,c(h),g}angular.module("view-form").factory("Socket",a),a.$inject=["$timeout","$window"]}(),angular.module("view-form").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}}]); |