Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren authored Dec 6, 2019
1 parent 89439b1 commit 7ca92db
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ <h1><img src="assets/infragram-logo.png" alt="Infragram logo image." style="floa

<div class="zone last" id="save-zone" style="display:none;">
<p>OUTPUT</p>
<button onClick="infragram.download()" type="button" class="btn btn-primary btn-lg">Save</button>
<button onClick="openInPl()" type="button" class="btn btn-primary btn-lg">Save</button>
<button onClick="infragram.download()" type="button" class="btn btn-primary btn-lg">Download</button>
<button onClick="openInSequencer()" type="button" class="btn btn-primary btn-lg">Export</button>
</div>

Expand Down Expand Up @@ -207,13 +208,26 @@ <h4 style="margin-bottom:40px;"><a style="color:#444;" href="http://publiclab.or
</div>

<script>
var infragram, openInSequencer;
var infragram, openInPl, openInSequencer;
(function() {
infragram = Infragram({
uploader: false,
processor: 'webgl'
});

openInPl = function openInPl() {
var dataurl = infragram.options.processor.getInputImage();
function postToPL(imgSrc) {
var uniq = Date.now();
$('body').append('<form method="post" id="postToPL' + uniq + '" action="https://publiclab.org/post" target="postToPLWindow"><input type="hidden" name="datauri_main_image" /></form>');
f = $('#postToPL' + uniq)[0];
f.datauri_main_image.value = imgSrc;
window.open('', 'postToPLWindow');
f.submit();
}
postToPL(dataurl);
}

openInSequencer = function openInSequencer() {
var color = $('#m_exp').val().substr(1,3) == "R-B" ? "blue" : "red";
var dataurl = infragram.options.processor.getInputImage();
Expand Down

0 comments on commit 7ca92db

Please sign in to comment.