mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 01:17:18 +00:00
added dropbox module
This commit is contained in:
parent
d939aa96fb
commit
a6ef735553
2 changed files with 55 additions and 0 deletions
|
|
@ -144,6 +144,8 @@ Javascript dissabled.
|
|||
|
||||
* Fixed bug with setting path of index.html.
|
||||
|
||||
* Added dropbox module.
|
||||
|
||||
2012.10.01, Version 0.1.7
|
||||
|
||||
* Changed name of menu files, fixed npm and jitsu
|
||||
|
|
|
|||
53
lib/client/storage/_dropbox.js
Normal file
53
lib/client/storage/_dropbox.js
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
var CloudCommander, DOM, Dropbox; //o7d6llji052vijk
|
||||
/* module for work with github */
|
||||
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
var cloudcmd = CloudCommander,
|
||||
CLIENT_ID,
|
||||
DropBoxStore = {},
|
||||
options = {
|
||||
linkType: "preview",
|
||||
// "preview" (default) is a preview link to the document for sharing,
|
||||
// "directLink" is an expiring link to the contents of the file for downloading
|
||||
success: function(files) {
|
||||
console.log("Here's the file link:" + files[0].link);
|
||||
},
|
||||
cancel: function() {
|
||||
console.log('Chose something');
|
||||
}
|
||||
};
|
||||
|
||||
cloudcmd.Storage = {};
|
||||
|
||||
/* PRIVATE FUNCTIONS */
|
||||
|
||||
/**
|
||||
* function loads dropbox.js
|
||||
*/
|
||||
function load(){
|
||||
console.time('dropbox load');
|
||||
|
||||
var lElement = DOM.anyload({
|
||||
src : 'https://www.dropbox.com/static/api/1/dropbox.js',
|
||||
not_append : true,
|
||||
id : 'dropboxjs',
|
||||
func : DropBoxStore.choose
|
||||
|
||||
});
|
||||
|
||||
lElement.setAttribute('data-app-key', 'o7d6llji052vijk');
|
||||
document.body.appendChild(lElement);
|
||||
}
|
||||
|
||||
DropBoxStore.choose = function(){
|
||||
Dropbox.choose(options);
|
||||
};
|
||||
|
||||
cloudcmd.Storage.Keys = function(){
|
||||
load();
|
||||
};
|
||||
|
||||
cloudcmd.Storage.DropBoxStore = DropBoxStore;
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue