@@ -827,20 +827,25 @@ jQuery(document).ready(function () {
827
827
$ ( '#notificationMeta' ) . removeClass ( "is-invalid" ) ;
828
828
$ ( '#errorExists' ) . hide ( ) ;
829
829
830
- var notoficationMetaIsEmpty = (
830
+ var notificationMetaIsEmpty = (
831
831
! allowEmpty && notificationMeta == "" || ! allowEmpty && notificationMeta . replace ( / \s / g, "" ) == '""' ) ;
832
- if ( notoficationMetaIsEmpty ) {
833
- $ ( '#invalidNotificationMeta' ) . text ( "NotificationMeta must not be empty" ) ;
832
+ if ( notificationMetaIsEmpty ) {
833
+ $ ( '#invalidNotificationMeta' ) . text ( "NotificationMeta must not be empty. " ) ;
834
834
error = true ;
835
835
} else if ( vm . restPost ( ) ) {
836
836
//validate url not implemented yet.
837
837
} else if ( ! vm . restPost ( ) ) {
838
838
// Validate email
839
- var regExpression = / ^ ( ( [ ^ < > ( ) \[ \] \\ . , ; : \s @ " ] + ( \. [ ^ < > ( ) \[ \] \\ . , ; : \s @ " ] + ) * ) | ( " .+ " ) ) @ ( ( \[ [ 0 - 9 ] { 1 , 3 } \. [ 0 - 9 ] { 1 , 3 } \. [ 0 - 9 ] { 1 , 3 } \. [ 0 - 9 ] { 1 , 3 } ] ) | ( ( [ a - z A - Z \- 0 - 9 ] + \. ) + [ a - z A - Z ] { 2 , } ) ) $ / ;
840
- var isInvalidEmailAddress = ( ! regExpression . test ( notificationMeta ) && notificationMeta != "" ) ;
841
- if ( isInvalidEmailAddress ) {
842
- $ ( '#invalidNotificationMeta' ) . text ( "Not a valid email." ) ;
843
- error = true ;
839
+ var emails = notificationMeta . split ( "," ) ;
840
+ for ( var email of emails ) {
841
+ email = email . trim ( ) ;
842
+ var validEmailRegExpression = / ^ ( ( [ ^ < > ( ) \[ \] \\ . , ; : \s @ " ] + ( \. [ ^ < > ( ) \[ \] \\ . , ; : \s @ " ] + ) * ) | ( " .+ " ) ) @ ( ( \[ [ 0 - 9 ] { 1 , 3 } \. [ 0 - 9 ] { 1 , 3 } \. [ 0 - 9 ] { 1 , 3 } \. [ 0 - 9 ] { 1 , 3 } ] ) | ( ( [ a - z A - Z \- 0 - 9 ] + \. ) + [ a - z A - Z ] { 2 , } ) ) $ / ;
843
+ var isValidEmailAddress = validEmailRegExpression . test ( email ) ;
844
+ if ( ! isValidEmailAddress ) {
845
+ $ ( '#invalidNotificationMeta' ) . text ( email + " not a valid email." ) ;
846
+ error = true ;
847
+ break ;
848
+ }
844
849
}
845
850
}
846
851
if ( error ) {
0 commit comments