diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 2971109a0..4f2bcbca7 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -85,6 +85,7 @@ module.exports = (grunt) -> concurrent: build: [ + 'concat:license' 'build-crx' 'build-userjs' 'build-userscript' @@ -152,7 +153,6 @@ module.exports = (grunt) -> grunt.registerTask 'build', [ 'concurrent:build' - 'concat:license' ] grunt.registerTask 'build-crx', [ diff --git a/builds/4chan-X.js b/builds/4chan-X.js index ef639957d..1bee27b1b 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -1583,26 +1583,15 @@ a = as[_i]; if (a.textContent === board) { a = a.cloneNode(true); - if (/-title/.test(t)) { - a.textContent = a.title; - } else if (/-replace/.test(t)) { - if ($.hasClass(a, 'current')) { - a.textContent = a.title; + a.textContent = /-title/.test(t) || /-replace/.test(t) && $.hasClass(a, 'current') ? a.title : /-full/.test(t) ? "/" + board + "/ - " + a.title : (m = t.match(/-text:"(.+)"/)) ? m[1] : a.textContent; + if (m = t.match(/-(index|catalog)/)) { + a.setAttribute('data-only', m[1]); + a.href = "//boards.4chan.org/" + board + "/"; + if (m[1] === 'catalog') { + a.href += 'catalog'; } - } else if (/-full/.test(t)) { - a.textContent = "/" + board + "/ - " + a.title; - } else if (/-(index|catalog|text)/.test(t)) { - if (m = t.match(/-(index|catalog)/)) { - a.setAttribute('data-only', m[1]); - a.href = "//boards.4chan.org/" + board + "/"; - if (m[1] === 'catalog') { - a.href += 'catalog'; - } - } - if (m = t.match(/-text:"(.+)"/)) { - a.textContent = m[1]; - } - } else if (board === '@') { + } + if (board === '@') { $.addClass(a, 'navSmall'); } return a; @@ -7420,6 +7409,10 @@ case 'hr': case 'tv': return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename; + case 'c': + case 'w': + case 'wg': + return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename; case 'ck': case 'fa': case 'lit': @@ -7428,7 +7421,6 @@ case 'cgl': case 'g': case 'mu': - case 'w': return "//rbt.asia/" + boardID + "/full_image/" + filename; case 'an': case 'k': @@ -7504,6 +7496,11 @@ boards: ['hr', 'tg', 'tv', 'x'], base: 'foolfuuka' }, + 'NyaFuu': { + base: '//archive.nyafuu.org', + boards: ['c', 'w', 'wg'], + type: 'foolfuuka' + }, 'Warosu': { base: '//fuuka.warosu.org', boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'], @@ -7528,11 +7525,6 @@ base: '//www.cliché.net/4chan/cgi-board.pl', boards: ['e'], type: 'fuuka' - }, - 'NyaFuu': { - base: '//archive.nyafuu.org', - boards: ['c', 'w'], - type: 'fuuka' } }, path: function(base, archiver, data) { diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index f28fe4847..81fa6dd0b 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1579,26 +1579,15 @@ a = as[_i]; if (a.textContent === board) { a = a.cloneNode(true); - if (/-title/.test(t)) { - a.textContent = a.title; - } else if (/-replace/.test(t)) { - if ($.hasClass(a, 'current')) { - a.textContent = a.title; + a.textContent = /-title/.test(t) || /-replace/.test(t) && $.hasClass(a, 'current') ? a.title : /-full/.test(t) ? "/" + board + "/ - " + a.title : (m = t.match(/-text:"(.+)"/)) ? m[1] : a.textContent; + if (m = t.match(/-(index|catalog)/)) { + a.setAttribute('data-only', m[1]); + a.href = "//boards.4chan.org/" + board + "/"; + if (m[1] === 'catalog') { + a.href += 'catalog'; } - } else if (/-full/.test(t)) { - a.textContent = "/" + board + "/ - " + a.title; - } else if (/-(index|catalog|text)/.test(t)) { - if (m = t.match(/-(index|catalog)/)) { - a.setAttribute('data-only', m[1]); - a.href = "//boards.4chan.org/" + board + "/"; - if (m[1] === 'catalog') { - a.href += 'catalog'; - } - } - if (m = t.match(/-text:"(.+)"/)) { - a.textContent = m[1]; - } - } else if (board === '@') { + } + if (board === '@') { $.addClass(a, 'navSmall'); } return a; @@ -7441,6 +7430,10 @@ case 'hr': case 'tv': return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename; + case 'c': + case 'w': + case 'wg': + return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename; case 'ck': case 'fa': case 'lit': @@ -7449,7 +7442,6 @@ case 'cgl': case 'g': case 'mu': - case 'w': return "//rbt.asia/" + boardID + "/full_image/" + filename; case 'an': case 'k': @@ -7525,6 +7517,11 @@ boards: ['hr', 'tg', 'tv', 'x'], base: 'foolfuuka' }, + 'NyaFuu': { + base: '//archive.nyafuu.org', + boards: ['c', 'w', 'wg'], + type: 'foolfuuka' + }, 'Warosu': { base: '//fuuka.warosu.org', boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'], @@ -7549,11 +7546,6 @@ base: '//www.cliché.net/4chan/cgi-board.pl', boards: ['e'], type: 'fuuka' - }, - 'NyaFuu': { - base: '//archive.nyafuu.org', - boards: ['c', 'w'], - type: 'fuuka' } }, path: function(base, archiver, data) { diff --git a/builds/crx/script.js b/builds/crx/script.js index f3eda3d54..628714297 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -793,7 +793,7 @@ return localItems = {}; } catch (_error) { err = _error; - return c.error(err); + return c.error(err.stack); } }); return function(key, val) { @@ -1582,26 +1582,15 @@ a = as[_i]; if (a.textContent === board) { a = a.cloneNode(true); - if (/-title/.test(t)) { - a.textContent = a.title; - } else if (/-replace/.test(t)) { - if ($.hasClass(a, 'current')) { - a.textContent = a.title; + a.textContent = /-title/.test(t) || /-replace/.test(t) && $.hasClass(a, 'current') ? a.title : /-full/.test(t) ? "/" + board + "/ - " + a.title : (m = t.match(/-text:"(.+)"/)) ? m[1] : a.textContent; + if (m = t.match(/-(index|catalog)/)) { + a.setAttribute('data-only', m[1]); + a.href = "//boards.4chan.org/" + board + "/"; + if (m[1] === 'catalog') { + a.href += 'catalog'; } - } else if (/-full/.test(t)) { - a.textContent = "/" + board + "/ - " + a.title; - } else if (/-(index|catalog|text)/.test(t)) { - if (m = t.match(/-(index|catalog)/)) { - a.setAttribute('data-only', m[1]); - a.href = "//boards.4chan.org/" + board + "/"; - if (m[1] === 'catalog') { - a.href += 'catalog'; - } - } - if (m = t.match(/-text:"(.+)"/)) { - a.textContent = m[1]; - } - } else if (board === '@') { + } + if (board === '@') { $.addClass(a, 'navSmall'); } return a; @@ -7425,6 +7414,10 @@ case 'hr': case 'tv': return "http://archive.4plebs.org/" + boardID + "/full_image/" + filename; + case 'c': + case 'w': + case 'wg': + return "//archive.nyafuu.org/" + boardID + "/full_image/" + filename; case 'ck': case 'fa': case 'lit': @@ -7433,7 +7426,6 @@ case 'cgl': case 'g': case 'mu': - case 'w': return "//rbt.asia/" + boardID + "/full_image/" + filename; case 'an': case 'k': @@ -7509,6 +7501,11 @@ boards: ['hr', 'tg', 'tv', 'x'], base: 'foolfuuka' }, + 'NyaFuu': { + base: '//archive.nyafuu.org', + boards: ['c', 'w', 'wg'], + type: 'foolfuuka' + }, 'Warosu': { base: '//fuuka.warosu.org', boards: ['cgl', 'ck', 'fa', 'jp', 'lit', 's4s', 'q', 'tg'], @@ -7533,11 +7530,6 @@ base: '//www.cliché.net/4chan/cgi-board.pl', boards: ['e'], type: 'fuuka' - }, - 'NyaFuu': { - base: '//archive.nyafuu.org', - boards: ['c', 'w'], - type: 'fuuka' } }, path: function(base, archiver, data) {