2017-03-13 19:08:21 +00:00
"use strict" ; function hashFnv32a ( str , asString , seed ) { var i , l , hval = void 0 === seed ? 2166136261 : seed ; for ( i = 0 , l = str . length ; i < l ; i ++ ) hval ^= str . charCodeAt ( i ) , hval += ( hval << 1 ) + ( hval << 4 ) + ( hval << 7 ) + ( hval << 8 ) + ( hval << 24 ) ; return asString ? ( "0000000" + ( hval >>> 0 ) . toString ( 16 ) ) . substr ( - 8 ) : hval >>> 0 } var ApplicationConfiguration = function ( ) { var applicationModuleName = "NodeForm" , applicationModuleVendorDependencies = [ "duScroll" , "ui.select" , "cgBusy" , "ngSanitize" , "vButton" , "ngResource" , "NodeForm.templates" , "ui.router" , "ui.bootstrap" , "ui.utils" , "pascalprecht.translate" ] , 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 . 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 ( "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>' ) , $templateCache . 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 cg-busy="{promise:updatePromise,templateUrl:\'modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html\',message:\'Updating form...\', backdrop:false, wrapperClass:\'.busy-updating-wrapper\'}"></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 } } < / h 3 > \ n
$templateCache . 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.views}}</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 } } < / s t r o n g > < / d i v > < d i v c l a s s = c o l - x s - 3 > < s t r o n g > { { ' F I E L D _ V I E W S ' | t r a n s l a t e } } < / s t r o n g > < / d i v > < d i v c l a s s = c o l - x s - 3 > < s t r o n g > { { ' F I E L D _ R E S P O N S E S ' | t r a n s l a t e } } < / s t r o n g > < / d i v > < d i v c l a s s = c o l - x s - 3 > < s t r o n g > { {
$templateCache . put ( "modules/users/views/authentication/signup.client.view.html" , '<section class="auth signup-view valign-wrapper" data-ng-controller=AuthenticationController><div class="row valign"><div class="col-md-12 text-center vcenter" style="padding-bottom: 50px"><img src=/static/modules/core/img/logo_white.svg height=100px></div><div class="col-xs-offset-3 col-xs-6 col-sm-offset-4 col-sm-4"><form name=userForm data-ng-submit=signup() class="signin form-horizontal" autocomplete=off><fieldset><div data-ng-show=error id=signup_errors class="text-center text-danger">{{\'SIGNUP_ERROR_TEXT\' | translate}}:<br><strong data-ng-bind=error></strong></div><div class=form-group><input id=username name=username class=form-control ng-pattern=languageRegExp ng-minlength=4 ng-model=credentials.username placeholder="{{ \'USERNAME_LABEL\' | translate }}" ng-minlength=4></div><div class=form-group><input type=email id=email name=email class=form-control ng-model=credentials.email placeholder="{{ \'EMAIL_LABEL\' | translate }}"></div><div class=form-group><input type=password id=password name=password class=form-control ng-model=credentials.password placeholder="{{ \'PASSWORD_LABEL\' | translate }}" ng-minlength=4></div><div class="text-center form-group"><button type=submit class="btn btn-signup btn-rounded btn-block">{{ \'SIGNUP_BTN\' | translate }}</button></div></fieldset></form><div class="text-center forgot-password"><a ui-sref=signin>{{ \'SIGN_IN_ACCOUNT_LINK\' | translate }}</a></div></div></div></section>' ) , $templateCache . 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>' ) , $templateCache . 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>" ) , $templateCache . 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>" ) , $templateCache . 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 your password</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"></div><div class=form-group><label for=verifyPassword>{{ \'VERIFY_PASSWORD_LABEL\' | translate } } < / l a b e l > < i n p u t t y p e = p a s s w o r d i d = v e r i f y P a s s w o r d n a m e = v e r i f y P a s s w o r d c l a s s = f o r m - c o n t r o l d a t a - n g - m o d e l = p a s s w o r d D e t a i l s . v e r i f y P a s s w o r d p l a c e h o l d e r = " V e r i f y P a s s w o r d " > < / d i v > < d i v c l a s s = " t e x t - c e n t e r f o r m - g r o u p " > < b u t t o n t y p e = s u b m i t c l a s s = " b t n b t n - l a r g e b t n - p r i m a r y " > U p d a t e P a s s w o r d < / b u t t o n > < / d
document . querySelectorAll ( ".ng-invalid.focusOn" ) [ 0 ] . focus ( ) } ; var getDeviceData = function ( ) { var md = new MobileDetect ( window . navigator . userAgent ) , deviceType = "other" ; return md . tablet ( ) ? deviceType = "tablet" : md . mobile ( ) ? deviceType = "mobile" : md . is ( "bot" ) || ( deviceType = "desktop" ) , { type : deviceType , name : window . navigator . platform } } , getIpAndGeo = function ( ) { $ . ajaxSetup ( { async : ! 1 } ) ; var geoData = $ . getJSON ( "https://freegeoip.net/json/" ) . responseJSON ; return $ . ajaxSetup ( { async : ! 0 } ) , { ipAddr : geoData . ip , geoLocation : { City : geoData . city , Country : geoData . country _name } } } ; $rootScope . submitForm = $scope . submitForm = function ( ) { var _timeElapsed = TimeCounter . stopClock ( ) ; $scope . loading = ! 0 ; var form = _ . cloneDeep ( $scope . myform ) , deviceData = getDeviceData ( ) ; form . device = deviceData ; var geoData = getIpAndGeo ( ) ; form . ipAddr = geoData . ipAddr , form . geoLocation = geoData . geoLocation , console . log ( geoData ) , form . timeElapsed = _timeElapsed , form . percentageComplete = $filter ( "formValidity" ) ( $scope . myform ) / $scope . myform . visible _form _fields . length * 100 , delete form . visible _form _fields ; for ( var i = 0 ; i < $scope . myform . form _fields . length ; i ++ ) "dropdown" !== $scope . myform . form _fields [ i ] . fieldType || $scope . myform . form _fields [ i ] . deletePreserved || ( $scope . myform . form _fields [ i ] . fieldValue = $scope . myform . form _fields [ i ] . fieldValue . option _value ) ; setTimeout ( function ( ) { $scope . submitPromise = $http . post ( "/forms/" + $scope . myform . _id , form ) . success ( function ( data , status , headers ) { $scope . myform . submitted = ! 0 , $scope . loading = ! 1 , SendVisitorData . send ( $scope . myform , getActiveField ( ) , _timeElapsed ) } ) . error ( function ( error ) { $scope . loading = ! 1 , console . error ( error ) , $scope . error = error . message } ) } , 500 ) } , $scope . reloadForm ( ) } ] } } ] ) , angular . module ( "view-form" ) . service ( "CurrentForm" , function ( ) { var _form = { } ; this . getForm = function ( ) { return _form } , this . setForm = function ( form ) { _form = form } } ) , angular . module ( "view-form" ) . factory ( "Forms" , [ "$resource" , "VIEW_FORM_URL" , function ( $resource , VIEW _FORM _URL ) { return $resource ( VIEW _FORM _URL , { formId : "@_id" } , { get : { method : "GET" , transformResponse : function ( data , header ) { var form = angular . fromJson ( data ) ; return form . visible _form _fields = _ . filter ( form . form _fields , function ( field ) { return field . deletePreserved === ! 1 } ) , form } } , update : { method : "PUT" } , save : { method : "POST" } } ) } ] ) , function ( ) { function Socket ( $timeout , $window ) { function connect ( url ) { service . socket = io ( url , { transports : [ "websocket" , "polling" ] } ) } function emit ( eventName , data ) { service . socket && service . socket . emit ( eventName , data ) } function on ( eventName , callback ) { service . socket && service . socket . on ( eventName , function ( data ) { $timeout ( function ( ) { callback ( data ) } ) } ) } function removeListener ( eventName ) { service . socket && service . socket . removeListener ( eventName ) } var service = { connect : connect , emit : emit , on : on , removeListener : removeListener , socket : null } ; return connect ( window . location . protocol + "//" + window . location . hostname + ":" + $window . socketPort ) , service } angular . module ( "view-form" ) . factory ( "Socket" , Socket ) , Socket . $inject = [ "$timeout" , "$window" ] } ( ) , angular . module ( "view-form" ) . service ( "TimeCounter" , [ function ( ) { var _startTime , _endTime = null ; this . timeSpent = 0 , this . restartClock = function ( ) { _startTime = Date . now ( ) , _endTime = null } , this . getTimeElapsed = function ( ) { if ( _startTime ) return Math . abs ( Date . now ( ) . valueOf ( ) - _startTime . valueOf ( ) ) / 1e3 } , this . stopClock = function ( ) { return _startTime && null === _endTime ? ( _endTime = Date . now ( ) , this . timeSpent = Math . abs ( _endTime . valueOf ( ) - _startTime . valueOf ( ) ) / 1e3 , this . _startTime = this . _endTime = null , this . timeSpent ) : new Error ( "Clock has not been started" ) } , this . clockStarted = function ( ) { return ! ! this . _startTime } } ] ) ;