2626 * This function stores the client ID in this object for use by a Dropbox
2727 * instance to be created later, once an access token is gained by the
2828 * login process in `getAccess()`.
29+ *
30+ * The second parameter is optional, but can provide a URL to use for the
31+ * Dropbox login page. By default, it uses the page in this same folder.
32+ * However, if you have loaded this project from a CDN, then you may not
33+ * have that file in your project. In such a case, you can provide the CDN
34+ * URL to teh Dropbox login page as the second parameter here. For your
35+ * convenience, that URL is:
36+ * https://cdn.jsdelivr.net/gh/lurchmath/cloud-storage@v1/dropbox-login.html
2937 */
30- function DropboxFileSystem ( clientID )
38+ function DropboxFileSystem ( clientID , loginURL )
3139{
3240 this . clientID = clientID ;
41+ this . loginURL = loginURL || './dropbox-login.html' ;
3342}
3443
3544/*
@@ -44,7 +53,7 @@ function DropboxFileSystem ( clientID )
4453DropboxFileSystem . prototype . getAccess = function ( successCB , failureCB )
4554{
4655 if ( this . dropbox ) return successCB ( ) ;
47- var loginWindow = window . open ( './dropbox-login.html' ) ;
56+ var loginWindow = window . open ( this . loginURL ) ;
4857 var that = this ;
4958 if ( ! this . installedEventHandler ) {
5059 window . addEventListener ( 'message' , function ( event ) {
0 commit comments