From 28a4761d1b008e24cebf5947ad8d440632db5775 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 18 Dec 2011 01:50:46 +0100 Subject: [PATCH] Fix no sauce from breaking 4chan X. Close #61 --- 4chan_x.user.js | 2 +- changelog | 2 ++ script.coffee | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index fd540aad3..e991fc2a7 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2231,7 +2231,7 @@ sauce = { init: function() { - sauce.prefixes = conf['flavors'].match(/^[^#].+$/gm); + if (!(sauce.prefixes = conf['flavors'].match(/^[^#].+$/gm)).length) return; sauce.names = sauce.prefixes.map(function(prefix) { return prefix.match(/(\w+)\./)[1]; }); diff --git a/changelog b/changelog index 72b6b135f..fdf2cf3f6 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- mayhem + fix empty sauce or all flavors commented out from breaking 4chan X 2.23.5 - mayhem diff --git a/script.coffee b/script.coffee index 95bf48241..0a0394d2d 100644 --- a/script.coffee +++ b/script.coffee @@ -1790,7 +1790,7 @@ anonymize = sauce = init: -> - sauce.prefixes = conf['flavors'].match /^[^#].+$/gm + return unless (sauce.prefixes = conf['flavors'].match /^[^#].+$/gm).length sauce.names = sauce.prefixes.map (prefix) -> prefix.match(/(\w+)\./)[1] g.callbacks.push (root) -> return if root.className is 'inline' or not span = $ '.filesize', root