git ssb

16+

Dominic / patchbay



Tree: a293d80e9190015db0189ca3cd19e0be3acf6d1b

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

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