Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name wykop płeć dla daltonistów
- // @version 1
- // @grant none
- // @include /wykop.pl/
- // @author [email protected]
- (function() {
- 'use strict';
- var $ = document.querySelectorAll.bind(document);
- function createElement(innerText) {
- var outer = document.createElement('div');
- outer.style.opacity = '0.5';
- outer.style.position = 'absolute';
- outer.style.width = '100%';
- outer.style.top = '1px';
- outer.style.right = '2px';
- outer.style['z-index'] = '5';
- var inner = document.createElement('div');
- inner.style.display = 'block';
- inner.style.color = '#fefefe';
- inner.style['text-shadow'] = '-1px -1px 0 #050505, 1px -1px 0 #050505, -1px 1px 0 #050505, 1px 1px 0 #050505';
- inner.style['text-align'] = 'right';
- inner.style['font-weight'] = 'bold';
- inner.style['font-size'] = '1.4rem';
- inner.innerHTML = innerText;
- outer.appendChild(inner);
- return outer;
- }
- function addSex(sex) {
- var elementToAdd = createElement(sex);
- return function(elem) {
- elem.parentNode.insertBefore(elementToAdd.cloneNode(true), elem);
- elem.classList.add('sexAdded');
- }
- }
- $('.logged-user .avatar ')[0].classList.add('sexAdded');
- function addSexes() {
- $('.avatar:not(.sexAdded):not(.small)').forEach(function(elem) {
- elem.parentNode.style.position = 'relative';
- });
- $('.avatar.female:not(.sexAdded)').forEach(addSex('K'));
- $('.avatar.male:not(.sexAdded)').forEach(addSex('M'));
- $('.avatar:not(.sexAdded):not(.female):not(.male)').forEach(addSex('B'));
- }
- (function addSexesTimeout() {
- addSexes();
- setTimeout(addSexesTimeout, 10000);
- })();
- })();
- // ==/UserScript==
Add Comment
Please, Sign In to add comment