Browse Source

More toolbars/back buttons

master
Shadowfacts 5 years ago
parent
commit
c4a32aeb42
Signed by: shadowfacts GPG Key ID: 94A5AB95422746E5
  1. 10
      complete.html
  2. 2
      css/main.css
  3. 4
      js/complete.js
  4. 4
      js/repo.js
  5. 42
      repo.html
  6. 4
      type.html

10
complete.html

@ -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>

2
css/main.css

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

4
js/complete.js

@ -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}`;
});

4
js/repo.js

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

42
repo.html

@ -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>

4
type.html

@ -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>

Loading…
Cancel
Save