-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor.html
144 lines (131 loc) · 2.27 KB
/
editor.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<html>
<head>
</head>
<title>editor</title>
<style>
body#editor {
margin: 0;
padding: 0;
border: 0;
text-align: left;
font: 12px Verdana, Arial, Helvetica, sans-serif;
background: #4180B6;
}
div#header {
color: #fff;
margin: 0 auto;
padding: 0;
border: 0;
height: 90px;
background: #4180B6;
width: 100%;
}
div#test {
margin: 0;
padding: 0;
border: 0;
height: 495px;
background: #4180B6;
}
div#code {
float: left;
height: 495px;
width: 49%;
margin: 0;
padding: 0;
border: 0;
background: #2C587C;
}
div#butt {
float: left;
height: 400px;
width: 2%;
margin: 40px, 0px;
padding: 0;
background: #C8D7E3;
}
div#result {
float: right;
height: 495px;
width: 49%;
margin: 0;
padding: 0;
background: #880000;
}
#header h1 {
margin: 20px 0 0 0;
padding: 0;
font-size: 30px;
float: left;
vertical-align: middle;
}
#butt input {
writing-mode: tb-rl; scrollWidth:100 %;
background: yellow;
color: #293D6B;
width: 100%;
height: 100%;
font: 12px Verdana, Arial, Helvetica, sans-serif;
}
#code textarea {
margin: 0;
padding: 10px 0 0 5px;
border: 0;
width: 100%;
overflow: auto;
height: 400px;
font: 12px "Courier New", Courier, monospace;
}
#result iframe {
margin: 0;
padding: 0;
width: 99%;
height: 400px;
background: #fff;
}
</style>
<body id="editor">
<div id="header">
<h1>
HTML EDITOR
</h1>
</div>
<div id="test">
<div id="code">
<h2>
edit your code here
</h2>
<TEXTAREA id="runcode" cols="80" rows="24 ">
<html>
<body>
<script language="javascript">
</script>
</body>
</html>
</TEXTAREA>
</div>
<div id="butt">
<INPUT onclick="runEx('runcode')" type="button" value="RUN" />
</div>
<div id="result">
<h2>
result:
</h2>
<iframe id="ihtml" value=""></iframe>
</div>
</div>
<script type="text/javascript">
function runEx(id){
var textid = document.getElementById(id);
if (textid.value != ""){
var iframe = document.getElementById("ihtml");
doc = iframe.contentWindow.document;
doc.write(textid.value);
doc.close();
}
}
var iframe = document.getElementById("ihtml");
iframe.innerHTML = ("");
</script>
</body>
</html>