Inserts big mod buttons on toolbar pages
当前为
// ==UserScript==
// @author noeatnosleep
// @name BMB Toolbar Insert
// @version 1.0.0
// @namespace BMBTI
// @description Inserts big mod buttons on toolbar pages
// @include *reddit.com/tb/*
// ==/UserScript==
function generateButtons () {
$(document).find('#header')[0].style.paddingTop='18px';
var newToolbar = document.createElement("div");
newToolbar.id = "newToolbar";
document.body.insertBefore(newToolbar,document.body.firstChild);
var subredditbar = document.getElementById('sr-header-area');
newToolbar.style.cssText="color:black;background-color:'#f0f0f0';border-bottom:1px black solid;font-family:verdana, arial, helvetica, sans-serif;font-size:90%;height:32px;padding:3px 0px 3px 6px;text-transform:uppercase;width:100%;z-index:+999999;position:fixed;top:0;";
newToolbar.style.backgroundColor='#f0f0f0';
newToolbar.style.paddingLeft = '6px';
newToolbar.style.paddingTop = '3px';
newToolbar.style.paddingBottom = '3px';
newToolbar.style.top='0px';
newToolbar.innerHTML += "<a id='approvePost' style='color:black;' href='#'> APPROVE </a>";
}
}
function doStuff() {
$('#approvePost').on('click',function(e){
goApprove();
});
function goApprove() {
if (parsedPage[3] == 'user'){
var items = $('#siteTable').find('.positive');
Array.prototype.forEach.call(items, function(el, i){
setTimeout(function(){
el.click();
},100 + ( i * 400 ));
});
return false;
generateButtons(), doStuff();