2022-02-26 21:30:11 -05:00
|
|
|
"use strict";
|
|
|
|
Vue.component('tf-user', {
|
|
|
|
props: ['id'],
|
|
|
|
computed: {
|
|
|
|
following: {
|
|
|
|
get: function() {
|
|
|
|
return g_data.users &&
|
|
|
|
g_data.users[g_data.whoami] &&
|
|
|
|
g_data.users[g_data.whoami].following &&
|
|
|
|
g_data.users[g_data.whoami].following[this.id];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
whoami: { get: function() { return g_data.whoami; } },
|
|
|
|
users: { get: function() { return g_data.users; } },
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
show_user: function() {
|
|
|
|
window.parent.postMessage({action: 'setHash', hash: this.id}, '*');
|
|
|
|
},
|
|
|
|
},
|
2022-04-14 19:47:41 -04:00
|
|
|
template: `<md-chip :class="following ? 'md-accent' : ''">
|
|
|
|
<a :href="'#' + id" style="color: #fff">{{users[id] && users[id].name ? users[id].name : id}}</a>
|
2022-02-26 21:30:11 -05:00
|
|
|
<md-tooltip v-if="users[id] && users[id].name">{{id}}</md-tooltip>
|
|
|
|
</md-chip>`,
|
|
|
|
});
|