// ==UserScript==
// @name deviantART Go to Last Page of Topic
// @namespace http://davidjcobb.deviantart.com
// @description Adds a "Last Page" link to topics in deviantART's forums.
// @include http://forum.deviantart.com/*/*/
// ==/UserScript==
unsafeWindow.FFGM_DJC_DA_GoThroughForumTable = window.FFGM_DJC_DA_GoThroughForumTable = function() {
for (var i=0;i<document.getElementsByTagName("table").length;i++) {
if (document.getElementsByTagName("table")[i].className=="forum f full") {
for (var a=1;a<document.getElementsByTagName("table")[i].rows.length;a++) {
if (document.getElementsByTagName("table")[i].rows[a].cells.length==1) continue;
var URL=document.getElementsByTagName("table")[i].rows[a].cells[1].childNodes[1].href;
var postCount=document.getElementsByTagName("table")[i].rows[a].cells[3].childNodes[0].nodeValue.replace(/s/gi,"");
var lastPageOffset=parseInt(postCount)-(parseInt(postCount) % 25);
var lastURL=URL+"?offset="+lastPageOffset;
var A=document.createElement("A");
A.innerHTML=postCount;
A.href=lastURL;
document.getElementsByTagName("table")[i].rows[a].cells[3].replaceChild(A,document.getElementsByTagName("table")[i].rows[a].cells[3].childNodes[0]);
}
break;
}
}
}
FFGM_DJC_DA_GoThroughForumTable();















Devious Comments
Comments
The setting of the number of messages per page is the tripping point, indeed, I thought I could store it from previous browsing...
--
82% of statistics in signatures are made up.
Spreading them is un-original and sheepish. If you agree, copy this in your... wait, no!
No to signature clichés! You are on an art site, be creative!
I've no idea how to.
--
I'd put the link on the Deviation, but deviantART's file upload script is so ridiculously fragile (and unfit for release!) that any add-on breaks it, and I really don't feel like going through all of my add-ons one by one, so I can't edit the Deviation at all.
--
тнє פuїпєα ρїפѕ αгє гїѕїпפ...
--
--
Philosophy Nerd
--
тнє פuїпєα ρїפѕ αгє гїѕїпפ...
--
тнє פuїпєα ρїפѕ αгє гїѕїпפ...
--
Previous PageNext Page