Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
* master:
  Add missing trailing EOL in paper-toolbar-test.js.
  Remove self-closing tags in dummy app sidenav.
  fix self closing tags
  Add missing trailing EOL in paper-toolbar.hbs.
  update toolbars (adopted-ember-addons#367)
  use double quotes
  contributing.md: Add comments to coding style.
  Update changelog.md.
  Fix npm 2.x build failures for angular-material-source dependency (adopted-ember-addons#364)
  Toolbar class bindings (adopted-ember-addons#362)
  md-button class bindings (adopted-ember-addons#365)
  progress-circular dummy app: Restore previous behavior inadvertently commented out.
  progress-circular & -linear dummy app: Start/stop progress when route is activated/deactivated.
  link directly to `ember-route-action` helper (adopted-ember-addons#363)
  Bump version to `1.0.0-alpha.0`.
  dummy app: Make version extremely apparent.
  contributing.md: Document building and deploying dummy app to github.io.
  Checkbox & switch examples layout (adopted-ember-addons#361)

# Conflicts:
#	package.json
  • Loading branch information
eriktrom committed May 6, 2016
2 parents 90d7507 + deb5e63 commit 7ebc7de
Show file tree
Hide file tree
Showing 22 changed files with 373 additions and 88 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ Contributions and pull requests are always welcome. Contributors may often be fo
- Actions maybe be specified by a string action name (`onChange="updateValue"`) or an action closure (`onChange=(action (mut "myValue"))`). If you need to specify a target or additional parameter, you must use an action closure.
- Many attributes have been renamed for clarity and consistency. See the specific changes below.

#### 1.0.0 specific changes
#### 1.0.0-alpha.1

- [#365](https://github.com/miguelcobain/ember-paper/pull/365) paper-button: Support for `fab` and `mini`.
- [#362](https://github.com/miguelcobain/ember-paper/pull/362) paper-toolbar: Support for `tall`.
- [#364](https://github.com/miguelcobain/ember-paper/pull/364) Support installation via both npm versions 2 and 3.
- [#367](https://github.com/miguelcobain/ember-paper/pull/367) You should now use `paper-toolbar-tools` component (or respective contextual component) instead of the `md-toolbar-tools` class.

#### 1.0.0-alpha.0
- [1a9b641](https://github.com/miguelcobain/ember-paper/commit/1a9b6411a8ca30f3e9440d8585dc0f1ff4ff7649) paper-progress-circular now uses `diameter` instead of `md-diameter`
- [cf2a8da](https://github.com/miguelcobain/ember-paper/commit/cf2a8da350ea805e11eef36914ae76213b4c9f24) paper-progress-linear now uses `bufferValue` instead of `buffer-value`
- [#285](https://github.com/miguelcobain/ember-paper/pull/285) paper-checkbox now uses *actions up, data down*. `onChange` action is mandatory.
Expand Down
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Many ember-paper contributors hang out on the [e-paper channel on slack](https:/
* **jscs.** Before submitting a pull request,
check for coding style issues with `jscs -c .jscsrc app addon`.

* **Comments.** Include block-style (`/**`) comments before functions with a non-trivial or non-obvious purpose. Include line-style (`//`) comments wherever code might not be obvious to a future contributor, years later, without your knowledge of the functioning of the code. If an intermediate-level Ember developer will wonder why something works, explain it.
* **Actions.** Accept action closures rather than strings representing action names.
`{{some-component someAction=(action "myAction")}}`, not `{{some-component someAction="myAction" param="the stuff" target=someTarget}}`. Invoke the action with `this.sendAction('onWhatever');`. There is no need to test for the presence of `onWhatever` as `sendAction` handles that situation.

Expand Down Expand Up @@ -83,3 +84,22 @@ becomes
`<md-some-element>` should be implemented as an ember component, such as `{{paper-some-element}}`.

* **Features.** Seek to provide feature parity using Angular Material styles, but implemented in an Ember-centric way.

## Building and deploying the dummy app to github

If needed, update `ember-cli-github-pages` to version `0.0.9` or later, or the latest master of `0.0.8`. This version supports the `destination` option.

1. In the `master` branch, ensure that the version number in `package.json` reflects the current changes and CHANGELOG.md. If needed, bump the version number, commit, and make a git tag for the release.

2. Build the `master` branch:
```bash
checkout master
mkdir release-1 # if the directory does not already exist
ember github-pages:commit --message "Publish gh-pages for v1.0.0-alpha.0" --destination "release-1"
```

3. If the `0.2` branch needs building, repeat step 2 for `release-0-2`.

4. Checkout branch `gh-pages` and confirm that you are satisfied.

5. Push `gh-pages` to github.
8 changes: 7 additions & 1 deletion addon/components/paper-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ export default BaseFocusable.extend(RippleMixin, ProxiableMixin, ColorMixin, {
type: 'button',
tagName: 'button',
classNames: ['paper-button', 'md-default-theme', 'md-button'],
raised: false,
iconButton: false,
fab: computed.reads('mini'), // circular button
mini: false,
classNameBindings: [
'raised:md-raised',
'iconButton:md-icon-button'
'iconButton:md-icon-button',
'fab:md-fab',
'mini:md-mini'
],

// Ripple Overrides
Expand Down
6 changes: 6 additions & 0 deletions addon/components/paper-toolbar-tools.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Ember from 'ember';
const { Component } = Ember;

export default Component.extend({
classNames: ['md-toolbar-tools']
});
7 changes: 5 additions & 2 deletions addon/components/paper-toolbar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import Ember from 'ember';
import ColorMixin from 'ember-paper/mixins/color-mixin';
const { Component } = Ember;

export default Ember.Component.extend(ColorMixin, {
export default Component.extend(ColorMixin, {
tagName: 'md-toolbar',
classNames: ['md-default-theme']
classNames: ['md-default-theme'],
tall: false,
classNameBindings: ['tall:md-tall']
});
3 changes: 3 additions & 0 deletions app/components/paper-toolbar-tools.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import PaperToolbarTools from 'ember-paper/components/paper-toolbar-tools';

export default PaperToolbarTools;
12 changes: 6 additions & 6 deletions app/templates/components/paper-card.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{yield (hash
title=(component 'paper-card-title')
content=(component 'paper-card-content')
actions=(component 'paper-card-actions')
header=(component 'paper-card-header')
image=(component 'paper-card-image')
media=(component 'paper-card-media')
title=(component "paper-card-title")
content=(component "paper-card-content")
actions=(component "paper-card-actions")
header=(component "paper-card-header")
image=(component "paper-card-image")
media=(component "paper-card-media")
)}}
3 changes: 3 additions & 0 deletions app/templates/components/paper-toolbar.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{yield (hash
tools=(component "paper-toolbar-tools")
)}}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ember-paper",
"description": "The Ember approach to Material Design.",
"version": "0.2.12",
"version": "1.0.0-alpha.0",
"directories": {
"doc": "doc",
"test": "tests"
Expand Down Expand Up @@ -52,14 +52,14 @@
"loader.js": "^4.0.1"
},
"dependencies": {
"angular-material-source": "angular/material#v1.0.6",
"broccoli-autoprefixer": "^3.0.0",
"broccoli-filter": "^1.2.3",
"broccoli-funnel": "^1.0.1",
"broccoli-merge-trees": "^1.1.0",
"ember-cli-babel": "^5.1.6",
"ember-css-transitions": "^0.1.0",
"ember-wormhole": "^0.3.4"
"ember-wormhole": "^0.3.4",
"angular-material-source": "angular/material#v1.0.6"
},
"keywords": [
"ember-addon",
Expand Down
24 changes: 15 additions & 9 deletions tests/dummy/app/controllers/progress-circular.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
import Ember from 'ember';
const { Controller, run } = Ember;

export default Ember.Controller.extend({
export default Controller.extend({
mode: 'query',
determinateValue: 30,
determinateValue: 0,
timer: null,

init() {
start() {
this.set('determinateValue', 30);
this.setupTimer();
},

setupTimer() {
Ember.run.later(this, function() {
this.incrementProperty('determinateValue', 1);
if (this.get('determinateValue') > 100) {
this.set('timer', run.later(this, function() {
let value = this.incrementProperty('determinateValue', 1);
if (value > 100) {
this.set('determinateValue', 30);
}
this.setupTimer();
}, 100));
},

Ember.run.later(this, this.setupTimer);

}, 100);
stop() {
run.cancel(this.get('timer'));
}

});
34 changes: 22 additions & 12 deletions tests/dummy/app/controllers/progress-linear.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
import Ember from 'ember';
const { Controller, run } = Ember;

export default Ember.Controller.extend({
export default Controller.extend({

mode: 'query',
determinateValue: 30,
determinateValue2: 30,

init() {
determinateValue: 0,
determinateValue2: 0,
timer: null,
timer2: null,

start() {
this.set('determinateValue', 30);
this.set('determinateValue2', 30);
this.setupTimer();
this.setupTimer2();
},

setupTimer() {
Ember.run.later(this, function() {
this.incrementProperty('determinateValue', 1);
this.set('timer', run.later(this, function() {
let value = this.incrementProperty('determinateValue', 1);
this.incrementProperty('determinateValue2', 1.5);
if (this.get('determinateValue') > 100) {
if (value > 100) {
this.set('determinateValue', 30);
this.set('determinateValue2', 30);
}

Ember.run.later(this, this.setupTimer);
this.setupTimer();

}, 100);
}, 100));
},

setupTimer2() {
Ember.run.later(this, function() {
this.set('timer2', run.later(this, function() {
this.set('mode', this.get('mode') === 'query' ? 'determinate' : 'query');
Ember.run.later(this, this.setupTimer2);
}, 7200);
}, 7200));
},

stop() {
run.cancel(this.get('timer'));
run.cancel(this.get('timer2'));
}

});
15 changes: 15 additions & 0 deletions tests/dummy/app/routes/progress-circular.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Ember from 'ember';

const { Route, on } = Ember;

export default Route.extend({

onActivate: on('activate', function() {
this.controllerFor('progress-circular').start();
}),

onDeactivate: on('deactivate', function() {
this.controllerFor('progress-circular').stop();
})

});
15 changes: 15 additions & 0 deletions tests/dummy/app/routes/progress-linear.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Ember from 'ember';

const { Route, on } = Ember;

export default Route.extend({

onActivate: on('activate', function() {
this.controllerFor('progress-linear').start();
}),

onDeactivate: on('deactivate', function() {
this.controllerFor('progress-linear').stop();
})

});
4 changes: 2 additions & 2 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{#paper-toolbar class="site-content-toolbar"}}
<div class="md-toolbar-tools">
<div class="logo">
<img src="ember-logo-white.png" height="30"/>&nbsp;&nbsp;<strong>Paper</strong>
<img src="ember-logo-white.png" height="30"/>&nbsp;&nbsp;<strong>Paper 1.0</strong>
</div>
</div>
{{/paper-toolbar}}
Expand Down Expand Up @@ -32,7 +32,7 @@
{{#paper-item onClick=(transition-to "sidenav")}}Sidenav {{paper-icon "warning" title="Not updated yet."}}{{/paper-item}}
{{#paper-item onClick=(transition-to "slider")}}Slider {{paper-icon "warning" title="Not updated yet."}}{{/paper-item}}
{{#paper-item onClick=(transition-to "switch")}}Switch{{/paper-item}}
{{#paper-item onClick=(transition-to "toolbar")}}Toolbar {{paper-icon "warning" title="Not updated yet."}}{{/paper-item}}
{{#paper-item onClick=(transition-to "toolbar")}}Toolbar{{/paper-item}}
{{#paper-item onClick=(transition-to "typography")}}Typography{{/paper-item}}
{{/paper-list}}

Expand Down
4 changes: 4 additions & 0 deletions tests/dummy/app/templates/button.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
{{#paper-button raised=true primary=true onClick=(action "targetButton") bubbles=false}}Button no bubble{{/paper-button}}
</p>
<p>
{{#paper-button raised=true fab=true}}Fab{{/paper-button}}
{{#paper-button raised=true mini=true}}Mini{{/paper-button}}
{{#paper-button iconButton=true}}{{paper-icon "accessibility"}}{{/paper-button}}
</p>
{{/custom-button}}
Expand All @@ -53,6 +55,8 @@
\{{#paper-button raised=true primary=true onClick=(action "targetButton") bubbles=false}}Button no bubble\{{/paper-button}}
&lt;/p&gt;
&lt;p&gt;
\{{#paper-button raised=true fab=true}}Fab\{{/paper-button}}
\{{#paper-button raised=true mini=true}}Mini\{{/paper-button}}
\{{#paper-button iconButton=true}}\{{paper-icon "more-vert"}}\{{/paper-button}}
&lt;/p&gt;
&lt;p&gt;
Expand Down
46 changes: 35 additions & 11 deletions tests/dummy/app/templates/checkbox.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,46 @@
</div>
{{/paper-toolbar}}
{{#paper-content class="md-padding"}}
<div class="doc-content">
{{#paper-checkbox value=value1 onChange=(action (mut value1))}}A checkbox: {{value1}}{{/paper-checkbox}}
{{#paper-checkbox value=value2 onChange=(action (mut value2))}}A checkbox: {{if value2 "yep" "nope"}}{{/paper-checkbox}}
{{#paper-checkbox value=value3 onChange=(action (mut value3)) disabled=true}}Checkbox (disabled){{/paper-checkbox}}
{{#paper-checkbox value=true onChange=(action (mut value4)) disabled=true}}Checkbox (disabled and value){{/paper-checkbox}}
{{#paper-checkbox value=value5 onChange=(action (mut value5)) noink=true}}Checkbox (no ink){{/paper-checkbox}}
<div class="doc-content" layout="column">
{{#paper-checkbox value=value1 onChange=(action (mut value1))}}
A checkbox: {{value1}}
{{/paper-checkbox}}
{{#paper-checkbox value=value2 onChange=(action (mut value2))}}
A checkbox: {{if value2 "yep" "nope"}}
{{/paper-checkbox}}
{{#paper-checkbox value=value3 onChange=(action (mut value3)) disabled=true}}
Checkbox (disabled)
{{/paper-checkbox}}
{{#paper-checkbox value=true onChange=(action (mut value4)) disabled=true}}
Checkbox (disabled and value)
{{/paper-checkbox}}
{{#paper-checkbox value=value5 onChange=(action (mut value5)) noink=true}}
Checkbox (no ink)
{{/paper-checkbox}}

{{paper-checkbox label="Blockless version" value=value6 onChange=(action "toggleValue6")}}

<h3>Template</h3>
{{~#code-block language='handlebars'}}
\{{#paper-checkbox value=value1 onChange=(action (mut value1))}}A checkbox: \{{value1}}\{{/paper-checkbox}}
\{{#paper-checkbox value=value2 onChange=(action (mut value2))}}A checkbox: \{{if value2 "yep" "nope"}}\{{/paper-checkbox}}
\{{#paper-checkbox value=value3 onChange=(action (mut value3)) disabled=true}}Checkbox (disabled)\{{/paper-checkbox}}
\{{#paper-checkbox value=true onChange=(action (mut value4)) disabled=true}}Checkbox (disabled and checked)\{{/paper-checkbox}}
\{{#paper-checkbox value=value5 onChange=(action (mut value5)) noink=true}}Checkbox (no ink)\{{/paper-checkbox}}
\{{#paper-checkbox value=value1 onChange=(action (mut value1))}}
A checkbox: \{{value1}}
\{{/paper-checkbox}}

\{{#paper-checkbox value=value2 onChange=(action (mut value2))}}
A checkbox: \{{if value2 "yep" "nope"}}
\{{/paper-checkbox}}

\{{#paper-checkbox value=value3 onChange=(action (mut value3)) disabled=true}}
Checkbox (disabled)
\{{/paper-checkbox}}

\{{#paper-checkbox value=true onChange=(action (mut value4)) disabled=true}}
Checkbox (disabled and checked)
\{{/paper-checkbox}}

\{{#paper-checkbox value=value5 onChange=(action (mut value5)) noink=true}}
Checkbox (no ink)
\{{/paper-checkbox}}

\{{paper-checkbox label="Blockless version" value=value6 onChange=(action "toggleValue6")}}
{{~/code-block}}
Expand Down
Loading

0 comments on commit 7ebc7de

Please sign in to comment.