Skip to content

moszeed/drbx-js-backbone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#drbx-js-backbone

Join the chat at https://gitter.im/moszeed/drbx-js-backbone
a drbx.js backbone plugin, to sync to Dropbox

#how to use install from npm

npm i drbx-js-backbone

and require like this

var Backbone = require('drbx-js-backbone);

##usage examples ####init, with popup driver and login

var Backbone = require('drbx-js-backbone);
    Backbone.init({
        client  : { key : [Dropbox API Key] },
        auth    : new Dropbox._Dropbox.AuthDriver.Popup({
            receiverUrl     : [receiverUrl],
            rememberUser    : true
        })
    });

    Backbone.login()
        .then(function isLoggedIn() {
            console.log('user is logged in');
        })
        .catch(function(err) {
            console.log(err);
        });

####get accountInfo

Backbone.DrbxJs.accountInfo()
    .then(function getUserData(userData) {
        console.log(userData);
    })
    .catch(function(err) {
        console.log(err);
    });

####create a model

var Model = new Backbone.Model.extend({
	url: '/path/to/file'
});

####create a collection

var Collection = new Backbone.Collection.extend({
	url: '/path/to/file'
	model: Model
});

About

a drbx.js backbone plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published