diff --git a/CHANGELOG.md b/CHANGELOG.md
index 331b308b8..2f1a71051 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,3 @@
-<<<<<<< HEAD
## v2.7.0
*2013-12-16*
@@ -24,8 +23,6 @@
## v2.6.0
*2013-11-27*
-=======
->>>>>>> v3
**MayhemYDG**:
- **New option**: `Auto-hide header on scroll`.
- Added support for `4cdn.org`.
@@ -73,29 +70,8 @@
**Zixaphir**:
- Infinite Scrolling Bugfix (chrome)
-<<<<<<< HEAD
### v2.4.1
*2013-10-13*
-=======
-### v1.2.44
-*2013-12-06*
-
-**MayhemYDG**:
-- Cooldown fix (You can no longer post an image reply immediately after a text reply)
-- Fix for 4chan markup change that caused a lot of errors
-
-**seaweedchan**:
-- Fix catalog links option
-
-### v1.2.43
-*2013-11-10*
-
-**noface**:
-- Strawpoll.me embedding support (as usual, only works on HTTP 4chan due to lack of HTTPS)
-
-### v1.2.42
-*2013-10-22*
->>>>>>> v3
**Zixaphir**:
- Bugfixes
diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js
index 64630b584..86b2c91ef 100644
--- a/builds/appchan-x.user.js
+++ b/builds/appchan-x.user.js
@@ -14133,11 +14133,10 @@
if (!Conf['Catalog Links']) {
return;
}
- el = $.el('label', {
+ CatalogLinks.el = el = $.el('label', {
id: 'toggleCatalog',
href: 'javascript:;',
- innerHTML: " Catalog Links",
- title: "Turn catalog links " + (Conf['Header catalog links'] ? 'off' : 'on') + "."
+ innerHTML: " Catalog Links"
});
input = $('input', el);
$.on(input, 'change', this.toggle);
@@ -14152,33 +14151,88 @@
});
},
toggle: function() {
- var useCatalog;
-
$.event('CloseMenu');
- $.set('Header catalog links', useCatalog = this.checked);
- return CatalogLinks.set(useCatalog);
+ $.set('Header catalog links', this.checked);
+ return CatalogLinks.set(this.checked);
},
set: function(useCatalog) {
- var a, board, path, _i, _len, _ref;
+ var a, board, generateURL, path, _i, _len, _ref;
path = useCatalog ? 'catalog' : '';
- _ref = $$("#board-list a:not(.catalog),\n#boardNavDesktopFoot a");
+ generateURL = useCatalog && Conf['External Catalog'] ? CatalogLinks.external : function(board) {
+ return a.href = "/" + board + "/" + path;
+ };
+ _ref = $$("#board-list a:not(.catalog), #boardNavDesktopFoot a");
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
a = _ref[_i];
- board = a.pathname.split('/')[1];
- if (['f', 'status', '4chan'].contains(board) || !board) {
+ if (!['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'].contains(a.hostname) || !(board = a.pathname.split('/')[1]) || ['f', 'status', '4chan'].contains(board)) {
continue;
}
- if (Conf['External Catalog']) {
- a.href = useCatalog ? CatalogLinks.external(board) : "/" + board + "/";
- } else {
- a.pathname = "/" + board + "/" + path;
- }
+ a.href = generateURL(board);
}
- return this.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
+ return CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
},
external: function(board) {
- return (['a', 'c', 'g', 'co', 'k', 'm', 'o', 'p', 'v', 'vg', 'w', 'cm', '3', 'adv', 'an', 'cgl', 'ck', 'diy', 'fa', 'fit', 'int', 'jp', 'mlp', 'lit', 'mu', 'n', 'po', 'sci', 'toy', 'trv', 'tv', 'vp', 'x', 'q'].contains(board) ? "http://catalog.neet.tv/" + board : ['d', 'e', 'gif', 'h', 'hr', 'hc', 'r9k', 's', 'pol', 'soc', 'u', 'i', 'ic', 'hm', 'r', 'w', 'wg', 'wsg', 't', 'y'].contains(board) ? "http://4index.gropes.us/" + board : "/" + board + "/catalog");
+ switch (board) {
+ case 'a':
+ case 'c':
+ case 'g':
+ case 'co':
+ case 'k':
+ case 'm':
+ case 'o':
+ case 'p':
+ case 'v':
+ case 'vg':
+ case 'w':
+ case 'cm':
+ case '3':
+ case 'adv':
+ case 'an':
+ case 'cgl':
+ case 'ck':
+ case 'diy':
+ case 'fa':
+ case 'fit':
+ case 'int':
+ case 'jp':
+ case 'mlp':
+ case 'lit':
+ case 'mu':
+ case 'n':
+ case 'po':
+ case 'sci':
+ case 'toy':
+ case 'trv':
+ case 'tv':
+ case 'vp':
+ case 'x':
+ case 'q':
+ return "http://catalog.neet.tv/" + board;
+ case 'd':
+ case 'e':
+ case 'gif':
+ case 'h':
+ case 'hr':
+ case 'hc':
+ case 'r9k':
+ case 's':
+ case 'pol':
+ case 'soc':
+ case 'u':
+ case 'i':
+ case 'ic':
+ case 'hm':
+ case 'r':
+ case 'w':
+ case 'wg':
+ case 'wsg':
+ case 't':
+ case 'y':
+ return "http://4index.gropes.us/" + board;
+ default:
+ return "/" + board + "/catalog";
+ }
},
ready: function() {
var catalogLink;
diff --git a/builds/crx/script.js b/builds/crx/script.js
index 0de7b9d80..61a8187e9 100644
--- a/builds/crx/script.js
+++ b/builds/crx/script.js
@@ -14125,11 +14125,10 @@
if (!Conf['Catalog Links']) {
return;
}
- el = $.el('label', {
+ CatalogLinks.el = el = $.el('label', {
id: 'toggleCatalog',
href: 'javascript:;',
- innerHTML: " Catalog Links",
- title: "Turn catalog links " + (Conf['Header catalog links'] ? 'off' : 'on') + "."
+ innerHTML: " Catalog Links"
});
input = $('input', el);
$.on(input, 'change', this.toggle);
@@ -14144,33 +14143,88 @@
});
},
toggle: function() {
- var useCatalog;
-
$.event('CloseMenu');
- $.set('Header catalog links', useCatalog = this.checked);
- return CatalogLinks.set(useCatalog);
+ $.set('Header catalog links', this.checked);
+ return CatalogLinks.set(this.checked);
},
set: function(useCatalog) {
- var a, board, path, _i, _len, _ref;
+ var a, board, generateURL, path, _i, _len, _ref;
path = useCatalog ? 'catalog' : '';
- _ref = $$("#board-list a:not(.catalog),\n#boardNavDesktopFoot a");
+ generateURL = useCatalog && Conf['External Catalog'] ? CatalogLinks.external : function(board) {
+ return a.href = "/" + board + "/" + path;
+ };
+ _ref = $$("#board-list a:not(.catalog), #boardNavDesktopFoot a");
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
a = _ref[_i];
- board = a.pathname.split('/')[1];
- if (['f', 'status', '4chan'].contains(board) || !board) {
+ if (!['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'].contains(a.hostname) || !(board = a.pathname.split('/')[1]) || ['f', 'status', '4chan'].contains(board)) {
continue;
}
- if (Conf['External Catalog']) {
- a.href = useCatalog ? CatalogLinks.external(board) : "/" + board + "/";
- } else {
- a.pathname = "/" + board + "/" + path;
- }
+ a.href = generateURL(board);
}
- return this.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
+ return CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
},
external: function(board) {
- return (['a', 'c', 'g', 'co', 'k', 'm', 'o', 'p', 'v', 'vg', 'w', 'cm', '3', 'adv', 'an', 'cgl', 'ck', 'diy', 'fa', 'fit', 'int', 'jp', 'mlp', 'lit', 'mu', 'n', 'po', 'sci', 'toy', 'trv', 'tv', 'vp', 'x', 'q'].contains(board) ? "http://catalog.neet.tv/" + board : ['d', 'e', 'gif', 'h', 'hr', 'hc', 'r9k', 's', 'pol', 'soc', 'u', 'i', 'ic', 'hm', 'r', 'w', 'wg', 'wsg', 't', 'y'].contains(board) ? "http://4index.gropes.us/" + board : "/" + board + "/catalog");
+ switch (board) {
+ case 'a':
+ case 'c':
+ case 'g':
+ case 'co':
+ case 'k':
+ case 'm':
+ case 'o':
+ case 'p':
+ case 'v':
+ case 'vg':
+ case 'w':
+ case 'cm':
+ case '3':
+ case 'adv':
+ case 'an':
+ case 'cgl':
+ case 'ck':
+ case 'diy':
+ case 'fa':
+ case 'fit':
+ case 'int':
+ case 'jp':
+ case 'mlp':
+ case 'lit':
+ case 'mu':
+ case 'n':
+ case 'po':
+ case 'sci':
+ case 'toy':
+ case 'trv':
+ case 'tv':
+ case 'vp':
+ case 'x':
+ case 'q':
+ return "http://catalog.neet.tv/" + board;
+ case 'd':
+ case 'e':
+ case 'gif':
+ case 'h':
+ case 'hr':
+ case 'hc':
+ case 'r9k':
+ case 's':
+ case 'pol':
+ case 'soc':
+ case 'u':
+ case 'i':
+ case 'ic':
+ case 'hm':
+ case 'r':
+ case 'w':
+ case 'wg':
+ case 'wsg':
+ case 't':
+ case 'y':
+ return "http://4index.gropes.us/" + board;
+ default:
+ return "/" + board + "/catalog";
+ }
},
ready: function() {
var catalogLink;
diff --git a/src/Miscellaneous/CatalogLinks.coffee b/src/Miscellaneous/CatalogLinks.coffee
index 999549548..95f85a051 100755
--- a/src/Miscellaneous/CatalogLinks.coffee
+++ b/src/Miscellaneous/CatalogLinks.coffee
@@ -2,11 +2,10 @@ CatalogLinks =
init: ->
$.ready @ready
return unless Conf['Catalog Links']
- el = $.el 'label',
+ CatalogLinks.el = el = $.el 'label',
id: 'toggleCatalog'
href: 'javascript:;'
innerHTML: " Catalog Links"
- title: "Turn catalog links #{if Conf['Header catalog links'] then 'off' else 'on'}."
input = $ 'input', el
$.on input, 'change', @toggle
@@ -23,39 +22,40 @@ CatalogLinks =
toggle: ->
$.event 'CloseMenu'
- $.set 'Header catalog links', useCatalog = @checked
- CatalogLinks.set useCatalog
+ $.set 'Header catalog links', @checked
+ CatalogLinks.set @checked
set: (useCatalog) ->
path = if useCatalog then 'catalog' else ''
- for a in $$ """
- #board-list a:not(.catalog),
- #boardNavDesktopFoot a
- """
- board = a.pathname.split('/')[1]
- continue if ['f', 'status', '4chan'].contains(board) or !board
- if Conf['External Catalog']
- a.href = if useCatalog
- CatalogLinks.external board
- else
- "/#{board}/"
- else
- a.pathname = "/#{board}/#{path}"
- @title = "Turn catalog links #{if useCatalog then 'off' else 'on'}."
+
+ generateURL = if useCatalog and Conf['External Catalog']
+ CatalogLinks.external
+ else
+ (board) -> a.href = "/#{board}/#{path}"
+
+ for a in $$ """#board-list a:not(.catalog), #boardNavDesktopFoot a"""
+ continue if !['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'].contains(a.hostname) or
+ !(board = a.pathname.split('/')[1]) or
+ ['f', 'status', '4chan'].contains board
+
+ # Href is easier than pathname because then we don't have
+ # conditions where External Catalog has been disabled between switches.
+ a.href = generateURL board
+
+ CatalogLinks.el.title = "Turn catalog links #{if useCatalog then 'off' else 'on'}."
external: (board) ->
- return (
- if ['a', 'c', 'g', 'co', 'k', 'm', 'o', 'p', 'v', 'vg', 'w', 'cm', '3', 'adv', 'an', 'cgl', 'ck', 'diy', 'fa', 'fit', 'int', 'jp', 'mlp', 'lit', 'mu', 'n', 'po', 'sci', 'toy', 'trv', 'tv', 'vp', 'x', 'q'].contains board
+ switch board
+ when 'a', 'c', 'g', 'co', 'k', 'm', 'o', 'p', 'v', 'vg', 'w', 'cm', '3', 'adv', 'an', 'cgl', 'ck', 'diy', 'fa', 'fit', 'int', 'jp', 'mlp', 'lit', 'mu', 'n', 'po', 'sci', 'toy', 'trv', 'tv', 'vp', 'x', 'q'
"http://catalog.neet.tv/#{board}"
- else if ['d', 'e', 'gif', 'h', 'hr', 'hc', 'r9k', 's', 'pol', 'soc', 'u', 'i', 'ic', 'hm', 'r', 'w', 'wg', 'wsg', 't', 'y'].contains board
+ when 'd', 'e', 'gif', 'h', 'hr', 'hc', 'r9k', 's', 'pol', 'soc', 'u', 'i', 'ic', 'hm', 'r', 'w', 'wg', 'wsg', 't', 'y'
"http://4index.gropes.us/#{board}"
else
"/#{board}/catalog"
- )
ready: ->
if catalogLink = ($('.pages.cataloglink a', d.body) or $ '[href=".././catalog"]', d.body)
catalogLink.textContent = ''
catalogLink.className = 'a-icon'
Header.addShortcut catalogLink, true
- catalogLink.id = 'catalog'
\ No newline at end of file
+ catalogLink.id = 'catalog'