Skip to content

Commit

Permalink
prepared for publishing, with edited README, better package.json sett…
Browse files Browse the repository at this point in the history
…ings, and a more comfortable testing timeout
  • Loading branch information
mminkoff committed May 19, 2017
1 parent 913057f commit e94b241
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 14 deletions.
64 changes: 54 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,71 @@
# ember-filestack
# Ember-filestack

This README outlines the details of collaborating on this Ember addon.
[![npm version](https://badge.fury.io/js/ember-filestack.svg)](http://badge.fury.io/js/ember-filestack)
[![Build Status](https://travis-ci.org/mminkoff/ember-filestack.svg)](https://travis-ci.org/mminkoff/ember-filestack)
[![Ember Observer Score](http://emberobserver.com/badges/ember-filestack.svg)](http://emberobserver.com/addons/ember-filestack)

Provides file picking, storing, and converting funtionality from [Filestack](https://www.filestack.com) using v3+ of their API.

This addon borrows from and builds heavily on [Ember-cli-filepicker](https://github.com/DudaDev/ember-cli-filepicker)

## Installation

* `git clone <repository-url>` this repository
* `cd ember-filestack`
* `npm install`
* `bower install`
* `ember install ember-filestack`

## Usage
* Create your filestack.com key here: https://www.filestack.com/.
* Add your filestack.com key in your config/environment.js
```javascript
//config/environment.js
module.exports = function(environment) {
var ENV = {
//...
filestackKey: '<your-filestack-key>'
};
//...
}
```
* Use the filestack.com documentation for options like extensions and services.
* In your template:
```handlebars
{{ember-filestack-picker options=options onSelection='fileSelected' onClose='onClose' onError='onError'}}
```
* You should pass options to determine the behavior of the picker. Documentation can be found here: https://www.filestack.com/docs/javascript-api/pick-v3.


## Notes
In order to have access to the `filestack` instance you can:
* If `Ember.inject.service` is supported then in your object you can use:
```javascript
export default Ember.Component.extend({
//injecting the filestack object
filestack: Ember.inject.service(),

someFunction: function(){
// Use the promise in case you are not sure that your component will be initialized after filestack has been loaded
this.get('filestack.promise').then(function(filestack){
// do something with filestack
});

// OR if you are sure filestack has already been loaded use:
this.get('filestack.instance')
}
});
```

## Running

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
* `ember server`
* Visit your app at http://localhost:4200.

## Running Tests

* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `npm test` (Runs `ember try:testall` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`

## Building

* `ember build`

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
For more information on using ember-cli, visit [http://ember-cli.com/](http://ember-cli.com/).
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ember-filestack",
"version": "0.0.0",
"description": "The default blueprint for ember-cli addons.",
"version": "0.0.1",
"description": "Ember Addon for https://filestack.com support",
"keywords": [
"ember-addon"
],
Expand All @@ -18,6 +18,8 @@
"test": "ember try:each"
},
"dependencies": {
"broccoli-funnel": "^1.2.0",
"broccoli-merge-trees": "^2.0.0",
"ember-cli-babel": "^5.1.7",
"ember-cli-htmlbars": "^1.1.1",
"filestack-js": "^0.6.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module.exports = function(environment) {
},

filestackKey: "AOkSBYOLvTqK3GzWzQMOuz",
filestackLoadTimeout: 100,
filestackLoadTimeout: 1000,

APP: {
// Here you can pass flags/options to your application instance
// when it is created
Expand Down

0 comments on commit e94b241

Please sign in to comment.