@@ -113,7 +113,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
113
113
return fields ;
114
114
} , authmethod . getLoginFields = function ( viewEventData ) {
115
115
var fields = authmethod . getRegisterFields ( viewEventData ) ;
116
- ( "sms" === viewEventData . auth_method || "email" === viewEventData . auth_method ) && fields . push ( {
116
+ "sms" !== viewEventData . auth_method && "email" !== viewEventData . auth_method || fields . push ( {
117
117
name : "code" ,
118
118
type : "code" ,
119
119
required : ! 0 ,
@@ -180,7 +180,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
180
180
attrs . code && attrs . code . length > 0 && ( scope . code = attrs . code ) , scope . email = null ,
181
181
attrs . email && attrs . email . length > 0 && ( scope . email = attrs . email ) , scope . isAdmin = ! 1 ,
182
182
autheventid === adminId && ( scope . isAdmin = ! 0 ) , scope . resendAuthCode = function ( field ) {
183
- if ( ! scope . sendingData && "sms" === scope . method && - 1 !== scope . telIndex && ! scope . form [ "input" + scope . telIndex ] . $invalid ) {
183
+ if ( ! scope . sendingData && "sms" === scope . method && scope . telIndex !== - 1 && ! scope . form [ "input" + scope . telIndex ] . $invalid ) {
184
184
field . value = "" ;
185
185
var data = { } ;
186
186
data . tlf = scope . telField . value , scope . sendingData = ! 0 , Authmethod . resendAuthCode ( data , autheventid ) . success ( function ( rcvData ) {
@@ -210,9 +210,13 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
210
210
} ) : angular . isDefined ( rcvData [ "redirect-to-url" ] ) ? $window . location . href = rcvData [ "redirect-to-url" ] : Authmethod . getPerm ( "vote" , "AuthEvent" , autheventid ) . success ( function ( rcvData2 ) {
211
211
var khmac = rcvData2 [ "permission-token" ] , path = khmac . split ( ";" ) [ 1 ] , hash = path . split ( "/" ) [ 0 ] , msg = path . split ( "/" ) [ 1 ] ;
212
212
$window . location . href = "/booth/" + autheventid + "/vote/" + hash + "/" + msg ;
213
- } ) ) : ( scope . sendingData = ! 1 , scope . status = "Not found" , scope . error = $i18next ( "avRegistration.invalidCredentials" ) ) ;
213
+ } ) ) : ( scope . sendingData = ! 1 , scope . status = "Not found" , scope . error = $i18next ( "avRegistration.invalidCredentials" , {
214
+ support : ConfigService . contact . email
215
+ } ) ) ;
214
216
} ) . error ( function ( error ) {
215
- scope . sendingData = ! 1 , scope . status = "Registration error: " + error . message , scope . error = $i18next ( "avRegistration.invalidCredentials" ) ;
217
+ scope . sendingData = ! 1 , scope . status = "Registration error: " + error . message , scope . error = $i18next ( "avRegistration.invalidCredentials" , {
218
+ support : ConfigService . contact . email
219
+ } ) ;
216
220
} ) ;
217
221
}
218
222
} , scope . apply = function ( authevent ) {
@@ -223,7 +227,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
223
227
return scope . stateData [ el . name ] ? ( el . value = scope . stateData [ el . name ] , el . disabled = ! 0 ) : ( el . value = null ,
224
228
el . disabled = ! 1 ) , "email" === el . type && null !== scope . email ? ( el . value = scope . email ,
225
229
el . disabled = ! 0 ) : "code" === el . type && null !== scope . code ? ( el . value = scope . code . trim ( ) . replace ( / | \n | \t | - | _ / g, "" ) . toUpperCase ( ) ,
226
- el . disabled = ! 0 ) : "tlf" === el . type && "sms" === scope . method && ( null !== scope . email && - 1 === scope . email . indexOf ( "@" ) && ( el . value = scope . email ,
230
+ el . disabled = ! 0 ) : "tlf" === el . type && "sms" === scope . method && ( null !== scope . email && scope . email . indexOf ( "@" ) === - 1 && ( el . value = scope . email ,
227
231
el . disabled = ! 0 ) , scope . telIndex = index + 1 , scope . telField = el ) , el ;
228
232
} ) , filled_fields = _ . filter ( fields , function ( el ) {
229
233
return null !== el . value ;
@@ -654,7 +658,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
654
658
}
655
659
var checkCollapse = function ( instance , el , options ) {
656
660
var maxHeight = select ( instance , el , instance . maxHeightSelector ) . css ( "max-height" ) , height = angular . element ( el ) [ 0 ] . scrollHeight ;
657
- if ( - 1 === maxHeight . indexOf ( "px" ) ) return void console . log ( "invalid non-pixels max-height for " + instance . maxHeightSelector ) ;
661
+ if ( maxHeight . indexOf ( "px" ) === - 1 ) return void console . log ( "invalid non-pixels max-height for " + instance . maxHeightSelector ) ;
658
662
if ( maxHeight = parseInt ( maxHeight . replace ( "px" , "" ) ) , height > maxHeight ) {
659
663
if ( instance . isCollapsed ) return ;
660
664
instance . isCollapsed = ! 0 , collapseEl ( instance , el ) . addClass ( "collapsed" ) , select ( instance , el , instance . toggleSelector ) . removeClass ( "hidden in" ) ;
@@ -747,7 +751,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
747
751
}
748
752
if ( void 0 === format && ( format = "str" ) , 0 === total_votes ) return print ( 0 ) ;
749
753
var base = question . totals . valid_votes + question . totals . null_votes + question . totals . blank_votes ;
750
- return ( void 0 === over || null === over ) && ( over = question . answer_total_votes_percentage ) ,
754
+ return void 0 !== over && null !== over || ( over = question . answer_total_votes_percentage ) ,
751
755
"over-valid-votes" === over && ( base = question . totals . valid_votes ) , print ( 100 * total_votes / base ) ;
752
756
} ;
753
757
} ) , angular . module ( "avUi" ) . service ( "CheckerService" , function ( ) {
@@ -847,7 +851,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
847
851
prefix : sumStrs ( d . prefix , item . prefix )
848
852
} ) ;
849
853
} ) , ! 0 ) ) ;
850
- return pass || "chain" !== d . data . groupType ? ! 0 : ! 1 ;
854
+ return ! ( ! pass && "chain" === d . data . groupType ) ;
851
855
} ) ;
852
856
return ret ;
853
857
}
@@ -856,8 +860,8 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
856
860
return function ( number , fixedDigits ) {
857
861
angular . isNumber ( fixedDigits ) && fixedDigits >= 0 && ( number = number . toFixed ( parseInt ( fixedDigits ) ) ) ;
858
862
var number_str = ( number + "" ) . replace ( "." , "," ) , ret = "" , commaPos = number_str . length ;
859
- - 1 !== number_str . indexOf ( "," ) && ( commaPos = number_str . indexOf ( "," ) ) ;
860
- for ( var i = 0 ; commaPos > i ; i ++ ) {
863
+ number_str . indexOf ( "," ) !== - 1 && ( commaPos = number_str . indexOf ( "," ) ) ;
864
+ for ( var i = 0 ; i < commaPos ; i ++ ) {
861
865
var reverse = commaPos - i ;
862
866
reverse % 3 === 0 && reverse > 0 && i > 0 && ( ret += "." ) , ret += number_str [ i ] ;
863
867
}
@@ -867,7 +871,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
867
871
return function ( originString , searchString ) {
868
872
if ( ! angular . isString ( originString ) || ! angular . isString ( searchString ) ) return ! 1 ;
869
873
var lastIndex = originString . indexOf ( searchString ) ;
870
- return - 1 !== lastIndex && lastIndex === originString . length - searchString . length ;
874
+ return lastIndex !== - 1 && lastIndex === originString . length - searchString . length ;
871
875
} ;
872
876
} ) , angular . module ( "avUi" ) . service ( "StateDataService" , [ "$state" , function ( $state ) {
873
877
var data = { } ;
0 commit comments