aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/webtry/templates/content.html
blob: bf27f3e80f61c1c67e2b19cb3cd6fc2ff798f0b9 (plain)
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
<section id="content">

  <template id="sourcesTemplate">
    <button id="" class=source><img width=64 height=64 src=""></button>
  </template>

  <div id="inputBitmapEnable">
    <input type="checkbox" id="enableSource" data-id="{{.Source}}">
    <label for="enableSource">Use an input bitmap</label>
  </div>

  <button id="selectedSource"></button>

  <pre id="sourceCode">SkBitmap source;</pre>

  <div class="well" id="chooseSource">
    <div class="panel panel-primary">
      <div class="panel-heading">
        <h3 class="panel-title">
          Choose an existing image to use as an input bitmap, or upload a new one below.
        </h3>
      </div>
      <div class="panel-body" id="chooseList">
      </div>
    </div>
    <div class="panel panel-default">
      <div class="panel-heading">
        <div class="panel-title">
          Upload a new image
        </div>
      </div>
      <div class="panel-body">
        <form action="/sources/" method="post" accept-charset="utf-8" enctype="multipart/form-data">
          <div class="form-group">
            <label for="upload">File input</label>
            <input type="file" accept="image/*" name="upload" value="" id="upload">
          </div>
          <button class="btn btn-default" type="submit">Upload Image</button>
        </form>
      </div>
    </div>
  </div>

  <textarea spellcheck=false name='code' id='code' rows='15' cols='100'>{{.Code}}</textarea>

  <div class="action-buttons">
    <button class="btn btn-primary btn-lg" id='run'>Run</button>
    <a class="btn btn-default btn-lg" href='{{if .Hash}}/c/{{.Hash}}{{end}}' {{if not .Hash}}style="display: none;"{{end}} target=_blank id="permalink">Share</a>

    <button class="btn btn-default btn-lg" id='embedButton' {{if not .Hash}}style="display:none;"{{end}}/>Embed</button>
    <input type="text" value="" id="embed" readonly style="display:none;">
  </div>

  <p>
  <img  touch-action='none' class='zoom' id='img' src='{{if .Hash}}/i/{{.Hash}}.png{{end}}'/>
  </p>
  <p id='zoomHex'></p>

  <h2>Warnings and Errors</h2>
  <pre id="output"></pre>
  <h2>Runtime output</h2>
  <pre id="stdout"></pre>

</section>