diff --git a/4chan_x.user.js b/4chan_x.user.js index 40b92f50e..19688495e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -99,7 +99,6 @@ Imaging: { 'Image Auto-Gif': [false, 'Animate gif thumbnails'], 'Image Expansion': [true, 'Expand images'], - 'Expand From Current': [true, 'Expand images from current position to thread end'], 'Image Hover': [false, 'Show full image on mouseover'], 'Sauce': [true, 'Add sauce to images'], 'Reveal Spoilers': [false, 'Replace spoiler thumbnails by the original thumbnail'] @@ -119,6 +118,7 @@ 'Cooldown': [true, 'Prevent "flood detected" errors.'], 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.'], 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.'], + 'Open Reply in New Tab': [false, 'Open replies in a new tab that are made from the main board.'], 'Remember QR size': [false, 'Remember the size of the Quick reply (Firefox only).'], 'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'], 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], @@ -136,15 +136,15 @@ } }, filter: { - name: '', - tripcode: '', - email: '', - subject: '', - comment: '', - filename: '', - dimensions: '', - filesize: '', - md5: '' + name: [''].join('\n'), + tripcode: [''].join('\n'), + email: ['# Filter any e-mails that are not `sage` on /a/ and /jp/:', '#/^(?!sage$)/;boards:a,jp'].join('\n'), + subject: ['# Filter Generals on /v/:', '#/general/i;boards:v;op:only'].join('\n'), + comment: ['# Filter Stallman copypasta on /g/:', '#/what you\'re refer+ing to as linux/i;boards:g'].join('\n'), + filename: [''].join('\n'), + dimensions: ['# Highlight potential wallpapers:', '#/1920x1080/;op:yes;highlight;boards:w,wg'].join('\n'), + filesize: [''].join('\n'), + md5: [''].join('\n') }, sauces: ['http://iqdb.org/?url=$1', 'http://www.google.com/searchbyimage?image_url=$1', '#http://tineye.com/search?url=$1', '#http://saucenao.com/search.php?db=999&url=$1', '#http://3d.iqdb.org/?url=$1', '#http://regex.info/exif.cgi?imgurl=$2', '# uploaders:', '#http://imgur.com/upload?url=$2', '#http://omploader.org/upload?url1=$2', '# "View Same" in archives:', '#http://archive.foolz.us/a/image/$3/', '#http://archive.installgentoo.net/g/image/$3'].join('\n'), time: '%m/%d/%y(%a)%H:%M', @@ -169,7 +169,7 @@ expandThread: ['e', 'Expand thread'], watch: ['w', 'Watch thread'], hide: ['x', 'Hide thread'], - expandImage: ['m', 'Expand selected image'], + expandImages: ['m', 'Expand selected image'], expandAllImages: ['M', 'Expand all images'], update: ['u', 'Update now'], unreadCountTo0: ['z', 'Reset unread status'] @@ -535,7 +535,7 @@ filter = { filters: {}, init: function() { - var boards, filter, hl, key, op, regexp, _i, _len, _ref, _ref2, _ref3; + var boards, filter, hl, key, op, regexp, _i, _len, _ref, _ref2, _ref3, _ref4; for (key in config.filter) { this.filters[key] = []; _ref = conf[key].split('\n'); @@ -555,7 +555,9 @@ continue; } op = ((_ref3 = filter.match(/op:(yes|no|only)/)) != null ? _ref3[1].toLowerCase() : void 0) || 'no'; - hl = /highlight/.test(filter); + if (hl = /highlight/.test(filter)) { + hl = ((_ref4 = filter.match(/highlight:(\w+)/)) != null ? _ref4[1].toLowerCase() : void 0) || 'filter_highlight'; + } this.filters[key].push(this.createFilter(regexp, op, hl)); } if (!this.filters[key].length) delete this.filters[key]; @@ -564,12 +566,19 @@ }, 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, 'filter_highlight'); + $.addClass(root, hl); + if (isOP && !g.REPLY) { + thisThread = root.parentNode; + if (firstThread = $('div[class=op]')) { + $.before(firstThread.parentNode, [thisThread, thisThread.nextElementSibling]); + } + } } else if (isOP) { - threadHiding.hideHide(root.parentNode); + if (!g.REPLY) threadHiding.hideHide(root.parentNode); } else { replyHiding.hideHide(root.previousSibling); } @@ -960,7 +969,7 @@ case conf.expandThread: expandThread.toggle(thread); break; - case conf.expandImage: + case conf.expandImages: keybinds.img(thread); break; case conf.nextThread: @@ -1867,7 +1876,7 @@ return qr.message.send(post); }, response: function(html) { - var b, doc, err, node, persona, postNumber, reply, thread, _, _ref; + var b, doc, err, node, open, persona, postNumber, reply, thread, _, _ref; doc = $.el('a', { innerHTML: html }); @@ -1915,6 +1924,10 @@ } else { qr.cooldown.auto = qr.replies.length > 1; qr.cooldown.set(/sage/i.test(reply.email) ? 60 : 30); + if (conf['Open Reply in New Tab'] && !g.REPLY && !qr.cooldown.auto) { + open = GM_openInTab || window.open; + open("http://boards.4chan.org/" + g.BOARD + "/res/" + thread + "#" + postNumber, "_blank"); + } } if (conf['Persistent QR'] || qr.cooldown.auto) { reply.rm(); @@ -2099,7 +2112,7 @@ \
\
Sauce is disabled.
\ -
Lines starting with a # will be ignored.
\ + Lines starting with a # will be ignored.\