Last active
December 11, 2015 04:58
-
-
Save Pcushing/4549106 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#filepicker-single-license').on('click', function(e){ | |
e.preventDefault(); | |
var featherEditor = new Aviary.Feather({ | |
apiKey: '1V6FW064w0CkvYNV2rihHg', | |
apiVersion: 2, | |
tools: ['crop', 'orientation', 'blemish'], | |
onSave: function(imageID, newURL) { | |
// var newFPFile = new FPFile({url: newURL}); //Need to get this piece working | |
filepicker.store( | |
newURL, //this isn't right, need to pass a FPFile object or something similar | |
{mimetype:'image/png'}, | |
function(FPFile){ | |
var fileUrl = FPFile["url"]; | |
$('.license-no-image').addClass('hide'); | |
$('#license_file_url').val(fileUrl); | |
$('#license-preview').attr('src', fileUrl).removeClass('hide'); | |
$('.control-group').removeClass('hide'); | |
} | |
); | |
}, | |
appendTo: 'injection_site' | |
}); | |
var preview = $('#license-preview')[0]; | |
filepicker.pick({ | |
mimetype: 'image/*', | |
container: 'window', | |
services: imageSources, | |
}, | |
function(fpfile) { | |
preview.src = fpfile.url; | |
featherEditor.launch({ | |
image: preview, | |
url: fpfile.url | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment