Files: 1a326ad6e229f48d252a5d8e4e8dd65a803f4d58 / app / html / settings / custom-styles.js
885 bytesRaw
1 | const nest = require('depnest') |
2 | const { h } = require('mutant') |
3 | |
4 | exports.gives = nest({ |
5 | 'app.html.settings': true |
6 | }) |
7 | |
8 | exports.needs = nest({ |
9 | 'app.html.settings': 'map', |
10 | 'settings.obs.get': 'first', |
11 | 'settings.sync.set': 'first' |
12 | }) |
13 | |
14 | exports.create = function (api) { |
15 | return nest({ |
16 | 'app.html.settings': customStyles |
17 | }) |
18 | |
19 | function customStyles () { |
20 | const customStyles = api.settings.obs.get('patchbay.customStyles', '') |
21 | const styles = h('textarea', { value: customStyles }) |
22 | |
23 | return { |
24 | title: 'Custom Styles', |
25 | body: h('CustomStyles', [ |
26 | h('p', 'Comma-seperated list of tabs which will open on startup.'), |
27 | styles, |
28 | h('button', {'ev-click': peachify}, 'Apply Styles') |
29 | ]) |
30 | } |
31 | |
32 | function peachify () { |
33 | api.settings.sync.set({ |
34 | patchbay: { |
35 | customStyles: styles.value |
36 | } |
37 | }) |
38 | } |
39 | } |
40 | } |
41 | |
42 |
Built with git-ssb-web