diff --git a/LICENSE b/LICENSE index 4ec9bb7c9..df264f5ae 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* appchan x - Version 2.9.0 - 2014-03-08 +* appchan x - Version 2.9.0 - 2014-03-09 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 01534a581..3c369d106 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -25,7 +25,7 @@ // ==/UserScript== /* -* appchan x - Version 2.9.0 - 2014-03-08 +* appchan x - Version 2.9.0 - 2014-03-09 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -5977,7 +5977,9 @@ return Get.postFromRoot($.x('ancestor::div[contains(@class,"postContainer")][1]', node)); }, contextFromNode: function(node) { - return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', node)); + var snapshot; + snapshot = $.X('ancestor::div[contains(@class,"postContainer")]', node); + return Get.postFromRoot(snapshot.snapshotItem(snapshot.length - 1)); }, postDataFromLink: function(link) { var boardID, path, postID, threadID, _ref; @@ -7276,7 +7278,7 @@ fullID = post.fullID; return g.posts.forEach(function(post) { if (__indexOf.call(post.quotes, fullID) >= 0) { - return recursive.apply(null, [post].concat(__slice.call(args))); + return post[recursive].apply(post, args); } }); } diff --git a/builds/crx/script.js b/builds/crx/script.js index 4d0290052..3bd1fe940 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* appchan x - Version 2.9.0 - 2014-03-08 +* appchan x - Version 2.9.0 - 2014-03-09 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -6035,7 +6035,9 @@ return Get.postFromRoot($.x('ancestor::div[contains(@class,"postContainer")][1]', node)); }, contextFromNode: function(node) { - return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', node)); + var snapshot; + snapshot = $.X('ancestor::div[contains(@class,"postContainer")]', node); + return Get.postFromRoot(snapshot.snapshotItem(snapshot.length - 1)); }, postDataFromLink: function(link) { var boardID, path, postID, threadID, _ref; @@ -7327,7 +7329,7 @@ fullID = post.fullID; return g.posts.forEach(function(post) { if (__indexOf.call(post.quotes, fullID) >= 0) { - return recursive.apply(null, [post].concat(__slice.call(args))); + return post[recursive].apply(post, args); } }); } diff --git a/src/Filtering/Recursive.coffee b/src/Filtering/Recursive.coffee index 610492554..ac01949df 100755 --- a/src/Filtering/Recursive.coffee +++ b/src/Filtering/Recursive.coffee @@ -30,4 +30,4 @@ Recursive = {fullID} = post g.posts.forEach (post) -> if fullID in post.quotes - recursive post, args... + post[recursive] args... diff --git a/src/General/Get.coffee b/src/General/Get.coffee index d8176a7ee..11ea71b6b 100755 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -17,7 +17,8 @@ Get = postFromNode: (node) -> Get.postFromRoot $.x 'ancestor::div[contains(@class,"postContainer")][1]', node contextFromNode: (node) -> - Get.postFromRoot $.x 'ancestor::div[parent::div[@class="thread"]][1]', node + snapshot = $.X 'ancestor::div[contains(@class,"postContainer")]', node + Get.postFromRoot snapshot.snapshotItem(snapshot.length - 1) postDataFromLink: (link) -> if link.hostname is 'boards.4chan.org' path = link.pathname.split '/'