diff --git a/.gitignore b/.gitignore index 30a36fe..e8468a3 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,9 @@ testem.log .node_modules.ember-try/ bower.json.ember-try package.json.ember-try + +# npm package-lock.json can get stale because we use yarn; someone might commit a npm installed `package-lock.json` +package-lock.json + +# git time metric /.gtm/ diff --git a/README.md b/README.md index 5046f7e..d6d7746 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,11 @@ Ember.TextSupport enhancements including a `{{input-text}}` and `{{text-area}}` [![ember-beta](https://img.shields.io/badge/ember--try-ember--beta-brightgreen.svg)](https://circleci.com/gh/cybertoothca/ember-cli-text-support-mixins) [![ember-canary](https://img.shields.io/badge/ember--try-ember--canary-brightgreen.svg)](https://circleci.com/gh/cybertoothca/ember-cli-text-support-mixins) +## Demo & Documentation + +The demonstration web application can be found here: +[https://ember-cli-text-support-mixins.cybertooth.io/](https://ember-cli-text-support-mixins.cybertooth.io/). + ## Installation The following command will install this add-on: @@ -46,177 +51,22 @@ This add-on no longer depends on JQuery. ### Dependencies -#### `keyevent` - -The constants from [`keyevent`](https://github.com/cybertoothca/keyevent) are installed -by yarn and `ember-cli-node-assets`. - -## Demo - -The demonstration web application can be found here: -[http://ember-cli-text-support-mixins.cybertooth.io/](http://ember-cli-text-support-mixins.cybertooth.io/). - -## What Does This Add-on Do? - -This add-on supplies the following _components_: - -* `input-text` - a simple extension of the Ember text component that includes the following mixins: -`ctrl-enter-submits-form.js` (**disabled** by default), `enter-submits-form.js` (**enabled** by default), -`escape-key-clears.js` (**enabled** by default), `focus-selects-text.js` (**enabled** by default), and -`trigger-focus.js` (always on). -* `text-area` - a simple extension of the Ember text component that includes the following mixins: -`ctrl-enter-submits-form.js` (**disabled** by default), `escape-key-clears.js` (**enabled** by default), -`focus-selects-text.js` (**enabled** by default), and `trigger-focus.js` (always on). - -Also available are the following _mixins_. You can incorporate their behaviours into your components: - -* `ctrl-enter-submits-form.js` - the `CTRL+ENTER` keypress combination will try to submit the nearest form element. -* `enter-submits-form.js` - pressing `ENTER` in a text input will try to submit the nearest form element. -* `escape-key-clears.js` - pressing the `ESCAPE` key while focused in a text input or textarea will clear all text. -* `focus-selects-text.js` - triggers to select the text components text when focus is placed into the input. -* `trigger-focus.js` - fixes the quirk in Ember where html5 `autofocus` does not work after template re-renders. - -_Further information about these items can be found in the Usage section below and in the -[demo (dummy) application](http://ember-cli-text-support-mixins.cybertooth.io/)._ - -## Usage - -As mentioned above there are several examples on the demonstration site: -[http://ember-cli-text-support-mixins.cybertooth.io/](http://ember-cli-text-support-mixins.cybertooth.io/) - -### Components - -#### `{{input-text}}` - -Generates a text-type input: `` that includes clear on Escape press, -submit on Enter, submit on CTRL+Enter, select text when focused and autofocus when the templated is loaded -(and reloaded). +#### `ember-cli-element-closest-polyfill` -##### Arguments +Polyfill terrible M$ browsers with the `Element.closest()` & `Element.matches()` using +[`ember-cli-element-closest-polyfill`](https://github.com/miguelcobain/ember-cli-element-closest-polyfill). -* `afterClearAction` (defaults to `undefined`) - assign a closure function to this property -to invoke any type of behaviour after clearing the text. -* `afterCtrlEnterSubmitAction` (defaults to `undefined`) - assign a closure function to this -property to invoke any type of behaviour after CTRL+ENTER submitting the form. -* `beforeClearAction` (defaults to `undefined`) - assign a closure function to this property to -invoke any type of behaviour prior to clearing the text. -* `beforeCtrlEnterSubmitAction` (defaults to `undefined`) - assign a closure function to this property -to invoke any type of behaviour prior to CTRL+ENTER submitting the form. -* `ctrlEnterSubmitsForm?` (defaults to `false`) - enable or disable `CTRL`+`ENTER` submitting the nearest form. -* `enterWillSubmitForm?` (defaults to `true`) - enable or disable `ENTER` submitting the nearest form. -* `escapeKeyClears?` (defaults to `true`) - enable or disable the `ESCAPE` key clearing input/textarea text. -* `focusSelectsText?` (defaults to `true`) - enable or disable the selecting of input/textarea text when taking focus. -* _All the standard input attributes that apply to text boxes._ - -#### Examples - -``` - {{input-text value=model.someField}} -``` - -([Check out the demo...](http://ember-cli-text-support-mixins.cybertooth.io/)) - -#### `{{text-area}}` - -Generates a textarea: `