diff --git a/CHANGELOG.md b/CHANGELOG.md index 73c96c18a..b3cd531e4 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's work. This does not mean the changes are their fault, only that their code was used. All changes to the script are chosen by and the fault of the maintainer (ccd0). +### v1.11.6 + +**v1.11.6.0** *(2015-07-19)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.6.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.6.0/builds/4chan-X-noupdate.crx "Chromium version")] +- Based on v1.11.5.2. +- Implement 404 Redirect for `sys.4chan.org/board/imgboard.php?res=` URLs. +- Index navigation bugfixes. + ### v1.11.5 **v1.11.5.2** *(2015-07-15)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.5.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.5.2/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 1cd804653..aa0d6284f 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 45c1ae894..c797d1342 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.11.5.2 +// @version 1.11.6.0 // @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 ce53eb1e2..1fb20493b 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.11.5.2 +// @version 1.11.6.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -411,7 +411,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.5.2', + VERSION: '1.11.6.0', NAMESPACE: '4chan X.', boards: {} }; @@ -3407,7 +3407,6 @@ var mode, page, ref, ref1, search, state; if (e != null ? e.state : void 0) { ref = e.state, search = ref.search, mode = ref.mode; - page = Index.getCurrentPage(); state = {}; if (Index.search !== search) { state.search = Index.search = search; @@ -3416,6 +3415,7 @@ state.mode = mode; Index.saveMode(mode); } + page = Index.getCurrentPage(); if (Index.currentPage !== page) { state.page = Index.currentPage = page; } @@ -3974,6 +3974,7 @@ Index.pushState({ page: page }); + Index.setPage(); } } nodes = Index.buildSinglePage(Index.getCurrentPage()); @@ -14362,9 +14363,14 @@ securityCheck: function(URL) { return /^https:\/\//.test(URL) || location.protocol === 'http:' || Conf['Except Archives from Encryption']; }, - navigate: function(URL, alternative) { - if (URL && (Redirect.securityCheck(URL) || confirm("Redirect to " + URL + "?\n\nYour connection will not be encrypted."))) { - return location.replace(URL); + navigate: function(dest, data, alternative) { + var url; + if (!Redirect.data) { + Redirect.init(); + } + url = Redirect.to(dest, data); + if (url && (Redirect.securityCheck(url) || confirm("Redirect to " + url + "?\n\nYour connection will not be encrypted."))) { + return location.replace(url); } else if (alternative) { return location.replace(alternative); } @@ -17065,7 +17071,7 @@ }); }, initFeatures: function() { - var err, feature, k, len1, name, pathname, ref, ref1, ref2; + var err, feature, k, len1, match, name, pathname, ref, ref1, ref2; if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'sys.4chan.org' || ref === 'www.4chan.org') { $.globalEval('document.documentElement.classList.add("js-enabled");'); } @@ -17080,20 +17086,29 @@ if (g.VIEW === 'post') { PostSuccessful.init(); } + if (Conf['404 Redirect'] && /\/imgboard\.php$/.test(location.pathname) && (match = location.search.match(/\bres=(\d+)/))) { + $.ready(function() { + var ref1; + if (((ref1 = $.id('errmsg')) != null ? ref1.textContent : void 0) === 'Error: Specified thread does not exist.') { + return Redirect.navigate('thread', { + boardID: g.BOARD.ID, + postID: +match[1] + }); + } + }); + } return; case 'i.4cdn.org': $.asap((function() { return d.readyState !== 'loading'; }), function() { - var URL, pathname, ref1, video; + var pathname, ref1, video; if (Conf['404 Redirect'] && ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found')) { - Redirect.init(); pathname = location.pathname.split('/'); - URL = Redirect.to('file', { + return Redirect.navigate('file', { boardID: g.BOARD.ID, filename: pathname[pathname.length - 1] }); - return Redirect.navigate(URL); } else if (video = $('video')) { if (Conf['Volume in New Tab']) { Volume.setup(video); @@ -17196,14 +17211,12 @@ if ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') { if (g.VIEW === 'thread') { ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { - var href; if (Conf['404 Redirect']) { - href = Redirect.to('thread', { + return Redirect.navigate('thread', { boardID: g.BOARD.ID, threadID: g.THREADID, postID: +location.hash.match(/\d+/) - }); - return Redirect.navigate(href, "/" + g.BOARD + "/"); + }, "/" + g.BOARD + "/"); } }); } diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 6c88f41e5..5e987e6d3 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 0c9ab256b..97f7e6a3b 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.11.5.2 +// @version 1.11.6.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -410,7 +410,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.5.2', + VERSION: '1.11.6.0', NAMESPACE: '4chan X.', boards: {} }; @@ -3406,7 +3406,6 @@ var mode, page, ref, ref1, search, state; if (e != null ? e.state : void 0) { ref = e.state, search = ref.search, mode = ref.mode; - page = Index.getCurrentPage(); state = {}; if (Index.search !== search) { state.search = Index.search = search; @@ -3415,6 +3414,7 @@ state.mode = mode; Index.saveMode(mode); } + page = Index.getCurrentPage(); if (Index.currentPage !== page) { state.page = Index.currentPage = page; } @@ -3973,6 +3973,7 @@ Index.pushState({ page: page }); + Index.setPage(); } } nodes = Index.buildSinglePage(Index.getCurrentPage()); @@ -14361,9 +14362,14 @@ securityCheck: function(URL) { return /^https:\/\//.test(URL) || location.protocol === 'http:' || Conf['Except Archives from Encryption']; }, - navigate: function(URL, alternative) { - if (URL && (Redirect.securityCheck(URL) || confirm("Redirect to " + URL + "?\n\nYour connection will not be encrypted."))) { - return location.replace(URL); + navigate: function(dest, data, alternative) { + var url; + if (!Redirect.data) { + Redirect.init(); + } + url = Redirect.to(dest, data); + if (url && (Redirect.securityCheck(url) || confirm("Redirect to " + url + "?\n\nYour connection will not be encrypted."))) { + return location.replace(url); } else if (alternative) { return location.replace(alternative); } @@ -17064,7 +17070,7 @@ }); }, initFeatures: function() { - var err, feature, k, len1, name, pathname, ref, ref1, ref2; + var err, feature, k, len1, match, name, pathname, ref, ref1, ref2; if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'sys.4chan.org' || ref === 'www.4chan.org') { $.globalEval('document.documentElement.classList.add("js-enabled");'); } @@ -17079,20 +17085,29 @@ if (g.VIEW === 'post') { PostSuccessful.init(); } + if (Conf['404 Redirect'] && /\/imgboard\.php$/.test(location.pathname) && (match = location.search.match(/\bres=(\d+)/))) { + $.ready(function() { + var ref1; + if (((ref1 = $.id('errmsg')) != null ? ref1.textContent : void 0) === 'Error: Specified thread does not exist.') { + return Redirect.navigate('thread', { + boardID: g.BOARD.ID, + postID: +match[1] + }); + } + }); + } return; case 'i.4cdn.org': $.asap((function() { return d.readyState !== 'loading'; }), function() { - var URL, pathname, ref1, video; + var pathname, ref1, video; if (Conf['404 Redirect'] && ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found')) { - Redirect.init(); pathname = location.pathname.split('/'); - URL = Redirect.to('file', { + return Redirect.navigate('file', { boardID: g.BOARD.ID, filename: pathname[pathname.length - 1] }); - return Redirect.navigate(URL); } else if (video = $('video')) { if (Conf['Volume in New Tab']) { Volume.setup(video); @@ -17195,14 +17210,12 @@ if ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') { if (g.VIEW === 'thread') { ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { - var href; if (Conf['404 Redirect']) { - href = Redirect.to('thread', { + return Redirect.navigate('thread', { boardID: g.BOARD.ID, threadID: g.THREADID, postID: +location.hash.match(/\d+/) - }); - return Redirect.navigate(href, "/" + g.BOARD + "/"); + }, "/" + g.BOARD + "/"); } }); } diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 5460803df..2a338e6f2 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 3d985dbc3..ab597432d 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.11.5.2 +// @version 1.11.6.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index d0a7ff68b..6c1b9d084 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.11.5.2 +// @version 1.11.6.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -411,7 +411,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.5.2', + VERSION: '1.11.6.0', NAMESPACE: '4chan X.', boards: {} }; @@ -3407,7 +3407,6 @@ var mode, page, ref, ref1, search, state; if (e != null ? e.state : void 0) { ref = e.state, search = ref.search, mode = ref.mode; - page = Index.getCurrentPage(); state = {}; if (Index.search !== search) { state.search = Index.search = search; @@ -3416,6 +3415,7 @@ state.mode = mode; Index.saveMode(mode); } + page = Index.getCurrentPage(); if (Index.currentPage !== page) { state.page = Index.currentPage = page; } @@ -3974,6 +3974,7 @@ Index.pushState({ page: page }); + Index.setPage(); } } nodes = Index.buildSinglePage(Index.getCurrentPage()); @@ -14362,9 +14363,14 @@ securityCheck: function(URL) { return /^https:\/\//.test(URL) || location.protocol === 'http:' || Conf['Except Archives from Encryption']; }, - navigate: function(URL, alternative) { - if (URL && (Redirect.securityCheck(URL) || confirm("Redirect to " + URL + "?\n\nYour connection will not be encrypted."))) { - return location.replace(URL); + navigate: function(dest, data, alternative) { + var url; + if (!Redirect.data) { + Redirect.init(); + } + url = Redirect.to(dest, data); + if (url && (Redirect.securityCheck(url) || confirm("Redirect to " + url + "?\n\nYour connection will not be encrypted."))) { + return location.replace(url); } else if (alternative) { return location.replace(alternative); } @@ -17065,7 +17071,7 @@ }); }, initFeatures: function() { - var err, feature, k, len1, name, pathname, ref, ref1, ref2; + var err, feature, k, len1, match, name, pathname, ref, ref1, ref2; if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'sys.4chan.org' || ref === 'www.4chan.org') { $.globalEval('document.documentElement.classList.add("js-enabled");'); } @@ -17080,20 +17086,29 @@ if (g.VIEW === 'post') { PostSuccessful.init(); } + if (Conf['404 Redirect'] && /\/imgboard\.php$/.test(location.pathname) && (match = location.search.match(/\bres=(\d+)/))) { + $.ready(function() { + var ref1; + if (((ref1 = $.id('errmsg')) != null ? ref1.textContent : void 0) === 'Error: Specified thread does not exist.') { + return Redirect.navigate('thread', { + boardID: g.BOARD.ID, + postID: +match[1] + }); + } + }); + } return; case 'i.4cdn.org': $.asap((function() { return d.readyState !== 'loading'; }), function() { - var URL, pathname, ref1, video; + var pathname, ref1, video; if (Conf['404 Redirect'] && ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found')) { - Redirect.init(); pathname = location.pathname.split('/'); - URL = Redirect.to('file', { + return Redirect.navigate('file', { boardID: g.BOARD.ID, filename: pathname[pathname.length - 1] }); - return Redirect.navigate(URL); } else if (video = $('video')) { if (Conf['Volume in New Tab']) { Volume.setup(video); @@ -17196,14 +17211,12 @@ if ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') { if (g.VIEW === 'thread') { ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { - var href; if (Conf['404 Redirect']) { - href = Redirect.to('thread', { + return Redirect.navigate('thread', { boardID: g.BOARD.ID, threadID: g.THREADID, postID: +location.hash.match(/\d+/) - }); - return Redirect.navigate(href, "/" + g.BOARD + "/"); + }, "/" + g.BOARD + "/"); } }); } diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index c91aee9a3..504cd6a0b 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 1212774fc..29d44458f 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 f157f6ab1..3128164fa 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index b32c0e481..bf8e08a10 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.11.5.2", - "date": "2015-07-15T21:17:03.431Z", + "version": "1.11.6.0", + "date": "2015-07-20T02:05:39.061Z", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/",