summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/admin/adminz.js
diff options
context:
space:
mode:
authorjulian laplace <julescarbon@gmail.com>2022-10-31 12:00:16 +0100
committerjulian laplace <julescarbon@gmail.com>2022-10-31 12:00:16 +0100
commit341393513dc3622b6d59e5512a7ab11d82c7e6c3 (patch)
tree25eac45533edbf406f6afe7adcb707e7ad9726cd /public/assets/js/lib/views/admin/adminz.js
parenta2bf5ad8689fb0f9c662cf2bb17a6d4890aba349 (diff)
redirect to /stream on mobile
Diffstat (limited to 'public/assets/js/lib/views/admin/adminz.js')
-rw-r--r--public/assets/js/lib/views/admin/adminz.js52
1 files changed, 27 insertions, 25 deletions
diff --git a/public/assets/js/lib/views/admin/adminz.js b/public/assets/js/lib/views/admin/adminz.js
index caed86d..cd0c93d 100644
--- a/public/assets/js/lib/views/admin/adminz.js
+++ b/public/assets/js/lib/views/admin/adminz.js
@@ -1,39 +1,41 @@
var AdminView = View.extend({
-
- events: {
- },
+ events: {},
action: "/api/admin",
- initialize: function(opt){
+ initialize: function (opt) {
// this.hootbox = new HootBox ({ parent: this })
- this.password = new ChangePasswordForm ({ parent: this })
- this.lastlog = new LastLog ({ parent: this })
+ this.password = new ChangePasswordForm({ parent: this });
+ this.lastlog = new LastLog({ parent: this });
},
- load: function(){
- $("body").addClass("index").addClass("admin")
- $.get(this.action, this.populate.bind(this))
+ load: function () {
+ $("body").addClass("index").addClass("admin");
+ $.get(this.action, this.populate.bind(this));
},
- populate: function(data){
- $("body").removeClass('loading')
- console.log(data)
- this.password.load(data.usernames)
- this.lastlog.load(data.lastlog)
+ populate: function (data) {
+ $("body").removeClass("loading");
+ console.log(data);
+ this.password.load(data.usernames);
+ 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()
+ if (is_desktop) {
+ $(".search_form input").focus();
+ }
},
-
-})
+});