@@ -109,18 +109,18 @@ applyRandomString = function (min_length = 16) {
109109 var randomString = randomString2 ( min_length ) ;
110110 $ ( "input[name=v_password]" ) . val ( randomString ) ;
111111 if ( $ ( "input[name=v_password]" ) . attr ( "type" ) == "text" )
112- $ ( "#v_password " ) . text ( randomString ) ;
112+ $ ( ".js-password-output " ) . text ( randomString ) ;
113113 else
114- $ ( "#v_password " ) . text ( Array ( randomString . length + 1 ) . join ( "*" ) ) ;
114+ $ ( ".js-password-output " ) . text ( Array ( randomString . length + 1 ) . join ( "*" ) ) ;
115115 App . Actions . MAIL_ACC . update_password_meter ( ) ;
116116 generate_mail_credentials ( ) ;
117117} ;
118118
119119generate_mail_credentials = function ( ) {
120120 var div = $ ( '.mail-infoblock' ) . clone ( ) ;
121121 div . find ( '#mail_configuration' ) . remove ( ) ;
122- var pass = div . find ( '#v_password ' ) . text ( ) ;
123- if ( pass == "" ) div . find ( '#v_password ' ) . text ( ' ' ) ;
122+ var pass = div . find ( '.js-password-output ' ) . text ( ) ;
123+ if ( pass == "" ) div . find ( '.js-password-output ' ) . text ( ' ' ) ;
124124 var output = div . text ( ) ;
125125 output = output . replace ( / (?: \r \n | \r | \n | \t ) / g, "|" ) ;
126126 output = output . replace ( / { 2 } / g, "" ) ;
@@ -132,32 +132,32 @@ generate_mail_credentials = function() {
132132 output = output . replace ( / $ / , "" ) ;
133133 output = output . replace ( / : \| / g, ": " ) ;
134134 output = output . replace ( / \| / g, "\n" ) ;
135- $ ( '#v_credentials ' ) . val ( output ) ;
135+ $ ( '.js-hidden-credentials ' ) . val ( output ) ;
136136}
137137
138138$ ( document ) . ready ( function ( ) {
139- $ ( '#v_account ' ) . text ( $ ( 'input[name=v_account]' ) . val ( ) ) ;
140- $ ( '#v_password ' ) . text ( $ ( 'input[name=v_password]' ) . val ( ) ) ;
139+ $ ( '.js-account-output ' ) . text ( $ ( 'input[name=v_account]' ) . val ( ) ) ;
140+ $ ( '.js-password-output ' ) . text ( $ ( 'input[name=v_password]' ) . val ( ) ) ;
141141 generate_mail_credentials ( ) ;
142142
143143 $ ( 'input[name=v_account]' ) . change ( function ( ) {
144- $ ( '#v_account ' ) . text ( $ ( this ) . val ( ) ) ;
144+ $ ( '.js-account-output ' ) . text ( $ ( this ) . val ( ) ) ;
145145 generate_mail_credentials ( ) ;
146146 } ) ;
147147
148148 $ ( 'input[name=v_password]' ) . change ( function ( ) {
149149 if ( $ ( 'input[name=v_password]' ) . attr ( 'type' ) == 'text' )
150- $ ( '#v_password ' ) . text ( $ ( this ) . val ( ) ) ;
150+ $ ( '.js-password-output ' ) . text ( $ ( this ) . val ( ) ) ;
151151 else
152- $ ( '#v_password ' ) . text ( Array ( $ ( this ) . val ( ) . length + 1 ) . join ( '*' ) ) ;
152+ $ ( '.js-password-output ' ) . text ( Array ( $ ( this ) . val ( ) . length + 1 ) . join ( '*' ) ) ;
153153 generate_mail_credentials ( ) ;
154154 } ) ;
155155
156156 $ ( '.toggle-psw-visibility-icon' ) . click ( function ( ) {
157157 if ( $ ( 'input[name=v_password]' ) . attr ( 'type' ) == 'text' )
158- $ ( '#v_password ' ) . text ( $ ( 'input[name=v_password]' ) . val ( ) ) ;
158+ $ ( '.js-password-output ' ) . text ( $ ( 'input[name=v_password]' ) . val ( ) ) ;
159159 else
160- $ ( '#v_password ' ) . text ( Array ( $ ( 'input[name=v_password]' ) . val ( ) . length + 1 ) . join ( '*' ) ) ;
160+ $ ( '.js-password-output ' ) . text ( Array ( $ ( 'input[name=v_password]' ) . val ( ) . length + 1 ) . join ( '*' ) ) ;
161161 generate_mail_credentials ( ) ;
162162 } ) ;
163163
0 commit comments