项目作者: knownasilya

项目描述 :
Highlight a given term(s) inside the `{{highlight-terms}}` component block.
高级语言: JavaScript
项目地址: git://github.com/knownasilya/ember-highlight.git
创建时间: 2016-01-16T19:47:27Z
项目社区:https://github.com/knownasilya/ember-highlight

开源协议:MIT License

下载


ember-highlight

Highlight a given term(s) inside the {{highlight-terms}} component block.

NPM
Build Status
Ember Observer Score
Ember Version

See the demo.
Uses jquery-highlight internally.

  1. ember install ember-highlight

Usage

  1. <!-- list=['joh', 'fail'] -->
  2. {{#highlight-terms 'hello' list 'other'}}
  3. Hello my name is Johnny.
  4. {{/highlight-terms}}

Default term wrapper is span.highlight which is styled automatically
by a single style, see vendor/simple.css. To override just add your own style
to .highlight-terms .highlight.

Attributes

The positional params map to term. Each param can be an array of
terms, which are automatically flattened.

  • caseSensitive - Defaults to false.
  • wordsOnly - Defaults to false.
  • term - String or Array of strings, or an Array of arrays of strings.

Testing

  1. ember test --server

Visit http://localhost:4200/ember-highlight/ to see the demo app.

Building Demo (Github Pages)

Build by checking out the relevant branch, since the test dummy app
is actually the demo app.

Run the following command:

  1. ember github-pages:commit --message <message describing demo release>