diff --git a/CHANGELOG.md b/CHANGELOG.md index adeada1b4..8e7bcdaf4 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ The links to individual versions below are to copies of the script with the upda ### v1.10.12 +**v1.10.12.4** *(2015-05-10)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.12.4/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.12.4/builds/4chan-X-noupdate.crx "Chromium version")] +- Improve reporting to archive functionality. + **v1.10.12.3** *(2015-05-09)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.12.3/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.12.3/builds/4chan-X-noupdate.crx "Chromium version")] - Fix some captcha-related bugs. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 3b194e93a..d6c128b97 100644 Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js index 899e39a9a..63be1bc76 100644 --- a/builds/4chan-X-beta.meta.js +++ b/builds/4chan-X-beta.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @version 1.10.12.3 +// @version 1.10.12.4 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js index 6e5845dec..e1c51f23f 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X beta -// @version 1.10.12.3 +// @version 1.10.12.4 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -396,7 +396,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.12.3', + VERSION: '1.10.12.4', NAMESPACE: '4chan X.', boards: {} }; @@ -11854,8 +11854,7 @@ } a = $.el('a', { className: 'report-link', - href: 'javascript:;', - textContent: 'Report this post' + href: 'javascript:;' }); $.on(a, 'click', ReportLink.report); return Menu.menu.addEntry({ @@ -11863,9 +11862,11 @@ order: 10, open: function(post) { if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) { + a.textContent = 'Report this post'; ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; ReportLink.height = 200; } else if (Conf['Archive Report']) { + a.textContent = 'Report to archive'; ReportLink.url = Redirect.to('report', { boardID: post.board.ID, postID: post.ID @@ -15456,7 +15457,7 @@ } }, archive: function() { - var link, message, url; + var link, message, types, url; Redirect.init(); if (!(url = Redirect.to('report', { boardID: g.BOARD.ID, @@ -15465,21 +15466,29 @@ return; } if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) { - $.globalEval('self.close = function(){};'); - window.resizeBy(0, 350 - doc.clientHeight); - location.replace(url); + if (location.hash === '#redirect') { + $.globalEval('self.close = function(){};'); + window.resizeBy(0, 350 - doc.clientHeight); + location.replace(url); + } return; } link = $.el('a', { href: url, - textContent: 'Report to fgts' + textContent: 'Report to archive' }); $.on(link, 'click', function(e) { if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) { return window.resizeBy(0, 350 - doc.clientHeight); } }); - return $.add(d.body, [$.tn(' ['), link, $.tn(']')]); + $.add(d.body, [$.tn(' ['), link, $.tn(']')]); + if (types = $.id('reportTypes')) { + return $.on(types, 'change', function(e) { + var ref; + return $('form').action = (ref = e.target.value) === 'illegal' || ref === 'spam' ? '#redirect' : ''; + }); + } } }; diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index abee33177..3a4bd904b 100644 Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js index e7f8eeac6..b9507b1ac 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.10.12.3 +// @version 1.10.12.4 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -395,7 +395,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.12.3', + VERSION: '1.10.12.4', NAMESPACE: '4chan X.', boards: {} }; @@ -11853,8 +11853,7 @@ } a = $.el('a', { className: 'report-link', - href: 'javascript:;', - textContent: 'Report this post' + href: 'javascript:;' }); $.on(a, 'click', ReportLink.report); return Menu.menu.addEntry({ @@ -11862,9 +11861,11 @@ order: 10, open: function(post) { if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) { + a.textContent = 'Report this post'; ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; ReportLink.height = 200; } else if (Conf['Archive Report']) { + a.textContent = 'Report to archive'; ReportLink.url = Redirect.to('report', { boardID: post.board.ID, postID: post.ID @@ -15455,7 +15456,7 @@ } }, archive: function() { - var link, message, url; + var link, message, types, url; Redirect.init(); if (!(url = Redirect.to('report', { boardID: g.BOARD.ID, @@ -15464,21 +15465,29 @@ return; } if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) { - $.globalEval('self.close = function(){};'); - window.resizeBy(0, 350 - doc.clientHeight); - location.replace(url); + if (location.hash === '#redirect') { + $.globalEval('self.close = function(){};'); + window.resizeBy(0, 350 - doc.clientHeight); + location.replace(url); + } return; } link = $.el('a', { href: url, - textContent: 'Report to fgts' + textContent: 'Report to archive' }); $.on(link, 'click', function(e) { if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) { return window.resizeBy(0, 350 - doc.clientHeight); } }); - return $.add(d.body, [$.tn(' ['), link, $.tn(']')]); + $.add(d.body, [$.tn(' ['), link, $.tn(']')]); + if (types = $.id('reportTypes')) { + return $.on(types, 'change', function(e) { + var ref; + return $('form').action = (ref = e.target.value) === 'illegal' || ref === 'spam' ? '#redirect' : ''; + }); + } } }; diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index a1e112726..3c0f12189 100644 Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index 0b404b12b..22b31ed22 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.10.12.3 +// @version 1.10.12.4 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index e21e6e020..751713ece 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.10.12.3 +// @version 1.10.12.4 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -396,7 +396,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.12.3', + VERSION: '1.10.12.4', NAMESPACE: '4chan X.', boards: {} }; @@ -11854,8 +11854,7 @@ } a = $.el('a', { className: 'report-link', - href: 'javascript:;', - textContent: 'Report this post' + href: 'javascript:;' }); $.on(a, 'click', ReportLink.report); return Menu.menu.addEntry({ @@ -11863,9 +11862,11 @@ order: 10, open: function(post) { if (!(post.isDead || (post.thread.isDead && !post.thread.isArchived))) { + a.textContent = 'Report this post'; ReportLink.url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; ReportLink.height = 200; } else if (Conf['Archive Report']) { + a.textContent = 'Report to archive'; ReportLink.url = Redirect.to('report', { boardID: post.board.ID, postID: post.ID @@ -15456,7 +15457,7 @@ } }, archive: function() { - var link, message, url; + var link, message, types, url; Redirect.init(); if (!(url = Redirect.to('report', { boardID: g.BOARD.ID, @@ -15465,21 +15466,29 @@ return; } if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) { - $.globalEval('self.close = function(){};'); - window.resizeBy(0, 350 - doc.clientHeight); - location.replace(url); + if (location.hash === '#redirect') { + $.globalEval('self.close = function(){};'); + window.resizeBy(0, 350 - doc.clientHeight); + location.replace(url); + } return; } link = $.el('a', { href: url, - textContent: 'Report to fgts' + textContent: 'Report to archive' }); $.on(link, 'click', function(e) { if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0)) { return window.resizeBy(0, 350 - doc.clientHeight); } }); - return $.add(d.body, [$.tn(' ['), link, $.tn(']')]); + $.add(d.body, [$.tn(' ['), link, $.tn(']')]); + if (types = $.id('reportTypes')) { + return $.on(types, 'change', function(e) { + var ref; + return $('form').action = (ref = e.target.value) === 'illegal' || ref === 'spam' ? '#redirect' : ''; + }); + } } }; diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index e1acbd73c..bfbd632c7 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index 16b4dab39..ec46bf482 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.xml b/builds/updates.xml index ac55fa6c7..76378e826 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index ec65fa756..74e64dee0 100755 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", - "version": "1.10.12.3", - "date": "2015-05-10T02:11:26.536Z", + "version": "1.10.12.4", + "date": "2015-05-11T06:20:12.938Z", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/",