skia2/experimental/webtry/templates/content.html
commit-bot@chromium.org 0a7e5b7554 Add the ability to select a source image to use in the code.
A much farther ranging change than I suspected.

Basically add a 'source' integer to every Try, store that in the database with every Try, add the source to the computation of the hash, and load and use the 'source' value when navigating history.

BUG=skia:
R=mtklein@google.com

Author: jcgregorio@google.com

Review URL: https://codereview.chromium.org/294903017

git-svn-id: http://skia.googlecode.com/svn/trunk@14960 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-29 15:58:00 +00:00

43 lines
1.3 KiB
HTML

<section id=content>
<template id=sourcesTemplate>
<button id="" class=source><img width=64 height=64 src=''></button>
</template>
<input type="checkbox" id="enableSource" data-id="{{.Source}}"> Use an input bitmap.
<br>
<button id=selectedSource></button>
<pre id=sourceCode>SkBitmap source;</pre>
<div id=chooseSource>
Choose an image below or upload a new one to use as an input bitmap.
<div id="chooseList">
</div>
<form action="/sources/" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<input type="file" accept="image/*" name="upload" value="" id="upload">
<input type="submit" value="Add Image">
</form>
</div>
<pre>
<textarea spellcheck=false name='code' id='code' rows='15' cols='100'>{{.Code}}</textarea>
</pre>
<input type='button' value='Run' id='run'>
<a href='{{if .Hash}}/c/{{.Hash}}{{end}}' target=_blank id=permalink>Share</a>
<input type='button' value='Embed' id='embedButton' disabled/>
<input type="text" value="" id="embed" readonly style="display:none;">
<br>
<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><code id='output'></code></pre>
<h2>Runtime output</h2>
<pre id='stdout'></pre>
</section>