mirror of https://github.com/shadowfacts/type.git
Remove file name input from index
This commit is contained in:
parent
ce86403466
commit
81b730ff23
|
@ -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
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…
Reference in New Issue