Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/seven-io/sms-counter
- Owner: seven-io
- License: mit
- Created: 2020-06-04T14:12:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-08T06:59:41.000Z (7 months ago)
- Last Synced: 2024-05-29T13:52:15.714Z (6 months ago)
- Topics: gsm7, sms, sms-counter, ucs2
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@sms77.io/counter
- Size: 675 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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)