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 http://www.reddit.com/tb/*
// ==/UserScript==
function generateButtons () {
$(document).find('.left-side')[0].style.paddingTop='3px';
var modButtons = document.createElement("span");
modButtons.id = "modButtons";
document.body.insertBefore(modButtons,document.body.firstChild);
var subredditbar = document.getElementById('sr-header-area');
modButtons.style.cssText="color:black;background-color:'#f0f0f0';border-bottom:1px black solid;font-family:verdana, arial, helvetica, sans-serif;font-size:90%;height:12px;padding:3px 0px 3px 6px;text-transform:uppercase;width:100%;z-index:+999999;position:fixed;top:0;";
modButtons.style.backgroundColor='#f0f0f0';
modButtons.style.paddingLeft = '3px';
modButtons.style.paddingTop = '3px';
modButtons.style.paddingBottom = '3px';
modButtons.style.top='3px';
modButtons.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(), goApprove();