/** * The Linked accounts card on an account's page: other accounts that share a play key, email address or login address * with this one (from what the servers store; addresses themselves are never shown), and how many player reports are * about this account. */ (function () { 'use strict'; var card = document.getElementById('linksCard'); if (!card) return; var accountId = card.dataset.account; function detail(l) { if (l.link === 'PLAY_KEY') return l.name + (l.shared > 2 ? ' (' + l.shared + ' accounts use it)' : ''); if (l.link === 'LOGIN_ADDRESS') return l.name + (l.shared > 1 ? ' (' + l.shared + ')' : '') + (l.last_seen ? ', last ' + fmt.unix(l.last_seen) : ''); return l.name; } function load() { api.get('/api/accounts/' + accountId + '/links').then(function (d) { if (!d.success) return; var html = d.accounts.map(function (a) { return '