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