Stopped working
|
|
Looks like reddit has renamed the score text fields ID's from score_<name> to just 'score likes' with no specific identifier as to the comment in question. Thus commentroversy no longer works. They've also killed off the undeletion ability, so it's looking like they're making a concerted effort to kill off the 'useful' userscripts.</name> |
|
|
Not sure it's a concerted effort. I'm wait and see on that one, could be they just made some changes without fully understanding the repercussions. Nonetheless, it's a pain to update the scripts. Especially when you can only get at the id by class now. Sigh. |
|
|
Edit: D'oh. Because of the javascript namespace and the fact that Reddit already is using jQuery, don't load it as part of the script. Live and learn. Edit: Small change so if you -- if you use this, it should load before the Commentroversy script (put it higher in the Greasemonkey list) -- Using jQuery (imported/downloaded when this script loads) I wrote this to manually add the ids for all of the comments. Could probably use some cleaning up. Still, one hopes that the current state of Reddit will be amended to once again include ids in their markup and restore sanity to the (known) universe and premature code cleanup is for suckers. If you're bored feel free to improve on this. // ==UserScript==
// @name Reddit Add ids
// @description Adds ids to comment scores
// @include http://www.reddit.com/comments/*
// @include http://reddit.com/comments/*
// @include http://www.reddit.com/user/*
// @include http://reddit.com/user/*
// ==/UserScript==
// Add jQuery
//var GM_JQ = document.createElement('script');
//GM_JQ.src = 'http://jquery.com/src/jquery-latest.js';
//GM_JQ.type = 'text/javascript';
//document.getElementsByTagName('head')[0].appendChild(GM_JQ);
// Check if jQuery's loaded
function GM_wait() {
if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }
else { $ = unsafeWindow.jQuery; letsJQuery(); }
}
GM_wait();
// All your GM code must be inside this function
function letsJQuery() {
var IDed = $('.thing');
for (var i = 0; i < IDed.length; i++)
{
if (IDed[i].className.indexOf('id-') == -1)
continue;
var classes = IDed[i].className.split(' ');
var j = 0;
for (; classes[j].indexOf('id-') == -1 && j < classes.length;j++);
var score = $(".tagline .score", IDed[i])[0];
if (score != null)
score.id = 'score_' + classes[j].substring(3);
}
}
|
|
|
hobo, Just tried this and works like a dandy. Don't forget to copy the included pages over or you will have this script running on more than just the proper reddit pages. |
