Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/seven-io/sms-counter

A SMS Counter for attaching to HTML form elements.
https://github.com/seven-io/sms-counter

gsm7 sms sms-counter ucs2

Last synced: 5 days ago
JSON representation

A SMS Counter for attaching to HTML form elements.

Awesome Lists containing this project

README

        

# SMS Counter by seven

Counts the SMS character usage for a textarea or text input.

## Installation

### For Browsers

```html

```

### For NodeJS

#### Yarn `yarn add @seven.io/counter`

#### NPM `npm install @seven.io/counter`

```javascript
import '@seven.io/counter'
```

## Usage

```html

```

For advanced usage see the [examples](examples).

- [textarea](examples/textarea.html)
- [input](examples/input.html)
- [CSS Selector](examples/selector.html)
- [stats](examples/stats.html)
- [getCounterStats](examples/counterStats.js)

## Options

Set the window object before loading the library.

```javascript
window.SEVEN_COUNTER_OPTIONS = {
initEvent: string = 'DOMContentLoaded', // the DOM event for init
position: InsertPosition = 'afterend', // where to add the counter stats span relative to the input
selector: string = '*[data-seven-sms]', // the inputs selector
standalone: boolean = false, // stop attaching input listeners
stats: boolean = false, // whether to output stats or not - also accepts HTMLElement or CSS selector
}
```

## Support

Need help? Feel free to [contact us](https://www.seven.io/en/company/contact).

[![MIT](https://img.shields.io/badge/License-MIT-teal.svg)](LICENSE.txt)