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

Commit

Permalink
Merge branch 'release/v1.0.0' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscox committed Apr 10, 2017
2 parents 663c13f + 1036c66 commit 7bda1aa
Show file tree
Hide file tree
Showing 47 changed files with 945 additions and 608 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0

Remixer v1.0.0 Release.

## 0.7.0

### New Features
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,21 @@ remixer.addBooleanVariable("show", true, function(variable) {
});
```

## Is material-foundation affiliated with Google?
## API Documentation

Yes, the [material-foundation](https://github.com/material-foundation) organization is one of Google's new homes for tools and frameworks related to our [Material Design](https://material.io) system. Please check out our blog post [Design is Never Done](https://design.google.com/articles/design-is-never-done/) for more information regarding Material Design and how Remixer integrates with the system.
- Use these [common static methods](https://github.com/material-foundation/material-remixer-js/blob/develop/docs/remixer-api.md) to enable Remixer in your app.
- Or refer to the full [API documentation](https://material-foundation.github.io/material-remixer-js/docs) for more information.

## Contributing to Remixer

We're excited you want to contribute to the project! Please read these docs so we can get your contributions submitted quickly.
## Contributing
- [Contribution policy and guidelines](https://github.com/material-foundation/material-remixer-js/blob/develop/CONTRIBUTING.md)
- [Developing Remixer](https://github.com/material-foundation/material-remixer-js/blob/develop/docs/developing.md)
We gladly welcome contributions! If you have found a bug, have questions, or wish to contribute, please follow our [Contributing Guidelines](https://github.com/material-foundation/material-remixer-js/blob/develop/CONTRIBUTING.md).
## Is material-foundation affiliated with Google?
Yes, the [material-foundation](https://github.com/material-foundation) organization is one of Google's new homes for tools and frameworks related to our [Material Design](https://material.io) system. Please check out our blog post [Design is Never Done](https://design.google.com/articles/design-is-never-done/) for more information regarding Material Design and how Remixer integrates with the system.

## License

Expand Down
72 changes: 72 additions & 0 deletions docs/developing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Developing Remixer

### Setting up your development environment

First you'll need a recent version of [Node.js](https://nodejs.org) to work
with Remixer-js.

Once node is installed, simply clone our repo (or your fork of it) and
run `npm install`.

```bash
git clone git@github.com:material-foundation/material-remixer-js.git
cd material-remixer-js && npm install
```

### Typescript

The source code for Remixer-js is written in
[Typescript](https://www.typescriptlang.org), and compiled to es5 javascript for
distribution.

### Building Remixer

Use any of the following npm scripts to build dev or prod versions of Remixer-js.

```bash
# Builds an unminified version of Remixer-js within the build folder.
npm run build:dev

# Builds a minified version.
npm run build:prod

# Builds both unminified and minified versions.
npm run build
```

### Running the development server

We use [weback dev server](https://webpack.js.org/configuration/dev-server) for
hosting and live-reloading of any code changes.

```bash
npm run dev
open http://localhost:8080
```

### Linting

```bash
# Lint both CSS/LESS using lesshint.
npm run lint:css

# Lint typescript using tslint.
npm run lint:ts

# Lints both css and ts.
npm run lint
```

### Testing and Code Coverage

Testing uses the [karma](https://karma-runner.github.io) test runner with
[mocha](https://mochajs.org/) flavored testing framework. Code coverage
is reported by [istanbul](https://www.npmjs.com/package/istanbul-instrumenter-loader).

```bash
# Run tests and code coverage once.
npm run test

# Run with auto-watch indefinitely.
npm run test:watch
```
228 changes: 228 additions & 0 deletions docs/remixer-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
# Remixer API
The Remixer class is a singleton class that keeps track of all the Variables and deals with saving/syncing its values.

The following methods are the most commonly used to enable Remixer in your app.

- [remixer.start()](#start-static)
- [remixer.stop()](#stop-static)
- [remixer.addBooleanVariable()](#addbooleanvariable-static)
- [remixer.addColorVariable()](#addcolorvariable-static)
- [remixer.addNumberVariable()](#addnumbervariable-static)
- [remixer.addRangeVariable()](#addrangevariable-static)
- [remixer.addStringVariable()](#addstringvariable-static)

---

### start <sub><sup>`STATIC`</sup></sub>

Appends the HTML iFrame to body of client app. Attaches key listener to toggle Overlay visibility.

#### Syntax

```javascript
remixer.start();
remixer.start(remoteConfig);
```

#### Parameters

- **remoteConfig:** *object*

The optional firebase configuration. Provide this configuration if you wish to use the remote controller.

```javascript
var remoteConfig = {
apiKey: "<API_KEY>",
authDomain: "<PROJECT_ID>.firebaseapp.com",
databaseURL: "https://<DATABASE_NAME>.firebaseio.com"
...
};
```

#### Returns void

---

### stop <sub><sup>`STATIC`</sup></sub>

Removes iFrame and attached key listener.

#### Syntax

```javascript
remixer.stop();
```

#### Returns void

---

### addBooleanVariable <sub><sup>`STATIC`</sup></sub>

Adds a boolean Variable to array of Variables with optional callback.

#### Syntax

```javascript
remixer.addBooleanVariable(key, defaultValue);
remixer.addBooleanVariable(key, defaultValue, callback(variable) { ... } );
```

#### Parameters

- **key:** *string*

The key of the Variable.

- **defaultValue:** *boolean*

The initial default value of the variable.

- `OPTIONAL` **callback:** *function*

The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.

#### Returns [BooleanVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_booleanvariable_.booleanvariable.html)

---

### addColorVariable <sub><sup>`STATIC`</sup></sub>

Adds a color variable to array of variables with optional callback.

#### Syntax

```javascript
remixer.addColorVariable(key, defaultValue);
remixer.addColorVariable(key, defaultValue, limitedToValues);
remixer.addColorVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );
```

#### Parameters

- **key:** *string*

The key of the Variable.

- **defaultValue:** *string*

The initial default value of the variable.

- `OPTIONAL` **limitedToValues:** *string[]*

The optional array of allowed values.

- `OPTIONAL` **callback:** *function*

The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.

#### Returns [ColorVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_colorvariable_.colorvariable.html)

---

### addNumberVariable <sub><sup>`STATIC`</sup></sub>

Adds a number variable to array of variables with optional callback.

#### Syntax

```javascript
remixer.addNumberVariable(key, defaultValue);
remixer.addNumberVariable(key, defaultValue, limitedToValues);
remixer.addNumberVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );
```

#### Parameters

- **key:** *string*

The key of the Variable.

- **defaultValue:** *number*

The initial default value of the variable.

- `OPTIONAL` **limitedToValues:** *number[]*

The optional array of allowed values.

- `OPTIONAL` **callback:** *function*

The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.

#### Returns [NumberVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_numbervariable_.numbervariable.html)

---

### addRangeVariable <sub><sup>`STATIC`</sup></sub>

Adds a range Variable to array of Variables with optional callback.

#### Syntax

```javascript
remixer.addRangeVariable(key, defaultValue, minValue, maxValue, increment);
remixer.addRangeVariable(key, defaultValue, minValue, maxValue, increment, callback(variable) { ... } );
```

#### Parameters

- **key:** *string*

The key of the Variable.

- **defaultValue:** *number*

The initial default value of the variable.

- **minValue:** *number*

The allowed minimum value of the variable.

- **maxValue:** *number*

The allowed maximum value of the variable.

- **increment:** *number*

The amount to increment the value.

- `OPTIONAL` **callback:** *function*

The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.

#### Returns [RangeVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_rangevariable_.rangevariable.html)

---

### addStringVariable <sub><sup>`STATIC`</sup></sub>

Adds a string variable to array of variables with optional callback.

#### Syntax

```javascript
remixer.addStringVariable(key, defaultValue);
remixer.addStringVariable(key, defaultValue, limitedToValues);
remixer.addStringVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );
```

#### Parameters

- **key:** *string*

The key of the Variable.

- **defaultValue:** *string*

The initial default value of the variable.

- `OPTIONAL` **limitedToValues:** *string[]*

The optional array of allowed values.

- `OPTIONAL` **callback:** *function*

The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.

#### Returns [StringVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_stringvariable_.stringvariable.html)
4 changes: 2 additions & 2 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "material-remixer-examples",
"version": "0.0.1",
"version": "1.0.0",
"description": "Example app demonstrating usage of Remixer.",
"author": "The Material Remixer Authors (see AUTHORS)",
"license": "Apache-2.0",
Expand All @@ -16,6 +16,6 @@
"handlebars": "^4.0.6",
"jquery": "^3.1.1",
"material-design-lite": "^1.2.1",
"material-remixer": "^0.6.4"
"material-remixer": "^1.0.0"
}
}
Loading

0 comments on commit 7bda1aa

Please sign in to comment.