1.13.13 • Published 8 years ago

ember-cli-paint v1.13.13

Weekly downloads
34
License
MIT
Repository
github
Last release
8 years ago

Ember-cli-paint

Ember Observer Score

ember-cli-paint is an Ember addon that adds Paint components to your application.

More specifically it does two things:

  • Add core libraries to your project dependencies
app.import(path.join(app.bowerDirectory, 'paint/paint.scss'));
app.import(path.join(app.bowerDirectory, 'modernizr/modernizr.js'));
app.import(path.join(app.bowerDirectory, 'foundation/js/foundation/foundation.js'));

This means that after installing ember-cli-paint you'll be able to use paint css straight away.

  • Expose Ember components

Example: Tooltip Component

npm.io

export default Ember.Component.extend({
  classNameBindings: [':has-tip', 'tooltipPositionClass'],
  attributeBindings: ['ariaHaspopup:aria-haspopup', 'dataTooltip:data-tooltip', 'title'],

  ariaHaspopup: 'true',
  dataTooltip: '',
  tooltipPosition: 'bottom',

  tooltipPositionClass: function() {
    return `tip-${this.get('tooltipPosition')}`;
  }.property('tooltipPosition'),

  onDidInsertElement: function() {
    Ember.$(document).foundation({ tooltip: {} });
  }.on('didInsertElement')
});

You can extend the component in your project like so:

import Ember from 'ember';
import AsTooltip from 'ember-cli-paint/components/as-tooltip';

export default AsTooltip.extend({
  classNameBindings: [':avatar'],
  attributeBindings: ['src', 'alt', 'title'],
  tagName: 'img',
  tooltipPosition: 'top',

  user: null,
  alt: Ember.computed.alias('user.initials'),
  src: Ember.computed.alias('user.avatarUrl'),
  title: Ember.computed.alias('user.name')
});

And use it in templates

...
{{as-avatar user=lead class="lead"}}
...

You can also use it directly

{{#as-tooltip title="This will be in the tooltip"}}
  <img src="blabla"></img>
{{/as-tooltip}}

Creating your own component

Check out the documentation regarding addons at http://ember-cli.com. This blog post documents some of the hooks you can leverage in ember addons.

If you have added a new Paint component remember to bump its version in bower.json and in blueprints index.js

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

Publishing the package

  • Merge your PR on GitHub
  • git checkout master
  • git pull
  • Bump package version (e.g. npm version patch)
  • npm publish
  • git push --tags

For more information on using ember-cli, visit http://www.ember-cli.com/.

1.13.13

8 years ago

1.13.12

8 years ago

1.13.11

9 years ago

1.13.10

9 years ago

1.13.9

9 years ago

1.13.8

9 years ago

1.13.7

10 years ago

1.13.6

10 years ago

1.13.5

10 years ago

1.13.4

10 years ago

1.13.3

10 years ago

1.13.2

10 years ago

1.13.1

10 years ago

1.13.0

10 years ago

1.12.9

10 years ago

1.12.8

10 years ago

1.12.7

10 years ago

1.12.6

10 years ago

1.12.5

10 years ago

1.12.4

10 years ago

1.12.3

10 years ago

1.12.2

10 years ago

1.12.1

10 years ago

1.12.0

10 years ago

1.11.7

10 years ago

1.11.6

10 years ago

1.11.5

10 years ago

1.11.4

10 years ago

1.11.3

10 years ago

1.11.2

10 years ago

1.11.1

10 years ago

1.11.0

10 years ago

1.10.8

10 years ago

1.10.7

10 years ago

1.10.6

10 years ago

1.10.5

10 years ago

1.10.4

10 years ago

1.10.3

10 years ago

1.10.2

10 years ago

1.10.1

10 years ago

1.10.0

10 years ago

1.9.0

10 years ago

1.8.24

10 years ago

1.8.23

10 years ago

1.8.22

10 years ago

1.8.21

10 years ago

1.8.20

10 years ago

1.8.19

10 years ago

1.8.18

10 years ago

1.8.17

10 years ago

1.8.16

10 years ago

1.8.15

10 years ago

1.8.14

10 years ago

1.8.13

10 years ago

1.8.12

10 years ago

1.8.11

10 years ago

1.8.10

10 years ago

1.8.9

10 years ago

1.8.8

10 years ago

1.8.7

10 years ago

1.8.6

10 years ago

1.8.5

10 years ago

1.8.4

10 years ago

1.8.3

10 years ago

1.8.2

10 years ago

1.8.1

10 years ago

1.8.0

10 years ago

1.7.1

10 years ago

1.6.1

10 years ago

1.6.0

10 years ago

1.5.0

10 years ago

1.4.1

10 years ago

1.4.0

10 years ago

1.3.1

11 years ago

1.3.0

11 years ago

1.2.2

11 years ago

1.2.1

11 years ago

1.2.0

11 years ago

1.1.0

11 years ago

1.0.0

11 years ago