From a5c1461de8801afff33abc027b1a6f5880c7c2fa Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 22 Feb 2012 02:06:20 +0100 Subject: [PATCH] Release 2.27.1. Fix stubs with the new filter. MD5 filter will use string matching, not regular expressions. --- 4chan_x.user.js | 22 +++++++++++++++------- Cakefile | 2 +- changelog | 5 +++++ latest.js | 2 +- script.coffee | 20 ++++++++++++++------ 5 files changed, 36 insertions(+), 15 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 0234d4049..1d2e90187 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan x -// @version 2.27.0 +// @version 2.27.1 // @namespace aeosynth // @description Adds various features. // @copyright 2009-2011 James Campos @@ -20,7 +20,7 @@ * Copyright (c) 2009-2011 James Campos * Copyright (c) 2012 Nicolas Stepien * http://mayhemydg.github.com/4chan-x/ - * 4chan X 2.27.0 + * 4chan X 2.27.1 * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -206,7 +206,7 @@ NAMESPACE = '4chan_x.'; - VERSION = '2.27.0'; + VERSION = '2.27.1'; SECOND = 1000; @@ -550,7 +550,11 @@ continue; } try { - regexp = RegExp(regexp[1], regexp[2]); + if (key === 'md5') { + regexp = regexp[1]; + } else { + regexp = RegExp(regexp[1], regexp[2]); + } } catch (e) { alert(e.message); continue; @@ -571,7 +575,11 @@ return function(root, value, isOP) { var firstThread, thisThread; if (isOP && op === 'no' || !isOP && op === 'only') return false; - if (!regexp.test(value)) return false; + if (typeof regexp === 'string') { + if (regexp !== value) return false; + } else if (!regexp.test(value)) { + return false; + } if (hl) { $.addClass(root, hl); if (isOP && top && !g.REPLY) { @@ -585,7 +593,7 @@ if (isOP) { if (!g.REPLY) threadHiding.hideHide(root.parentNode); } else { - replyHiding.hideHide(root.previousSibling); + replyHiding.hideHide(root); } return true; }; @@ -2156,7 +2164,7 @@

Filename:

\

Image dimensions:

\

Filesize:

\ -

Image MD5:

\ +

Image MD5 (uses exact string matching, not regular expressions):

\ \ \
\ diff --git a/Cakefile b/Cakefile index c8602f9bd..cfbec6a85 100644 --- a/Cakefile +++ b/Cakefile @@ -2,7 +2,7 @@ {exec} = require 'child_process' fs = require 'fs' -VERSION = '2.27.0' +VERSION = '2.27.1' HEADER = """ // ==UserScript== diff --git a/changelog b/changelog index c91bee8b8..48881d608 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,10 @@ master +2.27.1 +- Mayhem + Fix stubs with the new filter. + The MD5 will now check for exact string matching, it will not use regular expressions. + 2.27.0 - aeosynth / ahodesuka new option: expand images from current position diff --git a/latest.js b/latest.js index 6af921b2e..22d1d4f89 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'2.27.0'},'*'); +postMessage({version:'2.27.1'},'*'); diff --git a/script.coffee b/script.coffee index 07c826a9b..4f54227fe 100644 --- a/script.coffee +++ b/script.coffee @@ -153,7 +153,7 @@ conf = {} ) null, config NAMESPACE = '4chan_x.' -VERSION = '2.27.0' +VERSION = '2.27.1' SECOND = 1000 MINUTE = 60*SECOND HOUR = 60*MINUTE @@ -455,8 +455,12 @@ filter = continue try - # Please, don't write silly regular expressions. - regexp = RegExp regexp[1], regexp[2] + if key is 'md5' + # MD5 filter will use strings instead of regular expressions. + regexp = regexp[1] + else + # Please, don't write silly regular expressions. + regexp = RegExp regexp[1], regexp[2] catch e # I warned you, bro. alert e.message @@ -489,7 +493,11 @@ filter = (root, value, isOP) -> if isOP and op is 'no' or !isOP and op is 'only' return false - unless regexp.test value + if typeof regexp is 'string' + # MD5 checking + if regexp isnt value + return false + else unless regexp.test value return false if hl $.addClass root, hl @@ -505,7 +513,7 @@ filter = unless g.REPLY threadHiding.hideHide root.parentNode else - replyHiding.hideHide root.previousSibling + replyHiding.hideHide root true node: (root) -> @@ -1751,7 +1759,7 @@ options =

Filename:

Image dimensions:

Filesize:

-

Image MD5:

+

Image MD5 (uses exact string matching, not regular expressions):