mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 05:31:15 -07:00
Reveal token input fields if blank
This commit is contained in:
parent
74b4e45915
commit
40e0db4f70
5 changed files with 31 additions and 10 deletions
|
@ -891,3 +891,23 @@ function loadBlurHash(elem, src) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
function _toggleRevealToken(elem, click) {
|
||||
var input = elem.parent().next('input');
|
||||
if ((input.prop('type') === 'password' && click) || !input.val()) {
|
||||
input.prop('type', 'text');
|
||||
elem.children('.fa').removeClass('fa-eye-slash').addClass('fa-eye');
|
||||
} else {
|
||||
input.prop('type', 'password');
|
||||
elem.children('.fa').removeClass('fa-eye').addClass('fa-eye-slash');
|
||||
}
|
||||
}
|
||||
function toggleRevealTokens() {
|
||||
$('.reveal-token').each(function () {
|
||||
_toggleRevealToken($(this));
|
||||
});
|
||||
}
|
||||
|
||||
$('body').on('click', '.reveal-token', function() {
|
||||
_toggleRevealToken($(this), true);
|
||||
});
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
}
|
||||
|
||||
getMobileDevicesTable();
|
||||
toggleRevealTokens();
|
||||
}
|
||||
|
||||
function deleteCallback() {
|
||||
|
@ -122,6 +123,8 @@
|
|||
$('#'+configToggle).val(0);
|
||||
}
|
||||
});
|
||||
|
||||
toggleRevealTokens();
|
||||
</script>
|
||||
% else:
|
||||
<div class="modal-dialog" role="document">
|
||||
|
|
|
@ -676,6 +676,7 @@
|
|||
}
|
||||
|
||||
getNewslettersTable();
|
||||
toggleRevealTokens();
|
||||
}
|
||||
|
||||
function deleteCallback() {
|
||||
|
@ -787,6 +788,8 @@
|
|||
};
|
||||
$(this).on('focus keyup input', function () { resizeTextarea(this); }).removeAttr('data-autoresize');
|
||||
});
|
||||
|
||||
toggleRevealTokens();
|
||||
</script>
|
||||
% else:
|
||||
<div class="modal-dialog" role="document">
|
||||
|
|
|
@ -453,6 +453,7 @@
|
|||
}
|
||||
|
||||
getNotifiersTable();
|
||||
toggleRevealTokens();
|
||||
}
|
||||
|
||||
function deleteCallback() {
|
||||
|
@ -911,6 +912,8 @@
|
|||
};
|
||||
$(this).on('focus keyup input', function () { resizeTextarea(this); }).removeAttr('data-autoresize');
|
||||
});
|
||||
|
||||
toggleRevealTokens();
|
||||
</script>
|
||||
% else:
|
||||
<div class="modal-dialog" role="document">
|
||||
|
|
|
@ -2267,6 +2267,7 @@ $(document).ready(function() {
|
|||
getMobileDevicesTable();
|
||||
loadUpdateDistros();
|
||||
setBaseURLSuffix();
|
||||
toggleRevealTokens();
|
||||
settingsChanged = false;
|
||||
}
|
||||
|
||||
|
@ -3204,16 +3205,7 @@ $(document).ready(function() {
|
|||
openBrowsePath(null, path, filter, description, target);
|
||||
});
|
||||
|
||||
$('body').on('click', '.reveal-token', function() {
|
||||
var input = $(this).parent().next('input');
|
||||
if (input.prop('type') === 'password') {
|
||||
input.prop('type', 'text');
|
||||
$(this).children('.fa').removeClass('fa-eye-slash').addClass('fa-eye');
|
||||
} else {
|
||||
input.prop('type', 'password');
|
||||
$(this).children('.fa').removeClass('fa-eye').addClass('fa-eye-slash');
|
||||
}
|
||||
});
|
||||
toggleRevealTokens();
|
||||
});
|
||||
</script>
|
||||
</%def>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue