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

Commit 7e4381a

Browse files
Merge pull request #3 from movableink/rr/2.0
Rr/2.0
2 parents d4a0dbc + ec2dd64 commit 7e4381a

12 files changed

+170
-232
lines changed

.babelrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"es2015",
5+
{
6+
"modules": false
7+
}
8+
]
9+
],
10+
"plugins": [
11+
]
12+
}

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
end_of_line = lf
8+
indent_style = space
9+
indent_size = 2

README.md

+22-25
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,58 @@
11
# Backpack
22

3-
Backpack is for building custom apps for use with Movable Ink
3+
Backpack is for building custom apps and projects for use with Movable Ink
44

55
## Installation
66

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

99
```bash
10-
npm install -g bower # if bower is not installed yet
11-
bower init
12-
bower install --save mi-backpack
13-
```
1410

15-
Then use it by referencing it from your HTML page:
11+
"dependencies": {
12+
"backpack": "git+ssh://[email protected]/movableink/backpack.git"
13+
}
14+
1615

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

21-
And from your JS:
18+
Then use it by importing it:
2219

2320
```javascript
24-
var myApp = new Backpack();
21+
import Backpack from "backpack";
2522
```
2623

27-
## API
28-
29-
### Trigger the fallback image
30-
31-
`.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.
32-
33-
Example:
24+
And from your project:
3425

3526
```javascript
36-
myApp.forceFallback()
27+
class Project extends Backpack{
28+
29+
constructor(){
30+
super();
31+
}
32+
33+
};
3734
```
3835

36+
## API
3937

40-
### Logging to console
38+
### Trigger the fallback image
4139

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

4442
Example:
4543

4644
```javascript
47-
myApp.logger('hello world')
45+
Project.forceFallback()
4846
```
4947

50-
5148
### Trigger an event
5249

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

5552
Example:
5653

5754
```javascript
58-
myApp.trigger('error', 'some helpful error comment');
55+
Project.trigger('error', 'some helpful error comment');
5956
```
6057

6158

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

6865
```javascript
69-
myApp.on('error', function(msg){
66+
Project.on('error', function(msg){
7067
// msg.detail -- 'some helpful error comment'
7168
});
7269
```

bower.json

-29
This file was deleted.

dist/backpack.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/backpack.js

-142
This file was deleted.

package.json

+28-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
22
"name": "backpack",
3-
"version": "1.1.0",
4-
"description": "Lib for building custom apps for use with Movable Ink",
5-
"main": "index.js",
3+
"version": "2.0.0",
4+
"description": "Lib for building custom apps and projects for use with Movable Ink",
5+
"main": "dist/backpack.js",
66
"directories": {
7-
"test": "tests"
7+
"lib": "src"
88
},
99
"dependencies": {},
1010
"devDependencies": {
11-
"bower": "^1.4.1",
12-
"qunitjs": "^1.18.0"
11+
"babel-core": "6.21.0",
12+
"babel-loader": "6.2.10",
13+
"babel-preset-es2015": "6.18.0",
14+
"webpack": "2.2.0-rc.3"
1315
},
1416
"scripts": {
15-
"test": "",
16-
"postinstall": ""
17+
"dev": "webpack --progress --watch",
18+
"prod": "webpack -p"
1719
},
1820
"repository": {
1921
"type": "git",
@@ -24,7 +26,24 @@
2426
"webcrop",
2527
"email"
2628
],
27-
"author": "Roger Rodriguez <[email protected]>",
29+
"author": {
30+
"name": "Solutions Engineering",
31+
"email": "[email protected]"
32+
},
33+
"contributors": [
34+
{
35+
"name": "Roger Rodriguez",
36+
"email": "[email protected]"
37+
},
38+
{
39+
"name": "Michael Nguyen",
40+
"email": "[email protected]"
41+
},
42+
{
43+
"name": "Peter Lo",
44+
"email": "[email protected]"
45+
}
46+
],
2847
"license": "MIT",
2948
"bugs": {
3049
"url": "https://github.com/movableink/backpack/issues"

0 commit comments

Comments
 (0)