Skip to content

Instantly share code, notes, and snippets.

@jthoenes
Created March 13, 2014 09:18
Show Gist options
  • Save jthoenes/9524944 to your computer and use it in GitHub Desktop.
Save jthoenes/9524944 to your computer and use it in GitHub Desktop.
API for image storage function of Redactor Feature Request
var storeImageLocally = function(imageFile, callback){
// result of asynchronous call which will store the file
var result = {
localUrl: 'filesystem:http://localhost:9000/persistent/someImage.jpg',
imageId: 'generated uid'
}
// call the callback with html to insert into redactor
callback('<img src="'+result.localUrl+'" data-image-id="'result.imageId'">');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment