File tree Expand file tree Collapse file tree
html/chat-room/html/chat-room-simple Expand file tree Collapse file tree Original file line number Diff line number Diff line change 110110 //:
111111
112112 var def = {
113- username : 'test' ,
114- password : 'test-123'
113+ username : 'test' ,
114+ password : 'test-123' ,
115+ 'password-show' : false ,
115116 } ;
116117
117- var shadow ;
118118
119+ var shadow ;
119120 var ui = { } ;
120121
121122
122123
123124 var btn = { } ;
125+ var set = { } ;
124126 var kd = { } ;
125127 var disp = { } ;
126128 var send = { } ;
157159 }
158160 $ ( info , '#password' ) . value = value ;
159161 $ ( info , '#show' ) . onclick = btn . password ;
162+ var { value, error} = ls . read [ 'chat-simple-password-show' ] ;
163+ if ( error ) {
164+ value = def [ 'password-show' ] ;
165+ }
166+ set . password ( value ) ;
160167
161168 $ ( shadow , '#txt' ) . onkeydown = kd . txt ;
162169 $ ( shadow , '#txt' ) . focus ( ) ;
178185
179186 var node = $ ( shadow , '#password' ) ;
180187 if ( node . getAttribute ( 'type' ) == 'password' ) {
181- node . removeAttribute ( 'type' ) ;
188+ set . password ( false ) ;
182189 } else {
183- node . setAttribute ( 'type' , ' password' ) ;
190+ set . password ( true ) ;
184191 }
185192
186193 } //password
187194
188195
196+ set . password = function ( v ) {
197+
198+ var node = $ ( shadow , '#password' ) ;
199+ if ( v ) {
200+ node . setAttribute ( 'type' , 'password' ) ;
201+ } else {
202+ node . removeAttribute ( 'type' ) ;
203+ }
204+
205+ } //password
206+
189207 kd . txt = function ( e ) {
190208 //console.log(e.ctrlKey,e.key);
191209 if ( e . ctrlKey && e . key == 'Enter' ) {
You can’t perform that action at this time.
0 commit comments