Skip to content

Commit 84b7b74

Browse files
committed
Added extra spacing in nav, added separate upload file elements
1 parent 27a892b commit 84b7b74

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

index.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,30 @@
3737
<div>
3838
<select id="context-selector" onchange="changeContext(this.value)" class="form-control form-control"></select>
3939
</div>
40+
&nbsp;
4041
<div>Please choose a <a href="https://github.com/ShawnZhong/JsSpim/tree/master/Tests" target="_blank">MIPS
4142
assembly file</a>: &nbsp
4243
</div>
4344
<div>
4445
<select id="file-selector0" onchange="main(this.value, 0)" class="form-control form-control"></select>
4546
</div>
47+
<div>&nbsp or &nbsp</div>
48+
<div>
49+
<div class="custom-file">
50+
<input type="file" class="custom-file-input" id="file-upload0"
51+
onChange="main(this.files[0], 0);this.value=''">
52+
<div class="custom-file-label">upload your own</div>
53+
</div>
54+
</div>
55+
&nbsp;
4656
<div>
4757
<select id="file-selector1" onchange="main(this.value, 1)" class="form-control form-control"></select>
4858
</div>
4959
<div>&nbsp or &nbsp</div>
5060
<div>
5161
<div class="custom-file">
52-
<input type="file" class="custom-file-input" id="file-upload"
53-
onChange="main(this.files[0]);this.value=''">
62+
<input type="file" class="custom-file-input" id="file-upload1"
63+
onChange="main(this.files[0], 1);this.value=''">
5464
<div class="custom-file-label">upload your own</div>
5565
</div>
5666
</div>

js/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ async function main(fileInput = `Tests/${fileList[0]}`, ctx = null) {
6767
Execution.init(false, ctx);
6868
changeContext(ctx);
6969
Elements.contextSelector.selectedIndex = ctx;
70+
switch (ctx) {
71+
case 0:
72+
Elements.fileSelector0.value = fileInput;
73+
break;
74+
case 1:
75+
Elements.fileSelector1.value = fileInput;
76+
break;
77+
default:
78+
}
7079
}
7180

7281
// Execution.init();

0 commit comments

Comments
 (0)