Jump to content
Sign in to follow this  
IceV

[Хак/Фича] Анти мат

Recommended Posts

Всё. Последняя фича на сегодня)) Фича: "Анти мат". Думаю.. многие искали что-то наподобие (но это не точно)

В main.tpl: (перед </body>)

<script type="text/javascript">
(antiMat = {
ban: ['лол', 'СВОИ СЛОВА ЧЕРЕЗ ЗАПЯТУЮ'],
word: function (m) {
$('textarea').keyup(function () {
var a = $(this).val(),
b = $(this);
$.each(antiMat.ban, function (i, val) {
if (a.search(new RegExp(val, 'gi')) != -1) {
b.val(a.replace(val, m.text));
if(m.message == true){
}}});
});}
})(antiMat.word({message:true, text:'[Данный текст запрещен]'}));
</script>

 

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×