OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Skia WebTry</title> | 4 <title>Skia WebTry</title> |
5 <meta charset='utf-8' /> | 5 <meta charset='utf-8' /> |
6 <style type="text/css" media="screen"> | 6 <link rel="stylesheet" href="/css/" type="text/css" media="screen"> |
7 .waiting, .waiting * { | |
8 cursor: wait; | |
9 } | |
10 textarea { | |
11 margin-left: 0; | |
12 border: solid 1px #ccc; | |
13 color: green; | |
14 } | |
15 pre, code { | |
16 padding: 0; | |
17 color: green; | |
18 } | |
19 #output { | |
20 color: #333; | |
21 } | |
22 </style> | |
23 </head> | 7 </head> |
24 <body> | 8 <body> |
| 9 <section id=title> |
| 10 <a href="/">Home</a> |
| 11 <a href="/recent">Recent</a> |
| 12 <a href="https://github.com/google/skia/tree/master/experimental/webtry">Cod
e</a> |
| 13 </section> |
| 14 <section id=content> |
25 <pre><code>#include "SkCanvas.h" | 15 <pre><code>#include "SkCanvas.h" |
26 | 16 |
27 void draw(SkCanvas* canvas) { | 17 void draw(SkCanvas* canvas) { |
28 <textarea name='code' id='code' rows='15' cols='80'>{{.UserCode}}</textarea> | 18 <textarea name='code' id='code' rows='15' cols='80'>{{.UserCode}}</textarea> |
29 } | 19 } |
30 </code></pre> | 20 </code></pre> |
31 | 21 |
32 <input type='button' value='Run' id='run'> | 22 <input type='button' value='Run' id='run'> |
33 | 23 |
34 <p>Image appears here:</p> | 24 <p>Image appears here:</p> |
35 <img id='img' src=''/> | 25 <img id='img' src=''/> |
36 | 26 |
37 <pre><code id='output'></code></pre> | 27 <pre><code id='output'></code></pre> |
38 | 28 |
| 29 </section> |
39 <script type='text/javascript' charset='utf-8'> | 30 <script type='text/javascript' charset='utf-8'> |
40 var run = document.getElementById('run'); | 31 var run = document.getElementById('run'); |
41 var code = document.getElementById('code'); | 32 var code = document.getElementById('code'); |
42 var output = document.getElementById('output'); | 33 var output = document.getElementById('output'); |
43 var img = document.getElementById('img'); | 34 var img = document.getElementById('img'); |
44 | 35 |
45 function beginWait() { | 36 function beginWait() { |
46 document.body.classList.add('waiting'); | 37 document.body.classList.add('waiting'); |
47 run.disabled = true; | 38 run.disabled = true; |
48 } | 39 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 var req = new XMLHttpRequest(); | 75 var req = new XMLHttpRequest(); |
85 req.addEventListener('load', codeComplete); | 76 req.addEventListener('load', codeComplete); |
86 req.addEventListener('error', codeError); | 77 req.addEventListener('error', codeError); |
87 req.overrideMimeType('application/json'); | 78 req.overrideMimeType('application/json'); |
88 req.open('POST', '.', true); | 79 req.open('POST', '.', true); |
89 req.send(code.value); | 80 req.send(code.value); |
90 } | 81 } |
91 </script> | 82 </script> |
92 </body> | 83 </body> |
93 </html> | 84 </html> |
OLD | NEW |