|
|
@ -14,6 +14,7 @@ module.exports = class { |
|
|
|
multipart: false, |
|
|
|
anchored: false, |
|
|
|
prevWasText: false, |
|
|
|
dark: false, |
|
|
|
} |
|
|
|
|
|
|
|
this.mounted = false; |
|
|
@ -83,18 +84,30 @@ module.exports = class { |
|
|
|
|
|
|
|
this.state.text = input.post.text |
|
|
|
|
|
|
|
if (input.highlights.length > 0 && (input.post.kind === "action" || input.post.kind === "text")) { |
|
|
|
this.state.dark = true |
|
|
|
} else { |
|
|
|
this.state.dark = false |
|
|
|
} |
|
|
|
|
|
|
|
if (!input.post.nick.startsWith("=")) { |
|
|
|
const postNick = input.post.nick.replace("'s", "").replace("s'", "s") |
|
|
|
for (const character of input.characters) { |
|
|
|
for (const nick of character.nicks) { |
|
|
|
if (nick === postNick) { |
|
|
|
this.state.name = character.name |
|
|
|
this.state.name = character.name + character.id |
|
|
|
this.state.shortName = character.shortName |
|
|
|
|
|
|
|
if (input.post.nick.endsWith("'s") || input.post.nick.endsWith("'")) { |
|
|
|
this.state.nameSuffix = (character.shortName.endsWith("s") || character.shortName.endsWith("z")) ? "'" : "'s" |
|
|
|
} |
|
|
|
|
|
|
|
if (input.highlights.length > 0) { |
|
|
|
this.state.dark = !(input.highlights.includes(character.id)) |
|
|
|
} else { |
|
|
|
this.state.dark = false |
|
|
|
} |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|