Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Side by Side Diff: experimental/webtry/templates/workspace.html

Issue 244313007: Move to using HTML templates when filling out the workspace history. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Workspace</title> 4 <title>Workspace</title>
5 <meta charset='utf-8' /> 5 <meta charset='utf-8' />
6 <link rel="stylesheet" href="/css/" type="text/css" media="screen"> 6 <link rel="stylesheet" href="/css/" type="text/css" media="screen">
7 </head> 7 </head>
8 <body> 8 <body>
9
10 <template id=tryTemplate>
11 <div class=tries>
12 <a href="">
13 <img width=64 height=64 src="">
14 </a>
15 </div>
16 </template>
9 {{template "titlebar.html"}} 17 {{template "titlebar.html"}}
10 <section id=content> 18 <section id=content>
11 {{if .Name}} 19 {{if .Name}}
12 <pre><code>#include "SkCanvas.h" 20 <pre><code>#include "SkCanvas.h"
13 21
14 void draw(SkCanvas* canvas) { 22 void draw(SkCanvas* canvas) {
15 <textarea spellcheck=false name='code' id='code' rows='15' cols='80'>{{.Code}} </textarea> 23 <textarea spellcheck=false name='code' id='code' rows='15' cols='80'>{{.Code}} </textarea>
16 } 24 }
17 </code></pre> 25 </code></pre>
18 26
19 <input type='button' value='Run' id='run'> 27 <input type='button' value='Run' id='run'>
20 28
21 <p>Image appears here:</p> 29 <p>Image appears here:</p>
22 <img id='img' src=''/> 30 <img id='img' src=''/>
23 31
24 <pre><code id='output'></code></pre> 32 <pre><code id='output'></code></pre>
25 </section> 33 </section>
34 <script type="text/javascript" charset="utf-8">
35 var history = {{.Tries}};
36 </script>
26 <section id=tryHistory> 37 <section id=tryHistory>
27 {{range .Tries}}
28 <div class=tries>
29 <a href="/c/{{.Hash}}">
30 <img width=64 height=64 src="/i/{{.Hash}}.png">
31 </a>
32 </div>
33 {{end}}
34 </section> 38 </section>
35 39
36 <script type='text/javascript' charset='utf-8'> 40 <script type='text/javascript' charset='utf-8'>
37 // Set the workspace name so run.js also updates the history. 41 // Set the workspace name so run.js also updates the history.
38 var workspaceName = "{{.Name}}"; 42 var workspaceName = "{{.Name}}";
39 </script> 43 </script>
40 <script src="/js/" type="text/javascript" charset="utf-8"></script> 44 <script src="/js/" type="text/javascript" charset="utf-8"></script>
41 {{else}} 45 {{else}}
42 <h1>Create</h1> 46 <h1>Create</h1>
43 Create a new workspace: 47 Create a new workspace:
44 <form action="." method="POST" accept-charset="utf-8"> 48 <form action="." method="POST" accept-charset="utf-8">
45 <p><input type="submit" value="Create"></p> 49 <p><input type="submit" value="Create"></p>
46 </form> 50 </form>
47 {{end}} 51 {{end}}
48 </section> 52 </section>
49 </body> 53 </body>
50 </html> 54 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698