Merge branch 'v3'

Conflicts:
	builds/appchan-x.user.js
	builds/crx/script.js
	src/Miscellaneous/CatalogLinks.coffee
This commit is contained in:
Zixaphir 2013-12-18 16:58:07 -07:00
commit 61a9364090
4 changed files with 167 additions and 83 deletions

View File

@ -1,4 +1,3 @@
<<<<<<< HEAD
## v2.7.0 ## v2.7.0
*2013-12-16* *2013-12-16*
@ -24,8 +23,6 @@
## v2.6.0 ## v2.6.0
*2013-11-27* *2013-11-27*
=======
>>>>>>> v3
**MayhemYDG**: **MayhemYDG**:
- **New option**: `Auto-hide header on scroll`. - **New option**: `Auto-hide header on scroll`.
- Added support for `4cdn.org`. - Added support for `4cdn.org`.
@ -73,29 +70,8 @@
**Zixaphir**: **Zixaphir**:
- Infinite Scrolling Bugfix (chrome) - Infinite Scrolling Bugfix (chrome)
<<<<<<< HEAD
### v2.4.1 ### v2.4.1
*2013-10-13* *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**: **Zixaphir**:
- Bugfixes - Bugfixes

View File

@ -14133,11 +14133,10 @@
if (!Conf['Catalog Links']) { if (!Conf['Catalog Links']) {
return; return;
} }
el = $.el('label', { CatalogLinks.el = el = $.el('label', {
id: 'toggleCatalog', id: 'toggleCatalog',
href: 'javascript:;', href: 'javascript:;',
innerHTML: "<input type=checkbox " + (Conf['Header catalog links'] ? 'checked' : '') + "> Catalog Links", innerHTML: "<input type=checkbox " + (Conf['Header catalog links'] ? 'checked' : '') + "> Catalog Links"
title: "Turn catalog links " + (Conf['Header catalog links'] ? 'off' : 'on') + "."
}); });
input = $('input', el); input = $('input', el);
$.on(input, 'change', this.toggle); $.on(input, 'change', this.toggle);
@ -14152,33 +14151,88 @@
}); });
}, },
toggle: function() { toggle: function() {
var useCatalog;
$.event('CloseMenu'); $.event('CloseMenu');
$.set('Header catalog links', useCatalog = this.checked); $.set('Header catalog links', this.checked);
return CatalogLinks.set(useCatalog); return CatalogLinks.set(this.checked);
}, },
set: function(useCatalog) { set: function(useCatalog) {
var a, board, path, _i, _len, _ref; var a, board, generateURL, path, _i, _len, _ref;
path = useCatalog ? 'catalog' : ''; 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++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
a = _ref[_i]; a = _ref[_i];
board = a.pathname.split('/')[1]; if (!['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'].contains(a.hostname) || !(board = a.pathname.split('/')[1]) || ['f', 'status', '4chan'].contains(board)) {
if (['f', 'status', '4chan'].contains(board) || !board) {
continue; continue;
} }
if (Conf['External Catalog']) { a.href = generateURL(board);
a.href = useCatalog ? CatalogLinks.external(board) : "/" + board + "/";
} else {
a.pathname = "/" + board + "/" + path;
}
} }
return this.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; return CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
}, },
external: function(board) { 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() { ready: function() {
var catalogLink; var catalogLink;

View File

@ -14125,11 +14125,10 @@
if (!Conf['Catalog Links']) { if (!Conf['Catalog Links']) {
return; return;
} }
el = $.el('label', { CatalogLinks.el = el = $.el('label', {
id: 'toggleCatalog', id: 'toggleCatalog',
href: 'javascript:;', href: 'javascript:;',
innerHTML: "<input type=checkbox " + (Conf['Header catalog links'] ? 'checked' : '') + "> Catalog Links", innerHTML: "<input type=checkbox " + (Conf['Header catalog links'] ? 'checked' : '') + "> Catalog Links"
title: "Turn catalog links " + (Conf['Header catalog links'] ? 'off' : 'on') + "."
}); });
input = $('input', el); input = $('input', el);
$.on(input, 'change', this.toggle); $.on(input, 'change', this.toggle);
@ -14144,33 +14143,88 @@
}); });
}, },
toggle: function() { toggle: function() {
var useCatalog;
$.event('CloseMenu'); $.event('CloseMenu');
$.set('Header catalog links', useCatalog = this.checked); $.set('Header catalog links', this.checked);
return CatalogLinks.set(useCatalog); return CatalogLinks.set(this.checked);
}, },
set: function(useCatalog) { set: function(useCatalog) {
var a, board, path, _i, _len, _ref; var a, board, generateURL, path, _i, _len, _ref;
path = useCatalog ? 'catalog' : ''; 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++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
a = _ref[_i]; a = _ref[_i];
board = a.pathname.split('/')[1]; if (!['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'].contains(a.hostname) || !(board = a.pathname.split('/')[1]) || ['f', 'status', '4chan'].contains(board)) {
if (['f', 'status', '4chan'].contains(board) || !board) {
continue; continue;
} }
if (Conf['External Catalog']) { a.href = generateURL(board);
a.href = useCatalog ? CatalogLinks.external(board) : "/" + board + "/";
} else {
a.pathname = "/" + board + "/" + path;
}
} }
return this.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; return CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + ".";
}, },
external: function(board) { 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() { ready: function() {
var catalogLink; var catalogLink;

View File

@ -2,11 +2,10 @@ CatalogLinks =
init: -> init: ->
$.ready @ready $.ready @ready
return unless Conf['Catalog Links'] return unless Conf['Catalog Links']
el = $.el 'label', CatalogLinks.el = el = $.el 'label',
id: 'toggleCatalog' id: 'toggleCatalog'
href: 'javascript:;' href: 'javascript:;'
innerHTML: "<input type=checkbox #{if Conf['Header catalog links'] then 'checked' else ''}> Catalog Links" innerHTML: "<input type=checkbox #{if Conf['Header catalog links'] then 'checked' else ''}> Catalog Links"
title: "Turn catalog links #{if Conf['Header catalog links'] then 'off' else 'on'}."
input = $ 'input', el input = $ 'input', el
$.on input, 'change', @toggle $.on input, 'change', @toggle
@ -23,39 +22,40 @@ CatalogLinks =
toggle: -> toggle: ->
$.event 'CloseMenu' $.event 'CloseMenu'
$.set 'Header catalog links', useCatalog = @checked $.set 'Header catalog links', @checked
CatalogLinks.set useCatalog CatalogLinks.set @checked
set: (useCatalog) -> set: (useCatalog) ->
path = if useCatalog then 'catalog' else '' path = if useCatalog then 'catalog' else ''
for a in $$ """
#board-list a:not(.catalog), generateURL = if useCatalog and Conf['External Catalog']
#boardNavDesktopFoot a CatalogLinks.external
""" else
board = a.pathname.split('/')[1] (board) -> a.href = "/#{board}/#{path}"
continue if ['f', 'status', '4chan'].contains(board) or !board
if Conf['External Catalog'] for a in $$ """#board-list a:not(.catalog), #boardNavDesktopFoot a"""
a.href = if useCatalog continue if !['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'].contains(a.hostname) or
CatalogLinks.external board !(board = a.pathname.split('/')[1]) or
else ['f', 'status', '4chan'].contains board
"/#{board}/"
else # Href is easier than pathname because then we don't have
a.pathname = "/#{board}/#{path}" # conditions where External Catalog has been disabled between switches.
@title = "Turn catalog links #{if useCatalog then 'off' else 'on'}." a.href = generateURL board
CatalogLinks.el.title = "Turn catalog links #{if useCatalog then 'off' else 'on'}."
external: (board) -> external: (board) ->
return ( switch board
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 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}" "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}" "http://4index.gropes.us/#{board}"
else else
"/#{board}/catalog" "/#{board}/catalog"
)
ready: -> ready: ->
if catalogLink = ($('.pages.cataloglink a', d.body) or $ '[href=".././catalog"]', d.body) if catalogLink = ($('.pages.cataloglink a', d.body) or $ '[href=".././catalog"]', d.body)
catalogLink.textContent = '' catalogLink.textContent = ''
catalogLink.className = 'a-icon' catalogLink.className = 'a-icon'
Header.addShortcut catalogLink, true Header.addShortcut catalogLink, true
catalogLink.id = 'catalog' catalogLink.id = 'catalog'