+ elt.nextElementSibling.classList.remove("active");
+ },
+ isGamer: function(sid) {
+ return this.people[sid].pages.some(p => p.indexOf("/game/") >= 0);
+ },
+ showPlayerActionBtn: function(sid) {
+ // Do not show action btn if I'm anonymous and target isn't playing,
+ // or target is anonymous and not playing,
+ // or target is me and I don't play anywhere.
+ const targetIsGamer = this.isGamer(sid);
+ if ((!this.st.user.name && !targetIsGamer) ||
+ (!this.people[sid].name && !this.isGamer(this.st.user.sid)) ||
+ (sid == this.st.user.sid && !targetIsGamer))
+ {
+ return false;
+ }
+ return true;