This commit is contained in:
Kabir Sala 2014-02-25 13:20:19 +01:00
parent d0e2d1a583
commit 9a4199d829
4 changed files with 15 additions and 10 deletions

View File

@ -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. * Licensed under the MIT license.
* https://github.com/Spittie/4chan-x/blob/master/LICENSE * https://github.com/Spittie/4chan-x/blob/master/LICENSE

View File

@ -24,7 +24,7 @@
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.4.0 - 2014-02-24 * 4chan X - Version 1.4.0 - 2014-02-25
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/Spittie/4chan-x/blob/master/LICENSE * https://github.com/Spittie/4chan-x/blob/master/LICENSE
@ -12180,7 +12180,8 @@
return; return;
} }
$.ready(function() { $.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() {}; this.title = function() {};
Thread.callbacks.push({ Thread.callbacks.push({
@ -12394,7 +12395,7 @@
}, },
navigate: function(e) { navigate: function(e) {
var boardID, load, pageNum, path, threadID, view; 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; return;
} }
$.addClass(Index.button, 'fa-spin'); $.addClass(Index.button, 'fa-spin');

View File

@ -1,6 +1,6 @@
// Generated by CoffeeScript // 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. * Licensed under the MIT license.
* https://github.com/Spittie/4chan-x/blob/master/LICENSE * https://github.com/Spittie/4chan-x/blob/master/LICENSE
@ -12183,7 +12183,8 @@
return; return;
} }
$.ready(function() { $.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() {}; this.title = function() {};
Thread.callbacks.push({ Thread.callbacks.push({
@ -12397,7 +12398,7 @@
}, },
navigate: function(e) { navigate: function(e) {
var boardID, load, pageNum, path, threadID, view; 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; return;
} }
$.addClass(Index.button, 'fa-spin'); $.addClass(Index.button, 'fa-spin');

View File

@ -3,8 +3,11 @@ Navigate =
init: -> init: ->
return if g.VIEW is 'catalog' or g.BOARD.ID is 'f' or !Conf['JSON Navigation'] 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 ->
$.ready -> $.on window, 'popstate', Navigate.popstate # 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 @title = -> return
@ -174,7 +177,7 @@ Navigate =
navigate: (e) -> navigate: (e) ->
return if @hostname isnt 'boards.4chan.org' or window.location.hostname is 'rs.4chan.org' or 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' $.addClass Index.button, 'fa-spin'