Jump to content

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


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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...