File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 37
37
< div >
38
38
< select id ="context-selector " onchange ="changeContext(this.value) " class ="form-control form-control "> </ select >
39
39
</ div >
40
+
40
41
< div > Please choose a < a href ="https://github.com/ShawnZhong/JsSpim/tree/master/Tests " target ="_blank "> MIPS
41
42
assembly file</ a > :  
42
43
</ div >
43
44
< div >
44
45
< select id ="file-selector0 " onchange ="main(this.value, 0) " class ="form-control form-control "> </ select >
45
46
</ div >
47
+ < div >   or  </ 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
+
46
56
< div >
47
57
< select id ="file-selector1 " onchange ="main(this.value, 1) " class ="form-control form-control "> </ select >
48
58
</ div >
49
59
< div >   or  </ div >
50
60
< div >
51
61
< 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='' ">
54
64
< div class ="custom-file-label "> upload your own</ div >
55
65
</ div >
56
66
</ div >
Original file line number Diff line number Diff line change @@ -67,6 +67,15 @@ async function main(fileInput = `Tests/${fileList[0]}`, ctx = null) {
67
67
Execution . init ( false , ctx ) ;
68
68
changeContext ( ctx ) ;
69
69
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
+ }
70
79
}
71
80
72
81
// Execution.init();
You can’t perform that action at this time.
0 commit comments