This repository was archived by the owner on Jan 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-14
lines changed
Expand file tree Collapse file tree 1 file changed +21
-14
lines changed Original file line number Diff line number Diff line change 1313// limitations under the License.
1414
1515( function ( ) {
16- var placeholder = '**********' ;
17- var showingPassword = false ;
18- new Clipboard ( document . getElementById ( 'copypassword' ) ) ;
19- document . getElementById ( 'showpassword' ) . addEventListener ( 'click' , function ( e ) {
20- showingPassword = ! showingPassword ;
21- var el = document . getElementById ( 'password' ) ;
22- if ( showingPassword ) {
23- e . target . textContent = 'Hide' ;
24- el . textContent = el . dataset . value ;
25- } else {
26- e . target . textContent = 'Show' ;
27- el . textContent = placeholder ;
28- }
29- } ) ;
16+ var onload = function ( ) {
17+ var placeholder = '**********' ;
18+ var showingPassword = false ;
19+ new Clipboard ( document . getElementById ( 'copypassword' ) ) ;
20+ document . getElementById ( 'showpassword' ) . addEventListener ( 'click' , function ( e ) {
21+ showingPassword = ! showingPassword ;
22+ var el = document . getElementById ( 'password' ) ;
23+ if ( showingPassword ) {
24+ e . target . textContent = 'Hide' ;
25+ el . textContent = el . dataset . value ;
26+ } else {
27+ e . target . textContent = 'Show' ;
28+ el . textContent = placeholder ;
29+ }
30+ } ) ;
31+ } ;
32+ if ( document . readyState != 'loading' ) {
33+ onload ( ) ;
34+ } else {
35+ document . addEventListener ( 'DOMContentLoaded' , onload ) ;
36+ }
3037} ) ( ) ;
You can’t perform that action at this time.
0 commit comments