From 1afcdd011cf0aabaab6a704442009dd489306e30 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Wed, 26 Mar 2014 15:31:26 -0700 Subject: [PATCH] Improve Scroll to Post Quoting You logic --- CHANGELOG.md | 5 ++++- builds/4chan-X.user.js | 2 +- builds/crx/script.js | 2 +- src/Quotelinks/QuoteMarkers.coffee | 9 +++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e1a9e88c..6d4eb9dba 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,8 +57,11 @@ - JSON Navigation now works for backlinks (when Quote Inlining is disabled) and backlink hashlinks. - JSON Navigation (Index, Catalog) performance improvements. - Added a nifty bread-crumb for the JSON Navigation. -- Many spiffy performance, state awareness, and sanity improvements to JSON Navigation. - Added a return button to the JSON Navigation that will switch you back to non-catalog view (requires NavLinks not to be hidden). +- Rewrote "Scroll to post quoting you" functionality, solving several small issues with it. +- Improved Linkifier link detection. +- Fixed an issue with Thread Updater intervals not saving correctly. +- Many spiffy performance, state awareness, and sanity improvements to JSON Navigation. ### v1.4.1 *2014-03-01* diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 7fdded0ab..662705d8a 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -5531,7 +5531,7 @@ len = posts.length - 1; index = i = posts.indexOf(post); while (true) { - if (index === (i = i === 0 ? len : i === len ? 0 : type === 'prev' ? i - 1 : i + 1)) { + if (index === (i = type === 'prev' ? i === 0 ? len : i - 1 : i === len ? 0 : i + 1)) { break; } post = posts[i]; diff --git a/builds/crx/script.js b/builds/crx/script.js index 9ea19e956..0d4a18f2a 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -5585,7 +5585,7 @@ len = posts.length - 1; index = i = posts.indexOf(post); while (true) { - if (index === (i = i === 0 ? len : i === len ? 0 : type === 'prev' ? i - 1 : i + 1)) { + if (index === (i = type === 'prev' ? i === 0 ? len : i - 1 : i === len ? 0 : i + 1)) { break; } post = posts[i]; diff --git a/src/Quotelinks/QuoteMarkers.coffee b/src/Quotelinks/QuoteMarkers.coffee index e386e63ff..2ff7f79ba 100644 --- a/src/Quotelinks/QuoteMarkers.coffee +++ b/src/Quotelinks/QuoteMarkers.coffee @@ -66,12 +66,13 @@ QuoteMarkers = index = i = posts.indexOf post while true break if index is ( - i = if i is 0 - len + i = if type is 'prev' + if i is 0 + len + else + i - 1 else if i is len 0 - else if type is 'prev' - i - 1 else i + 1 )