git ssb

16+

Dominic / patchbay



Tree: fd0e5304bd3777aa0d1bedb42467e378508b89cd

Files: fd0e5304bd3777aa0d1bedb42467e378508b89cd / app / html / settings / custom-styles.js

831 bytesRaw
1const nest = require('depnest')
2const { h } = require('mutant')
3
4exports.gives = nest({
5 'app.html.settings': true
6})
7
8exports.needs = nest({
9 'settings.obs.get': 'first',
10 'settings.sync.set': 'first'
11})
12
13exports.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