Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name NotABug Enhancement Suite
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match https://nab.cx/*
- // @grant none
- // @require http://code.jquery.com/jquery-3.3.1.min.js
- // ==/UserScript==
- (function() {
- 'use strict';
- let timerDn;
- let timerUp;
- function addGlobalStyle(css) {
- var head, style;
- head = document.getElementsByTagName('head')[0];
- if (!head) { return; }
- style = document.createElement('style');
- style.type = 'text/css';
- style.innerHTML = css;
- head.appendChild(style);
- }
- //display: inline-block;
- addGlobalStyle('.arrow { margin: 2px auto; }');
- $('.midcol').on('click', '.spammer', function() {
- let el;
- if ($(this).hasClass('upmod')) {
- clearInterval(timerUp);
- $(this).toggleClass('upmod up');
- } else if ($(this).hasClass('downmod')) {
- clearInterval(timerDn);
- $(this).toggleClass('downmod down');
- } else if ($(this).hasClass('up')) {
- el = $(this).next('.up');
- function voteUp() {
- if (el.hasClass('up')) el.click();
- }
- timerUp = setInterval(voteUp, 5000);
- voteUp();
- $(this).toggleClass('up upmod');
- } else if ($(this).hasClass('down')) {
- el = $(this).prev('.down');
- function voteDn() {
- if (el.hasClass('down')) el.click();
- }
- timerDn = setInterval(voteDn, 5000);
- voteDn();
- $(this).toggleClass('down downmod');
- }
- });
- const style = 'background-size: 100%; height: 0.75em; width: 0.75em;';
- $('.midcol').prepend('<div class="spammer arrow up" style="'+style+'"></div>');
- $('.midcol').append('<div class="spammer arrow down" style="'+style+'"></div>');
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement