Feature/fs 1339 add javascript include tag #163
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.