'); // }); // } //preventing spam in shoutbox if (window.location.href.indexOf("free-online-chat-rooms") > -1) { $('.shoutbox-message-input').attr('maxlength', '140'); } }); //ready ends $(window).on('action:ajaxify.end', function(event, data) { changeNoFollowLinks(); //Old redirects for so we don't lose seo juice if (data.url === 'shoutbox') { window.location.href = 'http://chatrooms.talkwithstranger.com/free-online-chat-rooms'; } if (data.url === 'draw') { window.location.href = 'http://chatrooms.talkwithstranger.com/drawing-pad'; } }); function changeNoFollowLinks() { $("a[href*='/talkwithstranger.com'], a[href*='.talkwithstranger.com'],a[href^='http://talkwithstranger.com'], a[href^='http://talkwithstranger.com/']").attr("rel", "follow"); } // filter bad words //var badWords = ['Sexting', 'Sexting', 'europe', 'c++', 'women']; function contains(target, pattern) { var value = 0; pattern.forEach(function(word) { value = value + target.includes(word); }); return (value === 1) } // true if topic has one of the bad words //console.log(contains($(".topic").find('span').text(), badWords)); /* get the cookie based on input */ function getCookie(input) { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var name = cookies[i].split('=')[0].toLowerCase(); var value = cookies[i].split('=')[1].toLowerCase(); if (name === input) { return value; } else if (value === input) { return name; } } return ""; }; });