forked from GithubBackups/vichan
Highlight references to the current post
This commit is contained in:
parent
1a259a3cd4
commit
2a2108a698
@ -74,7 +74,7 @@ onready(function(){
|
|||||||
.css('z-index', '100')
|
.css('z-index', '100')
|
||||||
.css('left', '0')
|
.css('left', '0')
|
||||||
.addClass('reply').addClass('post')
|
.addClass('reply').addClass('post')
|
||||||
.insertAfter(link.parent())
|
.appendTo(link.parents('div.post'))
|
||||||
|
|
||||||
// shrink expanded images
|
// shrink expanded images
|
||||||
newPost.find('div.file a[data-expanded="true"]').each(function() {
|
newPost.find('div.file a[data-expanded="true"]').each(function() {
|
||||||
@ -82,6 +82,19 @@ onready(function(){
|
|||||||
$(this).find('img.post-image').attr('src', thumb);
|
$(this).find('img.post-image').attr('src', thumb);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Highlight references to the current post
|
||||||
|
if (link.hasClass('mentioned-'+id)) {
|
||||||
|
var postLinks = newPost.find('div.body a:not([rel="nofollow"])');
|
||||||
|
if (postLinks.length > 1) {
|
||||||
|
var originalPost = link.parents('div.post').attr('id').replace("reply_", "");
|
||||||
|
postLinks.each(function() {
|
||||||
|
if ($(this).text() == ">>"+originalPost) {
|
||||||
|
$(this).addClass('dashed-underline');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var previewWidth = newPost.outerWidth(true);
|
var previewWidth = newPost.outerWidth(true);
|
||||||
var widthDiff = previewWidth - newPost.width();
|
var widthDiff = previewWidth - newPost.width();
|
||||||
var linkLeft = link.offset().left;
|
var linkLeft = link.offset().left;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user