37 lines
No EOL
1.3 KiB
JavaScript
37 lines
No EOL
1.3 KiB
JavaScript
jQuery(document).ready(function($) {
|
|
|
|
// $('#show-tokens').on('click', function() {
|
|
// if ($('input.token').attr('type') == 'password') {
|
|
// $('input.token').attr('type', 'text');
|
|
// $(this).addClass('dashicons-hidden').removeClass('dashicons-visibility')
|
|
// } else {
|
|
// $('input.token').attr('type', 'password');
|
|
// $(this).addClass('dashicons-visibility').removeClass('dashicons-hidden')
|
|
// }
|
|
// return false;
|
|
// });
|
|
|
|
$('input.token').each(function() {
|
|
var token = $(this)
|
|
var toggle = $('<a href="#" class="token-toggle dashicons dashicons-visibility"></a>');
|
|
token.wrap('<span class="token-box"></span>').after(toggle);
|
|
toggle.on('click', function() {
|
|
if (token.attr('type') == 'password') {
|
|
token.attr('type', 'text')
|
|
toggle.addClass('dashicons-hidden').removeClass('dashicons-visibility')
|
|
} else {
|
|
token.attr('type', 'password')
|
|
toggle.addClass('dashicons-visibility').removeClass('dashicons-hidden')
|
|
}
|
|
return false;
|
|
});
|
|
});
|
|
|
|
$('.repo-toggle').on('click', function() {
|
|
var id = $(this).data('repo');
|
|
$('.repo-'+id).toggleClass('open')
|
|
$('.repo-'+id+' > ul.packages').slideToggle(400)
|
|
return false;
|
|
});
|
|
|
|
}); |