Permalink
Browse files

Add image export. Fixes #3.

  • Loading branch information...
1 parent 035031f commit 45eb8b7822ae3ac0bc9cad8edaabeffd73c01e23 @tmcw committed Feb 19, 2012
Showing with 5 additions and 0 deletions.
  1. +1 −0 index.html
  2. +4 −0 site.js
View
@@ -30,6 +30,7 @@
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>
View
@@ -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 =

0 comments on commit 45eb8b7

Please sign in to comment.