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

Commit

Permalink
Merge pull request #3 from movableink/rr/2.0
Browse files Browse the repository at this point in the history
Rr/2.0
  • Loading branch information
roger-rodriguez authored Feb 22, 2017
2 parents d4a0dbc + ec2dd64 commit 7e4381a
Show file tree
Hide file tree
Showing 12 changed files with 170 additions and 232 deletions.
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"es2015",
{
"modules": false
}
]
],
"plugins": [
]
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
indent_style = space
indent_size = 2
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'
});
```
29 changes: 0 additions & 29 deletions bower.json

This file was deleted.

2 changes: 2 additions & 0 deletions dist/backpack.js

Large diffs are not rendered by default.

142 changes: 0 additions & 142 deletions lib/backpack.js

This file was deleted.

37 changes: 28 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"name": "backpack",
"version": "1.1.0",
"description": "Lib for building custom apps for use with Movable Ink",
"main": "index.js",
"version": "2.0.0",
"description": "Lib for building custom apps and projects for use with Movable Ink",
"main": "dist/backpack.js",
"directories": {
"test": "tests"
"lib": "src"
},
"dependencies": {},
"devDependencies": {
"bower": "^1.4.1",
"qunitjs": "^1.18.0"
"babel-core": "6.21.0",
"babel-loader": "6.2.10",
"babel-preset-es2015": "6.18.0",
"webpack": "2.2.0-rc.3"
},
"scripts": {
"test": "",
"postinstall": ""
"dev": "webpack --progress --watch",
"prod": "webpack -p"
},
"repository": {
"type": "git",
Expand All @@ -24,7 +26,24 @@
"webcrop",
"email"
],
"author": "Roger Rodriguez <[email protected]>",
"author": {
"name": "Solutions Engineering",
"email": "[email protected]"
},
"contributors": [
{
"name": "Roger Rodriguez",
"email": "[email protected]"
},
{
"name": "Michael Nguyen",
"email": "[email protected]"
},
{
"name": "Peter Lo",
"email": "[email protected]"
}
],
"license": "MIT",
"bugs": {
"url": "https://github.com/movableink/backpack/issues"
Expand Down
Loading

0 comments on commit 7e4381a

Please sign in to comment.