Commit a2b4868abcd60a593d913223d3af542f4c8e95b2
Add default minimal theme
Charles Lehner committed on 8/14/2016, 4:25:36 AMParent: a02496d0475717090976150d52e656f9915bcf7f
Files changed
modules/theme.js | changed |
modules/theme.js | ||
---|---|---|
@@ -6,8 +6,13 @@ | ||
6 | 6 | var sbot_links2 = plugs.first(exports.sbot_links2 = []) |
7 | 7 | var avatar_name = plugs.first(exports.avatar_name = []) |
8 | 8 | var blob_url = require('../plugs').first(exports.blob_url = []) |
9 | 9 | |
10 | +var defaultTheme = { | |
11 | + id: '&JFa42U6HtPm9k+s+AmpDIAoTJJI/PzoRC/J/WCfduDY=.sha256', | |
12 | + name: 'patchbay-minimal.css' | |
13 | +} | |
14 | + | |
10 | 15 | var link = document.head.appendChild(h('link', {rel: 'stylesheet'})) |
11 | 16 | var activeTheme |
12 | 17 | |
13 | 18 | function useTheme(id) { |
@@ -21,20 +26,23 @@ | ||
21 | 26 | radio.checked = (radio.value === activeTheme) |
22 | 27 | }) |
23 | 28 | } |
24 | 29 | |
25 | -setImmediate(function () { | |
26 | - useTheme(localStorage.themeId || '') | |
27 | -}) | |
30 | +function useSavedTheme() { | |
31 | + useTheme(localStorage.themeId || defaultTheme.id) | |
32 | +} | |
28 | 33 | |
34 | +setImmediate(useSavedTheme) | |
35 | + | |
29 | 36 | function themes() { |
30 | 37 | return cat([ |
31 | 38 | pull.values([ |
32 | 39 | { |
33 | 40 | id: '', |
34 | 41 | name: 'none', |
35 | 42 | feed: '' |
36 | - } | |
43 | + }, | |
44 | + defaultTheme, | |
37 | 45 | ]), |
38 | 46 | pull( |
39 | 47 | sbot_links2({ |
40 | 48 | query: [ |
@@ -105,9 +113,9 @@ | ||
105 | 113 | } |
106 | 114 | |
107 | 115 | function onreset(e) { |
108 | 116 | e.preventDefault() |
109 | - useTheme(localStorage.themeId || '') | |
117 | + useSavedTheme() | |
110 | 118 | } |
111 | 119 | } |
112 | 120 | |
113 | 121 | exports.screen_view = function (path) { |
Built with git-ssb-web