Skip to content

VarunBatraIT/jquery.hurt.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jquery.hurt.js

A small plugin to warn people when using swear words.

#Motivation:

Think before you type

How it works?

Plugin has inbuilt very small list (you can add more) of swear words/sentences so if anyone types something containing these words, it will give them a warning.

Usage

Using plugin is pretty much forward:

$('textarea, input').hurt(
{
      swearWords: ['fuck off', 'kill yourself', 'mother fucker', 'hate you', 'go to hell', 'leave me alone',
                   'you are dead'], #array of words/sentences if found, plugin will warn
      errorMessage: 'Kind of language you are using can actually <b>HURT</b> someone. Please reconsider.' #message to show
      classOnElement: 'hurt' #class will be added to input text or textarea where user is typing
      onEvent: 'focusout' #or keyup, keydown
      errorTemplate: '<div class="text-warning">errorMessage</div>'
    }
);

About

A small plugin to warn people when using swear words.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published