From 42beae77606b9a0e1bcdaf1ab0e494277c3938d8 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 22 Jan 2015 12:36:08 -0700 Subject: [PATCH] Fix the '-text' option with custom navigation #865 --- builds/appchan-x.user.js | 2 +- builds/crx/script.js | 2 +- src/General/Header.coffee | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 592bd8b3c..38753c7e9 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -4635,7 +4635,7 @@ if (Conf['JSON Navigation']) { $.on(a, 'click', Navigate.navigate); } - a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title : /-full/.test(t) ? "/" + boardID + "/ - " + a.title : (m = t.match(/-text:"([^"]+)"/)) ? m[1] : boardID; + a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title : /-full/.test(t) ? "/" + boardID + "/ - " + a.title : text || boardID; if (/-archive/.test(t)) { if (href = Redirect.to('board', { boardID: boardID diff --git a/builds/crx/script.js b/builds/crx/script.js index b43e1e2ab..35c584b9c 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4660,7 +4660,7 @@ if (Conf['JSON Navigation']) { $.on(a, 'click', Navigate.navigate); } - a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title : /-full/.test(t) ? "/" + boardID + "/ - " + a.title : (m = t.match(/-text:"([^"]+)"/)) ? m[1] : boardID; + a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title : /-full/.test(t) ? "/" + boardID + "/ - " + a.title : text || boardID; if (/-archive/.test(t)) { if (href = Redirect.to('board', { boardID: boardID diff --git a/src/General/Header.coffee b/src/General/Header.coffee index c4eb7b72d..f00027f40 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -206,10 +206,8 @@ Header = a.title else if /-full/.test t "/#{boardID}/ - #{a.title}" - else if m = t.match /-text:"([^"]+)"/ - m[1] else - boardID + text or boardID if /-archive/.test t if href = Redirect.to 'board', {boardID}