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.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/Spittie/4chan-x/blob/master/LICENSE
|
* https://github.com/Spittie/4chan-x/blob/master/LICENSE
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.4.1 - 2014-03-08
|
* 4chan X - Version 1.4.1 - 2014-03-09
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/Spittie/4chan-x/blob/master/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));
|
return Get.postFromRoot($.x('ancestor::div[contains(@class,"postContainer")][1]', node));
|
||||||
},
|
},
|
||||||
contextFromNode: function(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) {
|
postDataFromLink: function(link) {
|
||||||
var boardID, path, postID, threadID, _ref;
|
var boardID, path, postID, threadID, _ref;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Generated by CoffeeScript
|
// 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.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/Spittie/4chan-x/blob/master/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));
|
return Get.postFromRoot($.x('ancestor::div[contains(@class,"postContainer")][1]', node));
|
||||||
},
|
},
|
||||||
contextFromNode: function(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) {
|
postDataFromLink: function(link) {
|
||||||
var boardID, path, postID, threadID, _ref;
|
var boardID, path, postID, threadID, _ref;
|
||||||
|
|||||||
@ -17,7 +17,8 @@ Get =
|
|||||||
postFromNode: (node) ->
|
postFromNode: (node) ->
|
||||||
Get.postFromRoot $.x 'ancestor::div[contains(@class,"postContainer")][1]', node
|
Get.postFromRoot $.x 'ancestor::div[contains(@class,"postContainer")][1]', node
|
||||||
contextFromNode: (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) ->
|
postDataFromLink: (link) ->
|
||||||
if link.hostname is 'boards.4chan.org'
|
if link.hostname is 'boards.4chan.org'
|
||||||
path = link.pathname.split '/'
|
path = link.pathname.split '/'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user