Fix catalog link, fix Index on catalog.
It should have never ran on catalog, honestly.
This commit is contained in:
parent
678e4d1116
commit
2c6a26ca89
@ -2155,7 +2155,7 @@
|
|||||||
Index = {
|
Index = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var anchorEntry, input, label, modeEntry, name, refNavEntry, repliesEntry, sortEntry, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
|
var anchorEntry, input, label, modeEntry, name, refNavEntry, repliesEntry, sortEntry, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
|
||||||
if (g.BOARD.ID === 'f') {
|
if (g.BOARD.ID === 'f' || g.VIEW === 'catalog') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.button = $.el('a', {
|
this.button = $.el('a', {
|
||||||
@ -2290,6 +2290,9 @@
|
|||||||
$.on(this.searchInput, 'input', this.onSearchInput);
|
$.on(this.searchInput, 'input', this.onSearchInput);
|
||||||
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
|
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
|
||||||
$.on($('#returnlink', this.navLinks), 'click', Navigate.navigate);
|
$.on($('#returnlink', this.navLinks), 'click', Navigate.navigate);
|
||||||
|
$.on($('#cataloglink', this.navLinks), 'click', function() {
|
||||||
|
return window.location = "//boards.4chan.org/" + g.BOARD + "/catalog";
|
||||||
|
});
|
||||||
if (g.VIEW === 'index') {
|
if (g.VIEW === 'index') {
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
@ -12102,13 +12105,13 @@
|
|||||||
if (view === 'catalog' || ('f' === boardID || 'f' === g.BOARD.ID)) {
|
if (view === 'catalog' || ('f' === boardID || 'f' === g.BOARD.ID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
path = this.pathname;
|
path = this.pathname;
|
||||||
if (this.hash) {
|
if (this.hash) {
|
||||||
path += this.hash;
|
path += this.hash;
|
||||||
}
|
}
|
||||||
if (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
if (this.id !== 'popState') {
|
if (this.id !== 'popState') {
|
||||||
history.pushState(null, '', path);
|
history.pushState(null, '', path);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2165,7 +2165,7 @@
|
|||||||
Index = {
|
Index = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var anchorEntry, input, label, modeEntry, name, refNavEntry, repliesEntry, sortEntry, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
|
var anchorEntry, input, label, modeEntry, name, refNavEntry, repliesEntry, sortEntry, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
|
||||||
if (g.BOARD.ID === 'f') {
|
if (g.BOARD.ID === 'f' || g.VIEW === 'catalog') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.button = $.el('a', {
|
this.button = $.el('a', {
|
||||||
@ -2300,6 +2300,9 @@
|
|||||||
$.on(this.searchInput, 'input', this.onSearchInput);
|
$.on(this.searchInput, 'input', this.onSearchInput);
|
||||||
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
|
$.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);
|
||||||
$.on($('#returnlink', this.navLinks), 'click', Navigate.navigate);
|
$.on($('#returnlink', this.navLinks), 'click', Navigate.navigate);
|
||||||
|
$.on($('#cataloglink', this.navLinks), 'click', function() {
|
||||||
|
return window.location = "//boards.4chan.org/" + g.BOARD + "/catalog";
|
||||||
|
});
|
||||||
if (g.VIEW === 'index') {
|
if (g.VIEW === 'index') {
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
@ -12091,13 +12094,13 @@
|
|||||||
if (view === 'catalog' || ('f' === boardID || 'f' === g.BOARD.ID)) {
|
if (view === 'catalog' || ('f' === boardID || 'f' === g.BOARD.ID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
path = this.pathname;
|
path = this.pathname;
|
||||||
if (this.hash) {
|
if (this.hash) {
|
||||||
path += this.hash;
|
path += this.hash;
|
||||||
}
|
}
|
||||||
if (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
if (this.id !== 'popState') {
|
if (this.id !== 'popState') {
|
||||||
history.pushState(null, '', path);
|
history.pushState(null, '', path);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Index =
|
Index =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.BOARD.ID is 'f'
|
return if g.BOARD.ID is 'f' or g.VIEW is 'catalog'
|
||||||
|
|
||||||
@button = $.el 'a',
|
@button = $.el 'a',
|
||||||
className: 'index-refresh-shortcut fa fa-refresh'
|
className: 'index-refresh-shortcut fa fa-refresh'
|
||||||
@ -83,7 +83,10 @@ Index =
|
|||||||
$.on @pagelist, 'click', @cb.pageNav
|
$.on @pagelist, 'click', @cb.pageNav
|
||||||
$.on @searchInput, 'input', @onSearchInput
|
$.on @searchInput, 'input', @onSearchInput
|
||||||
$.on $('#index-search-clear', @navLinks), 'click', @clearSearch
|
$.on $('#index-search-clear', @navLinks), 'click', @clearSearch
|
||||||
$.on $('#returnlink', @navLinks), 'click', Navigate.navigate
|
$.on $('#returnlink', @navLinks), 'click', Navigate.navigate
|
||||||
|
$.on $('#cataloglink', @navLinks), 'click', ->
|
||||||
|
window.location = "//boards.4chan.org/#{g.BOARD}/catalog"
|
||||||
|
|
||||||
|
|
||||||
@update() if g.VIEW is 'index'
|
@update() if g.VIEW is 'index'
|
||||||
$.asap (-> $('.board', doc) or d.readyState isnt 'loading'), ->
|
$.asap (-> $('.board', doc) or d.readyState isnt 'loading'), ->
|
||||||
|
|||||||
@ -4,8 +4,7 @@ Navigate =
|
|||||||
return if g.VIEW is 'catalog' or g.BOARD.ID is 'f'
|
return if g.VIEW is 'catalog' or g.BOARD.ID is 'f'
|
||||||
|
|
||||||
# blink/webkit throw a popstate on page load. Not what we want.
|
# blink/webkit throw a popstate on page load. Not what we want.
|
||||||
$.ready ->
|
$.ready -> $.on window, 'popstate', Navigate.popstate
|
||||||
$.on window, 'popstate', Navigate.popstate
|
|
||||||
|
|
||||||
Thread.callbacks.push
|
Thread.callbacks.push
|
||||||
name: 'Navigate'
|
name: 'Navigate'
|
||||||
@ -27,10 +26,8 @@ Navigate =
|
|||||||
$.on postlink, 'click', Navigate.navigate
|
$.on postlink, 'click', Navigate.navigate
|
||||||
|
|
||||||
return unless Conf['Quote Hash Navigation']
|
return unless Conf['Quote Hash Navigation']
|
||||||
|
|
||||||
for hashlink in $$ '.hashlink', @nodes.comment
|
for hashlink in $$ '.hashlink', @nodes.comment
|
||||||
$.on hashlink, 'click', Navigate.navigate
|
$.on hashlink, 'click', Navigate.navigate
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
clean: ->
|
clean: ->
|
||||||
@ -79,9 +76,7 @@ Navigate =
|
|||||||
errors.push
|
errors.push
|
||||||
message: "Failed to reconnect feature #{name}."
|
message: "Failed to reconnect feature #{name}."
|
||||||
error: err
|
error: err
|
||||||
|
|
||||||
Main.handleErrors errors if errors
|
Main.handleErrors errors if errors
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
ready: (name, feature, condition) ->
|
ready: (name, feature, condition) ->
|
||||||
@ -92,7 +87,6 @@ Navigate =
|
|||||||
message: "Quote Threading Failed."
|
message: "Quote Threading Failed."
|
||||||
error: err
|
error: err
|
||||||
]
|
]
|
||||||
|
|
||||||
Main.handleErrors error if error
|
Main.handleErrors error if error
|
||||||
QR.generatePostableThreadsList()
|
QR.generatePostableThreadsList()
|
||||||
|
|
||||||
@ -188,11 +182,11 @@ Navigate =
|
|||||||
[boardID, view, threadID] = path
|
[boardID, view, threadID] = path
|
||||||
|
|
||||||
return if view is 'catalog' or 'f' in [boardID, g.BOARD.ID]
|
return if view is 'catalog' or 'f' in [boardID, g.BOARD.ID]
|
||||||
|
e.preventDefault() if e
|
||||||
|
|
||||||
path = @pathname
|
path = @pathname
|
||||||
path += @hash if @hash
|
path += @hash if @hash
|
||||||
|
|
||||||
e.preventDefault() if e
|
|
||||||
history.pushState null, '', path unless @id is 'popState'
|
history.pushState null, '', path unless @id is 'popState'
|
||||||
Navigate.path = @pathname
|
Navigate.path = @pathname
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user