Browse Source

Remove file name input from index

master
Shadowfacts 5 years ago
parent
commit
81b730ff23
Signed by: shadowfacts GPG Key ID: 94A5AB95422746E5
  1. 2
      index.html
  2. 10
      js/index.js

2
index.html

@ -26,8 +26,6 @@
<br>
<input type="text" id="branch" value="master" placeholder="master" required="true">
<br>
<input type="text" id="file" placeholder="path/to/file.js" required="true">
<br>
<input type="submit" value="Type">
</form>

10
js/index.js

@ -27,6 +27,12 @@ $("#form").submit((event) => {
let repo = $("#repo").val();
let branch = $("#branch").val();
let file = $("#file").val();
window.location.href = `/type.html#${repo}/${branch}/${file}`;
localforage.setItem(`${repo}/${branch}`, {})
.then(() => {
window.location.href = `/repo.html#${repo}/${branch}`;
})
.catch((e) => {
throw e;
});
});

Loading…
Cancel
Save