Skip to content

Instantly share code, notes, and snippets.

@goodgravy
Last active December 22, 2015 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goodgravy/6539470 to your computer and use it in GitHub Desktop.
Save goodgravy/6539470 to your computer and use it in GitHub Desktop.
function showImage (url) {
$('body').append('<img src="'+url+'" />');
}
$(function () {
forge.prefs.get('local-file', function (value) {
if (value) {
showImage(value);
} else {
forge.file.saveURL('https://trigger.io/forge-static/img/v2-cog-largepng.png', function (file) {
forge.file.URL(file, function (url) {
forge.logging.info('file saved as '+url);
forge.prefs.set('local-file', url);
showImage(url);
});
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment