diff --git a/4chan_x.user.js b/4chan_x.user.js
index a7a6b51bc..cb9926cc9 100644
--- a/4chan_x.user.js
+++ b/4chan_x.user.js
@@ -565,10 +565,17 @@
},
createFilter: function(regexp, op, hl) {
return function(root, value, isOP) {
+ var firstThread, thisThread;
if (isOP && op === 'no' || !isOP && op === 'only') return false;
if (!regexp.test(value)) return false;
if (hl) {
$.addClass(root, hl);
+ if (isOP && !g.REPLY) {
+ thisThread = root.parentNode;
+ if (firstThread = $('div[class=op]')) {
+ $.before(firstThread.parentNode, [thisThread, thisThread.nextElementSibling]);
+ }
+ }
} else if (isOP) {
if (!g.REPLY) threadHiding.hideHide(root.parentNode);
} else {
@@ -2114,10 +2121,10 @@
Use regular expressions, one per line.
\
Lines starting with a # will be ignored.
\
For example, /weeaboo/i will filter posts containing `weeaboo` case-insensitive.\
-
You can use these settings with each regular expression, separate them with semi-colons:\
+ You can use these settings with each regular expression, separate them with semicolons:\
- Per boards, separate them with commas. It is global if not specified.
For example: boards:a,jp;. \
- - Filter OP along with their threads only (`only`), replies only (`no`, this is default), or both (`yes`).
For example: op:only;, op:no; or op:yes;. \
- - Highlight instead of hiding. You can specify a class name to use with a userstyle.
For example: highlight; or hightlight:wallpaper;. \
+ - Filter OPs only along with their threads (`only`), replies only (`no`, this is default), or both (`yes`).
For example: op:only;, op:no; or op:yes;. \
+ - Highlight instead of hiding. Highlighted OPs will have their threads put on top of board pages. You can specify a class name to use with a userstyle.
For example: highlight; or hightlight:wallpaper;. \
\
Name:
\
Tripcode:
\
diff --git a/changelog b/changelog
index 3573ee786..b70c27a03 100644
--- a/changelog
+++ b/changelog
@@ -1,9 +1,9 @@
master
- Mayhem
The Filter now has per filter settings:
- - Filter the OP along its thread, replies only, or both.
+ - Filter the OP only along its thread, replies only, or both.
- Per boards, or global.
- - Highlight, or hide.
+ - Highlight, or hide. Highlighted OPs will have their threads put on top of the board page.
New filter group: Image dimensions.
Fix posting on Safari.
Fix rare case where the QR would not accept certain image types.
diff --git a/script.coffee b/script.coffee
index 4d72667b9..d9b59f856 100644
--- a/script.coffee
+++ b/script.coffee
@@ -485,6 +485,12 @@ filter =
return false
if hl
$.addClass root, hl
+ if isOP and not g.REPLY
+ # Put the highlighted OPs' threads on top of the board pages...
+ thisThread = root.parentNode
+ # ...before the first non highlighted thread.
+ if firstThread = $ 'div[class=op]'
+ $.before firstThread.parentNode, [thisThread, thisThread.nextElementSibling]
else if isOP
unless g.REPLY
threadHiding.hideHide root.parentNode
@@ -1710,8 +1716,8 @@ options =
For example, /weeaboo/i will filter posts containing `weeaboo` case-insensitive.
You can use these settings with each regular expression, separate them with semicolons:
- Per boards, separate them with commas. It is global if not specified.
For example: boards:a,jp;.
- - Filter OPs along with their threads only (`only`), replies only (`no`, this is default), or both (`yes`).
For example: op:only;, op:no; or op:yes;.
- - Highlight instead of hiding. You can specify a class name to use with a userstyle.
For example: highlight; or hightlight:wallpaper;.
+ - Filter OPs only along with their threads (`only`), replies only (`no`, this is default), or both (`yes`).
For example: op:only;, op:no; or op:yes;.
+ - Highlight instead of hiding. Highlighted OPs will have their threads put on top of board pages. You can specify a class name to use with a userstyle.
For example: highlight; or hightlight:wallpaper;.
Name:
Tripcode: