1
1
<!DOCTYPE html>
2
- < html lang =" en " >
2
+ < html >
3
3
< head >
4
- < title > Test ace editor</ title >
5
- < link rel ="stylesheet " href ="app.css "/>
6
- < style type ="text/css " media ="screen ">
7
- # header {
8
- background-color : # 60ff60 ;
9
- /*width: 100%;*/
10
- height : 70px ;
11
- margin : 5px 15% 5px 15% ;
12
- padding : 5px ;
13
- text-align : center;
14
- font-family : sans-serif;
15
- }
16
- /*#header * {
17
- float: center
18
- }*/
19
- # editor {
20
- /*position: absolute;
21
- left: 50px;
22
- bottom: 50px;
23
- top: 100px;*/
24
- width : 500px ;
25
- height : 500px ;
26
- display : inline-block;
27
- }
28
- # result {
29
- width : 640px ;
30
- height : 480px ;
31
- /*display: inline-block;*/
32
- }
33
- </ style >
4
+ < title > HTML Sandbox</ title >
5
+ < link rel ="stylesheet " href ="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css "/>
6
+ < link rel ="stylesheet " href ="app.css "/>
7
+ < style type ="text/css " media ="screen ">
8
+ # sandbox-header {
9
+ background-color : # 60ff60 ;
10
+ /*width: 100%;*/
11
+ height : 70px ;
12
+ margin : 5px 15% 5px 15% ;
13
+ padding : 5px ;
14
+ text-align : center;
15
+ font-family : sans-serif;
16
+ }
17
+ /*#header * {
18
+ float: center
19
+ }*/
20
+ # editor {
21
+ /*position: absolute;
22
+ left: 50px;
23
+ bottom: 50px;
24
+ top: 100px;*/
25
+ width : 500px ;
26
+ height : 500px ;
27
+ display : inline-block;
28
+ }
29
+ # result {
30
+ width : 640px ;
31
+ height : 480px ;
32
+ /*display: inline-block;*/
33
+ }
34
+ </ style >
34
35
</ head >
35
36
< body >
36
- < div id ="header ">
37
+ < header class ="navbar navbar-inverse " role ="banner ">
38
+ < div class ="container ">
39
+ < div class ="navbar-header ">
40
+ < a href ="index.html " class ="navbar-brand "> Coder Dojo Indy</ a >
41
+ </ div >
42
+ < nav class ="collapse navbar-collapse " role ="navigation ">
43
+ < ul class ="nav navbar-nav ">
44
+ < li >
45
+ < a href ="about.html "> About</ a >
46
+ </ li >
47
+ < li >
48
+ < a href ="programs.html "> Programs</ a >
49
+ </ li >
50
+ < li >
51
+ < a href ="faq.html "> FAQ</ a >
52
+ </ li >
53
+ </ ul >
54
+ </ nav >
55
+ </ div >
56
+ </ header >
57
+ < div id ="sandbox-header ">
37
58
< h3 style ="padding: 0; margin: 5px; "> HTML Sandbox</ h3 >
38
59
This HTML sandbox uses Ace editor. In order to save your code you must allow cookies. < strong > ↓</ strong >
39
60
</ div >
@@ -42,7 +63,6 @@ <h3 style="padding: 0; margin: 5px;">HTML Sandbox</h3>
42
63
< div id ="editor "> </ div >
43
64
< div id ="result-wrapper " style ="display: inline-block ">
44
65
< iframe id ="result ">
45
- < div > </ div >
46
66
</ iframe >
47
67
< br />
48
68
< button onclick ="updateCode() "> Run HTML</ button >
@@ -56,9 +76,11 @@ <h3 style="padding: 0; margin: 5px;">HTML Sandbox</h3>
56
76
var editor = ace . edit ( "editor" ) ;
57
77
editor . setTheme ( "ace/theme/monokai" ) ;
58
78
editor . getSession ( ) . setMode ( "ace/mode/html" ) ;
59
-
79
+ editor . getSession ( ) . setUseWrapMode ( true ) ;
80
+ editor . setValue ( "<!DOCTYPE html>\n<html>\n <head><\/head>\n <body><\/body>\n<\/html>" ) ;
60
81
function updateCode ( ) {
61
- $ ( "result" ) . html ( editor . getValue ( ) ) ;
82
+ //$("#result").srcdoc = (editor.getValue());
83
+ alert ( "Not functional right now!" ) ;
62
84
}
63
85
</ script >
64
86
</ body >
0 commit comments