From 4bdd604f0f8ffacbaceb4ae6c85562373cdd2bc2 Mon Sep 17 00:00:00 2001 From: Jordan Bates Date: Wed, 8 May 2013 03:18:23 -0700 Subject: [PATCH] Fix #63 --- LICENSE | 2 +- builds/4chan-X.js | 9 ++++++--- builds/4chan-X.user.js | 9 ++++++--- builds/crx/script.js | 9 ++++++--- src/General/Header.coffee | 4 +++- src/Miscellaneous/CatalogLinks.coffee | 3 +-- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index 87aa7c2b3..454797bba 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.1.16 - 2013-05-07 +* 4chan X - Version 1.1.16 - 2013-05-08 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.js b/builds/4chan-X.js index a34be37cb..8817c7819 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -18,7 +18,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.1.16 - 2013-05-07 +* 4chan X - Version 1.1.16 - 2013-05-08 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -1613,7 +1613,10 @@ a.setAttribute('data-only', m[1]); a.href = "//boards.4chan.org/" + board + "/"; if (m[1] === 'catalog') { - a.href += 'catalog'; + if (m[1] === 'catalog') { + a.href += 'catalog'; + } + $.addClass(a, 'catalog'); } } if (board === '@') { @@ -7930,7 +7933,7 @@ var a, board, path, _i, _len, _ref; path = useCatalog ? 'catalog' : ''; - _ref = $$("#board-list a[href*=\"boards.4chan.org\"],\n#boardNavDesktop a[href*=\"boards.4chan.org\"],\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); + _ref = $$("#board-list a[href*=\"boards.4chan.org\"]:not(.catalog),\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { a = _ref[_i]; board = a.pathname.split('/')[1]; diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index f494e8bd2..75e1274bd 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -18,7 +18,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.1.16 - 2013-05-07 +* 4chan X - Version 1.1.16 - 2013-05-08 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -1609,7 +1609,10 @@ a.setAttribute('data-only', m[1]); a.href = "//boards.4chan.org/" + board + "/"; if (m[1] === 'catalog') { - a.href += 'catalog'; + if (m[1] === 'catalog') { + a.href += 'catalog'; + } + $.addClass(a, 'catalog'); } } if (board === '@') { @@ -7951,7 +7954,7 @@ var a, board, path, _i, _len, _ref; path = useCatalog ? 'catalog' : ''; - _ref = $$("#board-list a[href*=\"boards.4chan.org\"],\n#boardNavDesktop a[href*=\"boards.4chan.org\"],\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); + _ref = $$("#board-list a[href*=\"boards.4chan.org\"]:not(.catalog),\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { a = _ref[_i]; board = a.pathname.split('/')[1]; diff --git a/builds/crx/script.js b/builds/crx/script.js index 4f913e040..03b941ac5 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.1.16 - 2013-05-07 +* 4chan X - Version 1.1.16 - 2013-05-08 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -1612,7 +1612,10 @@ a.setAttribute('data-only', m[1]); a.href = "//boards.4chan.org/" + board + "/"; if (m[1] === 'catalog') { - a.href += 'catalog'; + if (m[1] === 'catalog') { + a.href += 'catalog'; + } + $.addClass(a, 'catalog'); } } if (board === '@') { @@ -7935,7 +7938,7 @@ var a, board, path, _i, _len, _ref; path = useCatalog ? 'catalog' : ''; - _ref = $$("#board-list a[href*=\"boards.4chan.org\"],\n#boardNavDesktop a[href*=\"boards.4chan.org\"],\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); + _ref = $$("#board-list a[href*=\"boards.4chan.org\"]:not(.catalog),\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { a = _ref[_i]; board = a.pathname.split('/')[1]; diff --git a/src/General/Header.coffee b/src/General/Header.coffee index 9d9a7d6a2..a36c77835 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -162,7 +162,9 @@ Header = if m = t.match /-(index|catalog)/ a.setAttribute 'data-only', m[1] a.href = "//boards.4chan.org/#{board}/" - a.href += 'catalog' if m[1] is 'catalog' + if m[1] is 'catalog' + a.href += 'catalog' if m[1] is 'catalog' + $.addClass a, 'catalog' $.addClass a, 'navSmall' if board is '@' return a diff --git a/src/Miscellaneous/CatalogLinks.coffee b/src/Miscellaneous/CatalogLinks.coffee index 84c510473..b126ba7a5 100644 --- a/src/Miscellaneous/CatalogLinks.coffee +++ b/src/Miscellaneous/CatalogLinks.coffee @@ -28,8 +28,7 @@ CatalogLinks = set: (useCatalog) -> path = if useCatalog then 'catalog' else '' for a in $$ """ - #board-list a[href*="boards.4chan.org"], - #boardNavDesktop a[href*="boards.4chan.org"], + #board-list a[href*="boards.4chan.org"]:not(.catalog), #boardNavDesktopFoot a[href*="boards.4chan.org"] """ board = a.pathname.split('/')[1]