From c5ef9edf3169b9e2f1e082e9ca16e48a07e80070 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 25 Aug 2012 16:07:15 +0200 Subject: [PATCH 1/2] Close #704. Thanks @SlashG. --- 4chan_x.user.js | 7 ++++++- changelog | 2 ++ script.coffee | 7 ++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 3b9f3295e..e4b02eda5 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2404,6 +2404,11 @@ QR.captcha.count(captchas.length); if (!response) { err = 'No valid captcha.'; + } else { + response = response.trim(); + if (!/\s/.test(response)) { + response = "" + response + " " + response; + } } } if (err) { @@ -2435,7 +2440,7 @@ mode: 'regist', pwd: (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value, recaptcha_challenge_field: challenge, - recaptcha_response_field: response.replace(/^\s+/, 'a ').replace(/\s+$/, ' a') + recaptcha_response_field: response }; callbacks = { onload: function() { diff --git a/changelog b/changelog index 43ad1d398..f3ded16ca 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + One-word-captcha: you don't need to input an extra space anymore, the true word will be duplicated. 2.34.7 - Mayhem diff --git a/script.coffee b/script.coffee index 32d38b95f..b392e3e5e 100644 --- a/script.coffee +++ b/script.coffee @@ -1863,6 +1863,11 @@ QR = QR.captcha.count captchas.length unless response err = 'No valid captcha.' + else + response = response.trim() + # one-word-captcha: + # If there's only one word, duplicate it. + response = "#{response} #{response}" unless /\s/.test response if err # stop auto-posting @@ -1896,7 +1901,7 @@ QR = mode: 'regist' pwd: if m = d.cookie.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $('input[name=pwd]').value recaptcha_challenge_field: challenge - recaptcha_response_field: response.replace(/^\s+/, 'a ').replace /\s+$/, ' a' + recaptcha_response_field: response callbacks = onload: -> From 5522be6c154fe399ba3596acee1fb3d69441eec0 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 25 Aug 2012 16:07:49 +0200 Subject: [PATCH 2/2] Release 2.34.8. --- 4chan_x.user.js | 6 +++--- Cakefile | 2 +- changelog | 2 ++ latest.js | 2 +- script.coffee | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index e4b02eda5..e649a6699 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan x -// @version 2.34.7 +// @version 2.34.8 // @namespace aeosynth // @description Adds various features. // @copyright 2009-2011 James Campos @@ -23,7 +23,7 @@ * Copyright (c) 2009-2011 James Campos * Copyright (c) 2012 Nicolas Stepien * http://mayhemydg.github.com/4chan-x/ - * 4chan X 2.34.7 + * 4chan X 2.34.8 * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -5271,7 +5271,7 @@ return $.globalEval(("(" + code + ")()").replace('_id_', bq.id)); }, namespace: '4chan_x.', - version: '2.34.7', + version: '2.34.8', callbacks: [], css: '\ /* dialog styling */\ diff --git a/Cakefile b/Cakefile index 3ab7973d0..8bff52792 100644 --- a/Cakefile +++ b/Cakefile @@ -2,7 +2,7 @@ {exec} = require 'child_process' fs = require 'fs' -VERSION = '2.34.7' +VERSION = '2.34.8' HEADER = """ // ==UserScript== diff --git a/changelog b/changelog index f3ded16ca..ca8c7cd4f 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master + +2.34.8 - Mayhem One-word-captcha: you don't need to input an extra space anymore, the true word will be duplicated. diff --git a/latest.js b/latest.js index 5c611770a..247c74694 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'2.34.7'},'*') \ No newline at end of file +postMessage({version:'2.34.8'},'*') \ No newline at end of file diff --git a/script.coffee b/script.coffee index b392e3e5e..5bd26f8a8 100644 --- a/script.coffee +++ b/script.coffee @@ -4127,7 +4127,7 @@ Main = $.globalEval "(#{code})()".replace '_id_', bq.id namespace: '4chan_x.' - version: '2.34.7' + version: '2.34.8' callbacks: [] css: ' /* dialog styling */