update streamer page

This commit is contained in:
Thibault Duplessis 2018-04-25 17:21:58 +02:00
parent 05a95c328d
commit 61c0958bb1
4 changed files with 21 additions and 34 deletions

View file

@ -30,6 +30,14 @@
<div class="side_menu">
@menu("show", s.withoutStream.some)
</div>
<a class="blocker button" href="http://getublockorigin.com">
<i data-icon=""></i>
<strong>Install a malware blocker!</strong>
Be safe from ads and trackers<br />
infesting Twitch and YouTube.<br />
We recommend uBlock Origin<br />
which is free and open-source.
</a>
}
@moreCss = {
@ -38,8 +46,18 @@
}
@moreJs = {
@jsTag("ads.js")
@jsTag("streamer.js")
@embedJs {
$(function() {
$('button.follow').click(function() {
var klass = 'active';
$(this).toggleClass(klass);
$.ajax({
url: '/rel/' + ($(this).hasClass('active') ? 'follow/' : 'unfollow/') + $(this).data('user'),
method:'post'
});
});
});
}
}
@title = @{ s"${s.titleName} streams chess" }

View file

@ -31,7 +31,7 @@ object Spam {
private val replacements = List(
s"""chess24.com\\?ref=\\w+""" -> "chess24.com",
s"""chess.com/register\\?refId=\\w+""" -> "chess.com",
s"""${protocol}${cb}(\\.com)?[^\\s]*""" -> tosUrl
s"""\b${protocol}${cb}(\\.com)?[^\\s]*""" -> tosUrl
).map {
case (regex, replacement) => regex.r -> replacement
}

View file

@ -1,6 +0,0 @@
// Internet is a dangerous place.
// You should really install a malware blocker to get rid of ads, trackers and malware sites.
// Lichess recommends uBlock Origin. It's free and open source; fast and safe.
// Get it for Firefox: https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/
// Get it for Chrome: https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en
lichess.needBlocker = true;

View file

@ -1,25 +0,0 @@
$(function() {
$('button.follow').click(function() {
var klass = 'active';
$(this).toggleClass(klass);
$.ajax({
url: '/rel/' + ($(this).hasClass('active') ? 'follow/' : 'unfollow/') + $(this).data('user'),
method:'post'
});
});
setTimeout(function() {
if (!lichess.needBlocker) return;
var url = 'https://github.com/gorhill/uBlock#installation';
if (lichess.isChrome) url = 'https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm';
else if (navigator.userAgent.indexOf(' Firefox/') > -1) url = 'https://addons.mozilla.org/addon/ublock-origin/';
else if (navigator.userAgent.indexOf(' Edge/') > -1) url = 'https://www.microsoft.com/store/p/app/9nblggh444l4';
$('#site_header').append('<a class="blocker button" href="'+url+'">' +
'<i data-icon=""></i>' +
'<strong>Install a malware blocker!</strong>' +
'Be safe from ads and trackers<br />' +
'infesting Twitch and YouTube.<br />' +
'We recommend uBlock Origin<br />' +
'which is free and open-source.' +
'</a>');
}, 1000);
});