work for backlinks
This commit is contained in:
parent
91ab8eeae6
commit
ee4716b048
15
js/inline.js
15
js/inline.js
@ -4,9 +4,10 @@
|
|||||||
var inline = function(e) {
|
var inline = function(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
|
var $root = $(this).closest('.post')
|
||||||
var postNum = this.textContent.slice(2)
|
var postNum = this.textContent.slice(2)
|
||||||
|
|
||||||
var $clone = $('#inline_' + postNum)
|
var $clone = $root.find('#inline_' + postNum)
|
||||||
if ($clone.length)
|
if ($clone.length)
|
||||||
return $clone.remove()
|
return $clone.remove()
|
||||||
|
|
||||||
@ -15,9 +16,13 @@
|
|||||||
? '.op .body'
|
? '.op .body'
|
||||||
: '#reply_' + postNum + ' .body'
|
: '#reply_' + postNum + ' .body'
|
||||||
|
|
||||||
|
var node = this.className
|
||||||
|
? $root.find('.body').first().children().first()
|
||||||
|
: this.nextSibling
|
||||||
|
|
||||||
var link = {
|
var link = {
|
||||||
postNum: postNum,
|
node: node,
|
||||||
node: this
|
postNum: postNum
|
||||||
}
|
}
|
||||||
|
|
||||||
var OP = $('input[name="thread"]').val()
|
var OP = $('input[name="thread"]').val()
|
||||||
@ -48,7 +53,7 @@
|
|||||||
"class": 'inline',
|
"class": 'inline',
|
||||||
id: 'inline_' + link.postNum
|
id: 'inline_' + link.postNum
|
||||||
})
|
})
|
||||||
$clone.insertAfter(link.node)
|
$clone.insertBefore(link.node)
|
||||||
}
|
}
|
||||||
|
|
||||||
$('head').append(
|
$('head').append(
|
||||||
@ -60,7 +65,7 @@
|
|||||||
'}' +
|
'}' +
|
||||||
'</style>')
|
'</style>')
|
||||||
|
|
||||||
$('.body a')
|
$('.body a, .mentioned a')
|
||||||
.attr('onclick', null)// disable highlightReply. so hacky
|
.attr('onclick', null)// disable highlightReply. so hacky
|
||||||
.click(inline)
|
.click(inline)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user