Git Product home page Git Product logo

dropbox-from-amber's Introduction

DropboxFromAmber

Newer: Dropbox Datastore API & dropbox.js wrapper for Amber Smalltalk.

Currently, new version is not documented yet. No sample codes. But Dropbox-Datastore.st is a package for the Datastore API support.

Legacy: dropbox.js wrapper for Amber Smalltalk

Installation

Just copy and merge the whole directory to your Amber Smalltalk home. Use copyAll.sh or copyAll.bat, according to your platform.

Usage

| dropboxCli |
dropboxCli := DrClient default.
dropboxCli authenticateThen: [
  dropboxCli writeFile: 'hello.txt' data: 'world'.
].

Setting API key

By default, DrClient create 'Amber_ToDo_Demo' app folder to your dropbox (for the convenience of the example below). You can change the app folder by obtaining your own API key from dropbox.

API key can be set by DrClient defaultApiKey: 'encoded api key'. The method only accepts encoded API key for security reasons. Encoding can be done by Dropbox API key encoder.

Changing Authentication Driver

DrClient's default authentication driver is Redirect. It is suitable in most cases.

However, in mobile devises, Cordova driver would be better.

You can explicitly set the driver by DrClient defaultAuthDriverType:'redirect|popup|chrome|cordova|nodeserver'. Please read dropbox.js authentication drivers document for the differences.

drop-todo.html is the example of setting API key and auth driver from JavaScript side.

smalltalk.DrClient._defaultApiKey_('lT8r2O3iMCA=|ULla/D4WPtfkec3nxbtR+V861w9E+U9+krMlTYrV/A==');
smalltalk.DrClient._defaultAuthDriverType_('cordova');

Example

Extended ToDoList Example

dropboxFromAmber includes an extended ToDoList example. While the original jqmFromAmber example stores data to html5 localStorage, this version saves tasks to Dropbox.

How to try the example:

  1. install the demo prerequisite -- jqmFromAmber. It is used for ToDoList UI.
  2. start amber server
  3. open the demo page (http://localhost:4000/dropboxFromAmber.html) with your favorite web browser.

See the 'Dropbox-ToDo' package for details.

License

MIT license

dropbox-from-amber's People

Contributors

mumez avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.