This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from movableink/rr/2.0
Rr/2.0
- Loading branch information
Showing
12 changed files
with
170 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"es2015", | ||
{ | ||
"modules": false | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
``` | ||
|
||
|
||
|
@@ -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' | ||
}); | ||
``` |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
|
@@ -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" | ||
|
Oops, something went wrong.