summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/stream
diff options
context:
space:
mode:
authorjulian laplace <julescarbon@gmail.com>2022-10-27 17:56:15 +0200
committerjulian laplace <julescarbon@gmail.com>2022-10-27 17:56:15 +0200
commit7ac985f220ccedb8c4c305e15521c94436aa3dfb (patch)
tree4941c03ba4278cf2562aad5abe45381c3239762b /public/assets/js/lib/views/stream
parente2aff14776de097dca5b0b7fbafdef201558bf28 (diff)
add some post links and stuff
Diffstat (limited to 'public/assets/js/lib/views/stream')
-rw-r--r--public/assets/js/lib/views/stream/hootfilters.js13
1 files changed, 12 insertions, 1 deletions
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 {