diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 286002b35..29ece2123 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -71,18 +71,20 @@ Index = @navLinks = $.el 'div', className: 'navLinks' innerHTML: <%= importHTML('Features/Index-navlinks') %> + @navLinksBot = $.el 'div', + className: 'navLinks navLinksBot' + innerHTML: <%= importHTML('Features/Index-navlinksbot') %> @searchInput = $ '#index-search', @navLinks @currentPage = @getCurrentPage() - returnlink = $ '#returnlink a', @navLinks - returnlink.href = "/#{g.BOARD}/" + Index.setNavLinks() $.on d, 'scroll', Index.scroll $.on @pagelist, 'click', @cb.pageNav $.on @searchInput, 'input', @onSearchInput $.on $('#index-search-clear', @navLinks), 'click', @clearSearch - $.on returnlink, 'click', Navigate.navigate - $.on $('#cataloglink a', @navLinks), 'click', -> window.location = "//boards.4chan.org/#{g.BOARD}/catalog" + $.on $('.returnlink a', @navLinks), 'click', Navigate.navigate + $.on $('.returnlink a', @navLinksBot), 'click', Navigate.navigate @update() if g.VIEW is 'index' $.asap (-> $('.board', doc) or d.readyState isnt 'loading'), -> @@ -101,8 +103,11 @@ Index = $.rm el for el in $$ '.navLinks, .navLinksBot + hr' $.id('search-box')?.parentNode.remove() topNavPos = $.id('delform').previousElementSibling - $.before topNavPos, ($.el 'hr', className: 'desktop') if g.VIEW is 'index' + botNavPos = $ '.board' + $.before topNavPos, $.el 'hr' if g.VIEW is 'index' $.before topNavPos, Index.navLinks + $.after botNavPos, $.el 'hr' + $.after botNavPos, Index.navLinksBot $.rmClass doc, 'index-loading' $.asap (-> $('.pagelist', doc) or d.readyState isnt 'loading'), -> @@ -111,6 +116,10 @@ Index = else $.after $.id('delform'), Index.pagelist + setNavLinks: () -> + $('.returnlink a', Index.navLinks).href = $('.returnlink a', Index.navLinksBot).href = "//boards.4chan.org/#{g.BOARD}/" + $('.cataloglink a', Index.navLinks).href = $('.cataloglink a', Index.navLinksBot).href = "//boards.4chan.org/#{g.BOARD}/catalog" + scroll: $.debounce 100, -> return if Index.req or Conf['Index Mode'] isnt 'infinite' or (doc.scrollTop <= doc.scrollHeight - (300 + window.innerHeight)) or g.VIEW is 'thread' Index.pageNum = Index.getCurrentPage() unless Index.pageNum? # Avoid having to pushState to keep track of the current page diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 30bf1d16c..37612969b 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -131,7 +131,7 @@ Navigate = $.addClass current, 'current' if current = $ "a[href*='/#{boardID}/']", fullBoardList Header.generateBoardList Conf['boardnav'].replace /(\r\n|\n|\r)/g, ' ' - $('#returnlink a').href = "/#{g.BOARD}/" + Index.setNavLinks() $('form[name="post"]').action = "//sys.4chan.org/#{g.BOARD}/post" QR.flagsInput() if Conf['Quick Reply'] diff --git a/src/General/css/style.css b/src/General/css/style.css index 6ef3dc498..806b798f6 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -498,8 +498,10 @@ div.center:not(.ad-cnt) { .summary { text-decoration: none; } -.index #returnlink, -.index #bottomlink, +.index .returnlink, +.index .bottomlink, +.index .navLinksBot, +.index .navLinksBot + hr, .thread #index-last-refresh, .thread #index-search-clear, .thread #index-search { diff --git a/src/General/html/Features/Index-navlinks.html b/src/General/html/Features/Index-navlinks.html index 83adcf21e..4ba933836 100644 --- a/src/General/html/Features/Index-navlinks.html +++ b/src/General/html/Features/Index-navlinks.html @@ -1,6 +1,6 @@ -Return -Catalog -Bottom - +Return +Catalog +Bottom + ×