-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathindex.html
74 lines (70 loc) · 1.99 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Home Page</title>
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>
<style type="text/css" media="screen">
body {
overflow: hidden;
}
#editor {
min-width: 500px;
min-height: 500px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script
src="src-noconflict/ace.js"
type="text/javascript"
charset="utf-8"
></script>
</head>
<body>
<div>
<h1>Code Editor</h1>
<select id="myselect" onchange="onSelectChange(this.value.trim())">
<option value="53" >C++</option>
<option value="62" >Java</option>
<option value="70">Python</option>
</select>
<div id="editorContainer">
<div class="container" style="margin-top: 30px">
<div class="row">
<div class="col">
<pre id="editor">
</pre
>
</div>
<div class="col">
<button class="btn btn-success">Execute</button>
<br />
<pre id="ans"></pre>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="assets/js/main.js"></script>
<script src="texteditor.js"></script>
<script>
// document.onload()
function onSelectChange(selectedVal){
console.log(selectedVal)
if(selectedVal != undefined && selectedVal!=null && selectedVal!=""){
$("button").off('click');
codeEditor(selectedVal)
}
}
window.onload = function () {
codeEditor("53");
};
</script>
</body>
</html>