aboutsummaryrefslogtreecommitdiffstats
path: root/static/ui.js
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2018-09-29 10:41:35 -0700
committerAdam Mathes <adam@trenchant.org>2018-09-29 10:41:35 -0700
commit6a6cc29e2b5e55b785ef3cbcba2e6a85e29625f4 (patch)
tree84e1616333d75e2cfbfbc8dedc27144a7a6faab0 /static/ui.js
parent9ed9a09c02336a36e6bae328ed306a7c28de1600 (diff)
downloadneko-6a6cc29e2b5e55b785ef3cbcba2e6a85e29625f4.tar.gz
neko-6a6cc29e2b5e55b785ef3cbcba2e6a85e29625f4.tar.bz2
neko-6a6cc29e2b5e55b785ef3cbcba2e6a85e29625f4.zip
light/dark/black themes
Diffstat (limited to 'static/ui.js')
-rw-r--r--static/ui.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/static/ui.js b/static/ui.js
index b35e948..9742314 100644
--- a/static/ui.js
+++ b/static/ui.js
@@ -4,6 +4,7 @@ $(document).ready(function() {
if ( $(window).width() < 1024 ) {
$('#filters').addClass('hidden');
}
+ document.body.className = localStorage.getItem('theme');
boot();
});
@@ -170,6 +171,9 @@ var ControlsView = Backbone.View.extend({
'click .unread_filter': 'filterToUnread',
'click .new_feed': 'newFeed',
'click .search_go': 'filterToSearch',
+ 'click .light_theme': 'lightTheme',
+ 'click .dark_theme': 'darkTheme',
+ 'click .black_theme': 'blackTheme',
},
initialize: function() {
@@ -206,6 +210,21 @@ var ControlsView = Backbone.View.extend({
return this;
},
+ lightTheme: function() {
+ document.body.className = "light";
+ localStorage.setItem("theme", "light");
+ },
+
+ darkTheme: function() {
+ document.body.className = "dark";
+ localStorage.setItem("theme", "dark");
+ },
+
+ blackTheme: function() {
+ document.body.className = "black";
+ localStorage.setItem("theme", "black");
+ },
+
});
@@ -638,7 +657,6 @@ function infini_scroll() {
window.setTimeout(infini_scroll, 1000);
}
-
var ItemSelector = {
selected_index: 0,
}