logs-content: Added possessive prefix if nick has that.
This commit is contained in:
@@ -4,6 +4,7 @@ module.exports = class {
|
||||
shortName: "",
|
||||
name: "",
|
||||
text: "",
|
||||
nameSuffix: "",
|
||||
modal: null,
|
||||
removed: false,
|
||||
}
|
||||
@@ -39,6 +40,7 @@ module.exports = class {
|
||||
updatePost(input) {
|
||||
this.state.shortName = input.post.nick.split("_").shift()
|
||||
this.state.name = input.post.nick
|
||||
this.state.nameSuffix = ""
|
||||
|
||||
this.state.text = input.post.text.replace(/\x02/g, "**")
|
||||
|
||||
@@ -51,7 +53,15 @@ module.exports = class {
|
||||
for (const character of input.characters) {
|
||||
for (const nick of character.nicks) {
|
||||
if (nick === postNick) {
|
||||
this.state.name = character.name
|
||||
this.state.shortName = character.shortName
|
||||
|
||||
if (input.post.nick.endsWith("'s")) {
|
||||
this.state.nameSuffix = "'s"
|
||||
} else if (input.post.nick.endsWith("'")) {
|
||||
this.state.nameSuffix = "'"
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<markdown class="post-content post-scene" source=state.text />
|
||||
</div>
|
||||
<div if(input.post.kind === "action") class="post-body color-text">
|
||||
<markdown class="post-content post-action" source=(state.shortName + " " + state.text) />
|
||||
<markdown class="post-content post-action" source=(state.shortName + state.nameSuffix + " " + state.text) />
|
||||
</div>
|
||||
<div if(input.post.kind === "text") class="post-body color-text">
|
||||
<markdown class="post-content post-text" source=state.text />
|
||||
|
||||
Reference in New Issue
Block a user