forked from Cavemanon/cavepaintings
regexes are fun and pleasant to work with, in the same way that oranges are purple
This commit is contained in:
@ -41,14 +41,19 @@ $(document).ready(function() {
|
||||
|
||||
$("TABLE.sortable").tablesorter();
|
||||
|
||||
$(".comment_link").each(function(idx, elm) {
|
||||
var target_id = $(elm).text().match(/#c?(\d+)/);
|
||||
if(target_id && $("#c"+target_id[1])) {
|
||||
var target_name = $("#c"+target_id[1]+" .username").html();
|
||||
if(target_name) {
|
||||
$(elm).attr("href", "#c"+target_id[1]);
|
||||
$(elm).html("@"+target_name);
|
||||
}
|
||||
$(".shm-clink").each(function(idx, elm) {
|
||||
var target_id = $(elm).data("clink-sel");
|
||||
if(target_id && $(target_id)) {
|
||||
// if the target comment is already on this page, don't bother
|
||||
// switching pages
|
||||
$(elm).attr("href", target_id);
|
||||
// highlight it when clicked
|
||||
$(elm).click(function(e) {
|
||||
$(target_id).effect('highlight', {}, 5000);
|
||||
});
|
||||
// vanilla target name should already be in the URL tag, but this
|
||||
// will include the anon ID as displayed on screen
|
||||
$(elm).html("@"+$(target_id+" .username").html());
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user