Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
poteto committed Oct 27, 2015
2 parents 1552f76 + b189c24 commit 9f24e34
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 25 deletions.
20 changes: 16 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015
Copyright (c) 2015 Lauren Elizabeth Tan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ This addon provides a very declarative way to generate dynamic breadcrumbs.
$ ember install ember-crumbly
```

## Compatibility
This addon is tested against the `release`, `beta` and `canary` channels, `~1.11.x`, and `1.12.x`.

## Usage

### Basic usage
Expand Down Expand Up @@ -100,8 +103,8 @@ export default Ember.Route.extend({
```

```hbs
{{#bread-crumbs outputStyle='bootstrap" linkable=true as |component cow|}}
{{bread-crumb route=cow breadCrumbs=component}}
{{#bread-crumbs outputStyle="bootstrap" linkable=true as |component cow|}}
{{#bread-crumb route=cow breadCrumbs=component}}
{{#if cow.title}}
{{cow.title}}
{{else}}
Expand Down
16 changes: 10 additions & 6 deletions addon/components/bread-crumb.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import Ember from 'ember';
import layout from '../templates/components/bread-crumb';
import computed from 'ember-new-computed';

const {
Component,
computed
Component
} = Ember;
const {
oneWay,
bool
} = computed;

export default Component.extend({
layout,
tagName: 'li',
classNameBindings: [ 'crumbClass' ],
classNameBindings: ['crumbClass'],

crumbClass: computed.oneWay('breadCrumbs.crumbClass'),
linkClass: computed.oneWay('breadCrumbs.linkClass'),
hasBlock: computed.bool('template').readOnly()
crumbClass: oneWay('breadCrumbs.crumbClass'),
linkClass: oneWay('breadCrumbs.linkClass'),
hasBlock: bool('template').readOnly()
});
18 changes: 11 additions & 7 deletions addon/components/bread-crumbs.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
import Ember from 'ember';
import layout from '../templates/components/bread-crumbs';
import computed from 'ember-new-computed';

const {
get,
Component,
computed,
getWithDefault,
assert,
typeOf,
setProperties,
A: emberArray,
String: { classify }
} = Ember;
const {
bool,
readOnly
} = computed;

export default Component.extend({
layout,
tagName: 'ol',
linkable: true,
reverse: false,
classNameBindings: [ 'breadCrumbClass' ],
hasBlock: computed.bool('template').readOnly(),
currentUrl: computed.readOnly('applicationRoute.router.url'),
currentRouteName: computed.readOnly('applicationRoute.controller.currentRouteName'),
classNameBindings: ['breadCrumbClass'],
hasBlock: bool('template').readOnly(),
currentUrl: readOnly('applicationRoute.router.url'),
currentRouteName: readOnly('applicationRoute.controller.currentRouteName'),

routeHierarchy: computed('currentUrl', 'currentRouteName', 'reverse', {
get() {
Expand Down Expand Up @@ -60,9 +64,9 @@ export default Component.extend({

if (routes.length === 1) {
return `${name}.index`;
} else {
return routes.join('.');
}

return routes.join('.');
},

_filterIndexRoutes(routeNames) {
Expand Down
3 changes: 2 additions & 1 deletion addon/initializers/crumbly.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export function initialize(container, application) {
export function initialize() {
const application = arguments[1] || arguments[0];
application.inject('component:bread-crumbs', 'applicationRoute', 'route:application');
}

Expand Down
1 change: 0 additions & 1 deletion app/acceptance-tests/integration.js

This file was deleted.

20 changes: 20 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
/* jshint node: true */

module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
},
{
name: 'ember-1.11',
dependencies: {
'ember': '~1.11.0'
},
resolutions: {
'ember': '~1.11.0'
}
},
{
name: 'ember-1.12.1',
dependencies: {
'ember': '1.12.1'
},
resolutions: {
'ember': '1.12.1'
}
},
{
name: 'ember-release',
dependencies: {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-crumbly",
"version": "0.2.2",
"version": "1.0.0",
"description": "Declarative breadcrumb navigation for Ember apps",
"directories": {
"doc": "doc",
Expand Down Expand Up @@ -30,9 +30,10 @@
"ember-cli-release": "0.2.3",
"ember-cli-sri": "^1.0.3",
"ember-cli-uglify": "^1.2.0",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.3",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-new-computed": "^1.0.3",
"ember-suave": "1.0.0",
"ember-try": "0.0.6"
},
Expand Down
3 changes: 1 addition & 2 deletions testem.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"PhantomJS"
],
"launch_in_dev": [
"PhantomJS",
"Chrome"
"PhantomJS"
]
}

0 comments on commit 9f24e34

Please sign in to comment.