- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
// ==UserScript==
// @name syomaGKignore
// @description x-cross to ban GK users for syoma
// @version 0
// @match http://govnokod.ru/*
// @match http://www.govnokod.ru/*
// @grant none
// ==/UserScript==
window.addEventListener('load', function() {
localStorage.setItem('banned', localStorage.getItem('banned') || JSON.stringify([]));
var banned = JSON.parse(localStorage.getItem('banned'));
for (var i = 0; i < banned.length; i++) {
var hide = document.querySelectorAll('.entry-author a[href$="/' + banned[i] + '"]');
for (var j = 0; j < hide.length; j++) {
hide[j].parentNode.parentNode.parentNode.style.display = 'none';
}
}
var count = document.querySelector('.enrty-comments-count');
count.style.cursor = 'pointer';
count.addEventListener('click', function() {
localStorage.setItem('banned', JSON.stringify([]));
location.reload();
});
var votes = document.querySelectorAll('.comment-vote');
for (var i = 0; i < votes.length; i++) {
var cross = document.createElement('div');
cross.innerHTML = '☓';
cross.style.display = 'inline-block';
cross.style.color = 'black';
cross.style.marginLeft = '10px';
cross.style.cursor = 'pointer';
cross.addEventListener('click', function() {
var id = this.parentNode.querySelector('.entry-author a').href.replace(/^.*\//, '');
var banned = JSON.parse(localStorage.getItem('banned'));
if (banned.indexOf(id) < 0)
banned.push(id);
localStorage.setItem('banned', JSON.stringify(banned));
location.reload();
});
votes[i].parentNode.insertBefore(cross, votes[i]);
}
});
Follow us!