More toolbars/back buttons

This commit is contained in:
Shadowfacts 2016-10-02 11:10:08 -04:00
parent 27e7357e52
commit c4a32aeb42
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
6 changed files with 44 additions and 22 deletions

View File

@ -6,8 +6,14 @@
</head>
<body>
<p id="congrats"></p>
<p>Return to <a id="repo">repo</a> or <a href="/">start</a>.</p>
<div id="toolbar">
<button id="back">&#8249; Back</button>
</div>
<div id="content">
<p id="congrats"></p>
<p>Return to <a id="repo">repo</a> or <a href="/">start</a>.</p>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="js/complete.js"></script>

View File

@ -33,7 +33,7 @@
height: 20px;
}
.CodeMirror {
#content {
margin-top: 33px;
}

View File

@ -8,3 +8,7 @@ let file = hashBits[hashBits.length - 1];
$("#congrats").html(`Congratulations, you've completed <code>${file}</code> in <code>${repoName}</code>!`);
$("#repo").attr("href", `/repo.html#${repo}`);
$("#back").click(() => {
window.location.href = `/type.html#${hash}`;
});

View File

@ -23,3 +23,7 @@ $("#form").submit((event) => {
let file = $("#file").val();
window.location.href = `/type.html#${repo}/${file}`;
});
$("#back").click(() => {
window.location.href = "/";
});

View File

@ -6,27 +6,33 @@
<link rel="stylesheet" href="/css/main.css">
</head>
<body>
<noscript>
<div class="error">
JavaScript must be enabled.
</div>
<br>
</noscript>
<h1 id="repo"></h1>
<h2>Previous Files</h2>
<div>
<ul class="prev-list" id="prev-files"></ul>
<div id="toolbar">
<button id="back">&#8249; Back</button>
</div>
<h2>New File</h2>
<form id="form">
<input type="text" id="file" placeholder="path/to/file.js" required="true">
<br>
<input type="submit" value="Type">
</form>
<div id="content">
<noscript>
<div class="error">
JavaScript must be enabled.
</div>
<br>
</noscript>
<h1 id="repo"></h1>
<h2>Previous Files</h2>
<div>
<ul class="prev-list" id="prev-files"></ul>
</div>
<h2>New File</h2>
<form id="form">
<input type="text" id="file" placeholder="path/to/file.js" required="true">
<br>
<input type="submit" value="Type">
</form>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/localforage/1.4.2/localforage.min.js"></script>

View File

@ -72,7 +72,9 @@
</select>
</div>
<textarea id="editor"></textarea>
<div id="content">
<textarea id="editor"></textarea>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>