1/** 2 * @file 3 * Contains \Drupal\view_password\password.js. 4 */ 5 6(function ($) { 7 8 Drupal.behaviors.pwd = { 9 attach: function (context) { 10 11 $(".pwd-see :password").after("<span class='shwpd eye-close'></span>"); 12 // To stop repeating of image on rebuild of form. 13 $('span.eye-close').each(function () { 14 while ($(this).prop('tagName') == $(this).next().prop('tagName')) { 15 $(this).next().remove(); 16 } 17 }); 18 19 $(".shwpd").on('click', function () { 20 21 var pwd_clk_nme = $(this).prev(':password').attr('name'); 22 23 // If two password fields are there, then stop both from acting. 24 if ($(this).prev(':password').attr('name') == pwd_clk_nme) { 25 26 // To toggle the images. 27 $(this).toggleClass("eye-close eye-open"); 28 29 // Get the classnames of clicked element. 30 var classNames = $(this).attr("class").toString().split(' '); 31 $.each(classNames, function (i, className) { 32 33 if (className == 'eye-open') { 34 $('.eye-open').prev(':password').prop('type', 'text'); 35 } 36 else if (className == 'eye-close') { 37 $('.eye-close').prev(':text').prop('type', 'password'); 38 } 39 }); 40 } 41 }); 42 43 } 44 }; 45})(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.