Make Get.contextFromNode compatible with Quote Threading.
This commit is contained in:
parent
2504cedfee
commit
435b8d91e5
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* 4chan X - Version 1.4.1 - 2014-03-08
|
||||
* 4chan X - Version 1.4.1 - 2014-03-09
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/Spittie/4chan-x/blob/master/LICENSE
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
// ==/UserScript==
|
||||
|
||||
/*
|
||||
* 4chan X - Version 1.4.1 - 2014-03-08
|
||||
* 4chan X - Version 1.4.1 - 2014-03-09
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/Spittie/4chan-x/blob/master/LICENSE
|
||||
@ -3857,7 +3857,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;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Generated by CoffeeScript
|
||||
/*
|
||||
* 4chan X - Version 1.4.1 - 2014-03-08
|
||||
* 4chan X - Version 1.4.1 - 2014-03-09
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/Spittie/4chan-x/blob/master/LICENSE
|
||||
@ -3916,7 +3916,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;
|
||||
|
||||
@ -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 '/'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user