-
Notifications
You must be signed in to change notification settings - Fork 2
/
htmleditor.html
87 lines (86 loc) · 2.33 KB
/
htmleditor.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
<!DOCTYPE html>
<html>
<head>
<title>HTML Sandbox</title>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="app.css"/>
<style type="text/css" media="screen">
#sandbox-header {
background-color: #60ff60;
/*width: 100%;*/
height: 70px;
margin: 5px 15% 5px 15%;
padding: 5px;
text-align: center;
font-family: sans-serif;
}
/*#header * {
float: center
}*/
#editor {
/*position: absolute;
left: 50px;
bottom: 50px;
top: 100px;*/
width: 500px;
height: 500px;
display: inline-block;
}
#result {
width: 640px;
height: 480px;
/*display: inline-block;*/
}
</style>
</head>
<body>
<header class="navbar navbar-inverse" role="banner">
<div class="container">
<div class="navbar-header">
<a href="index.html" class="navbar-brand">Coder Dojo Indy</a>
</div>
<nav class="collapse navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
<li>
<a href="about.html">About</a>
</li>
<li>
<a href="programs.html">Programs</a>
</li>
<li>
<a href="faq.html">FAQ</a>
</li>
</ul>
</nav>
</div>
</header>
<div id="sandbox-header">
<h3 style="padding: 0; margin: 5px;">HTML Sandbox</h3>
This HTML sandbox uses Ace editor. In order to save your code you must allow cookies. <strong>↓</strong>
</div>
<br/>
<div id="wrapper">
<div id="editor"></div>
<div id="result-wrapper" style="display: inline-block">
<iframe id="result">
</iframe>
<br/>
<button onclick="updateCode()">Run HTML</button>
</div>
</div>
<!-- jquery -->
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://raw.githubusercontent.com/ajaxorg/ace-builds/master/src/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/html");
editor.getSession().setUseWrapMode(true);
editor.setValue("<!DOCTYPE html>\n<html>\n <head><\/head>\n <body><\/body>\n<\/html>");
function updateCode() {
//$("#result").srcdoc = (editor.getValue());
alert("Not functional right now!");
}
</script>
</body>
</html>