-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·116 lines (102 loc) · 3.06 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html>
<head>
<title>RemExec Web</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!--link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<style>
html {
height: 100%;
}
body {
width: 100%;
height: 100%;
}
.base {
width: 100%;
height: 100%;
min-width: 400px;
min-height: 400px;
padding: 20px 0;
}
.block {
height: 100%;
}
textarea {
font-family: monospace;
}
#result {
width: 100%;
height: 100%;
border: 1px solid gray;
padding: 5px;
font-family: monospace;
white-space: pre;
}
.main {
display: flex;
flex-flow: column nowrap;
height: 100%;
}
.main-header {
padding: 0 15px 15px 15px;
}
.main-content {
flex: 1 1 100%;
}
</style>
<script>
$(document).ready(function(e){
$('#execute').click(function(e){
$('#execute').toggleClass("disabled");
$('#state').text("Выполняется...");
$.ajax({
method: 'POST',
url: 'remexec-web.php',
data: {
code: $('#code').val(),
lang: $('select[name=lang]').val(),
},
success: function(data){
$('#execute').toggleClass("disabled");
$('#state').text("")
$('#result').html(data);},
});
});
});
</script>
</head>
<body>
<div class="base">
<div class="main">
<div class="main-header">
<div style="display: inline-block; width: 100px;">RemExec-web</div>
<select name="lang" class="form-control" style="display: inline-block; width: auto;">
<option value="cpp" selected>C++</option>
<option value="python">Python</option>
<option value="bash">bash</option>
</select>
<button class="btn btn-default" style="" id="execute">Выполнить</button>
<div id="state" style="display: inline-block; margin-left: 10px;"></div>
</div>
<div class="main-content">
<div class="block col-md-6">
<textarea id="code" class="form-control" style="resize: none; width: 100%; height: 100%;">#include <iostream>
using namespace std;
int main(int argc, char **argv){
cout << "Hello, world" << endl;
}</textarea>
</div>
<div class="block col-md-6">
<div id="result"><font color="red">(Вывод)</font></div>
</div>
</div>
</div>
</div>
</body>
</html>