feat: hide IP addresses by default, click to reveal
Added maskIp() helper that replaces IPs with ••••••••. A global delegated click handler reveals the address on click. Applied to: - Player list 'Address' column - Player info 'Address' field Styled .ip-masked with dimmed text and purple hover glow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -109,6 +109,23 @@
|
||||
|
||||
Router.start('#app-view');
|
||||
|
||||
// ---- IP address masking ----
|
||||
window.maskIp = function (ip) {
|
||||
if (!ip) return '';
|
||||
return '<span class="ip-masked" data-ip="' + ip + '" title="Click to reveal IP">••••••••</span>';
|
||||
};
|
||||
|
||||
document.addEventListener('click', function (e) {
|
||||
var el = e.target.closest('.ip-masked');
|
||||
if (el) {
|
||||
el.classList.remove('ip-masked');
|
||||
el.classList.add('ip-revealed');
|
||||
el.textContent = el.dataset.ip;
|
||||
el.title = '';
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// ---- Initial state ----
|
||||
showDisconnected();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user