Incorporate Mayhem's Get.postFromRoot simplifications from 59f2ca6a5128bfadb8c3472c9e081d2b46d7e970.
This commit is contained in:
parent
6b167d42b9
commit
3750c5bdf5
@ -13,11 +13,8 @@ Get =
|
||||
Get.threadFromRoot $.x 'ancestor::div[@class="thread"]', node
|
||||
postFromRoot: (root) ->
|
||||
return null unless root?
|
||||
link = $ '.postNum > a[href*="#"]', root
|
||||
boardID = link.pathname.split(/\/+/)[1]
|
||||
postID = link.hash[2..]
|
||||
index = root.dataset.clone
|
||||
post = g.posts["#{boardID}.#{postID}"]
|
||||
post = g.posts[root.dataset.fullID]
|
||||
index = root.dataset.clone
|
||||
if index then post.clones[index] else post
|
||||
postFromNode: (root) ->
|
||||
Get.postFromRoot $.x '(ancestor::div[contains(@class,"postContainer")][1]|following::div[contains(@class,"postContainer")][1])', root
|
||||
|
||||
@ -30,6 +30,7 @@ class Post
|
||||
@fullID = "#{@board}.#{@ID}"
|
||||
@context = @
|
||||
|
||||
root.dataset.fullID = @fullID
|
||||
post = $ '.post', root
|
||||
info = $ '.postInfo', post
|
||||
@nodes =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user