-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
82 lines (79 loc) · 2.71 KB
/
index.html
File metadata and controls
82 lines (79 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Bug Fixing Proto
</title>
<script src="editor.js" type="text/javascript" charset="utf-8"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="ace.js" type="text/javascript" charset="utf-8"></script>
<script src="diff.js" type="text/javascript" charset="utf-8"></script>
<script src="diff_shower.js" type="text/javascript" charset="utf-8"></script>
<script src="bugfixing_ui.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css" media="screen">
body {
/*overflow: hidden;*/
}
.ace{
margin: 0;
position: absolute;
top: 50px;
bottom: 0;
right: 0;
left: 0;
width:550px;
}
.highlight-red{
position:absolute;
background:rgba(200,0,0,0.5);
z-index:20
}
.hightlight-green{
position:absolute;
background:rgba(0, 200, 0,0.5);
z-index:20
}
</style>
</head>
<body>
<div id = "configure">
<span>Template File</span><input type="file" id="file" name="file"/>
</div>
<textarea name="solution" id="solution" ></textarea>
<script >
/* global bugFixingUI */
var ui = bugFixingUI({"readOnlyRegions": [
{"start":
{"row": 0,
"column": 0
}
//without end specified, the range ends at the end of the row
},
{"start":
{"row": 2,
"column": 2
},
"end":
{"row": 2,
"column": 10
}
},
]});
ui.init();
function handleFileSelect(evt) {
var file = evt.target.files[0];
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = (function(theFile) {
return function(e) {
//console.log(e.target.result)
ui.editor.setTemplate(e.target.result);
ui.editor.setValue(e.target.result);
};
})(file);
reader.readAsText(file);
}
document.getElementById('file').addEventListener('change', handleFileSelect, false);
</script>
</body>
</html>