summaryrefslogtreecommitdiff
path: root/static/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/script.js')
-rw-r--r--static/script.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/static/script.js b/static/script.js
index 325b8e5..4648567 100644
--- a/static/script.js
+++ b/static/script.js
@@ -194,7 +194,8 @@ function winGame(challenge) {
winEl.style = 'display: block;'
document.getElementById('btns').style = 'display: none;'
document.getElementById('meter').innerText = challenge.meter
- document.getElementById('ctx').innerHTML = challenge.ctx.replaceAll(/^(.*)/gm, ' $1') + `\n\t<span class="byline">&mdash;<a href="${challenge.link}">${challenge.title}</a>\n\t\t${challenge.collection}, ${challenge.author}</span>`
+ var collection = challenge.collection ? `${challenge.collection}, ` : ""
+ document.getElementById('ctx').innerHTML = challenge.ctx.replaceAll(/^(.*)/gm, ' $1') + `\n\t<span class="byline">&mdash;<a href="${challenge.link}">${challenge.title}</a>\n\t\t${collection}${challenge.author}</span>`
var firstguess = Object.values(guesses[0]).join(' ')
document.getElementById('share').value = `I solved Prosodyle #${getChallengeIdx()+1} at cyfraeviolae.org/prosodyle. My first guess was: "${firstguess}."`
}