Created
July 22, 2013 23:55
-
-
Save rickdog/6058726 to your computer and use it in GitHub Desktop.
filepicker.io.js
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
| ( | |
| function() | |
| { | |
| var start = function() { doDialog(); }; | |
| if (typeof filepicker=='undefined') | |
| { | |
| var s = document.createElement('script'); | |
| s.src = 'http://api.filepicker.io/v1/filepicker.js'; | |
| if (s.addEventListener) | |
| { | |
| s.addEventListener("load", start, false); | |
| } | |
| else | |
| { | |
| s.onreadystatechange=function() | |
| { | |
| if (this.readyState=="complete") | |
| { | |
| start(); | |
| s = null; | |
| } | |
| } | |
| } | |
| s.type = "text/javascript"; | |
| document.getElementsByTagName('head')[0].appendChild(s); | |
| } | |
| else | |
| { | |
| start(); | |
| } | |
| } | |
| )(); | |
| function doDialog() | |
| { | |
| filepicker.setKey('A0b1GBdwgSyv6Pop9ZFNQz'); | |
| // load dialog | |
| filepicker.pick | |
| ( | |
| function(InkBlob) | |
| { | |
| console.log(InkBlob.url); | |
| } | |
| ); | |
| } | |
| /* | |
| // save URL to filepicker | |
| filepicker.storeUrl("http://cdn.appstorm.net/web.appstorm.net/web/files/2013/06/aologo.png", function(InkBlob){ | |
| alert(InkBlob.url) | |
| }); | |
| */ | |
| /* | |
| // save to any. | |
| filepicker.exportFile( | |
| 'https://drpyjw32lhcoa.cloudfront.net/c882d28/img/success.png', | |
| {mimetype:'image/png'}, | |
| function(InkBlob){ | |
| console.log(InkBlob.url); | |
| }); | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment