Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moszeed/drbx-js-backbone
a drbx.js backbone plugin
https://github.com/moszeed/drbx-js-backbone
Last synced: about 21 hours ago
JSON representation
a drbx.js backbone plugin
- Host: GitHub
- URL: https://github.com/moszeed/drbx-js-backbone
- Owner: moszeed
- Created: 2015-06-06T11:37:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-29T10:33:59.000Z (over 9 years ago)
- Last Synced: 2024-11-04T04:19:14.412Z (11 days ago)
- Language: JavaScript
- Size: 598 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#drbx-js-backbone
[![Join the chat at https://gitter.im/moszeed/drbx-js-backbone](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/moszeed/drbx-js-backbone?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
a drbx.js backbone plugin, to sync to Dropbox#how to use
install from npmnpm 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
});