Skip to content

Commit

Permalink
Add image export. Fixes #3.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Feb 19, 2012
1 parent 035031f commit 45eb8b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h1>Project it Yourself!</h1>
render
<button id='hifi'>hifi</button>
<button id='lofi'>lofi</button>
<button id='download'>download</button>
<button id='share-button'>share!</button>
<div id='share'>
<textarea id='gist-share'></textarea>
Expand Down
4 changes: 4 additions & 0 deletions site.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ document.getElementById('lofi').onclick = function() {
load_and_draw();
};

document.getElementById('download').onclick = function() {
window.location.href = c2.toDataURL("image/png").replace("image/png", "image/octet-stream");
};

document.getElementById('share-button').onclick = function() {
document.getElementById('share').style.display = 'block';
document.getElementById('gist-share').value =
Expand Down

0 comments on commit 45eb8b7

Please sign in to comment.