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