From 1b6052304b5a479219346c2b36bdf455466e6a34 Mon Sep 17 00:00:00 2001 From: Kabir Sala Date: Sun, 9 Feb 2014 21:43:31 +0100 Subject: [PATCH] Stuff --- CHANGELOG.md | 7 +++++++ LICENSE | 2 +- README.md | 9 ++++++++- builds/4chan-X.meta.js | 6 +++--- builds/4chan-X.user.js | 27 +++++++++++++++++++-------- builds/crx/script.js | 21 ++++++++++++++++----- package.json | 2 +- src/Archive/Redirect.coffee | 12 +++++++++++- src/Posting/QR.captcha.coffee | 25 +++++++++++++++++-------- 9 files changed, 83 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e798d8e1..541b0f12a 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +### v1.3.3 +**MayhemYDG** +- Fix new captcha (Firefox only) + +**Spittie** +- Add archive.installgentoo.com + ### v1.3.2 *2014-01-12* diff --git a/LICENSE b/LICENSE index 64d784bab..30b0d0426 100755 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ * 4chan X - Version 1.3.3 - 2014-02-09 * * Licensed under the MIT license. -* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE +* https://github.com/Spittie/4chan-x/blob/master/LICENSE * * Appchan X Copyright © 2013-2013 Zixaphir * http://zixaphir.github.io/appchan-x/ diff --git a/README.md b/README.md index 312cecf2b..4bbc0d2c7 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,11 @@ -# Discontinued. +Personal fork of Seaweed's 4chan X. +Don't expect new features, I don't know Javascript, Coffeescript or all this stuff. +Don't expect any bug fix. +Don't expect any support. + +Actually, don't expect anything. + +Works with Firefox only. ## Forking diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index df8af8ecb..898396532 100755 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -5,7 +5,7 @@ // @minFFVer 26 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. -// @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE +// @license MIT; https://github.com/Spittie/4chan-x/blob/master/LICENSE // @match *://boards.4chan.org/* // @match *://sys.4chan.org/* // @match *://a.4cdn.org/* @@ -15,7 +15,7 @@ // @grant GM_deleteValue // @grant GM_openInTab // @run-at document-start -// @updateURL https://github.com/seaweedchan/4chan-x/raw/stable/builds/4chan-X.meta.js -// @downloadURL https://github.com/seaweedchan/4chan-x/raw/stable/builds/4chan-X.user.js +// @updateURL https://github.com/Spittie/4chan-x/raw/stable/builds/4chan-X.meta.js +// @downloadURL https://github.com/Spittie/4chan-x/raw/stable/builds/4chan-X.user.js // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 3563d85cc..845d8e2b7 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -6,7 +6,7 @@ // @minFFVer 26 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. -// @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE +// @license MIT; https://github.com/Spittie/4chan-x/blob/master/LICENSE // @match *://boards.4chan.org/* // @match *://sys.4chan.org/* // @match *://a.4cdn.org/* @@ -16,8 +16,8 @@ // @grant GM_deleteValue // @grant GM_openInTab // @run-at document-start -// @updateURL https://github.com/seaweedchan/4chan-x/raw/stable/builds/4chan-X.meta.js -// @downloadURL https://github.com/seaweedchan/4chan-x/raw/stable/builds/4chan-X.user.js +// @updateURL https://github.com/Spittie/4chan-x/raw/stable/builds/4chan-X.meta.js +// @downloadURL https://github.com/Spittie/4chan-x/raw/stable/builds/4chan-X.user.js // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== @@ -25,7 +25,7 @@ * 4chan X - Version 1.3.3 - 2014-02-09 * * Licensed under the MIT license. -* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE +* https://github.com/Spittie/4chan-x/blob/master/LICENSE * * Appchan X Copyright © 2013-2013 Zixaphir * http://zixaphir.github.io/appchan-x/ @@ -6132,7 +6132,8 @@ title: 'Verification', placeholder: 'Focus to load reCAPTCHA', autocomplete: 'off', - spellcheck: false + spellcheck: false, + tabIndex: 55 }); this.nodes = { img: imgContainer.firstChild, @@ -9914,7 +9915,7 @@ software: "foolfuuka" } }, - "Install Gentoo": { + "Install Gentoo (.net)": { boards: ["diy", "g", "sci"], files: [], data: { @@ -9924,6 +9925,16 @@ software: "fuuka" } }, + "Install Gentoo (.com)": { + boards: ["t", "g"], + files: ["t", "g"], + data: { + domain: "archive.installgentoo.com/", + http: true, + https: true, + software: "foolfuuka" + } + }, "Rebecca Black Tech": { boards: ["cgl", "g", "mu", "w"], files: ["cgl", "g", "mu", "w"], @@ -11713,7 +11724,7 @@ if (previous === g.VERSION) { return; } - changelog = 'https://github.com/seaweedchan/4chan-x/blob/master/CHANGELOG.md'; + changelog = 'https://github.com/Spittie/4chan-x/blob/master/CHANGELOG.md'; el = $.el('span', { innerHTML: "4chan X has been updated to version " + g.VERSION + "." }); @@ -11748,7 +11759,7 @@ return; } $.event('CloseMenu'); - html = "
"; + html = "
"; Settings.overlay = overlay = $.el('div', { id: 'overlay' }); diff --git a/builds/crx/script.js b/builds/crx/script.js index 471422d34..dccdd9c06 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -3,7 +3,7 @@ * 4chan X - Version 1.3.3 - 2014-02-09 * * Licensed under the MIT license. -* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE +* https://github.com/Spittie/4chan-x/blob/master/LICENSE * * Appchan X Copyright © 2013-2013 Zixaphir * http://zixaphir.github.io/appchan-x/ @@ -6123,7 +6123,8 @@ title: 'Verification', placeholder: 'Focus to load reCAPTCHA', autocomplete: 'off', - spellcheck: false + spellcheck: false, + tabIndex: 55 }); this.nodes = { img: imgContainer.firstChild, @@ -9903,7 +9904,7 @@ software: "foolfuuka" } }, - "Install Gentoo": { + "Install Gentoo (.net)": { boards: ["diy", "g", "sci"], files: [], data: { @@ -9913,6 +9914,16 @@ software: "fuuka" } }, + "Install Gentoo (.com)": { + boards: ["t", "g"], + files: ["t", "g"], + data: { + domain: "archive.installgentoo.com/", + http: true, + https: true, + software: "foolfuuka" + } + }, "Rebecca Black Tech": { boards: ["cgl", "g", "mu", "w"], files: ["cgl", "g", "mu", "w"], @@ -11702,7 +11713,7 @@ if (previous === g.VERSION) { return; } - changelog = 'https://github.com/seaweedchan/4chan-x/blob/master/CHANGELOG.md'; + changelog = 'https://github.com/Spittie/4chan-x/blob/master/CHANGELOG.md'; el = $.el('span', { innerHTML: "4chan X has been updated to version " + g.VERSION + "." }); @@ -11737,7 +11748,7 @@ return; } $.event('CloseMenu'); - html = "
"; + html = "
"; Settings.overlay = overlay = $.el('div', { id: 'overlay' }); diff --git a/package.json b/package.json index 1314d757b..8ffc6e4f9 100755 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", - "repo": "https://github.com/seaweedchan/4chan-x/", + "repo": "https://github.com/Spittie/4chan-x/", "page": "http://seaweedchan.github.io/4chan-x/", "buildsPath": "builds/", "mainBranch": "master", diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 9f7d54900..73b0e7932 100755 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -69,7 +69,7 @@ Redirect = https: true software: "foolfuuka" - "Install Gentoo": + "Install Gentoo (.net)": boards: ["diy", "g", "sci"] files: [] data: @@ -78,6 +78,16 @@ Redirect = https: true software: "fuuka" + "Install Gentoo (.com)": + boards: ["t", "g"] + files: ["t", "g"] + data: + domain: "archive.installgentoo.com/" + http: true + https: true + software: "foolfuuka" + + "Rebecca Black Tech": boards: ["cgl", "g", "mu", "w"] files: ["cgl", "g", "mu", "w"] diff --git a/src/Posting/QR.captcha.coffee b/src/Posting/QR.captcha.coffee index 4809ebba4..3b29bf45c 100644 --- a/src/Posting/QR.captcha.coffee +++ b/src/Posting/QR.captcha.coffee @@ -15,9 +15,10 @@ QR.captcha = placeholder: 'Focus to load reCAPTCHA' autocomplete: 'off' spellcheck: false + tabIndex: 55 @nodes = - img: imgContainer.firstChild - input: input + img: imgContainer.firstChild + input: input $.on input, 'focus', @setup @@ -29,7 +30,7 @@ QR.captcha = $.addClass QR.nodes.el, 'has-captcha' $.after QR.nodes.com.parentNode, [imgContainer, input] - + @setupObserver = new MutationObserver @afterSetup @setupObserver.observe container, childList: true setup: -> @@ -40,15 +41,15 @@ QR.captcha = delete QR.captcha.setupObserver setLifetime = (e) -> QR.captcha.lifetime = e.detail - $.on window, 'captcha:timeout', setLifetime + $.on window, 'captcha:timeout', setLifetime $.globalEval 'window.dispatchEvent(new CustomEvent("captcha:timeout", {detail: RecaptchaState.timeout}))' $.off window, 'captcha:timeout', setLifetime {img, input} = QR.captcha.nodes img.parentNode.hidden = false - $.off input, 'focus', QR.captcha.setup - $.on input, 'keydown', QR.captcha.keydown.bind QR.captcha - $.on img.parentNode, 'click', QR.captcha.reload.bind QR.captcha + $.off input, 'focus', QR.captcha.setup + $.on input, 'keydown', QR.captcha.keydown.bind QR.captcha + $.on img.parentNode, 'click', QR.captcha.reload.bind QR.captcha $.get 'captchas', [], ({captchas}) -> QR.captcha.sync captchas @@ -58,9 +59,11 @@ QR.captcha = new MutationObserver(QR.captcha.load.bind QR.captcha).observe challenge, childList: true QR.captcha.load() + sync: (captchas) -> QR.captcha.captchas = captchas QR.captcha.count() + getOne: -> @clear() if captcha = @captchas.shift() @@ -76,6 +79,7 @@ QR.captcha = # If there's only one word, duplicate it. response = "#{response} #{response}" unless /\s/.test response {challenge, response} + save: -> return unless response = @nodes.input.value.trim() @captchas.push @@ -85,6 +89,7 @@ QR.captcha = @count() @reload() $.set 'captchas', @captchas + clear: -> return unless @captchas.length now = Date.now() @@ -94,6 +99,7 @@ QR.captcha = @captchas = @captchas[i..] @count() $.set 'captchas', @captchas + load: -> return unless @nodes.challenge.firstChild # -1 minute to give upload some time. @@ -103,6 +109,7 @@ QR.captcha = @nodes.img.src = "//www.google.com/recaptcha/api/image?c=#{challenge}" @nodes.input.value = null @clear() + count: -> count = @captchas.length @nodes.input.placeholder = switch count @@ -113,11 +120,13 @@ QR.captcha = else "Verification (#{count} cached captchas)" @nodes.input.alt = count # For XTRM RICE. + reload: (focus) -> # the 't' argument prevents the input from being focused $.globalEval 'Recaptcha.reload("t")' # Focus if we meant to. @nodes.input.focus() if focus + keydown: (e) -> if e.keyCode is 8 and not @nodes.input.value @reload() @@ -125,4 +134,4 @@ QR.captcha = @save() else return - e.preventDefault() + e.preventDefault() \ No newline at end of file