Don't use title attribute to select elements. #220

Hopefully this will reduce extension conflicts and sensitivity to 4chan changes.
This commit is contained in:
ccd0 2014-12-30 16:19:32 -08:00
parent 195fb0655e
commit 4015395c10
3 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ Get =
threadFromNode: (node) -> threadFromNode: (node) ->
Get.threadFromRoot $.x 'ancestor::div[@class="thread"]', node Get.threadFromRoot $.x 'ancestor::div[@class="thread"]', node
postFromRoot: (root) -> postFromRoot: (root) ->
link = $ 'a[title*="Link to this post"]', root link = $ '.postNum > a[href*="#"]', root
boardID = link.pathname.split('/')[1] boardID = link.pathname.split('/')[1]
postID = link.hash[2..] postID = link.hash[2..]
index = root.dataset.clone index = root.dataset.clone

View File

@ -16,7 +16,7 @@ class Clone extends Post
post: post post: post
info: info info: info
nameBlock: $ '.nameBlock', info nameBlock: $ '.nameBlock', info
quote: $ 'a[title*="Reply to this post"]', info quote: $ '.postNum > a:nth-of-type(2)', info
comment: $ '.postMessage', post comment: $ '.postMessage', post
quotelinks: [] quotelinks: []
backlinks: info.getElementsByClassName 'backlink' backlinks: info.getElementsByClassName 'backlink'

View File

@ -21,7 +21,7 @@ class Post
el.removeAttribute 'style' el.removeAttribute 'style'
# XXX /pol/ fakedoubles # XXX /pol/ fakedoubles
if board.ID is 'pol' if board.ID is 'pol'
$('a[title="Reply to this post"]', root2).textContent = +root2.id[2..] $('.postNum > a:nth-of-type(2)', root2).textContent = +root2.id[2..]
textNodes = $.X './/text()', root2 textNodes = $.X './/text()', root2
i = 0 i = 0
while node = textNodes.snapshotItem i++ while node = textNodes.snapshotItem i++
@ -41,7 +41,7 @@ class Post
post: post post: post
info: info info: info
nameBlock: $ '.nameBlock', info nameBlock: $ '.nameBlock', info
quote: $ 'a[title*="Reply to this post"]', info quote: $ '.postNum > a:nth-of-type(2)', info
comment: $ '.postMessage', post comment: $ '.postMessage', post
links: [] links: []
quotelinks: [] quotelinks: []