git ssb

0+

ev / microbay



forked from Dominic / patchbay

Commit a2b4868abcd60a593d913223d3af542f4c8e95b2

Add default minimal theme

Charles Lehner committed on 8/14/2016, 4:25:36 AM
Parent: a02496d0475717090976150d52e656f9915bcf7f

Files changed

modules/theme.jschanged
modules/theme.jsView
@@ -6,8 +6,13 @@
66 var sbot_links2 = plugs.first(exports.sbot_links2 = [])
77 var avatar_name = plugs.first(exports.avatar_name = [])
88 var blob_url = require('../plugs').first(exports.blob_url = [])
99
10+var defaultTheme = {
11+ id: '&JFa42U6HtPm9k+s+AmpDIAoTJJI/PzoRC/J/WCfduDY=.sha256',
12+ name: 'patchbay-minimal.css'
13+}
14+
1015 var link = document.head.appendChild(h('link', {rel: 'stylesheet'}))
1116 var activeTheme
1217
1318 function useTheme(id) {
@@ -21,20 +26,23 @@
2126 radio.checked = (radio.value === activeTheme)
2227 })
2328 }
2429
25-setImmediate(function () {
26- useTheme(localStorage.themeId || '')
27-})
30+function useSavedTheme() {
31+ useTheme(localStorage.themeId || defaultTheme.id)
32+}
2833
34+setImmediate(useSavedTheme)
35+
2936 function themes() {
3037 return cat([
3138 pull.values([
3239 {
3340 id: '',
3441 name: 'none',
3542 feed: ''
36- }
43+ },
44+ defaultTheme,
3745 ]),
3846 pull(
3947 sbot_links2({
4048 query: [
@@ -105,9 +113,9 @@
105113 }
106114
107115 function onreset(e) {
108116 e.preventDefault()
109- useTheme(localStorage.themeId || '')
117+ useSavedTheme()
110118 }
111119 }
112120
113121 exports.screen_view = function (path) {

Built with git-ssb-web