Created
October 15, 2016 14:45
-
-
Save hugodias/9fd3372f713a1f3ed7ef04748d14a17b 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
| class Dropbox | |
| constructor: -> | |
| @options = | |
| success: @success | |
| cancel: -> | |
| # Do something | |
| linkType: 'direct' | |
| multiselect: true | |
| extensions: [ | |
| '.jpg' | |
| '.png' | |
| '.gif' | |
| ] | |
| @bind() | |
| bind: -> | |
| $(document).on 'click', '#dropbox', => | |
| window.Dropbox.choose(@options) | |
| success: (files) => | |
| @upload file.link for file in files | |
| upload: (file_path) -> | |
| $.post("/pictures", | |
| remote_image_url: file_path | |
| ).done (picture) -> | |
| console.log picture |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment