diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 777563f00..0d53bf707 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -4507,9 +4507,6 @@ $.on(this.searchInput, 'input', this.onSearchInput); $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch); $.on($('#returnlink a', this.navLinks), 'click', Navigate.navigate); - $.on($('#cataloglink a', this.navLinks), 'click', function() { - return window.location = "//boards.4chan.org/" + g.BOARD + "/catalog"; - }); if (g.VIEW === 'index') { this.update(); } @@ -8768,9 +8765,9 @@ flagsInput: function() { var flag, nodes; nodes = QR.nodes; - if (nodes.flagSelector) { - $.rm(nodes.flagSelector); - delete nodes.flagSelector; + if (nodes.flag) { + $.rm(nodes.flag); + delete nodes.flag; } if (g.BOARD.ID === 'pol') { flag = QR.flags(); @@ -15668,7 +15665,8 @@ return; } $.ready(function() { - return $.on(window, 'popstate', Navigate.popstate); + $.on(window, 'popstate', Navigate.popstate); + return $.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/" + g.BOARD + "/catalog"; }); this.title = function() {}; Thread.callbacks.push({ @@ -15874,6 +15872,7 @@ updateTitle: function(_arg) { var board, subtitle, title; board = _arg.board, title = _arg.title; + $.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/" + g.BOARD + "/catalog"; if (subtitle = $('.boardSubtitle')) { $.rm(subtitle); } diff --git a/builds/crx/script.js b/builds/crx/script.js index 113691f50..0dc6e4a77 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4549,9 +4549,6 @@ $.on(this.searchInput, 'input', this.onSearchInput); $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch); $.on($('#returnlink a', this.navLinks), 'click', Navigate.navigate); - $.on($('#cataloglink a', this.navLinks), 'click', function() { - return window.location = "//boards.4chan.org/" + g.BOARD + "/catalog"; - }); if (g.VIEW === 'index') { this.update(); } @@ -8791,9 +8788,9 @@ flagsInput: function() { var flag, nodes; nodes = QR.nodes; - if (nodes.flagSelector) { - $.rm(nodes.flagSelector); - delete nodes.flagSelector; + if (nodes.flag) { + $.rm(nodes.flag); + delete nodes.flag; } if (g.BOARD.ID === 'pol') { flag = QR.flags(); @@ -15673,7 +15670,8 @@ return; } $.ready(function() { - return $.on(window, 'popstate', Navigate.popstate); + $.on(window, 'popstate', Navigate.popstate); + return $.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/" + g.BOARD + "/catalog"; }); this.title = function() {}; Thread.callbacks.push({ @@ -15879,6 +15877,7 @@ updateTitle: function(_arg) { var board, subtitle, title; board = _arg.board, title = _arg.title; + $.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/" + g.BOARD + "/catalog"; if (subtitle = $('.boardSubtitle')) { $.rm(subtitle); } diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 370c56838..d2f442d5f 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -86,7 +86,6 @@ Index = $.on @searchInput, 'input', @onSearchInput $.on $('#index-search-clear', @navLinks), 'click', @clearSearch $.on $('#returnlink a', @navLinks), 'click', Navigate.navigate - $.on $('#cataloglink a', @navLinks), 'click', -> window.location = "//boards.4chan.org/#{g.BOARD}/catalog" @update() if g.VIEW is 'index' $.asap (-> $('.board', doc) or d.readyState isnt 'loading'), -> diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 5656e55d0..a7e39c93a 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -3,8 +3,12 @@ Navigate = init: -> return if g.VIEW is 'catalog' or g.BOARD.ID is 'f' or !Conf['JSON Navigation'] - # blink/webkit throw a popstate on page load. Not what we want. - $.ready -> $.on window, 'popstate', Navigate.popstate + $.ready -> + # blink/webkit throw a popstate on page load. Not what we want. + $.on window, 'popstate', Navigate.popstate + + # Prevent having to update the catalog links whenever we open threads. + $.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/#{g.BOARD}/catalog" @title = -> return @@ -161,6 +165,7 @@ Navigate = Style.setTheme theme updateTitle: ({board, title}) -> + $.id('catalog').href = $.id('cataloglink').href = "//boards.4chan.org/#{g.BOARD}/catalog" $.rm subtitle if subtitle = $ '.boardSubtitle' $('.boardTitle').textContent = d.title = "/#{board}/ - #{title}" diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 8d910d027..d468d2f87 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -524,9 +524,9 @@ QR = flagsInput: -> {nodes} = QR - if nodes.flagSelector - $.rm nodes.flagSelector - delete nodes.flagSelector + if nodes.flag + $.rm nodes.flag + delete nodes.flag if g.BOARD.ID is 'pol' flag = QR.flags()