Created
October 23, 2013 00:38
-
-
Save TheEnigmaBlade/7110612 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Reddit - redditremove://* button | |
// @include *://reddit.com/* | |
// @include *://*.reddit.com/* | |
// @version 1.0 | |
// @run-at document-start | |
// ==/UserScript== | |
function addRemovalButtons() { | |
reason = 'just_because'; | |
//Add the button to the end of each post listing | |
$('body.moderator div.thing').each(function(){ | |
thing_id = $(this).attr('data-fullname'); | |
entry = $(this).children('div.entry').first(); | |
subreddit = $(entry).attr('subreddit'); | |
$(entry).find('ul.flat-list.buttons').append('<li> \ | |
<a href="redditremove://'+subreddit+'/'+thing_id+'/'+reason+'">remove with reason</a> \ | |
</li>'); | |
}); | |
} | |
//Add the script to the page | |
document.addEventListener('DOMContentLoaded', function(e) { | |
var s = document.createElement('script'); | |
s.textContent="("+addRemovalButtons.toString()+')();'; | |
document.head.appendChild(s); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment