Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
roger-rodriguez committed Feb 16, 2017
1 parent 9914031 commit 8e2b5fe
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,58 @@
# Backpack

Backpack is for building custom apps for use with Movable Ink
Backpack is for building custom apps and projects for use with Movable Ink

## Installation

Backpack is on bower. Install it with:
In your `package.json` include the following in your dependecies:

```bash
npm install -g bower # if bower is not installed yet
bower init
bower install --save mi-backpack
```

Then use it by referencing it from your HTML page:
"dependencies": {
"backpack": "git+ssh://[email protected]/movableink/backpack.git"
}


```html
<script src="bower_components/mi-backpack/lib/backpack.js"></script>
```

And from your JS:
Then use it by importing it:

```javascript
var myApp = new Backpack();
import backpack from "backpack";
```

## API

### Trigger the fallback image

`.forceFallback()` is useful for triggering the static fallback image associated with the block. Note: by default it will remove the `#mi_size_container` element from the DOM.

Example:
And from your project:

```javascript
myApp.forceFallback()
class Project extends Backpack{

constructor(){
super();
}

};
```

## API

### Logging to console
### Trigger the fallback image

`.logger()` makes it easier to follow `console.logs()` inside the app debug console.
`.forceFallback()` is useful for triggering the static fallback image associated with the block.

Example:

```javascript
myApp.logger('hello world')
Project.forceFallback()
```


### Trigger an event

`.trigger()` creates a synthetic event that bubbles up to the `document`.

Example:

```javascript
myApp.trigger('error', 'some helpful error comment');
Project.trigger('error', 'some helpful error comment');
```


Expand All @@ -66,7 +63,7 @@ myApp.trigger('error', 'some helpful error comment');
Example:

```javascript
myApp.on('error', function(msg){
Project.on('error', function(msg){
// msg.detail -- 'some helpful error comment'
});
```

0 comments on commit 8e2b5fe

Please sign in to comment.