Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure tags must fit pattern before adding them #21

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .babelrc

This file was deleted.

16 changes: 9 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
# Tab indent, JS style
[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 2
indent_style = tab

[{package.json,.*rc,*.yml}]
# Circle YAML files need to have spaces not tabs
[*.yml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
37 changes: 37 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true,
"mocha": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2017
},
"globals": {
"mixpanel": true,
"serverVars": true,
"avkind": true,
"kind": true,
"Stripe": true
},
"plugins": [
"must-use-await"
],
"rules": {
"curly": ["error", "all"],
"indent": [
"error",
"tab"
],
"must-use-await/must-use-await": 1, // 1 warn, 2 error
"linebreak-style": "off",
"quotes": "off",
"no-console": "off",
"semi": "off",
"no-unused-vars": "off",
"no-debugger": "off"
}
}
4 changes: 0 additions & 4 deletions .jshintrc

This file was deleted.

20 changes: 0 additions & 20 deletions LICENSE

This file was deleted.

55 changes: 9 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
tags-input
==========
## A fork of [tags-input](https://github.com/developit/tags-input)

[![NPM Version](http://img.shields.io/npm/v/tags-input.svg?style=flat)](https://www.npmjs.org/package/tags-input)
[![Bower Version](http://img.shields.io/bower/v/tags-input.svg?style=flat)](http://bower.io/search/?q=tags-input)
[![Gitter Room](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/developit/tags-input)
Slowly refactoring this module to add:

**Features:**
- Plain CommonJS / ES2017 / SASS and eslint.
- Unminified variables, code run through [prettier](https://github.com/prettier/prettier-eslint-cli).
- Unit tests

- I said `<input type="tags">` should be a thing.
- With full keyboard, mouse and focus support.
- Works with HTML5 `pattern` and `placeholder` attributes, too!
- Native [`change`](https://developer.mozilla.org/en-US/docs/Web/Events/change) and [`input`](https://developer.mozilla.org/en-US/docs/Web/Events/input) _("live" change)_ events.
- Using [preact](https://github.com/developit/preact)? (or react?) There's a wrapper called [preact-token-input](https://github.com/developit/preact-token-input)
- Works in modern browsers and IE10+

**Screenshot:**

> ![screenshot](http://cl.ly/image/3M3U1h1s2y0v/tags-screenshot.png)

[JSFiddle Demo](http://jsfiddle.net/developit/d5w4jpxq/)

---


Examples
========

It's easy to use! In addition to the example code, you'll also need to
include `tags-input.css` - I didn't bundle it because that's a bit gross.

**CommonJS:**
## Usage

```js
var tagsInput = require('tags-input');
Expand All @@ -44,21 +21,7 @@ document.body.appendChild(tags);
tagsInput(document.querySelector('input[type="tags"]'));

// or just enhance all tag inputs on the page:
[].forEach.call(document.querySelectorAll('input[type="tags"]'), tagsInput);
```

**HTML Example:**

```html
<link rel="stylesheet" href="tags-input.css">
<script src="tags-input.js"></script>

<form>
<label>
Add some
<input name="hashtags" type="tags" pattern="^#" placeholder="#hashtags">
</label>
</form>

<script>[].forEach.call(document.querySelectorAll('input[type="tags"]'), tagsInput);</script>
document.querySelectorAll('input[type="tags"]').forEach(function(element){
tagsInput(element)
});
```
30 changes: 0 additions & 30 deletions bower.json

This file was deleted.

34 changes: 0 additions & 34 deletions index.html

This file was deleted.

Loading