From 7ac985f220ccedb8c4c305e15521c94436aa3dfb Mon Sep 17 00:00:00 2001 From: julian laplace Date: Thu, 27 Oct 2022 17:56:15 +0200 Subject: add some post links and stuff --- public/assets/js/lib/views/stream/hootfilters.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'public/assets/js/lib/views/stream') diff --git a/public/assets/js/lib/views/stream/hootfilters.js b/public/assets/js/lib/views/stream/hootfilters.js index 2f4e4ac..68f0cdd 100644 --- a/public/assets/js/lib/views/stream/hootfilters.js +++ b/public/assets/js/lib/views/stream/hootfilters.js @@ -15,6 +15,7 @@ var HootFilters = View.extend({ this.$hoots = this.$("[name=hoots]"); this.$sortOrder = this.$(".sort"); this.$sort = this.$("[name=sort]"); + this.$editLink = this.$(".editLink"); this.$classicLink = this.$(".classicLink"); this.state = { unset: true, @@ -65,17 +66,27 @@ var HootFilters = View.extend({ this.$hoots.closest("label").toggle(hoots); this.$files.closest("label").toggle(normal_files); if (target.thread || target.keyword || target.username) { - let classicHref, classicText; + let classicHref, classicText, editText, editHref; if (target.thread) { + editHref = `/details/${target.thread}/settings`; classicHref = `/details/${target.thread}`; + editText = "settings"; classicText = "thread"; } else if (target.keyword) { + editHref = `/post/${target.keyword}`; classicHref = `/index/${target.keyword}`; + editText = "post"; classicText = "keyword"; } else if (target.username) { classicHref = `/profile/${target.username}`; classicText = "profile"; } + if (editHref) { + this.$editLink.show(); + this.$editLink.find("a").attr("href", editHref).html(editText); + } else { + this.$editLink.hide(); + } this.$classicLink.show(); this.$classicLink.find("a").attr("href", classicHref).html(classicText); } else { -- cgit v1.2.3-70-g09d2