From a8baffa972bdcfea84b2d5aa1022a9a85e0a53cd Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Mon, 10 Mar 2014 07:28:40 -0700 Subject: [PATCH] Disable CatalogSwitch without JSON Navigation --- LICENSE | 2 +- builds/4chan-X.user.js | 5 ++++- builds/crx/script.js | 5 ++++- src/General/Index.coffee | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index bb7ae873f..466133539 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.4.1 - 2014-03-09 +* 4chan X - Version 1.4.1 - 2014-03-10 * * 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 396d4cf56..2221c8ca1 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.4.1 - 2014-03-09 +* 4chan X - Version 1.4.1 - 2014-03-10 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -2843,6 +2843,9 @@ }, catalogSwitch: function() { var hash; + if (!Conf['JSON Navigation']) { + return; + } $.set('Index Mode', 'catalog'); hash = window.location.hash; return window.location = './' + hash; diff --git a/builds/crx/script.js b/builds/crx/script.js index b94eedd28..90f4e8369 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.4.1 - 2014-03-09 +* 4chan X - Version 1.4.1 - 2014-03-10 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -2902,6 +2902,9 @@ }, catalogSwitch: function() { var hash; + if (!Conf['JSON Navigation']) { + return; + } $.set('Index Mode', 'catalog'); hash = window.location.hash; return window.location = './' + hash; diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 26e6d182e..e633b9ae7 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -254,6 +254,7 @@ Index = $.event 'change', null, Index.selectSort catalogSwitch: -> + return if !Conf['JSON Navigation'] $.set 'Index Mode', 'catalog' {hash} = window.location window.location = './' + hash