Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99aec4d2cb | ||
|
|
3f944ff029 | ||
|
|
3cbe42e1ba | ||
|
|
01b501f9e5 | ||
|
|
9b7d182955 | ||
|
|
7c55fc03aa | ||
|
|
6fca626ea2 | ||
|
|
d92e6bfeb0 | ||
|
|
2d89096430 | ||
|
|
3988028256 | ||
|
|
c51733ef3b | ||
|
|
f81f05d274 | ||
|
|
25d4aa73d1 | ||
|
|
e1a5968341 | ||
|
|
5c4446f161 |
@@ -0,0 +1,23 @@
|
|||||||
|
const {parse, BOLD} = require("irc-caret-notation")
|
||||||
|
|
||||||
|
module.exports = class {
|
||||||
|
onCreate() {
|
||||||
|
this.state = {
|
||||||
|
paragraphs: [],
|
||||||
|
prev: "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onInput(input) {
|
||||||
|
if (this.state == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input.source != this.state.prev) {
|
||||||
|
this.state.prev = input.source
|
||||||
|
this.state.paragraphs = input.source.split("\n").filter(l => l.length > 0).map(l => parse(l, {
|
||||||
|
"*": (!(input.source.startsWith("(")) ? BOLD : null),
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<div class=["irc-caret-notation", input.class]>
|
||||||
|
<p for(p in state.paragraphs)>
|
||||||
|
<span for(chunk in p) class=chunk.cssClasses("icn-")>${chunk.text}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<a on-click("onClick") href=input.href>
|
<a on-click("onClick") href=input.href>
|
||||||
<div class=state.classes>
|
<div class=[state.classes, input.weak ? "dark" : null]>
|
||||||
<div class="icon color-primary">${input.icon}</div>
|
<div class=["icon", "color-primary"]>${input.icon}</div>
|
||||||
<div class=["text", input.selected ? "color-primary" : input.textClass]>
|
<div class=["text", input.selected ? "color-primary" : input.textClass]>
|
||||||
<include(input.renderBody) />
|
<include(input.renderBody) />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
const {logHeaderApi} = require("../../../../../rpdata/api/LogHeader")
|
||||||
|
|
||||||
|
module.exports = class {
|
||||||
|
onCreate(input) {
|
||||||
|
this.state = {
|
||||||
|
id: input.log.id,
|
||||||
|
channelName: input.log.channelName,
|
||||||
|
eventName: input.log.eventName,
|
||||||
|
nexts: [],
|
||||||
|
prevs: [],
|
||||||
|
loaded: false,
|
||||||
|
error: null,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount() {
|
||||||
|
this.timeout = setTimeout(() => {
|
||||||
|
logHeaderApi.list().then(logs => {
|
||||||
|
const index = logs.findIndex(l => l.id === this.state.id);
|
||||||
|
if (index === -1) {
|
||||||
|
return Promise.reject("This log not found in list.")
|
||||||
|
}
|
||||||
|
const log = logs[index]
|
||||||
|
const characterIds = log.characters.map(c => c.id);
|
||||||
|
const nexts = []
|
||||||
|
const prevs = []
|
||||||
|
const foundGroups = {}
|
||||||
|
let foundChannel = false
|
||||||
|
|
||||||
|
for (let i = index - 1; i >= 0; --i) {
|
||||||
|
const log2 = logs[i]
|
||||||
|
const hasEvent = (log.eventName ? log.eventName === log2.eventName : false)
|
||||||
|
const hasChannel = (log.channelName === log2.channelName)
|
||||||
|
|
||||||
|
const characters = log2.findCharacters(...characterIds)
|
||||||
|
const characterIdsKey = characters.map(c => c.id).sort().join(",")
|
||||||
|
|
||||||
|
const suggestion = {log: log2, characters, hasEvent, hasChannel}
|
||||||
|
|
||||||
|
if (hasChannel && !foundChannel) {
|
||||||
|
foundChannel = true
|
||||||
|
foundGroups[characterIdsKey] = true
|
||||||
|
|
||||||
|
nexts.push(suggestion)
|
||||||
|
} else if (hasEvent) {
|
||||||
|
foundGroups[characterIdsKey] = true
|
||||||
|
|
||||||
|
nexts.push(suggestion)
|
||||||
|
} else if (nexts.length < 8 && !hasEvent && characters.length > 1 && !foundGroups[characterIdsKey]) {
|
||||||
|
foundGroups[characterIdsKey] = true
|
||||||
|
nexts.push(suggestion)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = index + 1; i < logs.length; ++i) {
|
||||||
|
const log2 = logs[i]
|
||||||
|
const hasEvent = (log.eventName ? log.eventName === log2.eventName : false)
|
||||||
|
const hasChannel = (log.channelName === log2.channelName)
|
||||||
|
|
||||||
|
const characters = log2.findCharacters(...characterIds)
|
||||||
|
const characterIdsKey = characters.map(c => c.id).sort().join(",")
|
||||||
|
|
||||||
|
const suggestion = {log: log2, characters, hasEvent, hasChannel}
|
||||||
|
|
||||||
|
if (hasChannel && !foundChannel) {
|
||||||
|
foundChannel = true
|
||||||
|
foundGroups[characterIdsKey] = true
|
||||||
|
|
||||||
|
prevs.push(suggestion)
|
||||||
|
} else if (hasEvent) {
|
||||||
|
foundGroups[characterIdsKey] = true
|
||||||
|
|
||||||
|
prevs.push(suggestion)
|
||||||
|
} else if (prevs.length < 8 && !hasEvent && characters.length > 1 && !foundGroups[characterIdsKey]) {
|
||||||
|
foundGroups[characterIdsKey] = true
|
||||||
|
prevs.push(suggestion)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.state.nexts = nexts;
|
||||||
|
this.state.prevs = prevs;
|
||||||
|
this.state.loaded = true;
|
||||||
|
}).catch(err => {
|
||||||
|
console.warn("Suggestions load error:", err)
|
||||||
|
this.suggestionsError = "Failed to load suggestions: " + err.toString()
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
onUnmount() {
|
||||||
|
clearTimeout(this.timeout)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import moment from "moment"
|
||||||
|
|
||||||
|
<div class="log-suggestions">
|
||||||
|
<if (state.loaded && state.error == null)>
|
||||||
|
<if (state.nexts.length > 0 || state.prevs.length > 0)>
|
||||||
|
<if (state.nexts.length > 0)>
|
||||||
|
<h2 class="color-primary">Next Logs</h2>
|
||||||
|
<div for(s in state.nexts) class="suggestion color-primary">
|
||||||
|
<div class="suggestion-header color-primary"><a href=`/logs/${s.log.id}`>${s.log.name || `${s.log.channelName} - ${moment(s.log.date).format("MMMM D, YYYY")}`}</a></div>
|
||||||
|
<div for(paragraph in (s.log.description||"").split("\n").filter(p => p)) class="suggestion-description color-text">${paragraph}</div>
|
||||||
|
<div class="suggestion-tags">
|
||||||
|
<div if(s.hasEvent) class="suggestion-tag color-tag-event">${s.log.eventName}</div>
|
||||||
|
<div if(s.hasChannel) class="suggestion-tag color-tag-location">${s.log.channelName}</div>
|
||||||
|
<div for(c in s.characters) class="suggestion-tag color-tag-character">${c.name}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</if>
|
||||||
|
<if (state.prevs.length > 0)>
|
||||||
|
<h2 class="color-primary">Previous Logs</h2>
|
||||||
|
<div for(s in state.prevs) class="suggestion color-primary">
|
||||||
|
<div class="suggestion-header color-primary"><a href=`/logs/${s.log.id}`>${s.log.name || `${s.log.channelName} - ${moment(s.log.date).format("MMMM D, YYYY")}`}</a></div>
|
||||||
|
<div for(paragraph in (s.log.description||"").split("\n").filter(p => p)) class="suggestion-description color-text">${paragraph}</div>
|
||||||
|
<div class="suggestion-tags">
|
||||||
|
<div if(s.hasEvent) class="suggestion-tag color-tag-event">${s.log.eventName}</div>
|
||||||
|
<div if(s.hasChannel) class="suggestion-tag color-tag-location">${s.log.channelName}</div>
|
||||||
|
<div for(c in s.characters) class="suggestion-tag color-tag-character">${c.name}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
<else>
|
||||||
|
<div class="empty color-menu">(No suggestions)</div>
|
||||||
|
</else>
|
||||||
|
</if>
|
||||||
|
<else-if(state.error != null)>
|
||||||
|
<div class="error color-danger">{state.error}</div>
|
||||||
|
</else-if>
|
||||||
|
<else>
|
||||||
|
<div class="loading color-menu">Loading suggestions...</div>
|
||||||
|
</else>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
div.log-suggestions {
|
||||||
|
padding: 0 0.5ch;
|
||||||
|
margin-top: 1em;
|
||||||
|
margin-bottom: 2em;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
text-align: center;
|
||||||
|
margin: 0;
|
||||||
|
margin-bottom: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.empty, div.loading {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.suggestion {
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
padding: 0.5em;
|
||||||
|
|
||||||
|
div.suggestion-header {
|
||||||
|
margin: 0.125em 0.5ch;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
div.suggestion-description {
|
||||||
|
margin: 0.125em 0.5ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.suggestion-tags {
|
||||||
|
margin-top: 0.25em;
|
||||||
|
|
||||||
|
div.suggestion-tag {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 0.5ch;
|
||||||
|
margin: 0.125em 0.5ch;
|
||||||
|
border: 0.25px solid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,21 @@
|
|||||||
module.exports = class {
|
module.exports = class {
|
||||||
|
onCreate() {
|
||||||
|
this.state = {
|
||||||
|
highlights: [],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
select(value) {
|
select(value) {
|
||||||
this.emit("select", value)
|
this.emit("select", value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleHighlight(id) {
|
||||||
|
if (this.state.highlights.includes(id)) {
|
||||||
|
this.state.highlights = this.state.highlights.filter(id2 => id2 !== id)
|
||||||
|
} else {
|
||||||
|
this.state.highlights = this.state.highlights.concat(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.emit("hightlights", this.state.highlights);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,10 +4,23 @@
|
|||||||
<menu-link dark key="_create" on-click("select", "post.add", null) icon="+">Add Post</menu-link>
|
<menu-link dark key="_create" on-click("select", "post.add", null) icon="+">Add Post</menu-link>
|
||||||
<menu-gap />
|
<menu-gap />
|
||||||
</if-permitted>
|
</if-permitted>
|
||||||
<menu-header>Links</menu-header>
|
<menu-header>Channel</menu-header>
|
||||||
<menu-link href=("/logs/?channels="+encodeURIComponent(input.log.channel.name)) icon="#">${input.log.channel.name}</menu-link>
|
<menu-link href=("/logs/?channels="+encodeURIComponent(input.log.channel.name)) icon="#">${input.log.channel.name}</menu-link>
|
||||||
<menu-link if(input.log.channel.eventName) href=("/logs/?channels="+input.log.channel.eventName) icon="E">${input.log.channel.eventName}</menu-link>
|
<menu-gap />
|
||||||
<for(character in input.log.characters)>
|
<if(input.log.eventName)>
|
||||||
<menu-link href=("/logs/?characters="+character.id) icon="C">${character.name} <span class="weak">(${character.author})</span></menu-link>
|
<menu-header>Event</menu-header>
|
||||||
</for>
|
<menu-link href=("/logs/?events="+input.log.eventName) icon="E">${input.log.eventName}</menu-link>
|
||||||
|
<menu-gap />
|
||||||
|
</if>
|
||||||
|
<if(input.log.characters.length > 0)>
|
||||||
|
<menu-header>Characters</menu-header>
|
||||||
|
<for(character in input.log.characters)>
|
||||||
|
<menu-link weak=(state.highlights.length > 0 && !state.highlights.includes(character.id))
|
||||||
|
icon="C"
|
||||||
|
on-click("toggleHighlight", character.id)>
|
||||||
|
${character.name} <span class="weak">(${character.author})</span>
|
||||||
|
</menu-link>
|
||||||
|
</for>
|
||||||
|
<menu-gap />
|
||||||
|
</if>
|
||||||
</menu>
|
</menu>
|
||||||
@@ -9,6 +9,7 @@ module.exports = class {
|
|||||||
log: input.log,
|
log: input.log,
|
||||||
modal: null,
|
modal: null,
|
||||||
removed: false,
|
removed: false,
|
||||||
|
highlights: [],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,6 +112,11 @@ module.exports = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
postAdded(post) {
|
postAdded(post) {
|
||||||
|
// Stop duplicates in case of race condition.
|
||||||
|
if (this.state.log.posts.find(p => p.id === post.id)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.state.log.posts = this.state.log.posts.concat([post])
|
this.state.log.posts = this.state.log.posts.concat([post])
|
||||||
this.state.log = Object.assign({}, this.state.log)
|
this.state.log = Object.assign({}, this.state.log)
|
||||||
}
|
}
|
||||||
@@ -161,6 +167,10 @@ module.exports = class {
|
|||||||
this.state.removed = true
|
this.state.removed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
highlightsChanged(highlights) {
|
||||||
|
this.state.highlights = highlights.slice();
|
||||||
|
}
|
||||||
|
|
||||||
get title() {
|
get title() {
|
||||||
if (this.state.log.title) {
|
if (this.state.log.title) {
|
||||||
return this.state.log.title
|
return this.state.log.title
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<logs-content-menu user=input.user log=state.log on-select("open") />
|
<logs-content-menu on-hightlights("highlightsChanged") user=input.user log=state.log on-select("open") />
|
||||||
<main>
|
<main>
|
||||||
<div class="logs-content">
|
<div class="logs-content">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h1 class="color-primary">${component.title}</h1>
|
<h1 class="color-primary">${component.title}</h1>
|
||||||
|
<p for(paragraph in state.log.description.split("\n").filter(p => p)) class="color-text">${paragraph}</p>
|
||||||
<if-permitted user=input.user permission="log.edit">
|
<if-permitted user=input.user permission="log.edit">
|
||||||
<a on-click("open", "log.edit") class="color-menu">Edit</a>
|
<a on-click("open", "log.edit") class="color-menu">Edit</a>
|
||||||
</if-permitted>
|
</if-permitted>
|
||||||
@@ -25,8 +26,10 @@
|
|||||||
prev=(state.log.posts[loop.getIndex() - 1] || {})
|
prev=(state.log.posts[loop.getIndex() - 1] || {})
|
||||||
post=post
|
post=post
|
||||||
characters=state.log.characters
|
characters=state.log.characters
|
||||||
|
highlights=state.highlights
|
||||||
last=(post.position === state.log.posts.length)
|
last=(post.position === state.log.posts.length)
|
||||||
/>
|
/>
|
||||||
|
<log-suggestions log=state.log />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<add-post-modal enabled=(state.modal === "post.add") logId=state.log.id on-close("close") on-added("postAdded") />
|
<add-post-modal enabled=(state.modal === "post.add") logId=state.log.id on-close("close") on-added("postAdded") />
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ div.logs-content {
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0.25em 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -48,7 +49,7 @@ module.exports = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const timediff = Date.parse(input.post.time) - Date.parse(input.prev.time)
|
const timediff = Date.parse(input.post.time) - Date.parse(input.prev.time)
|
||||||
this.state.multipart = (input.post.nick == input.prev.nick && input.prev.multipart !== false) && (Math.abs(timediff) < 60000);
|
this.state.multipart = (!input.post.kind.startsWith("annotation.") && input.post.nick == input.prev.nick && input.prev.multipart !== false) && (Math.abs(timediff) < 60000);
|
||||||
this.state.prevWasText = (input.prev.kind === "text");
|
this.state.prevWasText = (input.prev.kind === "text");
|
||||||
|
|
||||||
this.updatePost(input)
|
this.updatePost(input)
|
||||||
@@ -80,39 +81,13 @@ module.exports = class {
|
|||||||
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.nameSuffix = ""
|
||||||
|
|
||||||
this.state.text = input.post.text.replace(/\x02/g, "**").replace(/\x1D/g, "*").replace(/\`/g, "\\`").trim();
|
|
||||||
|
|
||||||
// Fix Ctrl-Bs
|
this.state.text = input.post.text
|
||||||
let left = false
|
|
||||||
this.state.text = this.state.text.replace(/\s*\*\*\s*/g, str => {
|
|
||||||
left = !left
|
|
||||||
|
|
||||||
if (left) {
|
if (input.highlights.length > 0 && (input.post.kind === "action" || input.post.kind === "text")) {
|
||||||
return " **"
|
this.state.dark = true
|
||||||
} else if (!left) {
|
} else {
|
||||||
return "** "
|
this.state.dark = false
|
||||||
}
|
|
||||||
|
|
||||||
return str
|
|
||||||
})
|
|
||||||
|
|
||||||
if (this.state.text.startsWith("|")) {
|
|
||||||
this.state.name = ""
|
|
||||||
this.state.text = this.state.text.slice(1).trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (input.post.kind === "text" && !this.state.text.includes("\"") && !this.state.text.includes("\''") && !this.state.text.includes("|")) {
|
|
||||||
const colonIndex = this.state.text.indexOf(": ");
|
|
||||||
if (colonIndex != -1 && colonIndex < this.state.text.indexOf(" ")) {
|
|
||||||
this.state.text = this.state.text.replace(": ", ": \"") + "\"";
|
|
||||||
} else {
|
|
||||||
this.state.text = '"' + this.state.text + '"'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.state.text.charAt(0) == this.state.text.charAt(0).toUpperCase()) {
|
|
||||||
this.state.name = ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!input.post.nick.startsWith("=")) {
|
if (!input.post.nick.startsWith("=")) {
|
||||||
@@ -120,13 +95,19 @@ 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.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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div if(!state.removed) class=["post", component.kindClass("pk-"), state.multipart ? "multipart" : null, state.anchored ? "anchored" : null]>
|
<div if(!state.removed) class=["post", component.kindClass("pk-"), state.multipart ? "multipart" : null, state.anchored ? "anchored" : null, state.dark ? "dark" : null]>
|
||||||
<a class="anchor" id=input.post.id />
|
<a class="anchor" id=input.post.id />
|
||||||
<div class="post-meta-row">
|
<div class="post-meta-row">
|
||||||
<div class="options color-menu">
|
<div class="options color-menu">
|
||||||
@@ -19,18 +19,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<div if(input.post.kind.startsWith("annotation.")) class="post-body" >
|
<div if(input.post.kind.startsWith("annotation.")) class="post-body" >
|
||||||
<annotation level=(input.post.kind.substring(11))>
|
<annotation level=(input.post.kind.substring(11))>
|
||||||
<markdown class="post-content" source=state.text />
|
<irc-caret-notation class="post-content" source=state.text />
|
||||||
</annotation>
|
</annotation>
|
||||||
</div>
|
</div>
|
||||||
<div if(input.post.kind === "scene") class="post-body color-text">
|
<div if(input.post.kind === "scene") class="post-body color-text">
|
||||||
<markdown class="post-content post-scene" source=state.text />
|
<irc-caret-notation 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">
|
||||||
$ const prefix = ((!state.multipart || state.prevWasText) ? state.shortName + state.nameSuffix + " " : "");
|
$ const prefix = ((!state.multipart || state.prevWasText) ? state.shortName + state.nameSuffix + " " : "");
|
||||||
<markdown class="post-content post-action" source=(prefix + state.text) />
|
<irc-caret-notation class="post-content post-action" source=(prefix + 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 />
|
<irc-caret-notation class="post-content post-text" source=state.text />
|
||||||
</div>
|
</div>
|
||||||
<remove-post-modal enabled=(state.modal === "remove") post=input.post on-close("close") on-remove("remove") />
|
<remove-post-modal enabled=(state.modal === "remove") post=input.post on-close("close") on-remove("remove") />
|
||||||
<edit-post-modal enabled=(state.modal === "edit") post=input.post on-close("close") on-edited("edited") />
|
<edit-post-modal enabled=(state.modal === "edit") post=input.post on-close("close") on-edited("edited") />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
div.post {
|
div.post {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
margin-bottom: 1ch;
|
margin-bottom: 1.25em;
|
||||||
margin-left: -12px;
|
margin-left: -12px;
|
||||||
padding-left: 12px;
|
padding-left: 12px;
|
||||||
padding-right: 0.5ch;
|
padding-right: 0.5ch;
|
||||||
@@ -65,12 +65,54 @@ div.post {
|
|||||||
margin-top: 0.33em;
|
margin-top: 0.33em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
line-height: 1.33em;
|
||||||
|
margin-bottom: -0.25em;
|
||||||
|
|
||||||
|
span.icn-bold { font-weight: 800; }
|
||||||
|
span.icn-underline { text-decoration: underline; }
|
||||||
|
span.icn-italic { font-style: italic; }
|
||||||
|
|
||||||
|
span.icn-fg-0 { color: #fff; }
|
||||||
|
span.icn-fg-1 { color: #111; }
|
||||||
|
span.icn-fg-2 { color: #13d; }
|
||||||
|
span.icn-fg-3 { color: #173; }
|
||||||
|
span.icn-fg-4 { color: #d21; }
|
||||||
|
span.icn-fg-5 { color: #721; }
|
||||||
|
span.icn-fg-6 { color: #727; }
|
||||||
|
span.icn-fg-7 { color: #d71; }
|
||||||
|
span.icn-fg-8 { color: #aa1; }
|
||||||
|
span.icn-fg-9 { color: #1d3; }
|
||||||
|
span.icn-fg-10 { color: #177; }
|
||||||
|
span.icn-fg-11 { color: #1DD; }
|
||||||
|
span.icn-fg-12 { color: #127; }
|
||||||
|
span.icn-fg-13 { color: #c1a; }
|
||||||
|
span.icn-fg-14 { color: #444; }
|
||||||
|
span.icn-fg-15 { color: #aaa; }
|
||||||
|
span.icn-bg-0 { background-color: #fff; }
|
||||||
|
span.icn-bg-1 { background-color: #111; }
|
||||||
|
span.icn-bg-2 { background-color: #13d; }
|
||||||
|
span.icn-bg-3 { background-color: #173; }
|
||||||
|
span.icn-bg-4 { background-color: #d21; }
|
||||||
|
span.icn-bg-5 { background-color: #721; }
|
||||||
|
span.icn-bg-6 { background-color: #727; }
|
||||||
|
span.icn-bg-7 { background-color: #d71; }
|
||||||
|
span.icn-bg-8 { background-color: #aa1; }
|
||||||
|
span.icn-bg-9 { background-color: #1d3; }
|
||||||
|
span.icn-bg-10 { background-color: #177; }
|
||||||
|
span.icn-bg-11 { background-color: #1DD; }
|
||||||
|
span.icn-bg-12 { background-color: #127; }
|
||||||
|
span.icn-bg-13 { background-color: #c1a; }
|
||||||
|
span.icn-bg-14 { background-color: #444; }
|
||||||
|
span.icn-bg-15 { background-color: #aaa; }
|
||||||
|
}
|
||||||
p:first-of-type {
|
p:first-of-type {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
p:last-of-type {
|
p:last-of-type {
|
||||||
padding-bottom: 0.1em;
|
padding-bottom: 0.1em;
|
||||||
|
margin-bottom: 0em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,11 +133,15 @@ div.post.pk-text.anchored {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.post.multipart {
|
div.post.multipart {
|
||||||
margin-top: -0.9em;
|
margin-top: -1.5em;
|
||||||
|
|
||||||
div.post-meta {
|
div.post-meta {
|
||||||
span {
|
span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
div.post.dark {
|
||||||
|
opacity: 0.25;
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ module.exports = class {
|
|||||||
if (filter.search) {
|
if (filter.search) {
|
||||||
queries.push("search=" + encodeURIComponent(filter.search))
|
queries.push("search=" + encodeURIComponent(filter.search))
|
||||||
}
|
}
|
||||||
if (filter.limit) {
|
if (filter.limit != null) {
|
||||||
queries.push("limit=" + encodeURIComponent(filter.limit.toString()))
|
queries.push("limit=" + encodeURIComponent(filter.limit.toString()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,8 @@
|
|||||||
user=input.user
|
user=input.user
|
||||||
on-open("onOpenComment", comment)
|
on-open("onOpenComment", comment)
|
||||||
/>
|
/>
|
||||||
<if-permitted if(input.chapter.canComment) user=input.user author=input.chapter.author permission="chapter.edit">
|
|
||||||
|
<if-permitted if(input.chapter.canComment) user=input.user permission=["member", "chapter.edit"]>
|
||||||
<div class="add-comment color-menu" on-click("open", "addComment") >Add ${state.commentLabels[input.chapter.commentMode] || "Comment"}</div>
|
<div class="add-comment color-menu" on-click("open", "addComment") >Add ${state.commentLabels[input.chapter.commentMode] || "Comment"}</div>
|
||||||
</if-permitted>
|
</if-permitted>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ import moment from "moment"
|
|||||||
</tr>
|
</tr>
|
||||||
<tr if(input.comment.fictionalDate != null)>
|
<tr if(input.comment.fictionalDate != null)>
|
||||||
<th>Date:</th>
|
<th>Date:</th>
|
||||||
<td>${moment(input.comment.fictionalDate).format("MMM D, YYYY")}</td>
|
<td>
|
||||||
|
<date utc value=input.comment.fictionalDate></date>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -69,7 +71,7 @@ import moment from "moment"
|
|||||||
<markdown class="body" source=paragraph>
|
<markdown class="body" source=paragraph>
|
||||||
<if (input.comment.fictionalDate)>
|
<if (input.comment.fictionalDate)>
|
||||||
<span class="decoration color-menu">[</span>
|
<span class="decoration color-menu">[</span>
|
||||||
<date class="color-menu" value=input.comment.fictionalDate></date>
|
<date utc class="color-menu" value=input.comment.fictionalDate></date>
|
||||||
<span class="decoration color-menu">] </span>
|
<span class="decoration color-menu">] </span>
|
||||||
</if>
|
</if>
|
||||||
<span class="decoration color-menu"><</span>
|
<span class="decoration color-menu"><</span>
|
||||||
@@ -108,7 +110,7 @@ import moment from "moment"
|
|||||||
</div>
|
</div>
|
||||||
<chapter-meta kind="title" value=input.comment.subject />
|
<chapter-meta kind="title" value=input.comment.subject />
|
||||||
<chapter-meta kind="name" value=input.comment.characterName character=(input.comment.character) ukAuthor=input.comment.author />
|
<chapter-meta kind="name" value=input.comment.characterName character=(input.comment.character) ukAuthor=input.comment.author />
|
||||||
<chapter-meta kind="date" value=input.comment.fictionalDate />
|
<chapter-meta utc kind="date" value=input.comment.fictionalDate />
|
||||||
<chapter-meta weak kind="date" value=input.comment.createdDate />
|
<chapter-meta weak kind="date" value=input.comment.createdDate />
|
||||||
<chapter-meta weak kind="author" value=input.comment.author />
|
<chapter-meta weak kind="author" value=input.comment.author />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ const moment = require("moment")
|
|||||||
|
|
||||||
const {storyApi} = require("../../../../../rpdata/api/Story")
|
const {storyApi} = require("../../../../../rpdata/api/Story")
|
||||||
|
|
||||||
|
const ORDINAL_REGEX = /[0-9]{1,2}(st|nd|rd|th)/g
|
||||||
|
|
||||||
module.exports = class {
|
module.exports = class {
|
||||||
onCreate() {
|
onCreate() {
|
||||||
this.state = {
|
this.state = {
|
||||||
@@ -45,11 +47,13 @@ module.exports = class {
|
|||||||
const values = this.state.values
|
const values = this.state.values
|
||||||
|
|
||||||
let fictionalDate = new Date(values.fictionalDate + " UTC")
|
let fictionalDate = new Date(values.fictionalDate + " UTC")
|
||||||
if (values.fictionalDate != "") {
|
if (values.fictionalDate) {
|
||||||
if (Number.isNaN(fictionalDate.getTime())) {
|
if (Number.isNaN(fictionalDate.getTime())) {
|
||||||
this.state.error = `Could not parse ${values.fictionalDate} as date.`
|
this.state.error = `Could not parse ${values.fictionalDate} as date.`
|
||||||
if (values.fictionalDate.includes("th")) {
|
|
||||||
this.state.error += " Try to remove the 'th'."
|
const ordinal = values.fictionalDate.match(ORDINAL_REGEX)[0]
|
||||||
|
if (ordinal != null) {
|
||||||
|
this.state.error += " Try to remove the '"+ordinal.slice(-2)+"'."
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
+11
-9
@@ -28,15 +28,17 @@ module.exports = (req, res, next) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.user) {
|
if (["/static/", "/hax/", "/assets/"].find(p => req.path.startsWith(p)) == null) {
|
||||||
res.locals.user = {
|
if (req.user) {
|
||||||
loggedIn: true,
|
res.locals.user = {
|
||||||
name: req.user._json.name,
|
loggedIn: true,
|
||||||
permissions: getPermissions(req.user._json.name),
|
name: req.user._json.name,
|
||||||
}
|
permissions: getPermissions(req.user._json.name),
|
||||||
} else {
|
}
|
||||||
res.locals.user = {
|
} else {
|
||||||
loggedIn: false,
|
res.locals.user = {
|
||||||
|
loggedIn: false,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Generated
+79
-55
@@ -2308,13 +2308,13 @@
|
|||||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||||
},
|
},
|
||||||
"fsevents": {
|
"fsevents": {
|
||||||
"version": "1.2.4",
|
"version": "1.2.8",
|
||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.8.tgz",
|
||||||
"integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==",
|
"integrity": "sha512-tPvHgPGB7m40CZ68xqFGkKuzN+RnpGmSV+hgeKxhRpbxdqKXUFJGC3yonBOLzQBcJyGpdZFDfCsdOC2KFsXzeA==",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"nan": "^2.9.2",
|
"nan": "^2.12.1",
|
||||||
"node-pre-gyp": "^0.10.0"
|
"node-pre-gyp": "^0.12.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"abbrev": {
|
"abbrev": {
|
||||||
@@ -2324,7 +2324,8 @@
|
|||||||
},
|
},
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"aproba": {
|
"aproba": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
@@ -2332,7 +2333,7 @@
|
|||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"are-we-there-yet": {
|
"are-we-there-yet": {
|
||||||
"version": "1.1.4",
|
"version": "1.1.5",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2342,32 +2343,37 @@
|
|||||||
},
|
},
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^1.0.0",
|
||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"chownr": {
|
"chownr": {
|
||||||
"version": "1.0.1",
|
"version": "1.1.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"code-point-at": {
|
"code-point-at": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"console-control-strings": {
|
"console-control-strings": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
@@ -2375,15 +2381,15 @@
|
|||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "2.6.9",
|
"version": "4.1.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ms": "2.0.0"
|
"ms": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deep-extend": {
|
"deep-extend": {
|
||||||
"version": "0.5.1",
|
"version": "0.6.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
@@ -2426,7 +2432,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"glob": {
|
"glob": {
|
||||||
"version": "7.1.2",
|
"version": "7.1.3",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2444,11 +2450,11 @@
|
|||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"iconv-lite": {
|
"iconv-lite": {
|
||||||
"version": "0.4.21",
|
"version": "0.4.24",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"safer-buffer": "^2.1.0"
|
"safer-buffer": ">= 2.1.2 < 3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ignore-walk": {
|
"ignore-walk": {
|
||||||
@@ -2470,7 +2476,8 @@
|
|||||||
},
|
},
|
||||||
"inherits": {
|
"inherits": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"ini": {
|
"ini": {
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
@@ -2480,6 +2487,7 @@
|
|||||||
"is-fullwidth-code-point": {
|
"is-fullwidth-code-point": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"number-is-nan": "^1.0.0"
|
"number-is-nan": "^1.0.0"
|
||||||
}
|
}
|
||||||
@@ -2492,24 +2500,27 @@
|
|||||||
"minimatch": {
|
"minimatch": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "0.0.8",
|
"version": "0.0.8",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"minipass": {
|
"minipass": {
|
||||||
"version": "2.2.4",
|
"version": "2.3.5",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"safe-buffer": "^5.1.1",
|
"safe-buffer": "^5.1.2",
|
||||||
"yallist": "^3.0.0"
|
"yallist": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minizlib": {
|
"minizlib": {
|
||||||
"version": "1.1.0",
|
"version": "1.2.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2519,37 +2530,38 @@
|
|||||||
"mkdirp": {
|
"mkdirp": {
|
||||||
"version": "0.5.1",
|
"version": "0.5.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "0.0.8"
|
"minimist": "0.0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.0.0",
|
"version": "2.1.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"needle": {
|
"needle": {
|
||||||
"version": "2.2.0",
|
"version": "2.3.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"debug": "^2.1.2",
|
"debug": "^4.1.0",
|
||||||
"iconv-lite": "^0.4.4",
|
"iconv-lite": "^0.4.4",
|
||||||
"sax": "^1.2.4"
|
"sax": "^1.2.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node-pre-gyp": {
|
"node-pre-gyp": {
|
||||||
"version": "0.10.0",
|
"version": "0.12.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"detect-libc": "^1.0.2",
|
"detect-libc": "^1.0.2",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"needle": "^2.2.0",
|
"needle": "^2.2.1",
|
||||||
"nopt": "^4.0.1",
|
"nopt": "^4.0.1",
|
||||||
"npm-packlist": "^1.1.6",
|
"npm-packlist": "^1.1.6",
|
||||||
"npmlog": "^4.0.2",
|
"npmlog": "^4.0.2",
|
||||||
"rc": "^1.1.7",
|
"rc": "^1.2.7",
|
||||||
"rimraf": "^2.6.1",
|
"rimraf": "^2.6.1",
|
||||||
"semver": "^5.3.0",
|
"semver": "^5.3.0",
|
||||||
"tar": "^4"
|
"tar": "^4"
|
||||||
@@ -2565,12 +2577,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npm-bundled": {
|
"npm-bundled": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.6",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"npm-packlist": {
|
"npm-packlist": {
|
||||||
"version": "1.1.10",
|
"version": "1.4.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2591,7 +2603,8 @@
|
|||||||
},
|
},
|
||||||
"number-is-nan": {
|
"number-is-nan": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"object-assign": {
|
"object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
@@ -2601,6 +2614,7 @@
|
|||||||
"once": {
|
"once": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
}
|
}
|
||||||
@@ -2635,11 +2649,11 @@
|
|||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"rc": {
|
"rc": {
|
||||||
"version": "1.2.7",
|
"version": "1.2.8",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"deep-extend": "^0.5.1",
|
"deep-extend": "^0.6.0",
|
||||||
"ini": "~1.3.0",
|
"ini": "~1.3.0",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"strip-json-comments": "~2.0.1"
|
"strip-json-comments": "~2.0.1"
|
||||||
@@ -2667,16 +2681,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rimraf": {
|
"rimraf": {
|
||||||
"version": "2.6.2",
|
"version": "2.6.3",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"glob": "^7.0.5"
|
"glob": "^7.1.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.2",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"safer-buffer": {
|
"safer-buffer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
@@ -2689,7 +2704,7 @@
|
|||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "5.5.0",
|
"version": "5.7.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
@@ -2706,6 +2721,7 @@
|
|||||||
"string-width": {
|
"string-width": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"code-point-at": "^1.0.0",
|
"code-point-at": "^1.0.0",
|
||||||
"is-fullwidth-code-point": "^1.0.0",
|
"is-fullwidth-code-point": "^1.0.0",
|
||||||
@@ -2723,6 +2739,7 @@
|
|||||||
"strip-ansi": {
|
"strip-ansi": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-regex": "^2.0.0"
|
"ansi-regex": "^2.0.0"
|
||||||
}
|
}
|
||||||
@@ -2733,16 +2750,16 @@
|
|||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"tar": {
|
"tar": {
|
||||||
"version": "4.4.1",
|
"version": "4.4.8",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"chownr": "^1.0.1",
|
"chownr": "^1.1.1",
|
||||||
"fs-minipass": "^1.2.5",
|
"fs-minipass": "^1.2.5",
|
||||||
"minipass": "^2.2.4",
|
"minipass": "^2.3.4",
|
||||||
"minizlib": "^1.1.0",
|
"minizlib": "^1.1.1",
|
||||||
"mkdirp": "^0.5.0",
|
"mkdirp": "^0.5.0",
|
||||||
"safe-buffer": "^5.1.1",
|
"safe-buffer": "^5.1.2",
|
||||||
"yallist": "^3.0.2"
|
"yallist": "^3.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2752,20 +2769,22 @@
|
|||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"wide-align": {
|
"wide-align": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"string-width": "^1.0.2"
|
"string-width": "^1.0.2 || 2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"wrappy": {
|
"wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -3415,6 +3434,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz",
|
||||||
"integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4="
|
"integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4="
|
||||||
},
|
},
|
||||||
|
"irc-caret-notation": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/irc-caret-notation/-/irc-caret-notation-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-V/Dhqb/wentrfxH5U2pUTK1ye53mIEmpWCpT81Qa+/YfEDY7XuFjpCD/J0WRzjDqaecwn4mj0Mz+6T6bAz/BSA=="
|
||||||
|
},
|
||||||
"is-absolute": {
|
"is-absolute": {
|
||||||
"version": "0.2.6",
|
"version": "0.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz",
|
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz",
|
||||||
@@ -3977,9 +4001,9 @@
|
|||||||
"integrity": "sha1-OWCLQ1wJAfpVECF8FFJyjWvBm18="
|
"integrity": "sha1-OWCLQ1wJAfpVECF8FFJyjWvBm18="
|
||||||
},
|
},
|
||||||
"lodash": {
|
"lodash": {
|
||||||
"version": "4.17.10",
|
"version": "4.17.11",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
||||||
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
|
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
|
||||||
},
|
},
|
||||||
"lodash.includes": {
|
"lodash.includes": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
@@ -4289,9 +4313,9 @@
|
|||||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||||
},
|
},
|
||||||
"nan": {
|
"nan": {
|
||||||
"version": "2.10.0",
|
"version": "2.13.2",
|
||||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz",
|
||||||
"integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
|
"integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"nanomatch": {
|
"nanomatch": {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
"graphql-query-compress": "^1.1.0",
|
"graphql-query-compress": "^1.1.0",
|
||||||
"http-proxy-middleware": "^0.19.1",
|
"http-proxy-middleware": "^0.19.1",
|
||||||
"ip": "^1.1.5",
|
"ip": "^1.1.5",
|
||||||
|
"irc-caret-notation": "^1.0.0",
|
||||||
"isomorphic-fetch": "^2.2.1",
|
"isomorphic-fetch": "^2.2.1",
|
||||||
"jsonwebtoken": "^8.3.0",
|
"jsonwebtoken": "^8.3.0",
|
||||||
"lasso": "^3.2.6",
|
"lasso": "^3.2.6",
|
||||||
|
|||||||
@@ -27,6 +27,15 @@ class LogHeader {
|
|||||||
this.open = open
|
this.open = open
|
||||||
this.characters = characters.map(ch => new LogHeaderCharacter(ch.id, ch.name, ch.shortName, ch.author))
|
this.characters = characters.map(ch => new LogHeaderCharacter(ch.id, ch.name, ch.shortName, ch.author))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all characters in that log.
|
||||||
|
*
|
||||||
|
* @param {...string} ids Character IDs
|
||||||
|
*/
|
||||||
|
findCharacters(...ids) {
|
||||||
|
return this.characters.filter(c => ids.includes(c.id))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class LogHeaderCharacter {
|
class LogHeaderCharacter {
|
||||||
@@ -89,6 +98,11 @@ const logHeaderApi = {
|
|||||||
* @returns {Promise<LogHeader[]>}
|
* @returns {Promise<LogHeader[]>}
|
||||||
*/
|
*/
|
||||||
list(filter = {}) {
|
list(filter = {}) {
|
||||||
|
filter = Object.assign({}, filter)
|
||||||
|
if (filter.limit != null && filter.limit <= 0) {
|
||||||
|
delete filter.limit
|
||||||
|
}
|
||||||
|
|
||||||
return query(`
|
return query(`
|
||||||
query LogHeaders($filter: LogsFilter) {
|
query LogHeaders($filter: LogsFilter) {
|
||||||
headers: logs(filter:$filter) {
|
headers: logs(filter:$filter) {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ app.use("/story/by-author/", require("./routes/story/by-author"))
|
|||||||
app.use("/story/tag-list/", require("./routes/story/tag-list"))
|
app.use("/story/tag-list/", require("./routes/story/tag-list"))
|
||||||
app.use("/story/:id(S[0-9a-z]{15})/", require("./routes/story-content"))
|
app.use("/story/:id(S[0-9a-z]{15})/", require("./routes/story-content"))
|
||||||
app.use("/logs/", require("./routes/logs"))
|
app.use("/logs/", require("./routes/logs"))
|
||||||
app.use("/logs/:id([0-9]{4}-[0-1][0-9]-[0-3][0-9]_[0-9]{9}_[A-Za-z0-9\,\']{2,})/", require("./routes/logs-content"))
|
app.use("/logs/:id([0-9]{4}-[0-1][0-9]-[0-3][0-9]_[0-9]{9}_[A-Za-z0-9\,\'\-]{2,})/", require("./routes/logs-content"))
|
||||||
app.use("/logs/:id(L[0-9]{0,7})/", require("./routes/logs-content"))
|
app.use("/logs/:id(L[0-9]{0,7})/", require("./routes/logs-content"))
|
||||||
app.use("/data/", require("./routes/data"))
|
app.use("/data/", require("./routes/data"))
|
||||||
app.use("/data/characters/", require("./routes/data/characters"))
|
app.use("/data/characters/", require("./routes/data/characters"))
|
||||||
|
|||||||
Reference in New Issue
Block a user