Files: 2b05be8ee023fdd9580d6a845ba074a425756685 / app / html / settings / custom-styles.js
833 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 | 'settings.obs.get': 'first', |
10 | 'settings.sync.set': 'first' |
11 | }) |
12 | |
13 | exports.create = function (api) { |
14 | return nest({ |
15 | 'app.html.settings': customStyles |
16 | }) |
17 | |
18 | function customStyles () { |
19 | const customStyles = api.settings.obs.get('patchbay.customStyles', '') |
20 | const styles = h('textarea', { value: customStyles }) |
21 | |
22 | return { |
23 | title: 'Custom Styles', |
24 | body: h('CustomStyles', [ |
25 | h('p', 'Custom MCSS to be applied on this window.'), |
26 | styles, |
27 | h('button', { 'ev-click': save }, 'Apply Styles') |
28 | ]) |
29 | } |
30 | |
31 | function save () { |
32 | api.settings.sync.set({ |
33 | patchbay: { |
34 | customStyles: styles.value |
35 | } |
36 | }) |
37 | } |
38 | } |
39 | } |
40 |
Built with git-ssb-web