1(function($) { 2 __ = wp.i18n.__; 3 4 function mpResetToggle( button, show ) { 5 $(button) 6 .attr({ 7 'aria-label': show ? __( 'Show password' ) : __( 'Hide password' ) 8 }) 9 .find( '.text' ) 10 .text( show ? __( 'Show' ) : __( 'Hide' ) ) 11 .end() 12 .find( '.dashicons' ) 13 .removeClass( show ? 'dashicons-hidden' : 'dashicons-visibility' ) 14 .addClass( show ? 'dashicons-visibility' : 'dashicons-hidden' ); 15 } 16 17 $(document).ready( function() { 18 $('button.mp-hide-pw').each(function(index, button) { 19 $(button).show().on( 'click', function () { 20 pass = $(button).prev(); 21 if ( 'password' === $(pass).attr( 'type' ) ) { 22 $(pass).attr( 'type', 'text' ); 23 mpResetToggle( button, false ); 24 } else { 25 pass.attr( 'type', 'password' ); 26 mpResetToggle( button, true ); 27 } 28 }); 29 }); 30 }); 31})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.