From 9a4199d8298cbe3a16afa7bd082f6a6783b61e36 Mon Sep 17 00:00:00 2001 From: Kabir Sala Date: Tue, 25 Feb 2014 13:20:19 +0100 Subject: [PATCH] Fix #14 --- LICENSE | 2 +- builds/4chan-X.user.js | 7 ++++--- builds/crx/script.js | 7 ++++--- src/General/Navigate.coffee | 9 ++++++--- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/LICENSE b/LICENSE index c549317a4..ad138a2dd 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.4.0 - 2014-02-24 +* 4chan X - Version 1.4.0 - 2014-02-25 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index dbf3ccaf6..24e2dfd54 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.4.0 - 2014-02-24 +* 4chan X - Version 1.4.0 - 2014-02-25 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -12180,7 +12180,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({ @@ -12394,7 +12395,7 @@ }, navigate: function(e) { var boardID, load, pageNum, path, threadID, view; - if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || (e.type === 'click' && e.button !== 0)))) { + if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || e.ctrlKey || (e.type === 'click' && e.button !== 0)))) { return; } $.addClass(Index.button, 'fa-spin'); diff --git a/builds/crx/script.js b/builds/crx/script.js index 735d6b5ec..188ceb7d6 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.4.0 - 2014-02-24 +* 4chan X - Version 1.4.0 - 2014-02-25 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -12183,7 +12183,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({ @@ -12397,7 +12398,7 @@ }, navigate: function(e) { var boardID, load, pageNum, path, threadID, view; - if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || (e.type === 'click' && e.button !== 0)))) { + if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || e.ctrlKey || (e.type === 'click' && e.button !== 0)))) { return; } $.addClass(Index.button, 'fa-spin'); diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 1fd197446..56615c495 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -3,8 +3,11 @@ 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 @@ -174,7 +177,7 @@ Navigate = navigate: (e) -> return if @hostname isnt 'boards.4chan.org' or window.location.hostname is 'rs.4chan.org' or - (e and (e.shiftKey or (e.type is 'click' and e.button isnt 0))) # Not simply a left click + (e and (e.shiftKey or e.ctrlKey or (e.type is 'click' and e.button isnt 0))) # Not simply a left click $.addClass Index.button, 'fa-spin'