Official Ruby on Rails plugin for Filestack File Picker that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
The first of which loads the v3 Picker onto the page, while the second tag initializes it. You can define a custom client name in the config options as such:
// in app/assets/javascripts
console.log(custom_client_name)
Otherwise the name defaults to "filestack_client".
Another element has also been added, the filestack_picker_element (name open to discussion). It functions as a button that can be added to any page, which accepts a Javascript callback to handle return data from the API. Example usage would be such:
// in app/assets/javascripts
function handlePickerData(data){
console.log(data.filesUploaded[0].url)
}
Everything else that has been added has been to set up the next tasks, and as there is significant differences in the way that v2 and v3 Pickers behave, a lot of the code has been excised or rewritten. After looking through the issues, I have been careful to ensure we keep proper namespacing and that we are not modifying/affecting global rails options or names as much as possible.
Coverage decreased (-10.0%) to 90.0% when pulling cda70a745170ed04264fa3df77c0c813334d551d on feature/FS-1339-add-javascript-include-tag into cc149dde4df58bb17d5d690717d4552d5ca7f433 on develop.
This pull request fulfills the following tasks:
Initialization
The v3 picker is initialized as a variable on the client side. To deal with this, there are now two tags that must be added:
The first of which loads the v3 Picker onto the page, while the second tag initializes it. You can define a custom client name in the config options as such:
Which can then be referenced via:
Otherwise the name defaults to "filestack_client".
Another element has also been added, the filestack_picker_element (name open to discussion). It functions as a button that can be added to any page, which accepts a Javascript callback to handle return data from the API. Example usage would be such:
Everything else that has been added has been to set up the next tasks, and as there is significant differences in the way that v2 and v3 Pickers behave, a lot of the code has been excised or rewritten. After looking through the issues, I have been careful to ensure we keep proper namespacing and that we are not modifying/affecting global rails options or names as much as possible.