Help with this puzzle link

This commit is contained in:
Neale Pickett 2020-03-11 17:35:46 -06:00
parent 989bc2978e
commit 1b8053d9b5
3 changed files with 16 additions and 0 deletions

View File

@ -140,3 +140,12 @@ li[draggable] {
#cacheButton.disabled { #cacheButton.disabled {
display: none; display: none;
} }
#help {
text-decoration: none;
color: #fff;
background-color: #118;
padding: 0.25em;
border: 1px solid black;
font-size: 120%;
}

View File

@ -25,6 +25,7 @@
<input type="hidden" name="xAnswer"> <input type="hidden" name="xAnswer">
Team ID: <input type="text" name="id"> <br> Team ID: <input type="text" name="id"> <br>
Answer: <input type="text" name="answer" id="answer"> <span id="answer_ok"></span><br> Answer: <input type="text" name="answer" id="answer"> <span id="answer_ok"></span><br>
<a id="help" title="Help with this category" target="_blank" class="hidden">🛈</a>
<input type="submit" value="Submit"> <input type="submit" value="Submit">
</form> </form>
<div id="devel"></div> <div id="devel"></div>

View File

@ -151,6 +151,12 @@ function submit(e) {
function loadPuzzle(categoryName, points, puzzleId) { function loadPuzzle(categoryName, points, puzzleId) {
let puzzle = document.getElementById("puzzle") let puzzle = document.getElementById("puzzle")
let base = "content/" + categoryName + "/" + puzzleId + "/" let base = "content/" + categoryName + "/" + puzzleId + "/"
let helpElement = document.querySelector("#help")
if (helpElement) {
helpElement.classList.remove("hidden")
helpElement.href = "https://mattermost.cyfi.training/cyber-fire/channels/puzzle-" + categoryName
}
fetch(base + "puzzle.json") fetch(base + "puzzle.json")
.then(resp => { .then(resp => {