Last active
March 30, 2018 11:09
-
-
Save dvingerh/e687134c5861e0e9081e4970f1292ff3 to your computer and use it in GitHub Desktop.
HackForums Userscript: Add a 'view first unread post' link to the 'Your Posts' page. (HF View Unread Post Link on 'Your Posts')
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 HF View Unread Post Link on 'Your Posts' | |
// @description Add a 'view first unread post' link to the 'Your Posts' page. | |
// @include *hackforums.net/search.php* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js | |
// @version 1 | |
// @namespace https://greasyfork.org/users/24272 | |
// ==/UserScript== | |
var cont = true; | |
($('a[href$="lastpost"]').each(function() { | |
cont = false; | |
return; | |
})); | |
if (cont){ | |
$("a[href*='showthread.php?tid=']").each(function(e) { | |
excerpt = $(this).attr("href"); | |
if (excerpt.indexOf('pid') > -1) {} else { | |
$(this).parent().parent().prev().append("<a style='text-decoration: none; font-size: 18px; margin-left: -5px;' title='Go to first unread post' class='quick_jump' href=" + excerpt + '&action=newpost></a>'); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment