jQuery.profanityFilter
a simple client side profanity filter
// code:
$('#one').profanityFilter({
customSwears: ['ass']
})
This container will filter the word "ass" but will not filter "shit"
Often when I go to the bathroom, shit comes out of my ass.
// code:
$('#two').profanityFilter({
customSwears: ['ass'],
externalSwears: 'swearWords.json'
})
This container will filter both the words "shit" and "ass"
Often when I go to the bathroom, shit comes out of my ass.
// code:
$('#three').profanityFilter({
replaceWith: ['fun', 'stuff'],
customSwears: ['ass'],
externalSwears: 'swearWords.json'
})
This container will filter both the words "shit" and "ass", but will also change the replacement
character from an asterisk (*) a random word listed in the `replaceWith` array.
Often when I go to the bathroom, shit comes out of my ass.
// code:
$('#four').profanityFilter({
replaceWith:'#',
customSwears: ['ass'],
externalSwears: 'swearWords.json'
})
This container will filter both the words "shit" and "ass", but will also change the replacement
character from an asterisk (*) to a pound sign (#)
Often when I go to the bathroom, shit comes out of my ass.
// code:
$('#five').profanityFilter({
customSwears: ['ass'],
filter: true,
externalSwears: 'swearWords.json',
profaneText: function(data) {
$('#five')
.css('color', 'blue');
console.log(data);
}
});
This container won't filter anything, but it will do something clever because
it contains the word "ass"
Often when I go to the bathroom, shit comes out of my ass.
// code:
$('#six').profanityFilter({
customSwears: ['ass', 'shit'],
filter: false,
profaneText: function (data) {
data.forEach(function (element, index) {
var str = '' + element + '';
$('#six').html($("#six").html().replace(element, str));
});
}
});
This container won't filter anything, but it will do something clever with the swears that it finds.
Often when I go to the bathroom, shit comes out of my ass.