summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/index/index.js
diff options
context:
space:
mode:
authorjulian laplace <julescarbon@gmail.com>2022-10-25 23:26:31 +0200
committerjulian laplace <julescarbon@gmail.com>2022-10-25 23:26:31 +0200
commit1cfed2612fd1042a15d470a44ec87588c966dc12 (patch)
treeba850f589194a21fd1587dd71dfcd056a242e4ac /public/assets/js/lib/views/index/index.js
parentae311b71cccf5df9e0e19e276615cc32426d9de1 (diff)
hootstream... dark mode only
Diffstat (limited to 'public/assets/js/lib/views/index/index.js')
-rw-r--r--public/assets/js/lib/views/index/index.js78
1 files changed, 40 insertions, 38 deletions
diff --git a/public/assets/js/lib/views/index/index.js b/public/assets/js/lib/views/index/index.js
index 08da455..cd5f650 100644
--- a/public/assets/js/lib/views/index/index.js
+++ b/public/assets/js/lib/views/index/index.js
@@ -1,57 +1,59 @@
var IndexView = View.extend({
-
- events: {
- },
+ events: {},
action: "/api/index",
keywordAction: "/api/keyword/",
- initialize: function(opt){
+ initialize: function (opt) {
// opt.parent = parent
- this.hootbox = new HootBox ({ parent: this })
- this.threadbox = new ThreadBox ({ parent: this })
- this.lastlog = new LastLog ({ parent: this })
- this.countdown = new Countdown ({ parent: this })
+ this.hootbox = new HootBox({ parent: this });
+ this.threadbox = new ThreadBox({ parent: this });
+ this.lastlog = new LastLog({ parent: this });
+ this.countdown = new Countdown({ parent: this });
},
- load: function(keyword){
- $("body").addClass("index")
+ load: function (keyword) {
+ $("body").addClass("index");
if (keyword) {
- $(".subtitle").html('<a href="/">&lt; Home</a> &middot; <a href="/keywords">Keywords</a>')
- this.threadbox.options.latest = false
- this.threadbox.options.welcome = false
- $.get(this.keywordAction + keyword, this.populate.bind(this))
- }
- else {
- this.hootbox.options.required = true
- this.threadbox.options.latest = true
- this.threadbox.options.welcome = true
- $.get(this.action, this.populate.bind(this))
+ $(".subtitle").html(
+ '<a href="/">&lt; Home</a> &middot; <a href="/keywords">Keywords</a>'
+ );
+ this.threadbox.options.latest = false;
+ this.threadbox.options.welcome = false;
+ $.get(this.keywordAction + keyword, this.populate.bind(this));
+ } else {
+ this.hootbox.options.required = true;
+ this.threadbox.options.latest = true;
+ this.threadbox.options.welcome = true;
+ $.get(this.action, this.populate.bind(this));
}
},
- populate: function(data){
- $("body").removeClass('loading')
- this.hootbox.load(data.hootbox)
- this.threadbox.load(data)
- this.lastlog.load(data.lastlog)
+ populate: function (data) {
+ $("body").removeClass("loading");
+ this.data = data;
+ this.hootbox.load(data.hootbox);
+ this.threadbox.load(data);
+ this.lastlog.load(data.lastlog);
if (data.mail.count) {
- $(".alert").show().html(
- "<a href='/mail'>" +
- "You have " +
- data.mail.count +
- " new message" +
- courtesy_s(data.mail.count) +
- "!</a>")
+ $(".alert")
+ .show()
+ .html(
+ "<a href='/mail'>" +
+ "You have " +
+ data.mail.count +
+ " new message" +
+ courtesy_s(data.mail.count) +
+ "!</a>"
+ );
if (is_mobile) {
- $("#content").prepend( $(".alert") )
+ $("#content").prepend($(".alert"));
}
}
- $(".search_form input").focus()
+ $(".search_form input").focus();
},
- success: function(){
- window.location.href = "/index"
+ success: function () {
+ window.location.href = "/index";
},
-
-})
+});