Compare commits
391 commits
v1.28-back
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 1af30141d0 | |||
| d81da1acd3 | |||
| c97416b2c3 | |||
|
|
c3d993e46a | ||
|
|
f1dd12c601 | ||
|
|
82edcfe282 | ||
|
|
cd4e3b35bb | ||
|
|
2790b7d86e | ||
|
|
a47050e7ad | ||
|
|
9eab8ce38b | ||
|
|
dd3ca188ab | ||
|
|
aec5ba9d9c | ||
|
|
000714d22b | ||
|
|
3263cf2ff1 | ||
|
|
db85c42989 | ||
|
|
a73e2755dc | ||
|
|
aee968cba9 | ||
|
|
dcfde67d71 | ||
|
|
81d5e84044 | ||
|
|
883fb811e8 | ||
|
|
54d32c4c3f | ||
|
|
e7baf46890 | ||
|
|
ce0ae02c8b | ||
|
|
efe5629396 | ||
|
|
7c38dedcc7 | ||
|
|
af6cc4b911 | ||
|
|
64642274d8 | ||
|
|
af1a8a8715 | ||
|
|
6605f1d2b3 | ||
|
|
4d1b8e924a | ||
|
|
d69d3b7f13 | ||
|
|
83090d2e06 | ||
|
|
83456acbff | ||
|
|
08b837ff98 | ||
|
|
0e8c77a700 | ||
|
|
a36811954d | ||
|
|
39c9d4a46d | ||
|
|
593ec4c53d | ||
|
|
8c22384ddb | ||
|
|
7981b6fdd6 | ||
|
|
27d87f2238 | ||
|
|
c49a731134 | ||
|
|
ac7b0323e2 | ||
|
|
fe5bbb4713 | ||
|
|
e44cf615b5 | ||
|
|
cdea67809f | ||
|
|
79c04cc69a | ||
|
|
045be39e87 | ||
|
|
c1d692ffba | ||
|
|
c40d30aa2b | ||
|
|
d22f850598 | ||
|
|
7e7c3f43e7 | ||
|
|
614b0c237f | ||
|
|
b89d254386 | ||
|
|
26a3d4ce60 | ||
|
|
a7708f6cd5 | ||
|
|
ed722923d9 | ||
|
|
9d7087b6e7 | ||
|
|
e163308e35 | ||
|
|
19a86aa31b | ||
|
|
c84bbee02e | ||
|
|
7fc5372ca1 | ||
|
|
22068ab47e | ||
|
|
6dbbc9318d | ||
|
|
9d79e857f8 | ||
|
|
892cbd6886 | ||
|
|
3407568b5f | ||
|
|
51e33c0230 | ||
|
|
dfe45cac01 | ||
|
|
d9c23bc672 | ||
|
|
013b7faf9e | ||
|
|
8bec0552d4 | ||
|
|
3730aa7199 | ||
|
|
e4311271e9 | ||
|
|
43d18647b2 | ||
|
|
12508f8994 | ||
|
|
e2c48bd6ac | ||
|
|
3d12e85e56 | ||
|
|
a0fed34edb | ||
|
|
27e3e6f1b3 | ||
|
|
91fb688d9d | ||
|
|
99578d3be5 | ||
|
|
6b37c4521e | ||
|
|
b016724d04 | ||
|
|
9961fb73b4 | ||
|
|
270eb77802 | ||
|
|
84474499c7 | ||
|
|
bfc1d182be | ||
|
|
e682455872 | ||
|
|
09aa7e8a63 | ||
|
|
3da569700a | ||
|
|
daa4fbfecf | ||
|
|
5bf5ab8754 | ||
|
|
c59c4a8065 | ||
|
|
4c008099ca | ||
|
|
08d4139844 | ||
|
|
a425d8156c | ||
|
|
750f89b6ce | ||
|
|
bf72d38fcf | ||
|
|
11af5edc70 | ||
|
|
0bfbf59f0f | ||
|
|
b8c59db5f3 | ||
|
|
c3f526070f | ||
|
|
d0a76d4ce3 | ||
|
|
665515b626 | ||
|
|
2758a79ff5 | ||
|
|
43ac672d94 | ||
|
|
1aa3fbfef5 | ||
|
|
f4af775a98 | ||
|
|
8cf854af2e | ||
|
|
4627fa9c02 | ||
|
|
5b3d3e671c | ||
|
|
c1720b4a52 | ||
|
|
80e5b048ea | ||
|
|
414195c621 | ||
|
|
c3002b99c3 | ||
|
|
93d3b159ca | ||
|
|
3613dd9901 | ||
|
|
5ea192d5d4 | ||
|
|
9abfb85739 | ||
|
|
5785a5e026 | ||
|
|
2a4412e726 | ||
|
|
89b68c8009 | ||
|
|
eddcbe5cd2 | ||
|
|
5070ec8421 | ||
|
|
eff4ddea8a | ||
|
|
1b3ab562da | ||
|
|
4857a20b61 | ||
|
|
6de4b1ac5c | ||
|
|
db5d087425 | ||
|
|
7ab8bcd78a | ||
|
|
d93b880330 | ||
|
|
199b6241aa | ||
|
|
70be6fedfa | ||
|
|
618fb3b01f | ||
|
|
dc85311b54 | ||
|
|
6bd1293959 | ||
|
|
422c84d42e | ||
|
|
37b305eaea | ||
|
|
b27d381324 | ||
|
|
3777b1fcbb | ||
|
|
8af432933c | ||
|
|
55d5f440be | ||
|
|
ce48146bdb | ||
|
|
e4eae76bdf | ||
|
|
31f4119442 | ||
|
|
42b71ef6fc | ||
|
|
d4cd2ec666 | ||
|
|
9b58f4e365 | ||
|
|
b064b8f3a8 | ||
|
|
934550c942 | ||
|
|
58c1fc3c32 | ||
|
|
8737385a0e | ||
|
|
7cda8e4670 | ||
|
|
a441bd628b | ||
|
|
fa15187c2c | ||
|
|
45dd19494f | ||
|
|
3bba80d2f0 | ||
|
|
fab78f98a4 | ||
|
|
67669d4ff2 | ||
|
|
6f46a813cc | ||
|
|
dc023def19 | ||
|
|
02cc18395a | ||
|
|
931827fc72 | ||
|
|
891239658c | ||
|
|
972ecdfae3 | ||
|
|
92ef3b7ac1 | ||
|
|
71293de694 | ||
|
|
acf5f74ea2 | ||
|
|
dc7ac2bcd3 | ||
|
|
3451feef24 | ||
|
|
0a6dd34575 | ||
|
|
1129fe42cf | ||
|
|
e18ad7774c | ||
|
|
e7a864d84e | ||
|
|
2a4c9d96fe | ||
|
|
9e60de7243 | ||
|
|
bedca678fb | ||
|
|
75bbdf59a6 | ||
|
|
ad2c87910c | ||
|
|
bcf42b178e | ||
|
|
a34192caab | ||
|
|
1f1b56607b | ||
|
|
d3870d74f2 | ||
|
|
0d7c052feb | ||
|
|
8d62fe0801 | ||
|
|
2069311450 | ||
|
|
cec0604445 | ||
|
|
39eb82f73d | ||
|
|
4872e3019f | ||
|
|
3fb8dee637 | ||
|
|
5dde5a7f9f | ||
|
|
96f5cd0cf5 | ||
|
|
af2a771b7d | ||
|
|
e8ecb121f5 | ||
|
|
859f583ad1 | ||
|
|
36c2f90ec1 | ||
|
|
02465d9cdf | ||
|
|
361fdccda5 | ||
|
|
4a915659d4 | ||
|
|
f7b42fbfb2 | ||
|
|
6322d91478 | ||
|
|
f8b34ed71e | ||
|
|
4acc92a607 | ||
|
|
9aaa114fdb | ||
|
|
d20030311c | ||
|
|
fe1ae44e60 | ||
|
|
edca21bb99 | ||
|
|
9c5ad33944 | ||
|
|
4c754bfaf4 | ||
|
|
b53af33b09 | ||
|
|
15002baf6b | ||
|
|
6bdcef119c | ||
|
|
5eae65a0aa | ||
|
|
a95697045a | ||
|
|
de62a7ca0e | ||
|
|
3f972838b0 | ||
|
|
96cb90ed0d | ||
|
|
3e14c46c8c | ||
|
|
12f6253de7 | ||
|
|
781a1b1d14 | ||
|
|
714bdddb96 | ||
|
|
de9b5db120 | ||
|
|
4b7c11c301 | ||
|
|
b93f3e57ac | ||
|
|
c5243126ee | ||
|
|
3ca713ecf6 | ||
|
|
007ff1e7fd | ||
|
|
20b81b99f5 | ||
|
|
ed7a562b36 | ||
|
|
d78d54d062 | ||
|
|
cfc000a2cd | ||
|
|
cddca97378 | ||
|
|
53f941c1e7 | ||
|
|
55ea9f5f0b | ||
|
|
ca2fce8d05 | ||
|
|
22a4236485 | ||
|
|
85b10cf280 | ||
|
|
27bdcdc023 | ||
|
|
6f563f4492 | ||
|
|
c71b9fb48e | ||
|
|
b2b3bcb1b6 | ||
|
|
f5091b9267 | ||
|
|
4dbc572ea1 | ||
|
|
9ef97ca1c3 | ||
|
|
48402e277d | ||
|
|
74faac7baf | ||
|
|
8d2c5ff171 | ||
|
|
fb6c2897bb | ||
|
|
51f46b8034 | ||
|
|
283c340f16 | ||
|
|
12bf4db1b6 | ||
|
|
0b52921181 | ||
|
|
563414226a | ||
|
|
37f3ee0378 | ||
|
|
11d2588395 | ||
|
|
c43f970720 | ||
|
|
00a6428b9f | ||
|
|
7e69d7d9d0 | ||
|
|
4c98442fed | ||
|
|
6b68237f41 | ||
|
|
7836db8327 | ||
|
|
43a7a37ee6 | ||
|
|
b303485a87 | ||
|
|
b44fe5a086 | ||
|
|
34de7420e2 | ||
|
|
18568d40c6 | ||
|
|
45f5ae870b | ||
|
|
9d9462685b | ||
|
|
3a2a186e42 | ||
|
|
fb3def071f | ||
|
|
3a1a05636b | ||
|
|
7ec9e64dc0 | ||
|
|
034542f5e2 | ||
|
|
7ce651cad0 | ||
|
|
d24c973fff | ||
|
|
a638f96455 | ||
|
|
f4fb4e7d2c | ||
|
|
5aed82f366 | ||
|
|
282adab337 | ||
|
|
788f86f83e | ||
|
|
803fa2a4e9 | ||
|
|
63101c965f | ||
|
|
d6812f0cbe | ||
|
|
4e4481cf96 | ||
|
|
4696275047 | ||
|
|
ee416e344d | ||
|
|
f4927f67d3 | ||
|
|
f1b15733f1 | ||
|
|
4be8911f55 | ||
|
|
a5934a5555 | ||
|
|
8a632e7519 | ||
|
|
11b362a513 | ||
|
|
bdfade96a7 | ||
|
|
5b38c79318 | ||
|
|
291b1a0752 | ||
|
|
93ba5d7397 | ||
|
|
4cde746a74 | ||
|
|
f2189e29ce | ||
|
|
7fd668bdf9 | ||
|
|
d70df6fb6d | ||
|
|
3b792d2431 | ||
|
|
c450c6133c | ||
|
|
7d38418a66 | ||
|
|
5b9bcd63ce | ||
|
|
f38bcb9ea0 | ||
|
|
84bf487169 | ||
|
|
83fd78e322 | ||
|
|
0de9f239c8 | ||
|
|
28c0877dc9 | ||
|
|
5cf59ea97c | ||
|
|
89b82d3c9b | ||
|
|
65ebe938de | ||
|
|
015736486c | ||
|
|
374ef68028 | ||
|
|
f119189fe1 | ||
|
|
14f8a0bf29 | ||
|
|
f29be8cc75 | ||
|
|
9176e0caa2 | ||
|
|
bf1e4ec2e7 | ||
|
|
63cfcb1b1d | ||
|
|
1ade3d4392 | ||
|
|
01e447ac60 | ||
|
|
687564cb6f | ||
|
|
b06b2b8643 | ||
|
|
a5d5586dc3 | ||
|
|
aa2d5029be | ||
|
|
bde7039d25 | ||
|
|
55618fe5c3 | ||
|
|
b23c062e07 | ||
|
|
3b887d7a15 | ||
|
|
2532ab6764 | ||
|
|
a89f24d2f1 | ||
|
|
0666d4677e | ||
|
|
5e06f5cf94 | ||
|
|
379031379e | ||
|
|
802e1780b1 | ||
|
|
dedb82bb86 | ||
|
|
69c52921c4 | ||
|
|
faba19e94c | ||
|
|
aa666f0738 | ||
|
|
84cba42d86 | ||
|
|
54b7bf7a63 | ||
|
|
e5d5d0aa06 | ||
|
|
e7ffec8c03 | ||
|
|
296ba343c4 | ||
|
|
32c3bf2abd | ||
|
|
f5ee7f5df1 | ||
|
|
45b8794bf6 | ||
|
|
870d3e3445 | ||
|
|
460d8718c9 | ||
|
|
f49fb43ec3 | ||
|
|
b071189c65 | ||
|
|
c860bc1959 | ||
|
|
6c2e500135 | ||
|
|
6a055c620b | ||
|
|
4fdcfd7f05 | ||
|
|
c037064f57 | ||
|
|
c092951052 | ||
|
|
ccba528cbf | ||
|
|
950f862f2c | ||
|
|
c124c3826f | ||
|
|
5abaf7fbb3 | ||
|
|
4c9eecd0af | ||
|
|
bc52244c0b | ||
|
|
4487b6bc4f | ||
|
|
dc9f1435e3 | ||
|
|
98e5670011 | ||
|
|
c65d4ed648 | ||
|
|
36c89648b8 | ||
|
|
afc7d677e5 | ||
|
|
6fa3f9862e | ||
|
|
bdf3ad1958 | ||
|
|
1595370be0 | ||
|
|
b5e4add855 | ||
|
|
c26c5aaed2 | ||
|
|
720799633b | ||
|
|
5c662ed7ae | ||
|
|
9f006ad42e | ||
|
|
58febaeb9f | ||
|
|
636b58c39a | ||
|
|
bbfe558353 | ||
|
|
2408353194 | ||
|
|
e645a98a5e | ||
|
|
38d6dbbd3d | ||
|
|
69fbefdb73 | ||
|
|
0b3590278c | ||
|
|
de39b2fbed | ||
|
|
69a8d4b576 | ||
|
|
a737020492 | ||
|
|
4d30880d0f |
246 changed files with 11143 additions and 12579 deletions
13
.babelrc
13
.babelrc
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"ios": "10.3",
|
||||
"chrome": "60"
|
||||
},
|
||||
"useBuiltIns": "usage",
|
||||
"corejs": 3
|
||||
}]
|
||||
],
|
||||
"plugins": ["@babel/plugin-proposal-object-rest-spread"]
|
||||
}
|
||||
3
.dockerignore
Normal file
3
.dockerignore
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
node_modules
|
||||
app
|
||||
sessions
|
||||
|
|
@ -1,25 +1,18 @@
|
|||
{
|
||||
"parser": "@babel/eslint-parser",
|
||||
"env": {
|
||||
"es6": true,
|
||||
"es2021": true,
|
||||
"browser": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"experimentalObjectRestSpread": true
|
||||
}
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"no-prototype-builtins": "off",
|
||||
"no-console": "off",
|
||||
"no-undef": "off",
|
||||
"no-cond-assign": "off",
|
||||
"no-useless-escape": "off",
|
||||
"no-self-assign": "off",
|
||||
"no-fallthrough": "off",
|
||||
"no-empty": [
|
||||
"error",
|
||||
{
|
||||
|
|
@ -60,8 +53,5 @@
|
|||
"error",
|
||||
"never"
|
||||
]
|
||||
},
|
||||
"globals": {
|
||||
"module": true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
24
.forgejo/workflows/build.yml
Normal file
24
.forgejo/workflows/build.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
name: Build
|
||||
on: [workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
Deploy:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: ghcr.io/catthehacker/ubuntu:act-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: 'true'
|
||||
|
||||
- name: Docker Login
|
||||
run: |
|
||||
docker login -u riksolo -p ${{secrets.CONTAINER_REGISTRY_TOKEN}} git.riksolo.com
|
||||
|
||||
- name: Build and push
|
||||
run: |
|
||||
docker build -t git.riksolo.com/riksolo/open-stage-control:latest -t git.riksolo.com/riksolo/open-stage-control:${{github.sha}} .
|
||||
docker push git.riksolo.com/riksolo/open-stage-control:latest
|
||||
docker push git.riksolo.com/riksolo/open-stage-control:${{github.sha}}
|
||||
3
.github/FUNDING.yml
vendored
3
.github/FUNDING.yml
vendored
|
|
@ -1,3 +0,0 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
patreon: openstagecontrol
|
||||
23
.github/ISSUE_TEMPLATE/bug.md
vendored
23
.github/ISSUE_TEMPLATE/bug.md
vendored
|
|
@ -1,23 +0,0 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Report a bug in Open Stage Control
|
||||
title: '[Bug]'
|
||||
---
|
||||
|
||||
<!--
|
||||
|
||||
/!\ Don't forget to add a title /!\
|
||||
|
||||
Please provide as much contextual informations as possible:
|
||||
|
||||
- Open Stage Control version (or commit if built from sources)
|
||||
- Operating system
|
||||
- Open Stage Control options
|
||||
- Client type (built-in or external browser) and version
|
||||
- Session file (can be uploaded after adding the .txt extension)
|
||||
- Custom module
|
||||
- Server logs (from the terminal or the launcher's console)
|
||||
- Client logs (hit F12 in chromium/chrome to open the console)
|
||||
- Screenshot
|
||||
|
||||
-->
|
||||
5
.github/ISSUE_TEMPLATE/feature.md
vendored
5
.github/ISSUE_TEMPLATE/feature.md
vendored
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for Open Stage Control
|
||||
title: '[Feature] '
|
||||
---
|
||||
5
.github/SUPPORT.md
vendored
5
.github/SUPPORT.md
vendored
|
|
@ -1,5 +0,0 @@
|
|||
## How do I get help ?
|
||||
|
||||
- If you found a bug, open a bug report
|
||||
- If you have a suggestion, open a feature request
|
||||
- If you have a question or want to share your experience with other users, please use the dedicated forum at https://openstagecontrol.discourse.group/
|
||||
31
.gitignore
vendored
31
.gitignore
vendored
|
|
@ -1,14 +1,17 @@
|
|||
node_modules
|
||||
dist
|
||||
app/LICENSE
|
||||
app/assets/fonts/*
|
||||
app/assets/*.css*
|
||||
app/assets/*.png
|
||||
app/client/*.js*
|
||||
app/launcher/*.js*
|
||||
app/server/*
|
||||
app/docs/*
|
||||
!app/docs/.htaccess
|
||||
!app/server/.keep
|
||||
app/package.json
|
||||
*.pyc
|
||||
# npmg
|
||||
node_modules/
|
||||
|
||||
# build
|
||||
/app/
|
||||
|
||||
# python/midi build
|
||||
src/server/python/*
|
||||
!src/server/python/*.py
|
||||
|
||||
# docs build
|
||||
src/docs/widgets-reference.js
|
||||
properties-reference.md
|
||||
|
||||
# packaging
|
||||
dist/
|
||||
sessions/
|
||||
56
.travis.yml
56
.travis.yml
|
|
@ -1,56 +0,0 @@
|
|||
anHsudo: required
|
||||
language: node_js
|
||||
dist: focal
|
||||
node_js:
|
||||
- "16"
|
||||
before_install:
|
||||
- sudo dpkg --add-architecture i386
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq wine fakeroot xvfb python3.10 python3-pip python3-setuptools rpm
|
||||
- python3 -m pip install mkdocs
|
||||
- python3 -m pip install mkdocs-material
|
||||
install: npm install
|
||||
before_deploy:
|
||||
deploy:
|
||||
provider: releases
|
||||
api-key: $API_KEY
|
||||
file_glob: true
|
||||
file: dist/packages/*
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
before_deploy:
|
||||
- yes | gem update --system --force
|
||||
- gem install bundler
|
||||
- gem install faraday-net_http -v '3.3.0'
|
||||
- gem install uri
|
||||
- gem install logger
|
||||
- export VERSION=$(sed -nE 's/^\s*"version":\ "(.*?)",$/\1/p' package.json)
|
||||
- npm run build-docs
|
||||
- npm run package -- --all
|
||||
- npm run package-node
|
||||
- cd $TRAVIS_BUILD_DIR/dist/open-stage-control-linux-x64/resources/app/server/
|
||||
- wget https://github.com/jean-emmanuel/open-stage-control-midi/releases/latest/download/osc-midi-linux && chmod +x osc-midi-linux && echo "true" > osc-midi.json
|
||||
- cd $TRAVIS_BUILD_DIR/dist/open-stage-control-win32-x64/resources/app/server/
|
||||
- wget https://github.com/jean-emmanuel/open-stage-control-midi/releases/latest/download/osc-midi-windows.exe && chmod +x osc-midi-windows.exe && echo "true" > osc-midi.json
|
||||
- cd $TRAVIS_BUILD_DIR/dist/open-stage-control-darwin-x64/open-stage-control.app/Contents/Resources/app/server
|
||||
- wget https://github.com/jean-emmanuel/open-stage-control-midi/releases/latest/download/osc-midi-osx && chmod +x osc-midi-osx && echo "true" > osc-midi.json
|
||||
# - cd $TRAVIS_BUILD_DIR/dist/open-stage-control-darwin-arm64/open-stage-control.app/Contents/Resources/app/server
|
||||
# - wget https://github.com/jean-emmanuel/open-stage-control-midi/releases/latest/download/osc-midi-osx && chmod +x osc-midi-osx && echo "true" > osc-midi.json
|
||||
- cd $TRAVIS_BUILD_DIR
|
||||
- mkdir dist/packages
|
||||
- npm run deb64
|
||||
- mv dist/open-stage-control-linux-x64/*.deb dist/packages/
|
||||
- npm run rpm64
|
||||
- cd dist
|
||||
- mv open-stage-control-node open-stage-control_${VERSION}_node
|
||||
- mv open-stage-control-win32-x64 open-stage-control_${VERSION}_win32-x64
|
||||
- mv open-stage-control-linux-x64/*.rpm packages/
|
||||
- mv open-stage-control-linux-x64 open-stage-control_${VERSION}_linux-x64
|
||||
- zip -q -r --symlinks packages/open-stage-control_${VERSION}_osx-x64.zip open-stage-control-darwin-x64/open-stage-control.app
|
||||
# - zip -q -r --symlinks packages/open-stage-control_${VERSION}_osx-arm64.zip open-stage-control-darwin-arm64/open-stage-control.app
|
||||
- zip -q -r packages/open-stage-control_${VERSION}_node.zip open-stage-control_${VERSION}_node
|
||||
- zip -q -r packages/open-stage-control_${VERSION}_win32-x64.zip open-stage-control_${VERSION}_win32-x64
|
||||
- zip -q -r packages/open-stage-control_${VERSION}_linux-x64.zip open-stage-control_${VERSION}_linux-x64
|
||||
- ls packages
|
||||
- cd ..
|
||||
7
AI_POLICY.md
Normal file
7
AI_POLICY.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
Anything AI-related is strictly prohibited from this project.
|
||||
|
||||
If you think this project could benefit from a smart use of AI, think harder.
|
||||
|
||||
Think harder about the (hundreds of) millions of data workers that make your AI "smart", not to mention the monumental ecological waste it represents.
|
||||
|
||||
If you still think this way, don't tell me.
|
||||
211
CHANGELOG.md
211
CHANGELOG.md
|
|
@ -1,10 +1,213 @@
|
|||
# Changelog
|
||||
|
||||
## 1.31.2
|
||||
|
||||
- bug fixes
|
||||
- editor: fix regression (1.30.0) causing errors when editing the value property
|
||||
|
||||
- widgets
|
||||
- canvas: allow `onResize` to send and trigger widget synchronization and scripts
|
||||
|
||||
## 1.31.1
|
||||
|
||||
- bug fixes
|
||||
- clone: regression causing error when some widgets have a non-string id
|
||||
|
||||
## 1.31.0
|
||||
|
||||
- widgets
|
||||
- clone, fragment: add `scoped` property. This allows making the widget self-contained (independent from its original) by prefixing all widget ids automatically (and transparently resolving unprefixed ids in advanced syntaxes and scripts within the scope)
|
||||
|
||||
- bug fixes
|
||||
- midi: unrecognized `no_auto_note_off` option
|
||||
- MacOs: the app now quits when all windows are closed
|
||||
- launcher: if the Tray icon is enabled, closing the launcher window won't quit the app if the server is running
|
||||
- scrollbar widget: fix initial value in vertical mode
|
||||
- console: fix copying using CmdOrCtrl+C when the editor is enabled
|
||||
|
||||
- custom module
|
||||
- objects transmitted using `receive()` will be received as objects by the client app (instead of a json string)
|
||||
|
||||
## 1.30.4
|
||||
|
||||
- bug fixes
|
||||
- remote control: add support for icon transform suffixes
|
||||
- editor: fix moving/resing widgets inside folders when using percent units
|
||||
- clone: `@{parent.propertyName}` blocks in target widget now update when clone's parent property updates
|
||||
|
||||
- widgets
|
||||
- encoder: add `horizontal` mode
|
||||
- knob: add `encoder` design
|
||||
|
||||
## 1.30.3
|
||||
|
||||
- bug fixes
|
||||
- scrollbar: missing update upon target container resize
|
||||
- server: regression breaking reception of osc message over tcp
|
||||
|
||||
- widgets
|
||||
- file: remember last visited directy per widget if `directory` property is not set
|
||||
- knob: add `horizontal` mode
|
||||
- eq: filter responses are now only computed when needed; the widget's value is no longer exposed / sync'ed.
|
||||
- plot, eq: unclip line drawing on y-axis
|
||||
|
||||
- scripting
|
||||
- add `uploadFile` function for reading client-side files
|
||||
- add `scrollIntoView` function
|
||||
|
||||
## 1.30.2
|
||||
|
||||
- bug fixes
|
||||
- when using objects in properties, numbers-as-strings and booleans-as-strings values are now preserved instead of being converted to their litteral counterparts
|
||||
- rgb: fix rendering issue
|
||||
- patchbay: interaction and rendering issues
|
||||
- `event.preventDefault` in `onTouch` now affect modal buttons
|
||||
- menu: use click event instead of tap in `toggle` and `doubleTap-toggle` modes
|
||||
- button: missing `move` events in `onTouch`
|
||||
- error when logging `event` object in `onTouch`
|
||||
|
||||
- widgets
|
||||
- modal/button/file: add `click` property
|
||||
|
||||
- editor
|
||||
- preserve code editor undo history between consecutive edits of a same widget's property
|
||||
- preserve fullscreen code editor focus when saving / submitting
|
||||
|
||||
- client
|
||||
- add `noWarning` client option
|
||||
|
||||
## 1.30.1
|
||||
|
||||
- bug fixes
|
||||
- regression breaking user asset loading from a root directory named "assets"
|
||||
- regression breaking custom module's `nativeRequire()` for locally installed modules
|
||||
|
||||
## 1.30.0
|
||||
|
||||
- bug fixes
|
||||
- server: fix resolving absolute file urls containing the remote-root path
|
||||
- prevent editor zoom level from affecting drag events when the editor is disabled
|
||||
- prevent changing editor zoom level when it's disabled
|
||||
- fader: fix touchZone == knob for compact design
|
||||
- separator labels missing in inspector
|
||||
- make the client app more robust to restrictive browser settings (cookie must still be enabled for the app to fully work)
|
||||
|
||||
- widgets
|
||||
- the html property is no longer restricted / sanitized
|
||||
- input/textarea/select no longer have their appearance property reset in custom html
|
||||
- canvas: added `contextType` property
|
||||
- file: honor server's `remote-root` option (remove root path from displayed path and returned value)
|
||||
- menu: changed default `layout` to `vertical`
|
||||
- root/panel/modal/tab: support setting `scroll` to `hidden` (hides scrollbars and allows scrolling)
|
||||
- add new `scrollbar` widget that connects to a scrolling container widget and acts as it scrollbar
|
||||
- input: add `noCanvas` option to avoid blurry text under some circumstances
|
||||
- xy: add `clipX` and `clipY` proprties (allows multixy to set per-pads anges limits)
|
||||
- button: add `onTouch` script
|
||||
- switch: make `values` property dynamic
|
||||
|
||||
- editor
|
||||
- selecting a widget automatically shows it in the widget tree if it's not minimized
|
||||
- submitting an unchanged value for the `value` property will now affect the value state of the widget even if the property content itself did not change
|
||||
|
||||
- scripting
|
||||
- user scripts are longer protected against infinite loop and the main window object may be reached (it's not supported to break out of scripting context, but resources are no longer wasted to prevent it)
|
||||
- `toolbar()` can now target menu actions by id instead of index
|
||||
- `getToolbar()` function added (returns the state of a menu entry toggle)
|
||||
- calling `setFocus()` without argument now unfocuses current active element
|
||||
|
||||
- midi
|
||||
- add `no_auto_note_off` option
|
||||
- add `Restart backend` action to the launcher's menu
|
||||
- add `restartMidiBackend()` function to custom module context
|
||||
|
||||
- breaking change
|
||||
- dropped support for iOS 10.3
|
||||
- minimum chromium version requirement raised to 70
|
||||
- macOS 11 (Big Sur) or above is now required (the node package will work on older system)
|
||||
- scrollbars are no longer emulated on iOS
|
||||
- scrollbar styling is now done using only the standard css scrollbar-* properties) to be more in line with system scrollbars in general
|
||||
- panels no longer use their value to set/get their scrolling state, nor do they sync scrolling automatically. Instead there's now a dedicated scrollbar widget that can be used for this.
|
||||
|
||||
- misc
|
||||
- now using electron v36.9.5
|
||||
|
||||
## 1.29.9
|
||||
|
||||
- build
|
||||
- fix building from sources now that open stage control is not hosted on github
|
||||
|
||||
- scripting
|
||||
- user scripts are longer protected against infinite loop
|
||||
|
||||
## 1.29.8
|
||||
|
||||
- bug fixes
|
||||
- firefox: `onTouch` error when the cursor goes outside the page
|
||||
- dropdown: label not initialized until a value is set
|
||||
- editor: regression (1.29.0) preventing color changes made with the color to be undoable unless validaed with the enter key
|
||||
- editor: color picker interaction issue in near #000000
|
||||
- rgb: incoming values were not queued when during user interaction
|
||||
|
||||
- client
|
||||
- add `title` client option
|
||||
|
||||
## 1.29.7
|
||||
|
||||
- launcher
|
||||
- add tray icon and menu (landed in 1.29.6 accidentally), disabled by default (can be enabled from the launcher's menu)
|
||||
|
||||
|
||||
## 1.29.6
|
||||
|
||||
- bug fixes
|
||||
- matrix: prevent error when `quantity` is invalid
|
||||
- multixy/xy: send value when setting `spring` to `true` (only if current value is different than spring value)
|
||||
- switch/menu/fader: more consistent rendering when `borderRadius` is set
|
||||
|
||||
- widgets
|
||||
- multixy/xy: add `stepsX` and `stepsY` properties
|
||||
|
||||
- misc
|
||||
- native silicon buids (osx-arm64)
|
||||
|
||||
## 1.29.5
|
||||
|
||||
- bug fixes
|
||||
- keyboard: regression (1.27.5) breaking `velocity` property
|
||||
- editor: retain scroll position in code editors
|
||||
- cli: regression (1.28) preventing from setting options from a terminal on windows
|
||||
|
||||
|
||||
## 1.29.4
|
||||
|
||||
- bug fixes
|
||||
- regression (1.29.3) breaking some widget recreation routines
|
||||
|
||||
## 1.29.3
|
||||
|
||||
- widgets
|
||||
- frame: add `allow` property
|
||||
- matrix: make `quantity` a dynamic property to avoid losing widget state when it changes
|
||||
- patchbay: missing `preArgs` implementation
|
||||
|
||||
## 1.29.1 / 1.29.2
|
||||
|
||||
- bug fixes
|
||||
- scripting: `setFocus` not working on iOS
|
||||
- fader/range: drawing error with `pips` enabled
|
||||
|
||||
## 1.29.0
|
||||
|
||||
- bug fixes
|
||||
- file browser: drive listing failing on recent windows
|
||||
- root: `hideMenu` not working when `--read-only` is set
|
||||
- combining `--read-only` and `--fullscreen` now disables `F11` on built-in client
|
||||
- regression breaking `pips` for range widget
|
||||
|
||||
- widgets
|
||||
- add `onTouch` to all container widgets
|
||||
- allow starting a traversing gesture outside a touchable widget
|
||||
- fader: make `knobSize` dynamic
|
||||
|
||||
## 1.28.5
|
||||
|
||||
|
|
@ -856,7 +1059,7 @@
|
|||
|
||||
- advanced syntaxes
|
||||
- new syntax for creating and using custom variables in properties: `VAR{name, default}`
|
||||
- `JS{}` blocks don't require 2 brackets anymore (`JS{{}}` still works)
|
||||
- `JS{}` blocks don't require 2 brackets anymore (`JS\{\{}}` still works)
|
||||
|
||||
- scripting
|
||||
- add `getVar()` and `setVar()` for reading and modifying custom variables. This allows modifying properties directly from scripts (if they contain `VAR{}` blocks).
|
||||
|
|
@ -927,7 +1130,7 @@
|
|||
- add option for receiving note off with velocity
|
||||
|
||||
- misc
|
||||
- v0->v1 session conversion: remove `JS{{}}` in script property
|
||||
- v0->v1 session conversion: remove `JS\{\{}}` in script property
|
||||
|
||||
## 1.9.0
|
||||
|
||||
|
|
@ -1529,14 +1732,14 @@ As of this version, packages except the `node` package are bundled with a midi b
|
|||
|
||||
- scripting (general)
|
||||
- removed MathJS language
|
||||
- reuse #{} syntax as as shorthand for JS{{}} (one liner, implicit return)
|
||||
- reuse #{} syntax as as shorthand for JS\{\{}} (one liner, implicit return)
|
||||
- added `locals` variable, a variable store scoped to the widget
|
||||
- renamed `global` to `globals`
|
||||
- expose environment variables in `globals`: `url`, `env` (query parameters), `platform`, `screen` (width/height)
|
||||
|
||||
- script widget
|
||||
- always hidden except in project tree
|
||||
- `script` property must not be wrapped in a JS{{}} block anymore
|
||||
- `script` property must not be wrapped in a JS\{\{}} block anymore
|
||||
- added `stateGet` and `stateSet` functions
|
||||
- added `storage` object, proxy to the document's localStorage object (allows storing data that persist after refresh/close (cleared with the browser's cache)
|
||||
- added `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` function proxies with an extra `id` argument (they clear automatically when called multiple times and upon widget removal. `id` is scoped to the widget)
|
||||
|
|
|
|||
29
Dockerfile
Normal file
29
Dockerfile
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
FROM node:24-alpine
|
||||
|
||||
RUN apk --no-cache add git
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
RUN mkdir /sessions
|
||||
RUN touch /sessions/session.json
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENV ELECTRON_RUN_AS_NODE=1
|
||||
|
||||
ENV SEND="127.0.0.1:8080"
|
||||
ENV LOAD="/sessions/main.json"
|
||||
ENV PORT=8080
|
||||
ENV OSC_PORT=8080
|
||||
ENV READ_ONLY=false
|
||||
|
||||
RUN chmod +x entrypoint.sh
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
10
README.md
10
README.md
|
|
@ -11,5 +11,11 @@ Open Stage Control
|
|||
|
||||
----
|
||||
|
||||
Copyleft © Jean-Emmanuel Doucet @ [AMMD](http://ammd.net) 2014-2022.
|
||||
This program is a free software released under the [GNU/GPL3](ttps://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license.
|
||||
Docker additions by Rik Berkelder.
|
||||
|
||||
mount `/sessions` directory. default session file is created and loaded there.
|
||||
|
||||
---
|
||||
|
||||
Copyleft © Jean-Emmanuel Doucet 2014-2025.
|
||||
This program is a free software released under the [GNU/GPL3](https://framagit.org/jean-emmanuel/open-stage-control/-/blob/master/LICENSE) license.
|
||||
|
|
|
|||
2
app/assets/themes/.gitignore
vendored
2
app/assets/themes/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
||||
2
app/client/.gitignore
vendored
2
app/client/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
||||
|
|
@ -1 +0,0 @@
|
|||
ErrorDocument 404 /404.html
|
||||
|
|
@ -1 +0,0 @@
|
|||
require('./server/open-stage-control-server')
|
||||
2
app/launcher/.gitignore
vendored
2
app/launcher/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
||||
49
basesession.json
Normal file
49
basesession.json
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"createdWith": "Open Stage Control",
|
||||
"version": "1.31.2",
|
||||
"type": "session",
|
||||
"content": {
|
||||
"type": "root",
|
||||
"lock": false,
|
||||
"id": "root",
|
||||
"visible": true,
|
||||
"interaction": true,
|
||||
"comments": "",
|
||||
"width": "auto",
|
||||
"height": "auto",
|
||||
"colorText": "auto",
|
||||
"colorWidget": "auto",
|
||||
"alphaFillOn": "auto",
|
||||
"borderRadius": "auto",
|
||||
"padding": "auto",
|
||||
"html": "",
|
||||
"css": "",
|
||||
"colorBg": "auto",
|
||||
"layout": "default",
|
||||
"justify": "start",
|
||||
"gridTemplate": "",
|
||||
"contain": true,
|
||||
"scroll": true,
|
||||
"innerPadding": true,
|
||||
"tabsPosition": "top",
|
||||
"hideMenu": false,
|
||||
"variables": "@{parent.variables}",
|
||||
"traversing": false,
|
||||
"value": "",
|
||||
"default": "",
|
||||
"linkId": "",
|
||||
"address": "auto",
|
||||
"preArgs": "",
|
||||
"typeTags": "",
|
||||
"decimals": 2,
|
||||
"target": "",
|
||||
"ignoreDefaults": false,
|
||||
"bypass": false,
|
||||
"onCreate": "",
|
||||
"onValue": "",
|
||||
"onTouch": "",
|
||||
"onPreload": "",
|
||||
"widgets": [],
|
||||
"tabs": []
|
||||
}
|
||||
}
|
||||
8
docker-compose.yml
Normal file
8
docker-compose.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
services:
|
||||
app:
|
||||
build: .
|
||||
volumes:
|
||||
- ./sessions:/sessions
|
||||
ports:
|
||||
- 8080:8080
|
||||
|
||||
10
entrypoint.sh
Normal file
10
entrypoint.sh
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
test -f "$LOAD" || cp "basesession.json" "$LOAD"
|
||||
|
||||
exec node app/index.js \
|
||||
--port $PORT \
|
||||
--osc-port $OSC_PORT \
|
||||
--send $SEND \
|
||||
--load $LOAD \
|
||||
--read-only=$READ_ONLY
|
||||
12014
package-lock.json
generated
12014
package-lock.json
generated
File diff suppressed because it is too large
Load diff
71
package.json
71
package.json
|
|
@ -2,7 +2,7 @@
|
|||
"name": "open-stage-control",
|
||||
"productName": "Open Stage Control",
|
||||
"description": "Libre and modular OSC / MIDI controller",
|
||||
"version": "1.28.5",
|
||||
"version": "1.31.2",
|
||||
"author": {
|
||||
"name": "Jean-Emmanuel Doucet",
|
||||
"email": "jean-emmanuel@ammd.net"
|
||||
|
|
@ -15,58 +15,58 @@
|
|||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jean-emmanuel/open-stage-control"
|
||||
"url": "https://framagit.org/jean-emmanuel/open-stage-control"
|
||||
},
|
||||
"homepage": "http://openstagecontrol.ammd.net/",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@babel/core": "7.18.0",
|
||||
"@babel/eslint-parser": "7.17.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.18.0",
|
||||
"@babel/polyfill": "7.12.1",
|
||||
"@babel/preset-env": "7.18.0",
|
||||
"@electron/remote": "2.0.8",
|
||||
"@electron/packager": "18.4.4",
|
||||
"@electron/remote": "2.1.3",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@rollup/plugin-commonjs": "^28.0.6",
|
||||
"@rollup/plugin-json": "^6.1.0",
|
||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
||||
"@rollup/plugin-terser": "^0.4.4",
|
||||
"ace-builds": "1.39.0",
|
||||
"ansi-html": "0.0.9",
|
||||
"babelify": "10.0.0",
|
||||
"balanced-match": "2.0.0",
|
||||
"bonjour": "github:jean-emmanuel/bonjour",
|
||||
"browserify": "17.0.0",
|
||||
"bonjour": "git+https://framagit.org/jean-emmanuel/bonjour.git",
|
||||
"chokidar": "3.5.3",
|
||||
"chroma-js": "2.4.2",
|
||||
"core-js": "3.22.5",
|
||||
"cpr": "3.0.1",
|
||||
"deep-extend": "0.6.0",
|
||||
"electron-localshortcut": "3.2.1",
|
||||
"electron-packager": "15.2.0",
|
||||
"electron-packager-plugin-non-proprietary-codecs-ffmpeg": "1.0.2",
|
||||
"env-paths": "2.2.1",
|
||||
"eslint": "8.16.0",
|
||||
"exorcist": "2.0.0",
|
||||
"fastdom": "1.0.10",
|
||||
"file-saver": "2.0.5",
|
||||
"gyronorm": "2.0.6",
|
||||
"http-auth": "4.1.9",
|
||||
"json5": "2.2.1",
|
||||
"jsondiffpatch": "0.4.1",
|
||||
"keyboardjs": "2.6.4",
|
||||
"licensify": "3.1.3",
|
||||
"loop-protect": "github:jean-emmanuel/loop-protect#v1.0.1",
|
||||
"minimatch": "5.1.0",
|
||||
"nanohtml": "1.10.0",
|
||||
"nanoid": "3.3.4",
|
||||
"nanomorph": "5.4.3",
|
||||
"node-forge": "1.3.1",
|
||||
"node-mouse": "0.0.2",
|
||||
"node-sass": "9.0.0",
|
||||
"nodemon": "2.0.16",
|
||||
"nosleep.js": "0.12.0",
|
||||
"open": "8.4.0",
|
||||
"osc": "github:jean-emmanuel/osc.js",
|
||||
"osc": "2.4.5",
|
||||
"python-shell": "3.0.1",
|
||||
"qrcode": "1.5.1",
|
||||
"replacestream": "4.0.3",
|
||||
"sanitize-html": "1.27.5",
|
||||
"rollup": "4.50.1",
|
||||
"rollup-plugin-copy": "3.5.0",
|
||||
"rollup-plugin-license": "^3.6.0",
|
||||
"rollup-plugin-node-externals": "^8.1.1",
|
||||
"sass": "1.89.2",
|
||||
"scope-css": "1.2.1",
|
||||
"screenfull": "5.2.0",
|
||||
"semver": "7.3.7",
|
||||
|
|
@ -74,42 +74,37 @@
|
|||
"sortablejs": "1.15.0",
|
||||
"source-map-support": "0.5.21",
|
||||
"stacktrace-js": "2.0.2",
|
||||
"through": "2.3.8",
|
||||
"uglifyify": "5.0.2",
|
||||
"webworkify": "1.5.0",
|
||||
"ua-parser-js": "2.0.7",
|
||||
"ws": "8.6.0",
|
||||
"yargs": "17.5.1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"electron": "15.1.0",
|
||||
"electron": "36.9.5",
|
||||
"electron-installer-debian": "3.1.0",
|
||||
"electron-installer-redhat": "3.4.0"
|
||||
"electron-installer-redhat": "git+https://framagit.org/jean-emmanuel/electron-installer-redhat.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "echo '\\033[36m=> Dependencies installed successfully. Run \"npm run build\" to build the assets.\\033[0m\n'",
|
||||
"start": "electron app/",
|
||||
"build": "npm run build-css && npm run build-js && node scripts/copy-assets.js && echo '\\033[36m=> JS and CSS assets built successfully. Run \"npm run package\" to build an executable or \"npm start\" to run the app.\\033[0m\n'",
|
||||
"build": "npm run build-css && npm run build-js && echo '\\033[36m=> JS and CSS assets built successfully. Run \"npm run package\" to build an executable or \"npm start\" to run the app.\\033[0m\n'",
|
||||
"package": "node scripts/package.js",
|
||||
"package-node": "node scripts/package-node.js",
|
||||
"deb64": "electron-installer-debian --src dist/open-stage-control-linux-x64/ --arch amd64 --dest dist/open-stage-control-linux-x64/ --icon resources/images/logo.png",
|
||||
"rpm64": "electron-installer-redhat --src dist/open-stage-control-linux-x64/ --arch x86_64 --dest dist/open-stage-control-linux-x64/ --icon resources/images/logo.png",
|
||||
"deb64": "electron-installer-debian --src dist/open-stage-control-linux-x64/ --arch amd64 --dest dist/ --icon resources/images/logo.png",
|
||||
"rpm64": "electron-installer-redhat --src dist/open-stage-control-linux-x64/ --arch x86_64 --dest dist/ --icon resources/images/logo.png",
|
||||
"build-css": "node scripts/build-css.js",
|
||||
"build-js": "npm run build-launcher-js && npm run build-client-js && npm run build-server-js",
|
||||
"build-client-js": "node scripts/build-client.js",
|
||||
"build-launcher-js": "node scripts/build-launcher.js",
|
||||
"build-server-js": "node scripts/build-server.js",
|
||||
"watch-client": "npm run build-client-js -- --watch",
|
||||
"watch-browser": "npm run build-client-js -- --watch",
|
||||
"watch-css": "nodemon --watch src/scss -e scss -x \"npm run build-css -- --reload\"",
|
||||
"watch-server": "nodemon --watch src/server/ -e js -x \"npm run build-server-js\"",
|
||||
"watch-launcher": "nodemon --watch src/launcher/ -e js -x \"npm run build-launcher-js\"",
|
||||
"build-docs": "node scripts/build-widgets-reference.js > resources/docs/docs/widgets/properties-reference.md && cd resources && python3 -m mkdocs build",
|
||||
"test": "eslint src && npm run build && node tests/test.js"
|
||||
"build-js": "npm run build-launcher-js && npm run build-client-js && npm run build-server-js",
|
||||
"build-client-js": "rollup -c scripts/client.rollup.config.js",
|
||||
"watch-client": "npm run build-client-js -- --watch",
|
||||
"build-server-js": "rollup -c scripts/server.rollup.config.js",
|
||||
"watch-server": "npm run build-server-js -- --watch",
|
||||
"build-launcher-js": "rollup -c scripts/launcher.rollup.config.js",
|
||||
"watch-launcher": "npm run build-launcher-js -- --watch",
|
||||
"build-docs": "rollup -c scripts/docs.rollup.config.js && node src/docs/widgets-reference.js > resources/docs/docs/widgets/properties-reference.md && cd resources && python3 -m mkdocs build",
|
||||
"lint": "eslint src --ext mjs",
|
||||
"test": "npm run lint && npm run build"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16 <=20"
|
||||
},
|
||||
"devDependencies": {
|
||||
"watchify": "4.0.0"
|
||||
"node": ">=16"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ Client options can be set either with the server's `--client-options` option, or
|
|||
| altTraversing | 1 / 0 | 0 | set to 1 to enable an alternative traversing behavior for toggle buttons (traversing gestures on toggle buttons will change their values in only one way depending on the first touched button's state) |
|
||||
| virtualKeyboard | 1 / 0 | 0 | (desktop only) set to 1 to enable the virtual keyboard by default |
|
||||
| notifications | 1 / 0 | 1 | set to 0 to hide notifications by default |
|
||||
| title | string | '' | replace window title |
|
||||
| noWarning | 1 / 0 | 0 | set to 0 to disable unsaved session warnings |
|
||||
|
||||
Example:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
## License
|
||||
|
||||
Copyleft © Jean-Emmanuel Doucet @ [AMMD](http://ammd.net) 2014-2022.
|
||||
This program is a free software released under the [GNU/GPL3](https://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license.
|
||||
Copyleft © Jean-Emmanuel Doucet 2014-2025.
|
||||
This program is a free software released under the [GNU/GPL3](https://framagit.org/jean-emmanuel/open-stage-control/-/blob/master/LICENSE) license.
|
||||
|
||||
## Dependencies
|
||||
|
||||
Open Stage Control relies on several other free softwares:
|
||||
Open Stage Control relies on several other free softwares listed in [package.json](https://framagit.org/jean-emmanuel/open-stage-control/-/blob/master/package.json).
|
||||
|
||||
https://github.com/jean-emmanuel/open-stage-control/network/dependencies
|
||||
|
||||
The default theme is based on [Nord](https://www.nordtheme.com/), some UI components are inspired by the [Atom](https://atom.io/) text editor.
|
||||
The default theme was based on [Nord](https://www.nordtheme.com/), some UI components were inspired by the text editor formerly known as Atom (now [Pulsar](https://pulsar-edit.dev/)).
|
||||
|
||||
## Contributors
|
||||
|
||||
https://github.com/jean-emmanuel/open-stage-control/graphs/contributors
|
||||
[Jean-Emmanuel](https://framagit.org/jean-emmanuel), [MartinHN](https://github.com/MartinHN), [Eric Theise](https://github.com/erictheise), [danielappelt](https://github.com/erictheise), [ritschwumm](https://github.com/ritschwumm), [matthijskooijman](https://github.com/matthijskooijman), [WillyKaze](https://github.com/WillyKaze), [stefanboca](https://github.com/stefanboca), [pixelnerve](https://github.com/pixelnerve), [AdamAdamsMusic](https://github.com/AdamAdamsMusic), [wicast](https://github.com/wicast), [kdallafior](https://github.com/kdallafior), [brunetton](https://github.com/brunetton), [cyberic99](https://github.com/cyberic99), [kdejaeger](https://github.com/kdejaeger), [trebmuh](https://github.com/trebmuh), [MagnusReichel](https://github.com/MagnusReichel), [jpcima](https://github.com/jpcima), [t1st3](https://github.com/t1st3")
|
||||
|
||||
## Infrastructure supports
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ The module is executed in a restricted context, only a few globals are available
|
|||
----
|
||||
|
||||
#### `app`
|
||||
[`Event Emitter`](https://nodejs.org/api/events.html#events_class_eventemitter), useful for monitoring the events sent by the different clients. Event names can be found in [callbacks.js](https://github.com/jean-emmanuel/open-stage-control/blob/master/src/server/callbacks.js), callbacks are called with 2 arguments: `data` (object) and `client` (object: `{address, id}`)
|
||||
[`Event Emitter`](https://nodejs.org/api/events.html#events_class_eventemitter), useful for monitoring the events sent by the different clients. Event names can be found in [callbacks.js](https://framagit.org/jean-emmanuel/open-stage-control/-/blob/master/src/server/node/ipc/callbacks.mjs), callbacks are called with 2 arguments: `data` (object) and `client` (object: `{address, id}`)
|
||||
|
||||
----
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ This function can be used to load native node modules or locally installed modul
|
|||
|
||||
#### `tcpServer`
|
||||
|
||||
Raw access to the server's [TCP backend](https://github.com/jean-emmanuel/open-stage-control/blob/master/src/server/osc/tcp.js). Can be used to monitor the state of TCP connections:
|
||||
Raw access to the server's [TCP backend](https://framagit.org/jean-emmanuel/open-stage-control/-/blob/master/src/server/node/osc/tcp.mjs). Can be used to monitor the state of TCP connections:
|
||||
|
||||
```js
|
||||
for (var ip in tcpServer.clients) {
|
||||
|
|
@ -167,6 +167,10 @@ for (var ip in tcpServer.clients) {
|
|||
```
|
||||
|
||||
|
||||
#### `restartMidiBackend()`
|
||||
|
||||
This function can be used to restart the midi backend (if already running) without restarting the server
|
||||
|
||||
#### Other javascript globals
|
||||
|
||||
- `console`
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ The **server** can run on all [platforms supported by Electron](https://www.elec
|
|||
The **client** is compatible with the following browsers:
|
||||
|
||||
- Firefox: version `75` and higher
|
||||
- Chromium / Chrome: version `60` and higher
|
||||
- Chromium / Chrome: version `75` and higher
|
||||
|
||||
iOS devices must be of version `10.3` or higher.
|
||||
iOS devices must be of version `11` or higher.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
??? example "Linux 64bit"
|
||||
=== "Linux 64bit"
|
||||
|
||||
**Ubuntu / Debian**
|
||||
|
||||
|
|
@ -41,19 +41,28 @@ iOS devices must be of version `10.3` or higher.
|
|||
- Extract it in the location of your choice
|
||||
- The file inside it named `open-stage-control` is the app's main executable
|
||||
|
||||
??? example "Mac 64bit"
|
||||
=== "Mac 64bit"
|
||||
|
||||
- [Download](/download) `open-stage-control-VERSION-osx.zip`
|
||||
- [Download](/download) `open-stage-control-VERSION-osx-x64.zip`
|
||||
- Extract it in the location of your choice
|
||||
- Drag `open-stage-control.app` in your `Application` folder
|
||||
|
||||
??? example "Windows 64bit"
|
||||
|
||||
=== "Mac Silicon (arm)"
|
||||
|
||||
- [Download](/download) `open-stage-control-VERSION-osx-arm.zip`
|
||||
- Extract it in the location of your choice
|
||||
- Drag `open-stage-control.app` in your `Application` folder
|
||||
|
||||
See [https://disable-gatekeeper.github.io/](https://disable-gatekeeper.github.io/) to workaround the "damaged and can't be opened" error.
|
||||
|
||||
=== "Windows 64bit"
|
||||
|
||||
- [Download](/download) `open-stage-control-VERSION-win32-x64.zip`
|
||||
- Extract it in the location of your choice
|
||||
- The file inside it named `open-stage-control.exe` is the app's main executable
|
||||
|
||||
??? example "Other systems"
|
||||
=== "Other systems"
|
||||
|
||||
- Install [Node.js](https://nodejs.org/en/download/package-manager/)
|
||||
- Download `open-stage-control-VERSION-node.zip`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Running the app from the sources slightly differs from using prebuilt binaries:
|
|||
|
||||
## Requirements
|
||||
|
||||
- [Node.js](https://nodejs.org/en/#download) (v16)
|
||||
- [Node.js](https://nodejs.org/en/#download)
|
||||
- [git](https://git-scm.com/downloads)
|
||||
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ Running the app from the sources slightly differs from using prebuilt binaries:
|
|||
**Download**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/jean-emmanuel/open-stage-control
|
||||
git clone https://framagit.org/jean-emmanuel/open-stage-control.git
|
||||
cd open-stage-control/
|
||||
# uncomment next line if you want the latest release
|
||||
# instead of the current development version
|
||||
|
|
@ -87,8 +87,23 @@ This will build the app in `dist/open-stage-control-PLATFORM-ARCH`.
|
|||
Building the app for windows from a linux system requires wine to be installed.
|
||||
|
||||
|
||||
## Debian/Ubuntu installer
|
||||
## Debian / Ubuntu and RPM installers
|
||||
|
||||
```
|
||||
npm run deb64
|
||||
```
|
||||
=== "Debian / Ubuntu"
|
||||
|
||||
```
|
||||
npm run deb64
|
||||
```
|
||||
|
||||
=== "RPM"
|
||||
|
||||
```
|
||||
npm run rpm
|
||||
```
|
||||
|
||||
|
||||
## Build script on Mac Silicon
|
||||
|
||||
This user-contributed script can be used to build open stage control on recent Macs:
|
||||
|
||||
https://github.com/rewgs/osc-as
|
||||
|
|
|
|||
|
|
@ -94,7 +94,11 @@ Send program changes with a `-1` offset to match some software/hardware implemen
|
|||
|
||||
**`note_off_velocity`**
|
||||
|
||||
Enable receiving noteOff messages with a velocity and on a different address than noteOn messages.
|
||||
Use `/note_on` for noteOn messages and `/note_off` for noteOff messages instead of the defaut `/note` and velocity 0 for note off.
|
||||
|
||||
**`auto_note_off`**
|
||||
|
||||
Prevent converting outgoing noteOn messages with velocity 0 to noteOff messages.
|
||||
|
||||
|
||||
**`device_name:virtual`** (*Linux / Mac only*): creates a virtual midi device with one input port and one output port
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Remote control
|
||||
|
||||
When osc messages are received, the default behavior is to update the value of all widgets that match the address and preArgs. Additionally, Open Stage Control responds to some general osc commands.
|
||||
When osc messages are received, the default behavior is to update the value of all widgets that match the address and preArgs. Additionally, Open Stage Control clients respond to some general osc commands.
|
||||
|
||||
!!! note "Multi-client setup"
|
||||
These commands are interpreted by each client connected to the server so there might be more than one reply. Using a custom module is the only way to send a message to a single client.
|
||||
|
|
|
|||
|
|
@ -7,17 +7,22 @@
|
|||
- New window: open a new client window (hidden when stopped)
|
||||
- Load: load server configuration from file
|
||||
- Save / Save as: save server configuration to file
|
||||
- List MIDI devices: list available MIDI devices in the console
|
||||
- MIDI
|
||||
- List devices: list available MIDI devices in the console
|
||||
- Restart backend: restart midi backend without restarting the server
|
||||
- Console:
|
||||
- Clear: clear console
|
||||
- Autoscroll: enable/disable console autoscroll
|
||||
- Check for update at startup: enable/disable this feature
|
||||
- Autostart: start the server automatically when launcher is started
|
||||
- Always on top: pin the launcher window above other the windows
|
||||
- Launcher
|
||||
- Autostart: start the server automatically when launcher is started
|
||||
- Always on top: pin the launcher window above other the windows
|
||||
- Use tray: enable tray icon and menu
|
||||
- Start minimized: starts the launcher minimized (or hidden in tray)
|
||||
|
||||
The "play/stop" icon can be used to start and stop the server without opening the menu.
|
||||
|
||||
## 2. Configuration form
|
||||
## 2. Configuration form
|
||||
|
||||
Each server option is displayed here. When clicking on an option's label, a short help will be printed in the console. When an option is not correctly set, its label will turn to orange and an error message will be printed in the console.
|
||||
|
||||
|
|
@ -25,6 +30,10 @@ Each server option is displayed here. When clicking on an option's label, a shor
|
|||
|
||||
The console displays various information, runtime errors and server debug messages.
|
||||
|
||||
## Tray icon
|
||||
|
||||
If `Use tray` is set, the launcher comes with a system tray icon that keeps the launcher alive when closed if there is at least one client window opened or if the server is running. Its context menu can be used to toggle the launcher's visibility and access some of the launcher's menu actions.
|
||||
|
||||
## Keyboard shortcuts
|
||||
|
||||
=== "Linux"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
The canvas widget allows creating custom widgets with user-defined drawings and touch reactions.
|
||||
|
||||
It has two special properties, `touch` and `draw`, that work like the `script` property : they are used to defined scripts that will be executed when specific events occurs.
|
||||
It has dedicated scripting properties (`onTouch`, `onDraw` and `onResize`) that work like the `onValue` property : they are used to defined scripts that will be executed when specific events occurs.
|
||||
|
||||
This widget requires a good understanding of the javascript [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) and of the javascript programming language in general.
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ If this property is enabled, the widget will be redrawn at a fixed rate even if
|
|||
|
||||
This script is executed when the widget is touched, when it is released, and during the movement of the pointer while the widget is touched.
|
||||
|
||||
This script has access to the same variables and functions as the `script` property (except the event-specific ones), plus the following:
|
||||
This script has access to the same variables and functions as the `onValue` property (except the event-specific ones), plus the following:
|
||||
|
||||
- `value`: widget value
|
||||
- `width`: canvas width in pixels
|
||||
|
|
@ -42,6 +42,7 @@ This script has access to the same variables and functions as the `script` prope
|
|||
- `targetTagName`: tag name of the html element under the pointer
|
||||
- `offsetX`, `offsetY`: touch coordinates in pixels, relative to the html element under the pointer
|
||||
- `movementX`, `movementY`: movement of the pointer in pixels since the last event
|
||||
- `pageX`, `pageY`: touch coordinates in pixels, relative to the page
|
||||
- `pointerId`: unique identifier used to differentiate fingers in multitouch situation
|
||||
- `altKey`, `ctrlKey`, `shiftKey`: keyboard modifier states
|
||||
- `force`: amount of pressure applied to the touch surface between `0` and `1` (see [Touch.force](https://developer.mozilla.org/en-US/docs/Web/API/Touch/force)). Equals `0` if the API is not supported or if no pressure information is found.
|
||||
|
|
@ -58,7 +59,7 @@ This script has access to the same variables and functions as the `script` prope
|
|||
|
||||
This script is executed when the widget should be redrawn, which is when it's touched and when it receives a value.
|
||||
|
||||
This script has access to the same variables and functions as the `script` property (except the event-specific ones), plus the following:
|
||||
This script has access to the same variables and functions as the `onValue` property (except the event-specific ones), plus the following:
|
||||
|
||||
- `value`: widget value
|
||||
- `width`: canvas width in pixels
|
||||
|
|
@ -66,11 +67,13 @@ This script has access to the same variables and functions as the `script` prope
|
|||
- `ctx`: [canvas rendering context](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) of the widget
|
||||
- `cssVars`: object containing the computed value of some of the widget's style properties such as `colorWidget`, `alphaFill`, `padding`, etc
|
||||
|
||||
In this script, all osc messages emissions are prevented and changing the value of a widget won't trigger widget synchronisation / scripts / advanced syntaxes updates.
|
||||
|
||||
### `onResize`
|
||||
|
||||
This script is executed when the widget has resized, before it is redrawn.
|
||||
|
||||
This script has access to the same variables and functions as the `script` property (except the event-specific ones), plus the following:
|
||||
This script has access to the same variables and functions as the `onValue` property (except the event-specific ones), plus the following:
|
||||
|
||||
- `value`: widget value
|
||||
- `width`: canvas width in pixels
|
||||
|
|
|
|||
|
|
@ -1,967 +0,0 @@
|
|||
<!-- This file is generated automatically from the widget class declarations. See scripts/build-widget-reference.js -->
|
||||
|
||||
## Common
|
||||
|
||||
??? api "<div id="generic_properties">Generic properties<a class="headerlink" href="#generic_properties" title="Permanent link">#</a></div>"
|
||||
Properties shared by all widgets
|
||||
|
||||
|
||||
|
||||
|
||||
=== "widget"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="lock">lock<a class="headerlink" href="#lock" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to prevent modifying this widget with the editor. This will not prevent deleting the widget or moving it from a container to another. |
|
||||
| <h6 id="type">type<a class="headerlink" href="#type" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Widget type |
|
||||
| <h6 id="id">id<a class="headerlink" href="#id" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Widgets sharing the same `id` will act as clones and update each other's value(s) without sending extra osc messages (avoid doing so unless the widgets expect the exact same values). |
|
||||
| <h6 id="visible">visible<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#visible" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to hide the widget. |
|
||||
| <h6 id="interaction">interaction<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#interaction" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to disable pointer interactions. |
|
||||
| <h6 id="comments">comments<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#comments" title="Permanent link">#</a></h6> | `string` | <code>""</code> | User comments. |
|
||||
|
||||
|
||||
=== "geometry"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="left">left<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#left" title="Permanent link">#</a></h6> | `number`|<br/>`string` | <code>"auto"</code> | When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).<br/><br/>Otherwise, the widget will be positioned at absolute coordinates |
|
||||
| <h6 id="top">top<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#top" title="Permanent link">#</a></h6> | `number`|<br/>`percentage` | <code>"auto"</code> | When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).<br/><br/>Otherwise, the widget will be positioned at absolute coordinates |
|
||||
| <h6 id="width">width<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#width" title="Permanent link">#</a></h6> | `number`|<br/>`percentage` | <code>"auto"</code> | Widget width |
|
||||
| <h6 id="height">height<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#height" title="Permanent link">#</a></h6> | `number`|<br/>`percentage` | <code>"auto"</code> | Widget height |
|
||||
| <h6 id="expand">expand<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#expand" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | If parent's layout is `vertical` or `horizontal`, set this to `true` to stretch the widget to use available space automatically. |
|
||||
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="colorText">colorText<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#colorText" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Text color. Set to "auto" to inherit from parent widget. |
|
||||
| <h6 id="colorWidget">colorWidget<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#colorWidget" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Widget's default accent color. Set to "auto" to inherit from parent widget. |
|
||||
| <h6 id="colorStroke">colorStroke<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#colorStroke" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Stroke color. Set to "auto" to use `colorWidget`. |
|
||||
| <h6 id="colorFill">colorFill<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#colorFill" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Fill color. Set to "auto" to use `colorWidget`. |
|
||||
| <h6 id="alphaStroke">alphaStroke<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#alphaStroke" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Stroke color opacity. |
|
||||
| <h6 id="alphaFillOff">alphaFillOff<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#alphaFillOff" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Fill color opacity (off). |
|
||||
| <h6 id="alphaFillOn">alphaFillOn<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#alphaFillOn" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Fill color opacity (on). |
|
||||
| <h6 id="lineWidth">lineWidth<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#lineWidth" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Stroke width. |
|
||||
| <h6 id="borderRadius">borderRadius<a class="headerlink" href="#borderRadius" title="Permanent link">#</a></h6> | `number`|<br/>`string` | <code>"auto"</code> | Border radius expressed as a number or a css string. This property may not work for all widgets. |
|
||||
| <h6 id="padding">padding<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#padding" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Inner spacing. |
|
||||
| <h6 id="html">html<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#html" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Custom html content to be inserted in the widget (before the widget's content). Elements are all unstyled by default, `css` should be used to customize their appearance.<br/><br/>The code is automatically wrapped in <div class="html"></div><br/><br/>Allowed HTML tags:<br/><br/> h1-6, blockquote, p, a, ul, ol, nl, li,<br/><br/> b, i, strong, em, strike, code, hr, br, div,<br/><br/> table, thead, img, caption, tbody, tr, th, td, pre<br/><br/>Allowed attributes:<br/><br/> <*>: class, style, title, name<br/><br/> <img>: src, width, height |
|
||||
| <h6 id="css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke` |
|
||||
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#value" title="Permanent link">#</a></h6> | `*` | <code>""</code> | Define the widget's value depending on other widget's values / properties using the advanced property syntax |
|
||||
| <h6 id="default">default<a class="headerlink" href="#default" title="Permanent link">#</a></h6> | `*` | <code>""</code> | If set, the widget will be initialized with this value when the session is loaded. |
|
||||
| <h6 id="linkId">linkId<a class="headerlink" href="#linkId" title="Permanent link">#</a></h6> | `string`|<br/>`array` | <code>""</code> | Widgets sharing the same `linkId` update each other's value(s) AND send their respective osc messages.<br/><br/>When prefixed with >>, the `linkId` will make the widget act as a master (sending but not receiving)<br/><br/>When prefixed with <<, the `linkId` will make the widget act as a slave (receiving but not sending) |
|
||||
|
||||
|
||||
=== "osc"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="address">address<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#address" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | OSC address for sending / receiving messages, it must start with a slash (`/`)<br/><br/>By default ("auto"), the widget's id is used: `/widget_id` |
|
||||
| <h6 id="preArgs">preArgs<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#preArgs" title="Permanent link">#</a></h6> | `*`|<br/>`array` | <code>""</code> | A value or array of values that will be prepended to the widget's value in the OSC messages it sends.<br/><br/>Incoming messages must match these to affect by the widget. |
|
||||
| <h6 id="typeTags">typeTags<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#typeTags" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Defines the osc argument types, one letter per argument (including preArgs)<br/>- If empty, the types are inferred automatically from the values (with numbers casted to floats by default)<br/>- If there are more arguments than type letters, the last type is used for the extra arguments<br/><br/>See <a href="http://opensoundcontrol.org/">OSC 1.0 specification</a> for existing typetags |
|
||||
| <h6 id="decimals">decimals<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#decimals" title="Permanent link">#</a></h6> | `integer` | <code>2</code> | Defines the number of decimals to send. |
|
||||
| <h6 id="target">target<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#target" title="Permanent link">#</a></h6> | `string`|<br/>`array`|<br/>`null` | <code>""</code> | This defines the targets of the widget's OSC messages<br/>- A `string` or `array` of strings formatted as follow: `ip:port` or `["ip:portA", "ip:portB"]`<br/>- If midi is enabled, targets can be `midi:device_name`<br/>- If no target is set, messages can still be sent if the server has default targets |
|
||||
| <h6 id="ignoreDefaults">ignoreDefaults<a class="headerlink" href="#ignoreDefaults" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to ignore the server's default targets |
|
||||
| <h6 id="bypass">bypass<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#bypass" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to prevent the widget from sending any osc message |
|
||||
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="onCreate">onCreate<a class="headerlink" href="#onCreate" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget (and its children) is created. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
| <h6 id="onValue">onValue<a class="headerlink" href="#onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
## Basics
|
||||
|
||||
??? api "<div id="button">button<a class="headerlink" href="#button" title="Permanent link">#</a></div>"
|
||||
On / off button.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="button_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#button_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--color-text-on`: `colorTextOn` |
|
||||
| <h6 id="button_colorTextOn">colorTextOn<a class="headerlink" href="#button_colorTextOn" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Defines the widget's text color when active. |
|
||||
| <h6 id="button_label">label<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#button_label" title="Permanent link">#</a></h6> | `string`|<br/>`boolean` | <code>"auto"</code> | Set to `false` to hide completely<br/>- Insert icons using the prefix ^ followed by the icon's name : `^play`, `^pause`, etc (see https://fontawesome.com/search?m=free&s=solid<br/>- Icons can be transformed with the following suffixes: `.flip-[horizontal|vertical|both]`, `.rotate-[90|180|270]`, `.spin`, `.pulse`. Example: `^play.flip-horizontal` |
|
||||
| <h6 id="button_vertical">vertical<a class="headerlink" href="#button_vertical" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to display the text vertically |
|
||||
| <h6 id="button_wrap">wrap<a class="headerlink" href="#button_wrap" title="Permanent link">#</a></h6> | `boolean`|<br/>`string` | <code>false</code> | Set to `true` to wrap long lines automatically. Set to `soft` to avoid breaking words.<br/><br/>Choices: `false`, `true`, `soft` |
|
||||
|
||||
=== "button"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="button_on">on<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#button_on" title="Permanent link">#</a></h6> | `*` | <code>1</code> | Set to `null` to send send no argument in the osc message. Ignored if `mode` is `momentary`. |
|
||||
| <h6 id="button_off">off<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#button_off" title="Permanent link">#</a></h6> | `*` | <code>0</code> | Set to `null` to send send no argument in the osc message. Must be different from `on`. Ignored if `mode` is `momentary` or `tap`. |
|
||||
| <h6 id="button_mode">mode<a class="headerlink" href="#button_mode" title="Permanent link">#</a></h6> | `string` | <code>"toggle"</code> | Interaction mode:<br/>- `toggle` (classic on/off switch)<br/>- `push` (press & release)<br/>- `momentary` (no release, no value sent with the address)<br/>- `tap` (no release, sends `on` as value)<br/><br/>Choices: `toggle`, `push`, `momentary`, `tap` |
|
||||
| <h6 id="button_doubleTap">doubleTap<a class="headerlink" href="#button_doubleTap" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to make the button require a double tap to be pushed instead of a single tap |
|
||||
| <h6 id="button_decoupled">decoupled<a class="headerlink" href="#button_decoupled" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` make the local feedback update only when it receives a value from an osc/midi message that matches the `on` or `off` property.<br/><br/>When `decoupled`, the button's value is ambiguous: when interacted with, it will send the value that's requested (`on` or `off` for `toggle` and `push` modes, `on` for `tap` mode, `null` for `momentary`), otherwise it will return the value received from the feedback message (`on` or `off` property).<br/><br/>From a script property, feedback messages can be simulated with:<br/><br/>`set("widget_id", value, {external: true})` |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="button_onValue">onValue<a class="headerlink" href="#button_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Additional variables:<br/>- `locals.touchCoords`: `[x, y]` array representing the touch coordinates, normalized between 0 and 1.<br/>- `locals.external`: `true` if value was received from an osc/midi message, `false otherwise`. |
|
||||
|
||||
??? api "<div id="switch">switch<a class="headerlink" href="#switch" title="Permanent link">#</a></div>"
|
||||
Value selector button.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="switch_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#switch_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--color-text-on`: `colorTextOn` |
|
||||
| <h6 id="switch_colorTextOn">colorTextOn<a class="headerlink" href="#switch_colorTextOn" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Defines the widget's text color when active. |
|
||||
| <h6 id="switch_layout">layout<a class="headerlink" href="#switch_layout" title="Permanent link">#</a></h6> | `string` | <code>"vertical"</code> | Defines how items should be laid out<br/><br/>Choices: `vertical`, `horizontal`, `grid` |
|
||||
| <h6 id="switch_gridTemplate">gridTemplate<a class="headerlink" href="#switch_gridTemplate" title="Permanent link">#</a></h6> | `string`|<br/>`number` | <code>""</code> | If `layout` is `grid`, can be either a number of columns or a valid value for the css property "grid-template". |
|
||||
| <h6 id="switch_wrap">wrap<a class="headerlink" href="#switch_wrap" title="Permanent link">#</a></h6> | `boolean`|<br/>`string` | <code>false</code> | Set to `true` to wrap long lines automatically. Set to `soft` to avoid breaking words.<br/><br/>Choices: `false`, `true`, `soft` |
|
||||
|
||||
=== "switch"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="switch_values">values<a class="headerlink" href="#switch_values" title="Permanent link">#</a></h6> | `array`|<br/>`object` | <code>\{<br/> "Value 1": 1,<br/> "Value 2": 2<br/>}</code> | `Array` of possible values to switch between : `[1,2,3]`<br/><br/>`Object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept<br/><br/>`{"labels": [], "values": []}` `object` where `labels` and `values` arrays must be of the same length. This syntax allows using the same label for different values. |
|
||||
| <h6 id="switch_mode">mode<a class="headerlink" href="#switch_mode" title="Permanent link">#</a></h6> | `string` | <code>"tap"</code> | Interaction mode:<br/>- `tap`: activates when the pointer is down but prevents further scrolling<br/>- `slide`: same as `tap` but allows sliding between values<br/>- `click`: activates upon click only and allows further scrolling<br/>- `flip`: selects the next value upon click regardless of where the widget is touched<br/><br/>Choices: `tap`, `slide`, `click`, `flip` |
|
||||
|
||||
??? api "<div id="dropdown">dropdown<a class="headerlink" href="#dropdown" title="Permanent link">#</a></div>"
|
||||
Native dropdown menu.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="dropdown_label">label<a class="headerlink" href="#dropdown_label" title="Permanent link">#</a></h6> | `string`|<br/>`boolean` | <code>"auto"</code> | Displayed text (defaults to current value). Keywords `%key` and `%value` will be replaced by the widget's selected key/value. |
|
||||
| <h6 id="dropdown_icon">icon<a class="headerlink" href="#dropdown_icon" title="Permanent link">#</a></h6> | `boolean` | <code>"true"</code> | Set to `false` to hide the dropdown icon |
|
||||
| <h6 id="dropdown_align">align<a class="headerlink" href="#dropdown_align" title="Permanent link">#</a></h6> | `string` | <code>"center"</code> | Set to `left` or `right` to change text alignment (otherwise center)<br/><br/>Choices: `center`, `left`, `right` |
|
||||
|
||||
=== "dropdown"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="dropdown_values">values<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#dropdown_values" title="Permanent link">#</a></h6> | `array`|<br/>`object` | <code>\{<br/> "Value 1": 1,<br/> "Value 2": 2<br/>}</code> | `Array` of possible values to switch between : `[1,2,3]`<br/><br/>`Object` of label:value pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept<br/><br/>`{"labels": [], "values": []}` `object` where `labels` and `values` arrays must be of the same length. This syntax allows using the same label for different values. |
|
||||
|
||||
??? api "<div id="menu">menu<a class="headerlink" href="#menu" title="Permanent link">#</a></div>"
|
||||
Drag and drop menu with a circular or grid layout.
|
||||
|
||||
=== "geometry"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="menu_size">size<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#menu_size" title="Permanent link">#</a></h6> | `number`|<br/>`array` | <code>200</code> | - If `layout` is `circular`: diameter (in px)<br/>- Else: square size or `[width, height]` array |
|
||||
| <h6 id="menu_ignoreTabs">ignoreTabs<a class="headerlink" href="#menu_ignoreTabs" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to allow the menu overflowing its tab ancestors. |
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="menu_label">label<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#menu_label" title="Permanent link">#</a></h6> | `string`|<br/>`boolean` | <code>"auto"</code> | Displayed text (defaults to current value). Keywords `%key` and `%value` will be replaced by the widget's selected key/value. |
|
||||
| <h6 id="menu_icon">icon<a class="headerlink" href="#menu_icon" title="Permanent link">#</a></h6> | `boolean` | <code>"true"</code> | Set to `false` to hide the dropdown icon |
|
||||
| <h6 id="menu_textAlign">textAlign<a class="headerlink" href="#menu_textAlign" title="Permanent link">#</a></h6> | `string` | <code>"center"</code> | Set to `left` or `right` to change text alignment (otherwise center)<br/><br/>Choices: `center`, `left`, `right` |
|
||||
| <h6 id="menu_menuAlignV">menuAlignV<a class="headerlink" href="#menu_menuAlignV" title="Permanent link">#</a></h6> | `string` | <code>"center"</code> | Set to `top` or `bottom` to change menu alignment (otherwise center)<br/><br/>Choices: `center`, `top`, `bottom` |
|
||||
| <h6 id="menu_menuAlignH">menuAlignH<a class="headerlink" href="#menu_menuAlignH" title="Permanent link">#</a></h6> | `string` | <code>"center"</code> | Set to `left` or `right` to change menu alignment (otherwise center)<br/><br/>Choices: `center`, `left`, `right` |
|
||||
| <h6 id="menu_layout">layout<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#menu_layout" title="Permanent link">#</a></h6> | `string` | <code>"circular"</code> | Defines whether the menu's layout should be rendered in a circle or in a box<br/><br/>Choices: `circular`, `horizontal`, `vertical`, `grid` |
|
||||
| <h6 id="menu_gridTemplate">gridTemplate<a class="headerlink" href="#menu_gridTemplate" title="Permanent link">#</a></h6> | `string`|<br/>`number` | <code>""</code> | If `layout` is `grid`, can be either a number of columns or a valid value for the css property "grid-template". |
|
||||
|
||||
=== "menu"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="menu_mode">mode<a class="headerlink" href="#menu_mode" title="Permanent link">#</a></h6> | `string` | <code>"default"</code> | Interaction modes:<br/>- `default`: opens on touch, closes and changes value on release<br/>- `toggle`: opens on click, closes and changes value on next click<br/>- `swipe`: opens on touch, changes value when the pointer moves above items, closes on release<br/>- `doubleTap`: same as `default` but opens on double tap<br/>- `doubleTap-toggle`: same as `toggle` but opens on double tap<br/><br/>Choices: `default`, `toggle`, `swipe`, `doubleTap`, `doubleTap-toggle` |
|
||||
| <h6 id="menu_values">values<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#menu_values" title="Permanent link">#</a></h6> | `array`|<br/>`object` | <code>[<br/> 1,<br/> 2,<br/> 3<br/>]</code> | `Array` of possible values to switch between : `[1,2,3]`<br/><br/>`Object` of label:value pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept<br/><br/>`{"labels": [], "values": []}` `object` where `labels` and `values` arrays must be of the same length. This syntax allows using the same label for different values. |
|
||||
| <h6 id="menu_weights">weights<a class="headerlink" href="#menu_weights" title="Permanent link">#</a></h6> | `array` | <code>""</code> | `Array` of `number` defining the weights of each value in `values`<br/><br/>Ignored when `mode` is `grid` |
|
||||
|
||||
??? api "<div id="input">input<a class="headerlink" href="#input" title="Permanent link">#</a></div>"
|
||||
Text input.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="input_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#input_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
| <h6 id="input_align">align<a class="headerlink" href="#input_align" title="Permanent link">#</a></h6> | `string` | <code>"center"</code> | Set to `left` or `right` to change text alignment (otherwise center)<br/><br/>Choices: `center`, `left`, `right` |
|
||||
| <h6 id="input_unit">unit<a class="headerlink" href="#input_unit" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Unit will be appended to the displayed widget's value (it doesn't affect osc messages) |
|
||||
|
||||
=== "input"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="input_asYouType">asYouType<a class="headerlink" href="#input_asYouType" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to make the input send its value at each keystroke |
|
||||
| <h6 id="input_numeric">numeric<a class="headerlink" href="#input_numeric" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to allow numeric values only and display a numeric keyboard on mobile devices<br/><br/>Can be a number to specify the stepping value for mousewheel interaction (only when the input is focused). |
|
||||
| <h6 id="input_validation">validation<a class="headerlink" href="#input_validation" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Regular expression: if the submitted value doesn't match the regular expression, it will be reset to the last valid value.<br/><br/>If leading and trailing slashes are omitted, they will be added automatically and the flag will be set to "gm"<br/><br/>Examples:<br/>- `^[0-9]*$` accepts digits only, any number of them<br/>- `/^[a-zs]{0,10}$/i` accept between 0 and 10 alphabetic characters and spaces (case insensitive) |
|
||||
| <h6 id="input_maxLength">maxLength<a class="headerlink" href="#input_maxLength" title="Permanent link">#</a></h6> | `number` | <code>""</code> | Maximum number of characters allowed |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="input_onValue">onValue<a class="headerlink" href="#input_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height` |
|
||||
|
||||
??? api "<div id="textarea">textarea<a class="headerlink" href="#textarea" title="Permanent link">#</a></div>"
|
||||
Text area (multi line input). Tip: hit shift + enter for new lines.
|
||||
|
||||
??? api "<div id="file">file<a class="headerlink" href="#file" title="Permanent link">#</a></div>"
|
||||
File/Folder selector (server-side).
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="file_align">align<a class="headerlink" href="#file_align" title="Permanent link">#</a></h6> | `string` | <code>"center"</code> | Set to `left` or `right` to change text alignment (otherwise center)<br/><br/>Choices: `center`, `left`, `right` |
|
||||
| <h6 id="file_hidePath">hidePath<a class="headerlink" href="#file_hidePath" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to only display the filename (the whole path will still be used as value) |
|
||||
| <h6 id="file_mode">mode<a class="headerlink" href="#file_mode" title="Permanent link">#</a></h6> | `string` | <code>"open"</code> | File browser mode<br/><br/>Choices: `open`, `save` |
|
||||
|
||||
=== "file"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="file_directory">directory<a class="headerlink" href="#file_directory" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Default browsing directory |
|
||||
| <h6 id="file_extension">extension<a class="headerlink" href="#file_extension" title="Permanent link">#</a></h6> | `string`|<br/>`array` | <code>"*"</code> | Only display files with this extension. Multiple extensions can be specified with an array of strings (`["jpg", "jpeg"]`) |
|
||||
| <h6 id="file_allowDir">allowDir<a class="headerlink" href="#file_allowDir" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Allow selecting a folder (by pressing "open" when no file is selected) |
|
||||
## Containers
|
||||
|
||||
??? api "<div id="panel">panel<a class="headerlink" href="#panel" title="Permanent link">#</a></div>"
|
||||
Widgets or Tabs container.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="panel_colorBg">colorBg<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#panel_colorBg" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Panel background color. Set to "auto" to inherit from parent widget. |
|
||||
| <h6 id="panel_layout">layout<a class="headerlink" href="#panel_layout" title="Permanent link">#</a></h6> | `string` | <code>"default"</code> | Defines how children are laid out.<br/><br/>Choices: `default`, `vertical`, `horizontal`, `grid` |
|
||||
| <h6 id="panel_justify">justify<a class="headerlink" href="#panel_justify" title="Permanent link">#</a></h6> | `string` | <code>"start"</code> | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.<br/><br/>Choices: `start`, `end`, `center`, `space-around`, `space-between` |
|
||||
| <h6 id="panel_gridTemplate">gridTemplate<a class="headerlink" href="#panel_gridTemplate" title="Permanent link">#</a></h6> | `string`|<br/>`number` | <code>""</code> | If `layout` is `grid`, can be either a number of columns or a valid value for the css property "grid-template". |
|
||||
| <h6 id="panel_contain">contain<a class="headerlink" href="#panel_contain" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | If `layout` is `vertical` or `horizontal`, prevents children from overflowing the panel. |
|
||||
| <h6 id="panel_scroll">scroll<a class="headerlink" href="#panel_scroll" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to disable scrollbars |
|
||||
| <h6 id="panel_innerPadding">innerPadding<a class="headerlink" href="#panel_innerPadding" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to make the `padding` property apply only between children and not at the container's inner boundaries. |
|
||||
| <h6 id="panel_tabsPosition">tabsPosition<a class="headerlink" href="#panel_tabsPosition" title="Permanent link">#</a></h6> | `string` | <code>"top"</code> | Defines the position of the navigation bar if the panel contains tabs<br/><br/>Choices: `top`, `bottom`, `left`, `right`, `hidden` |
|
||||
|
||||
=== "panel"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="panel_variables">variables<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#panel_variables" title="Permanent link">#</a></h6> | `*` | <code>"@\{parent.variables}"</code> | Defines one or more arbitrary variables that can be inherited by children widgets |
|
||||
| <h6 id="panel_traversing">traversing<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#panel_traversing" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget<br/><br/>Choices: `false`, `true`, `smart` |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="panel_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#panel_value" title="Permanent link">#</a></h6> | `integer`|<br/>`array` | <code>""</code> | If the panel contains tabs, its value defines which tab is selected selected (by index, starting with 0).<br/><br/>If the panel contains widgets and `scroll` is `true`, its value is an array that contains the scrolling state between 0 and 1 for the x and y axis. |
|
||||
|
||||
=== "children"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="panel_widgets">widgets<a class="headerlink" href="#panel_widgets" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously. |
|
||||
| <h6 id="panel_tabs">tabs<a class="headerlink" href="#panel_tabs" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously |
|
||||
|
||||
??? api "<div id="modal">modal<a class="headerlink" href="#modal" title="Permanent link">#</a></div>"
|
||||
A toggle button that opens a popup panel. Cannot contain tabs directly.
|
||||
|
||||
=== "geometry"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="modal_popupWidth">popupWidth<a class="headerlink" href="#modal_popupWidth" title="Permanent link">#</a></h6> | `number`|<br/>`percentage` | <code>"80%"</code> | Modal popup's size |
|
||||
| <h6 id="modal_popupHeight">popupHeight<a class="headerlink" href="#modal_popupHeight" title="Permanent link">#</a></h6> | `number`|<br/>`percentage` | <code>"80%"</code> | Modal popup's size |
|
||||
| <h6 id="modal_popupLeft">popupLeft<a class="headerlink" href="#modal_popupLeft" title="Permanent link">#</a></h6> | `number`|<br/>`percentage` | <code>"auto"</code> | Modal popup's position |
|
||||
| <h6 id="modal_popupTop">popupTop<a class="headerlink" href="#modal_popupTop" title="Permanent link">#</a></h6> | `number`|<br/>`percentage` | <code>"auto"</code> | Modal popup's position |
|
||||
| <h6 id="modal_relative">relative<a class="headerlink" href="#modal_relative" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to make the modal's position relative to the button's position. |
|
||||
| <h6 id="modal_ignoreTabs">ignoreTabs<a class="headerlink" href="#modal_ignoreTabs" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to allow the modal overflowing its tab ancestors. |
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="modal_colorBg">colorBg<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#modal_colorBg" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Panel background color. Set to "auto" to inherit from parent widget. |
|
||||
| <h6 id="modal_layout">layout<a class="headerlink" href="#modal_layout" title="Permanent link">#</a></h6> | `string` | <code>"default"</code> | Defines how children are laid out.<br/><br/>Choices: `default`, `vertical`, `horizontal`, `grid` |
|
||||
| <h6 id="modal_justify">justify<a class="headerlink" href="#modal_justify" title="Permanent link">#</a></h6> | `string` | <code>"start"</code> | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.<br/><br/>Choices: `start`, `end`, `center`, `space-around`, `space-between` |
|
||||
| <h6 id="modal_gridTemplate">gridTemplate<a class="headerlink" href="#modal_gridTemplate" title="Permanent link">#</a></h6> | `string`|<br/>`number` | <code>""</code> | If `layout` is `grid`, can be either a number of columns or a valid value for the css property "grid-template". |
|
||||
| <h6 id="modal_contain">contain<a class="headerlink" href="#modal_contain" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | If `layout` is `vertical` or `horizontal`, prevents children from overflowing the panel. |
|
||||
| <h6 id="modal_scroll">scroll<a class="headerlink" href="#modal_scroll" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to disable scrollbars |
|
||||
| <h6 id="modal_innerPadding">innerPadding<a class="headerlink" href="#modal_innerPadding" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to make the `padding` property apply only between children and not at the container's inner boundaries. |
|
||||
| <h6 id="modal_label">label<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#modal_label" title="Permanent link">#</a></h6> | `string`|<br/>`boolean` | <code>"auto"</code> | Set to `false` to hide completely<br/>- Insert icons using the prefix ^ followed by the icon's name : `^play`, `^pause`, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free)<br/>- Icons can be transformed with the following suffixes: `.flip-[horizontal|vertical|both]`, `.rotate-[90|180|270]`, `.spin`, `.pulse`. Example: `^play.flip-horizontal` |
|
||||
| <h6 id="modal_popupLabel">popupLabel<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#modal_popupLabel" title="Permanent link">#</a></h6> | `string`|<br/>`boolean` | <code>"auto"</code> | Alternative label for the modal popup |
|
||||
| <h6 id="modal_popupPadding">popupPadding<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#modal_popupPadding" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Modal's inner spacing. |
|
||||
|
||||
=== "modal"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="modal_variables">variables<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#modal_variables" title="Permanent link">#</a></h6> | `*` | <code>"@\{parent.variables}"</code> | Defines one or more arbitrary variables that can be inherited by children widgets |
|
||||
| <h6 id="modal_traversing">traversing<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#modal_traversing" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget<br/><br/>Choices: `false`, `true`, `smart` |
|
||||
| <h6 id="modal_doubleTap">doubleTap<a class="headerlink" href="#modal_doubleTap" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to make the modal require a double tap to open instead of a single tap |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="modal_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#modal_value" title="Permanent link">#</a></h6> | `integer` | <code>""</code> | Defines the modal's state:`0` for closed, `1` for opened |
|
||||
|
||||
=== "children"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="modal_widgets">widgets<a class="headerlink" href="#modal_widgets" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously. |
|
||||
| <h6 id="modal_tabs">tabs<a class="headerlink" href="#modal_tabs" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously |
|
||||
|
||||
??? api "<div id="clone">clone<a class="headerlink" href="#clone" title="Permanent link">#</a></div>"
|
||||
Widget replication with overridable properties.
|
||||
|
||||
=== "clone"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="clone_widgetId">widgetId<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#clone_widgetId" title="Permanent link">#</a></h6> | `string` | <code>""</code> | `id` of the widget to clone |
|
||||
| <h6 id="clone_props">props<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#clone_props" title="Permanent link">#</a></h6> | `object` | <code>\{}</code> | Cloned widget's properties to override |
|
||||
|
||||
??? api "<div id="fragment">fragment<a class="headerlink" href="#fragment" title="Permanent link">#</a></div>"
|
||||
Embedded session or fragment file with overridable properties.
|
||||
|
||||
=== "fragment"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="fragment_file">file<a class="headerlink" href="#fragment_file" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Fragment file path (relative to the session or theme file location by default, falling back to absolute path) |
|
||||
| <h6 id="fragment_fallback">fallback<a class="headerlink" href="#fragment_fallback" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Fallack fragment file path, loaded if `file` can't be opened |
|
||||
| <h6 id="fragment_props">props<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#fragment_props" title="Permanent link">#</a></h6> | `object` | <code>\{}</code> | Fragment widget's properties to override |
|
||||
|
||||
??? api "<div id="matrix">matrix<a class="headerlink" href="#matrix" title="Permanent link">#</a></div>"
|
||||
Generic matrix for creating rows/columns of widgets.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="matrix_colorBg">colorBg<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#matrix_colorBg" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Panel background color. Set to "auto" to inherit from parent widget. |
|
||||
| <h6 id="matrix_layout">layout<a class="headerlink" href="#matrix_layout" title="Permanent link">#</a></h6> | `string` | <code>"horizontal"</code> | Defines how children are laid out.<br/><br/>Choices: `horizontal`, `vertical`, `grid` |
|
||||
| <h6 id="matrix_justify">justify<a class="headerlink" href="#matrix_justify" title="Permanent link">#</a></h6> | `string` | <code>"start"</code> | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.<br/><br/>Choices: `start`, `end`, `center`, `space-around`, `space-between` |
|
||||
| <h6 id="matrix_gridTemplate">gridTemplate<a class="headerlink" href="#matrix_gridTemplate" title="Permanent link">#</a></h6> | `string`|<br/>`number` | <code>""</code> | If `layout` is `grid`, can be either a number of columns or a valid value for the css property "grid-template". |
|
||||
| <h6 id="matrix_contain">contain<a class="headerlink" href="#matrix_contain" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | If `layout` is `vertical` or `horizontal`, prevents children from overflowing the panel. |
|
||||
| <h6 id="matrix_scroll">scroll<a class="headerlink" href="#matrix_scroll" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to disable scrollbars |
|
||||
| <h6 id="matrix_innerPadding">innerPadding<a class="headerlink" href="#matrix_innerPadding" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to make the `padding` property apply only between children and not at the container's inner boundaries. |
|
||||
|
||||
=== "matrix"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="matrix_variables">variables<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#matrix_variables" title="Permanent link">#</a></h6> | `*` | <code>"@\{parent.variables}"</code> | Defines one or more arbitrary variables that can be inherited by children widgets |
|
||||
| <h6 id="matrix_traversing">traversing<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#matrix_traversing" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget<br/><br/>Choices: `false`, `true`, `smart` |
|
||||
| <h6 id="matrix_widgetType">widgetType<a class="headerlink" href="#matrix_widgetType" title="Permanent link">#</a></h6> | `string` | <code>"button"</code> | Defines the type of the widgets in the matrix |
|
||||
| <h6 id="matrix_quantity">quantity<a class="headerlink" href="#matrix_quantity" title="Permanent link">#</a></h6> | `number` | <code>4</code> | Defines the number of widgets in the matrix |
|
||||
| <h6 id="matrix_props">props<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#matrix_props" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "label": "#{$}"<br/>}</code> | Defines a set of property to override the widgets' defaults.<br/><br/>JS{} and #{} blocks in this field are resolved with an extra variable representing each widget's index: `$` (e.g. `#{$}`)<br/><br/>Advanced syntax blocks (@{}, OSC{}, JS{}, VAR{} and #{}) are resolved at the matrix' scope (ie @{this.variables} returns the matrix' variables property)<br/><br/>Advanced syntax blocks can be passed to children without being resolved at the matrix' scope by adding an underscore before the opening bracket.<br/><br/>Note: unless overridden, children inherit from the matrix' `id` and osc properties (`id` and `address` are appended with `/$`) |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="matrix_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#matrix_value" title="Permanent link">#</a></h6> | `integer`|<br/>`array` | <code>""</code> | If the panel contains tabs, its value defines which tab is selected selected (by index, starting with 0).<br/><br/>If the panel contains widgets and `scroll` is `true`, its value is an array that contains the scrolling state between 0 and 1 for the x and y axis. |
|
||||
|
||||
=== "children"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="matrix_widgets">widgets<a class="headerlink" href="#matrix_widgets" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously. |
|
||||
| <h6 id="matrix_tabs">tabs<a class="headerlink" href="#matrix_tabs" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously |
|
||||
|
||||
??? api "<div id="keyboard">keyboard<a class="headerlink" href="#keyboard" title="Permanent link">#</a></div>"
|
||||
Piano keyboard.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="keyboard_colorWhite">colorWhite<a class="headerlink" href="#keyboard_colorWhite" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | White keys color. |
|
||||
| <h6 id="keyboard_colorBlack">colorBlack<a class="headerlink" href="#keyboard_colorBlack" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Black keys color. |
|
||||
|
||||
=== "keyboard"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="keyboard_keys">keys<a class="headerlink" href="#keyboard_keys" title="Permanent link">#</a></h6> | `number` | <code>25</code> | Defines the number keys |
|
||||
| <h6 id="keyboard_start">start<a class="headerlink" href="#keyboard_start" title="Permanent link">#</a></h6> | `number` | <code>48</code> | MIDI note number to start with (default is C4)<br/><br/>Standard keyboards settings are: `[25, 48]`, `[49, 36]`, `[61, 36]`, `[88, 21]` |
|
||||
| <h6 id="keyboard_traversing">traversing<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#keyboard_traversing" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to disable traversing gestures |
|
||||
| <h6 id="keyboard_on">on<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#keyboard_on" title="Permanent link">#</a></h6> | `*` | <code>1</code> | Set to `null` to send send no argument in the osc message |
|
||||
| <h6 id="keyboard_off">off<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#keyboard_off" title="Permanent link">#</a></h6> | `*` | <code>0</code> | Set to `null` to send send no argument in the osc message |
|
||||
| <h6 id="keyboard_velocity">velocity<a class="headerlink" href="#keyboard_velocity" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to map the touch coordinates between `off` (top) and `on` (bottom). Requires `on` and `off` to be numbers |
|
||||
| <h6 id="keyboard_mode">mode<a class="headerlink" href="#keyboard_mode" title="Permanent link">#</a></h6> | `string` | <code>"push"</code> | Interaction mode:<br/>- `push` (press & release)<br/>- `toggle` (on/off switches)<br/>- `tap` (no release)<br/><br/>Choices: `push`, `toggle`, `tap` |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="keyboard_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#keyboard_value" title="Permanent link">#</a></h6> | `array` | <code>""</code> | The keyboard widget accepts the following values:<br/>- a `[note, value]` array to set the value of a single key where `note` is the note number and `value` depends on the `on` and `off` properties (any value different from `off` will be interpreted as `on`).<br/>- an array of values with one item per key in the keyboard |
|
||||
|
||||
??? api "<div id="patchbay">patchbay<a class="headerlink" href="#patchbay" title="Permanent link">#</a></div>"
|
||||
Connect inputs to outputs.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="patchbay_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#patchbay_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
|
||||
=== "patchbay"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="patchbay_inputs">inputs<a class="headerlink" href="#patchbay_inputs" title="Permanent link">#</a></h6> | `array`|<br/>`object` | <code>[<br/> "input_1",<br/> "input_2"<br/>]</code> | - `Array` of input names : `['input_1', 'input_2']`<br/>- `Object` of `"label_1": "input_1"` pairs (example: `{"label a": "name 1", "label b": "name 2"}`). Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept<br/><br/><br/><br/>Patchbay inputs can be connected to one or more outputs and will send messages of the following form when they are connected/disconnected: <br/><br/>`/patchbay_address input_x output_x output_y etc`<br/><br/>If no output is connected to the input, the message will be `/patchbay_address input_x`<br/><br/>The inputs values can be consumed with the property inheritance syntax: `@{patchbay_id/input_1}` returns an array of output names connected to `input_1`.<br/><br/>To change connections via scripting, one must target the input nodes as follows: `set('patchbay_id/input_name', ['output_x', 'output_y'])` |
|
||||
| <h6 id="patchbay_outputs">outputs<a class="headerlink" href="#patchbay_outputs" title="Permanent link">#</a></h6> | `array`|<br/>`object` | <code>[<br/> "output_1",<br/> "output_2"<br/>]</code> | List of output values the inputs can connect to (see `inputs`). |
|
||||
| <h6 id="patchbay_exclusive">exclusive<a class="headerlink" href="#patchbay_exclusive" title="Permanent link">#</a></h6> | `string` | <code>false</code> | - `in`: allows only one connection per input<br/>- `out`: allows only one connection per output<br/>- `both`: allows only one connection per input and output<br/><br/>Choices: `false`, `in`, `out`, `both` |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="patchbay_onValue">onValue<a class="headerlink" href="#patchbay_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height` |
|
||||
|
||||
??? api "<div id="folder">folder<a class="headerlink" href="#folder" title="Permanent link">#</a></div>"
|
||||
Flat container that doesn't affect layout. Mostly useful for grouping widgets in the tree.
|
||||
|
||||
=== "folder"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="folder_variables">variables<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#folder_variables" title="Permanent link">#</a></h6> | `*` | <code>"@\{parent.variables}"</code> | Defines one or more arbitrary variables that can be inherited by children widgets |
|
||||
|
||||
=== "children"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="folder_widgets">widgets<a class="headerlink" href="#folder_widgets" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously. |
|
||||
| <h6 id="folder_tabs">tabs<a class="headerlink" href="#folder_tabs" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously |
|
||||
|
||||
??? api "<div id="root">root<a class="headerlink" href="#root" title="Permanent link">#</a></div>"
|
||||
Main (unique) container
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="root_colorBg">colorBg<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#root_colorBg" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Panel background color. Set to "auto" to inherit from parent widget. |
|
||||
| <h6 id="root_layout">layout<a class="headerlink" href="#root_layout" title="Permanent link">#</a></h6> | `string` | <code>"default"</code> | Defines how children are laid out.<br/><br/>Choices: `default`, `vertical`, `horizontal`, `grid` |
|
||||
| <h6 id="root_justify">justify<a class="headerlink" href="#root_justify" title="Permanent link">#</a></h6> | `string` | <code>"start"</code> | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.<br/><br/>Choices: `start`, `end`, `center`, `space-around`, `space-between` |
|
||||
| <h6 id="root_gridTemplate">gridTemplate<a class="headerlink" href="#root_gridTemplate" title="Permanent link">#</a></h6> | `string`|<br/>`number` | <code>""</code> | If `layout` is `grid`, can be either a number of columns or a valid value for the css property "grid-template". |
|
||||
| <h6 id="root_contain">contain<a class="headerlink" href="#root_contain" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | If `layout` is `vertical` or `horizontal`, prevents children from overflowing the panel. |
|
||||
| <h6 id="root_scroll">scroll<a class="headerlink" href="#root_scroll" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to disable scrollbars |
|
||||
| <h6 id="root_innerPadding">innerPadding<a class="headerlink" href="#root_innerPadding" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to make the `padding` property apply only between children and not at the container's inner boundaries. |
|
||||
| <h6 id="root_tabsPosition">tabsPosition<a class="headerlink" href="#root_tabsPosition" title="Permanent link">#</a></h6> | `string` | <code>"top"</code> | Defines the position of the navigation bar if the panel contains tabs<br/><br/>Choices: `top`, `bottom`, `left`, `right`, `hidden` |
|
||||
| <h6 id="root_hideMenu">hideMenu<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#root_hideMenu" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to hide the main menu button. |
|
||||
|
||||
=== "root"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="root_variables">variables<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#root_variables" title="Permanent link">#</a></h6> | `*` | <code>"@\{parent.variables}"</code> | Defines one or more arbitrary variables that can be inherited by children widgets |
|
||||
| <h6 id="root_traversing">traversing<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#root_traversing" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget<br/><br/>Choices: `false`, `true`, `smart` |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="root_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#root_value" title="Permanent link">#</a></h6> | `integer`|<br/>`array` | <code>""</code> | If the panel contains tabs, its value defines which tab is selected selected (by index, starting with 0).<br/><br/>If the panel contains widgets and `scroll` is `true`, its value is an array that contains the scrolling state between 0 and 1 for the x and y axis. |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="root_onPreload">onPreload<a class="headerlink" href="#root_onPreload" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed before any other widget is created. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
|
||||
=== "children"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="root_widgets">widgets<a class="headerlink" href="#root_widgets" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously. |
|
||||
| <h6 id="root_tabs">tabs<a class="headerlink" href="#root_tabs" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously |
|
||||
|
||||
??? api "<div id="tab">tab<a class="headerlink" href="#tab" title="Permanent link">#</a></div>"
|
||||
Tabbed panel widget
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="tab_colorBg">colorBg<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#tab_colorBg" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Panel background color. Set to "auto" to inherit from parent widget. |
|
||||
| <h6 id="tab_layout">layout<a class="headerlink" href="#tab_layout" title="Permanent link">#</a></h6> | `string` | <code>"default"</code> | Defines how children are laid out.<br/><br/>Choices: `default`, `vertical`, `horizontal`, `grid` |
|
||||
| <h6 id="tab_justify">justify<a class="headerlink" href="#tab_justify" title="Permanent link">#</a></h6> | `string` | <code>"start"</code> | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.<br/><br/>Choices: `start`, `end`, `center`, `space-around`, `space-between` |
|
||||
| <h6 id="tab_gridTemplate">gridTemplate<a class="headerlink" href="#tab_gridTemplate" title="Permanent link">#</a></h6> | `string`|<br/>`number` | <code>""</code> | If `layout` is `grid`, can be either a number of columns or a valid value for the css property "grid-template". |
|
||||
| <h6 id="tab_contain">contain<a class="headerlink" href="#tab_contain" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | If `layout` is `vertical` or `horizontal`, prevents children from overflowing the panel. |
|
||||
| <h6 id="tab_scroll">scroll<a class="headerlink" href="#tab_scroll" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to disable scrollbars |
|
||||
| <h6 id="tab_innerPadding">innerPadding<a class="headerlink" href="#tab_innerPadding" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to make the `padding` property apply only between children and not at the container's inner boundaries. |
|
||||
| <h6 id="tab_tabsPosition">tabsPosition<a class="headerlink" href="#tab_tabsPosition" title="Permanent link">#</a></h6> | `string` | <code>"top"</code> | Defines the position of the navigation bar if the panel contains tabs<br/><br/>Choices: `top`, `bottom`, `left`, `right`, `hidden` |
|
||||
| <h6 id="tab_label">label<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#tab_label" title="Permanent link">#</a></h6> | `string`|<br/>`boolean` | <code>"auto"</code> | Set to `false` to hide completely<br/>- Insert icons using the prefix ^ followed by the icon's name : `^play`, `^pause`, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free)<br/>- Icons can be transformed with the following suffixes: `.flip-[horizontal|vertical|both]`, `.rotate-[90|180|270]`, `.spin`, `.pulse`. Example: `^play.flip-horizontal` |
|
||||
|
||||
=== "tab"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="tab_variables">variables<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#tab_variables" title="Permanent link">#</a></h6> | `*` | <code>"@\{parent.variables}"</code> | Defines one or more arbitrary variables that can be inherited by children widgets |
|
||||
| <h6 id="tab_traversing">traversing<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#tab_traversing" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget<br/><br/>Choices: `false`, `true`, `smart` |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="tab_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#tab_value" title="Permanent link">#</a></h6> | `integer`|<br/>`array` | <code>""</code> | If the panel contains tabs, its value defines which tab is selected selected (by index, starting with 0).<br/><br/>If the panel contains widgets and `scroll` is `true`, its value is an array that contains the scrolling state between 0 and 1 for the x and y axis. |
|
||||
|
||||
=== "children"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="tab_widgets">widgets<a class="headerlink" href="#tab_widgets" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously. |
|
||||
| <h6 id="tab_tabs">tabs<a class="headerlink" href="#tab_tabs" title="Permanent link">#</a></h6> | `array` | <code>[]</code> | Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously |
|
||||
## Frames
|
||||
|
||||
??? api "<div id="frame">frame<a class="headerlink" href="#frame" title="Permanent link">#</a></div>"
|
||||
Embed a web page in a frame. Note: some websites do not allow this.
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="frame_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#frame_value" title="Permanent link">#</a></h6> | `string` | <code>""</code> | External web page URL. |
|
||||
|
||||
??? api "<div id="svg">svg<a class="headerlink" href="#svg" title="Permanent link">#</a></div>"
|
||||
Svg parser.
|
||||
|
||||
=== "svg"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="svg_svg">svg<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#svg_svg" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Svg xml definition (will be wrapped in a `< svg />` element) |
|
||||
|
||||
??? api "<div id="html">html<a class="headerlink" href="#html" title="Permanent link">#</a></div>"
|
||||
Simple HTML parser.
|
||||
|
||||
??? api "<div id="image">image<a class="headerlink" href="#image" title="Permanent link">#</a></div>"
|
||||
Load a image (url or base64-encoded).
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="image_size">size<a class="headerlink" href="#image_size" title="Permanent link">#</a></h6> | `string` | <code>"cover"</code> | CSS background-size<br/><br/>Choices: `cover`, `contain`, `auto` |
|
||||
| <h6 id="image_position">position<a class="headerlink" href="#image_position" title="Permanent link">#</a></h6> | `string` | <code>"center"</code> | CSS background-position<br/><br/>Choices: `center`, `left`, `right`, `top`, `bottom`, `left top`, `left bottom`, `right top`, `right bottom` |
|
||||
| <h6 id="image_repeat">repeat<a class="headerlink" href="#image_repeat" title="Permanent link">#</a></h6> | `string` | <code>"no-repeat"</code> | CSS background-repeat<br/><br/>Choices: `no-repeat`, `repeat`, `repeat-x`, `repeat-y`, `space`, `round` |
|
||||
|
||||
=== "image"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="image_cache">cache<a class="headerlink" href="#image_cache" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to false to disable image caching (forces file reload when updating or editing the widget).<br/><br/>When true, sending `reload` to the widget reloads its image without changing its value |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="image_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#image_value" title="Permanent link">#</a></h6> | `string` | <code>""</code> | - File `url` or `path` (relative to the session or theme file location by default, falling back to absolute path)<br/>- Base64 encoded image : `data:image/...`<br/>- Enter "qrcode" to display the server's address QR code |
|
||||
## Graphs
|
||||
|
||||
??? api "<div id="plot">plot<a class="headerlink" href="#plot" title="Permanent link">#</a></div>"
|
||||
XY coordinates plot.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="plot_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#plot_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
| <h6 id="plot_dots">dots<a class="headerlink" href="#plot_dots" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Draw dots on the line |
|
||||
| <h6 id="plot_bars">bars<a class="headerlink" href="#plot_bars" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to use draw bars instead (disables `logScaleX` and forces `x axis` even spacing) |
|
||||
| <h6 id="plot_pips">pips<a class="headerlink" href="#plot_pips" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to hide the scale |
|
||||
|
||||
=== "plot"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="plot_rangeX">rangeX<a class="headerlink" href="#plot_rangeX" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the min and max values for the x axis |
|
||||
| <h6 id="plot_rangeY">rangeY<a class="headerlink" href="#plot_rangeY" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the min and max values for the y axis |
|
||||
| <h6 id="plot_logScaleX">logScaleX<a class="headerlink" href="#plot_logScaleX" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale. |
|
||||
| <h6 id="plot_logScaleY">logScaleY<a class="headerlink" href="#plot_logScaleY" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale. |
|
||||
| <h6 id="plot_origin">origin<a class="headerlink" href="#plot_origin" title="Permanent link">#</a></h6> | `number`|<br/>`boolean` | <code>"auto"</code> | Defines the y axis origin. Set to `false` to disable it |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="plot_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#plot_value" title="Permanent link">#</a></h6> | `array`|<br/>`string` | <code>""</code> | - `Array` of `y` values: `[y1, y2, ...]`<br/>- `Array` of `[x, y]` `array` values: `[[x1 , y1], [x2, y2], ...]`<br/>- `String` `array`: `"[y1, y2, ...]"` or `"[[x1 , y1], [x2, y2], ...]"`<br/>- `String` `object` to update specific coordinates only: `"{0: y1, 1: y2}"` or `"{0: [x1, y1], 1: [x2, y2]}"` |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="plot_onValue">onValue<a class="headerlink" href="#plot_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height` |
|
||||
|
||||
??? api "<div id="eq">eq<a class="headerlink" href="#eq" title="Permanent link">#</a></div>"
|
||||
Draws logarithmic frequency response from an array of filter objects.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="eq_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#eq_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
| <h6 id="eq_dots">dots<a class="headerlink" href="#eq_dots" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Draw dots on the line |
|
||||
| <h6 id="eq_bars">bars<a class="headerlink" href="#eq_bars" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to use draw bars instead (disables `logScaleX` and forces `x axis` even spacing) |
|
||||
| <h6 id="eq_pips">pips<a class="headerlink" href="#eq_pips" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to hide the scale |
|
||||
|
||||
=== "eq"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="eq_rangeX">rangeX<a class="headerlink" href="#eq_rangeX" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 20,<br/> "max": 22000<br/>}</code> | Defines the min and max values for the x axis (in Hz, logarithmic scale)<br/><br/>The sampling frequency used to compute the response curve will be 2 * rangeX.max |
|
||||
| <h6 id="eq_rangeY">rangeY<a class="headerlink" href="#eq_rangeY" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": -6,<br/> "max": 6<br/>}</code> | Defines the min and max values for the y axis (in dB) |
|
||||
| <h6 id="eq_origin">origin<a class="headerlink" href="#eq_origin" title="Permanent link">#</a></h6> | `number`|<br/>`boolean` | <code>"auto"</code> | Defines the y axis origin. Set to `false` to disable it |
|
||||
| <h6 id="eq_filters">filters<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#eq_filters" title="Permanent link">#</a></h6> | `array` | <code>""</code> | Each item must be an object with the following properties<br/>- `type`: string ("highpass", "highshelf", "lowpass", "lowshelf", "peak", "bandpass" or "notch", default: "peak")<br/>- `freq`: number (filter's resonant frequency, default: 1000)<br/>- `q`: number (Q factor, default: 1)<br/>- `gain`: number (default: 0)<br/>- `on`: boolean (default: true)<br/>- `poles`: if `type` is "highpass" or "lowpass", indicates the number of poles for the filter (if omitted or 0, a biquad filter with Q factor is used). Set to 1 for 6dB/otaves roll-off, 2 for 12dB/octaves, etc.<br/><br/>See https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode |
|
||||
| <h6 id="eq_pips">pips<a class="headerlink" href="#eq_pips" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to false to hide the scale |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="eq_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#eq_value" title="Permanent link">#</a></h6> | `array`|<br/>`string` | <code>""</code> | - `Array` of `y` values: `[y1, y2, ...]`<br/>- `Array` of `[x, y]` `array` values: `[[x1 , y1], [x2, y2], ...]`<br/>- `String` `array`: `"[y1, y2, ...]"` or `"[[x1 , y1], [x2, y2], ...]"`<br/>- `String` `object` to update specific coordinates only: `"{0: y1, 1: y2}"` or `"{0: [x1, y1], 1: [x2, y2]}"` |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="eq_onValue">onValue<a class="headerlink" href="#eq_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height` |
|
||||
|
||||
??? api "<div id="visualizer">visualizer<a class="headerlink" href="#visualizer" title="Permanent link">#</a></div>"
|
||||
Display its value over time.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="visualizer_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#visualizer_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
| <h6 id="visualizer_pips">pips<a class="headerlink" href="#visualizer_pips" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to hide the scale |
|
||||
|
||||
=== "visualizer"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="visualizer_rangeX">rangeX<a class="headerlink" href="#visualizer_rangeX" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the min and max values for the x axis |
|
||||
| <h6 id="visualizer_rangeY">rangeY<a class="headerlink" href="#visualizer_rangeY" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the min and max values for the y axis |
|
||||
| <h6 id="visualizer_logScaleX">logScaleX<a class="headerlink" href="#visualizer_logScaleX" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale. |
|
||||
| <h6 id="visualizer_logScaleY">logScaleY<a class="headerlink" href="#visualizer_logScaleY" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm's base. |
|
||||
| <h6 id="visualizer_origin">origin<a class="headerlink" href="#visualizer_origin" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Defines the y axis origin. Set to `false` to disable it |
|
||||
| <h6 id="visualizer_duration">duration<a class="headerlink" href="#visualizer_duration" title="Permanent link">#</a></h6> | `number` | <code>1</code> | Defines visualization duration in seconds |
|
||||
| <h6 id="visualizer_framerate">framerate<a class="headerlink" href="#visualizer_framerate" title="Permanent link">#</a></h6> | `number` | <code>30</code> | Defines visualization framerate |
|
||||
| <h6 id="visualizer_freeze">freeze<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#visualizer_freeze" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to freeze current view and ignore incoming values |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="visualizer_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#visualizer_value" title="Permanent link">#</a></h6> | `array`|<br/>`string` | <code>""</code> | - `Array` of `y` values: `[y1, y2, ...]`<br/>- `Array` of `[x, y]` `array` values: `[[x1 , y1], [x2, y2], ...]`<br/>- `String` `array`: `"[y1, y2, ...]"` or `"[[x1 , y1], [x2, y2], ...]"`<br/>- `String` `object` to update specific coordinates only: `"{0: y1, 1: y2}"` or `"{0: [x1, y1], 1: [x2, y2]}"` |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="visualizer_onValue">onValue<a class="headerlink" href="#visualizer_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height` |
|
||||
## Indicators
|
||||
|
||||
??? api "<div id="led">led<a class="headerlink" href="#led" title="Permanent link">#</a></div>"
|
||||
Intensity display.
|
||||
|
||||
=== "led"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="led_mode">mode<a class="headerlink" href="#led_mode" title="Permanent link">#</a></h6> | `string` | <code>"intensity"</code> | Defines how value is interpreted (see `value`)<br/><br/>Choices: `intensity`, `color` |
|
||||
| <h6 id="led_range">range<a class="headerlink" href="#led_range" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Value range |
|
||||
| <h6 id="led_alphaRange">alphaRange<a class="headerlink" href="#led_alphaRange" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Alpha range (if `mode` is `color`) |
|
||||
| <h6 id="led_logScale">logScale<a class="headerlink" href="#led_logScale" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | If `mode` is `intensity`, set to `true` to use logarithmic scale. |
|
||||
|
||||
=== "value"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="led_value">value<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#led_value" title="Permanent link">#</a></h6> | `number`|<br/>`array`|<br/>`string` | <code>""</code> | If `mode` is `intensity`:<br/>- `Number`: `intensity` between `range.min` and `range.max`<br/><br/>If `mode` is `color`:<br/>- `Array`: `[r, g, b]` (`r`, `g` and `b` between `range.min` and `range.max`)<br/>- `Array`: `[r, g, b, alpha]` (`alpha` between `alphaRange.min` and `alphaRange.max`)<br/>- `String`: CSS color |
|
||||
|
||||
??? api "<div id="text">text<a class="headerlink" href="#text" title="Permanent link">#</a></div>"
|
||||
Display text.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="text_vertical">vertical<a class="headerlink" href="#text_vertical" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to display the text vertically |
|
||||
| <h6 id="text_wrap">wrap<a class="headerlink" href="#text_wrap" title="Permanent link">#</a></h6> | `boolean`|<br/>`string` | <code>false</code> | Set to `true` to wrap long lines automatically. Set to `soft` to avoid breaking words.<br/><br/>Choices: `false`, `true`, `soft` |
|
||||
| <h6 id="text_align">align<a class="headerlink" href="#text_align" title="Permanent link">#</a></h6> | `string` | <code>"center"</code> | Text alignment.<br/><br/>Choices: `center`, `left`, `right`, `top`, `bottom`, `left top`, `left bottom`, `right top`, `right bottom` |
|
||||
## Pads
|
||||
|
||||
??? api "<div id="xy">xy<a class="headerlink" href="#xy" title="Permanent link">#</a></div>"
|
||||
Two-dimensional slider.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="xy_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#xy_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
| <h6 id="xy_pointSize">pointSize<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#xy_pointSize" title="Permanent link">#</a></h6> | `integer` | <code>20</code> | Defines the points' size (may be in %) |
|
||||
| <h6 id="xy_ephemeral">ephemeral<a class="headerlink" href="#xy_ephemeral" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | When set to `true`, the point will be drawn only while touched. |
|
||||
| <h6 id="xy_pips">pips<a class="headerlink" href="#xy_pips" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to hide the scale |
|
||||
| <h6 id="xy_label">label<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#xy_label" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Text displayed in the handle |
|
||||
|
||||
=== "xy"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="xy_snap">snap<a class="headerlink" href="#xy_snap" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | By default, the points are dragged from their initial position.<br/><br/>If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates |
|
||||
| <h6 id="xy_spring">spring<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#xy_spring" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | When set to `true`, the widget will go back to its default value when released |
|
||||
| <h6 id="xy_rangeX">rangeX<a class="headerlink" href="#xy_rangeX" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the min and max values for the x axis |
|
||||
| <h6 id="xy_rangeY">rangeY<a class="headerlink" href="#xy_rangeY" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the min and max values for the y axis |
|
||||
| <h6 id="xy_logScaleX">logScaleX<a class="headerlink" href="#xy_logScaleX" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale. |
|
||||
| <h6 id="xy_logScaleY">logScaleY<a class="headerlink" href="#xy_logScaleY" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale. |
|
||||
| <h6 id="xy_axisLock">axisLock<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#xy_axisLock" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Restrict movements to one of the axes only unless `Shift` is held.<br/><br/>When left empty, holding `Shift` while dragging will lock the pad according the first movement. `auto` will do the opposite.<br/><br/>Choices: ``, `x`, `y`, `auto` |
|
||||
| <h6 id="xy_doubleTap">doubleTap<a class="headerlink" href="#xy_doubleTap" title="Permanent link">#</a></h6> | `boolean`|<br/>`string` | <code>false</code> | Set to `true` to make the knob reset to its `default` value when receiving a double tap.<br/><br/>Can be an osc address, in which case the widget will just send an osc message with no value (but `preArgs` included).<br/><br/>If set to "script", `onTouch` will be called with `event.type` set to `doubleTap`. <br/><br/>Choices: `false`, `true`, `script` |
|
||||
| <h6 id="xy_sensitivity">sensitivity<a class="headerlink" href="#xy_sensitivity" title="Permanent link">#</a></h6> | `number` | <code>1</code> | Defines the pad's sensitivity when `snap` is `false` |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="xy_onValue">onValue<a class="headerlink" href="#xy_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height` |
|
||||
| <h6 id="xy_onTouch">onTouch<a class="headerlink" href="#xy_onTouch" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is touched and released. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
|
||||
??? api "<div id="rgb">rgb<a class="headerlink" href="#rgb" title="Permanent link">#</a></div>"
|
||||
Color picker with optional alpha slider.
|
||||
|
||||
=== "rgb"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="rgb_snap">snap<a class="headerlink" href="#rgb_snap" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | By default, the points are dragged from their initial position.<br/><br/>If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates |
|
||||
| <h6 id="rgb_spring">spring<a class="headerlink" href="#rgb_spring" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | When set to `true`, the widget will go back to its default value when released |
|
||||
| <h6 id="rgb_range">range<a class="headerlink" href="#rgb_range" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 255<br/>}</code> | Defines the widget's output scale. |
|
||||
| <h6 id="rgb_alpha">alpha<a class="headerlink" href="#rgb_alpha" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to enable alpha channel |
|
||||
| <h6 id="rgb_rangeAlpha">rangeAlpha<a class="headerlink" href="#rgb_rangeAlpha" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the widget's output scale for the alpha channel. |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="rgb_onTouch">onTouch<a class="headerlink" href="#rgb_onTouch" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is touched and released. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
|
||||
??? api "<div id="multixy">multixy<a class="headerlink" href="#multixy" title="Permanent link">#</a></div>"
|
||||
Multi-point XY pad.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="multixy_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#multixy_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
| <h6 id="multixy_pointSize">pointSize<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#multixy_pointSize" title="Permanent link">#</a></h6> | `integer` | <code>20</code> | Defines the points' default size (may be in %) |
|
||||
| <h6 id="multixy_ephemeral">ephemeral<a class="headerlink" href="#multixy_ephemeral" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | When set to `true`, the points will be drawn only while touched. |
|
||||
| <h6 id="multixy_pips">pips<a class="headerlink" href="#multixy_pips" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to hide the scale |
|
||||
|
||||
=== "multixy"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="multixy_points">points<a class="headerlink" href="#multixy_points" title="Permanent link">#</a></h6> | `integer`|<br/>`array` | <code>2</code> | Defines the number of points on the pad<br/><br/>Can be an array of strings that will be used as labels for the points (ex: `['A', 'B']`) |
|
||||
| <h6 id="multixy_pointsAttr">pointsAttr<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#multixy_pointsAttr" title="Permanent link">#</a></h6> | `object` | <code>[]</code> | Defines per-point properties that are otherwise inherited from the multixy. Must be an array of objects (one per point) that may contain the following keys:<br/>- visible (visibility and interactability)<br/>- colorFill (background color)<br/>- colorStroke (outline color)<br/>- colorText (label color)<br/>- color (shorthand for colorFill and colorStroke)<br/>- alphaFillOn (background opacity)<br/>- pointSize<br/>- label |
|
||||
| <h6 id="multixy_snap">snap<a class="headerlink" href="#multixy_snap" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | By default, the points are dragged from their initial position.<br/><br/>If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates |
|
||||
| <h6 id="multixy_spring">spring<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#multixy_spring" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | When set to `true`, the widget will go back to its default value when released |
|
||||
| <h6 id="multixy_rangeX">rangeX<a class="headerlink" href="#multixy_rangeX" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the min and max values for the x axis |
|
||||
| <h6 id="multixy_rangeY">rangeY<a class="headerlink" href="#multixy_rangeY" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the min and max values for the y axis |
|
||||
| <h6 id="multixy_logScaleX">logScaleX<a class="headerlink" href="#multixy_logScaleX" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale. |
|
||||
| <h6 id="multixy_logScaleY">logScaleY<a class="headerlink" href="#multixy_logScaleY" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale. |
|
||||
| <h6 id="multixy_axisLock">axisLock<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#multixy_axisLock" title="Permanent link">#</a></h6> | `string` | <code>""</code> | Restrict movements to one of the axes only.<br/><br/>When left empty, holding `Shift` while dragging will lock the pad according the first movement. `auto` will do the opposite.<br/><br/>Choices: ``, `x`, `y`, `auto` |
|
||||
| <h6 id="multixy_doubleTap">doubleTap<a class="headerlink" href="#multixy_doubleTap" title="Permanent link">#</a></h6> | `boolean`|<br/>`string` | <code>false</code> | Set to `true` to make the knob reset to its `default` value when receiving a double tap.<br/><br/>Can be an osc address, in which case the widget will just send an osc message with no value (but `preArgs` included).<br/><br/>If set to "script", `onTouch` will be called with `event.type` set to `doubleTap`. <br/><br/>Choices: `false`, `true`, `script` |
|
||||
| <h6 id="multixy_sensitivity">sensitivity<a class="headerlink" href="#multixy_sensitivity" title="Permanent link">#</a></h6> | `number` | <code>1</code> | Defines the pad's sensitivity when `snap` is `false` |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="multixy_onValue">onValue<a class="headerlink" href="#multixy_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height` |
|
||||
| <h6 id="multixy_onTouch">onTouch<a class="headerlink" href="#multixy_onTouch" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is touched and released. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
|
||||
??? api "<div id="canvas">canvas<a class="headerlink" href="#canvas" title="Permanent link">#</a></div>"
|
||||
Multitouch canvas widget with user-defined drawing functions and touch reactions.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="canvas_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#canvas_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
|
||||
=== "canvas"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="canvas_valueLength">valueLength<a class="headerlink" href="#canvas_valueLength" title="Permanent link">#</a></h6> | `number` | <code>1</code> | Defines the number of values accepted by the widget (minimum 1). Incoming messages that don't comply will be ignored<br/><br/>When calling `set()` from a script, submitted value should be an array only if `valueLength` is greater than 1. |
|
||||
| <h6 id="canvas_autoClear">autoClear<a class="headerlink" href="#canvas_autoClear" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | If set to `false`, the canvas context won't be cleared automatically and `ctx.clear()` will need to be called in `onDraw`. |
|
||||
| <h6 id="canvas_continuous">continuous<a class="headerlink" href="#canvas_continuous" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | If set to `true`, `onDraw` will be called at each frame, otherwise it will be called only when the widget is touched and when it receives a value.<br/><br/>Can be a number between 1 and 60 to specify the framerate (default: 30 fps). |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="canvas_onCreate">onCreate<a class="headerlink" href="#canvas_onCreate" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is created. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
| <h6 id="canvas_onValue">onValue<a class="headerlink" href="#canvas_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed whenever the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
| <h6 id="canvas_onTouch">onTouch<a class="headerlink" href="#canvas_onTouch" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is touched and released, and when the pointer moves when the widget is touched. See <a href="https://openstagecontrol.ammd.net/docs/widgets/canvas/">documentation</a>. |
|
||||
| <h6 id="canvas_onDraw">onDraw<a class="headerlink" href="#canvas_onDraw" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is redrawn. See <a href="https://openstagecontrol.ammd.net/docs/widgets/canvas/">documentation</a>. |
|
||||
| <h6 id="canvas_onResize">onResize<a class="headerlink" href="#canvas_onResize" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is resized. See <a href="https://openstagecontrol.ammd.net/docs/widgets/canvas/">documentation</a>. |
|
||||
## Sliders
|
||||
|
||||
??? api "<div id="fader">fader<a class="headerlink" href="#fader" title="Permanent link">#</a></div>"
|
||||
Vertical / horizontal slider.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="fader_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#fader_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
| <h6 id="fader_design">design<a class="headerlink" href="#fader_design" title="Permanent link">#</a></h6> | `string` | <code>"default"</code> | Design style<br/><br/>Choices: `default`, `round`, `compact` |
|
||||
| <h6 id="fader_knobSize">knobSize<a class="headerlink" href="#fader_knobSize" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Fader knob size |
|
||||
| <h6 id="fader_colorKnob">colorKnob<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#fader_colorKnob" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Fader knob color |
|
||||
| <h6 id="fader_horizontal">horizontal<a class="headerlink" href="#fader_horizontal" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to display the fader horizontally |
|
||||
| <h6 id="fader_pips">pips<a class="headerlink" href="#fader_pips" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to show range breakpoints (ignored if `design` is `compact`) |
|
||||
| <h6 id="fader_dashed">dashed<a class="headerlink" href="#fader_dashed" title="Permanent link">#</a></h6> | `boolean`|<br/>`array` | <code>false</code> | Set to `true` to display a dashed gauge. Can be set as an `array` of two numbers : `[dash_size, gap_size]` |
|
||||
| <h6 id="fader_gradient">gradient<a class="headerlink" href="#fader_gradient" title="Permanent link">#</a></h6> | `array`|<br/>`object` | <code>[]</code> | When set, the meter's gauge will be filled with a linear color gradient<br/>- each item must be a CSS color string.<br/>- as an `object`: each key must be a number between 0 and 1<br/>- each item must be a CSS color string.<br/><br/>Examples: `['blue', 'red']`, {'0': 'blue', '0.9': 'blue', '1': 'red'} |
|
||||
|
||||
=== "fader"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="fader_snap">snap<a class="headerlink" href="#fader_snap" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | By default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position |
|
||||
| <h6 id="fader_touchZone">touchZone<a class="headerlink" href="#fader_touchZone" title="Permanent link">#</a></h6> | `string` | <code>"all"</code> | Restrict interaction to a part of the widget:<br/>- `all`: touching the widget anywhere will start an interaction<br/>- `knob`: touching the knob will start an interaction<br/>- `gauge`: touching anywhere in the knob's moving range will start an interaction<br/><br/>This setting is ignored in containers with `traversing` set to `true`<br/><br/>Choices: `all`, `knob`, `gauge` |
|
||||
| <h6 id="fader_spring">spring<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#fader_spring" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | When set to `true`, the widget will go back to its `default` value when released |
|
||||
| <h6 id="fader_doubleTap">doubleTap<a class="headerlink" href="#fader_doubleTap" title="Permanent link">#</a></h6> | `boolean`|<br/>`string` | <code>false</code> | Set to `true` to make the knob reset to its `default` value when receiving a double tap.<br/><br/>Can be an osc address, in which case the widget will just send an osc message with no value (but `preArgs` included).<br/><br/>If set to "script", `onTouch` will be called with `event.type` set to `doubleTap`. <br/><br/>Choices: `false`, `true`, `script` |
|
||||
| <h6 id="fader_range">range<a class="headerlink" href="#fader_range" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the breakpoints of the fader's scale:<br/>- keys can be percentages and/or `min` / `max`<br/>- values can be `number` or `object` if a custom label is needed<br/><br/>Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`) |
|
||||
| <h6 id="fader_logScale">logScale<a class="headerlink" href="#fader_logScale" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale. Set to `-1` for exponential scale. |
|
||||
| <h6 id="fader_sensitivity">sensitivity<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#fader_sensitivity" title="Permanent link">#</a></h6> | `number` | <code>1</code> | Defines the fader's sensitivity when `snap` is `false` |
|
||||
| <h6 id="fader_steps">steps<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#fader_steps" title="Permanent link">#</a></h6> | `number`|<br/>`array`|<br/>`string` | <code>""</code> | Restricts the widget's value:<br/>- `number`: define a number of evenly spaced steps<br/>- `array` of numbers: use arbitrary values as steps<br/>- `auto`: use values defined in `range` |
|
||||
| <h6 id="fader_origin">origin<a class="headerlink" href="#fader_origin" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Defines the starting point's value of the fader's gauge |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="fader_onValue">onValue<a class="headerlink" href="#fader_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height` |
|
||||
| <h6 id="fader_onTouch">onTouch<a class="headerlink" href="#fader_onTouch" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is touched and released. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
|
||||
??? api "<div id="knob">knob<a class="headerlink" href="#knob" title="Permanent link">#</a></div>"
|
||||
Rotative knob slider.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="knob_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#knob_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
| <h6 id="knob_design">design<a class="headerlink" href="#knob_design" title="Permanent link">#</a></h6> | `string` | <code>"default"</code> | Design style<br/><br/>Note: "solid" design uses "colorStroke" for the central knob color.<br/><br/>Choices: `default`, `solid`, `line` |
|
||||
| <h6 id="knob_colorKnob">colorKnob<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#knob_colorKnob" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Knob color |
|
||||
| <h6 id="knob_pips">pips<a class="headerlink" href="#knob_pips" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to show the scale's breakpoints |
|
||||
| <h6 id="knob_dashed">dashed<a class="headerlink" href="#knob_dashed" title="Permanent link">#</a></h6> | `boolean`|<br/>`array` | <code>false</code> | Set to `true` to display a dashed gauge. Can be set as an `array` of two numbers : `[dash_size, gap_size]` |
|
||||
| <h6 id="knob_angle">angle<a class="headerlink" href="#knob_angle" title="Permanent link">#</a></h6> | `number` | <code>270</code> | Defines the angle's width of the knob, in degrees |
|
||||
|
||||
=== "knob"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="knob_mode">mode<a class="headerlink" href="#knob_mode" title="Permanent link">#</a></h6> | `string` | <code>"vertical"</code> | - `vertical`: relative move in vertical motion<br/>- `circular`: relative move in circular motion<br/>- `snap`: snap to touch position<br/>- `snap-alt`: alternative snap mode that allow jumping from `range.min` to `range.max`. `sensitivity` is ignored with this mode.<br/><br/>Choices: `vertical`, `circular`, `snap`, `snap-alt` |
|
||||
| <h6 id="knob_spring">spring<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#knob_spring" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | When set to `true`, the widget will go back to its `default` value when released |
|
||||
| <h6 id="knob_doubleTap">doubleTap<a class="headerlink" href="#knob_doubleTap" title="Permanent link">#</a></h6> | `boolean`|<br/>`string` | <code>false</code> | Set to `true` to make the knob reset to its `default` value when receiving a double tap.<br/><br/>Can be an osc address, in which case the widget will just send an osc message with no value (but `preArgs` included).<br/><br/>If set to "script", `onTouch` will be called with `event.type` set to `doubleTap`. <br/><br/>Choices: `false`, `true`, `script` |
|
||||
| <h6 id="knob_range">range<a class="headerlink" href="#knob_range" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the breakpoints of the fader's scale:<br/>- keys can be percentages and/or `min` / `max`<br/>- values can be `number` or `object` if a custom label is needed<br/><br/>Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`) |
|
||||
| <h6 id="knob_logScale">logScale<a class="headerlink" href="#knob_logScale" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale. Set to `-1` for exponential scale. |
|
||||
| <h6 id="knob_sensitivity">sensitivity<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#knob_sensitivity" title="Permanent link">#</a></h6> | `number` | <code>1</code> | Defines the knob's sensitivity when `mode` is not `snap` |
|
||||
| <h6 id="knob_steps">steps<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#knob_steps" title="Permanent link">#</a></h6> | `string`|<br/>`number`|<br/>`array` | <code>""</code> | Restricts the widget's value:<br/>- `number`: define a number of evenly spaced steps<br/>- `array` of numbers: use arbitrary values as steps<br/>- `auto`: use values defined in `range` |
|
||||
| <h6 id="knob_origin">origin<a class="headerlink" href="#knob_origin" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Defines the starting point's value of the knob's gauge |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="knob_onValue">onValue<a class="headerlink" href="#knob_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height` |
|
||||
| <h6 id="knob_onTouch">onTouch<a class="headerlink" href="#knob_onTouch" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is touched and released. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
|
||||
??? api "<div id="encoder">encoder<a class="headerlink" href="#encoder" title="Permanent link">#</a></div>"
|
||||
A knob that sends a relative direction information instead of an absolute value.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="encoder_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#encoder_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
|
||||
=== "encoder"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="encoder_mode">mode<a class="headerlink" href="#encoder_mode" title="Permanent link">#</a></h6> | `string` | <code>"circular"</code> | - `circular`: relative move in circular motion<br/>- `snap`: snap to touch position and move in vertical motion<br/>- `vertical`: relative move in vertical motion<br/><br/>Choices: `circular`, `snap`, `vertical` |
|
||||
| <h6 id="encoder_doubleTap">doubleTap<a class="headerlink" href="#encoder_doubleTap" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to make the fader reset to its `default` value when receiving a double tap.<br/><br/>Can also be an osc address, in which case the widget will just send an osc message (`/<doubleTap> <preArgs>`) |
|
||||
| <h6 id="encoder_range">range<a class="headerlink" href="#encoder_range" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the breakpoints of the fader's scale:<br/>- keys can be percentages and/or `min` / `max`<br/>- values can be `number` or `object` if a custom label is needed<br/><br/>Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`) |
|
||||
| <h6 id="encoder_logScale">logScale<a class="headerlink" href="#encoder_logScale" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale. Set to `-1` for exponential scale. |
|
||||
| <h6 id="encoder_sensitivity">sensitivity<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#encoder_sensitivity" title="Permanent link">#</a></h6> | `number` | <code>1</code> | When set between 0 and 1, reduces the encoder's verbosity |
|
||||
| <h6 id="encoder_ticks">ticks<a class="headerlink" href="#encoder_ticks" title="Permanent link">#</a></h6> | `number` | <code>""</code> | Defines the granularity / verbosity of the encoder (number of step for a 360° arc) |
|
||||
| <h6 id="encoder_back">back<a class="headerlink" href="#encoder_back" title="Permanent link">#</a></h6> | `*` | <code>-1</code> | Defines which value is sent when rotating the encoder anticlockwise |
|
||||
| <h6 id="encoder_forth">forth<a class="headerlink" href="#encoder_forth" title="Permanent link">#</a></h6> | `*` | <code>1</code> | Defines which value is sent when rotating the encoder clockwise |
|
||||
| <h6 id="encoder_release">release<a class="headerlink" href="#encoder_release" title="Permanent link">#</a></h6> | `number` | <code>""</code> | Defines which value is sent when releasing the encoder:<br/>- Set to `null` to send send no argument in the osc message<br/>- Can be an `object` if the type needs to be specified |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="encoder_onValue">onValue<a class="headerlink" href="#encoder_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height`<br/><br/>Additional variables:<br/>- `locals.speed`: encoder's speed (reduce `sensitivity` to increase averaging)<br/>- `locals.angle`: encoder's angle in degrees |
|
||||
| <h6 id="encoder_onTouch">onTouch<a class="headerlink" href="#encoder_onTouch" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is touched and released. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
|
||||
??? api "<div id="range">range<a class="headerlink" href="#range" title="Permanent link">#</a></div>"
|
||||
A fader with two heads for setting a range.
|
||||
|
||||
=== "style"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="range_css">css<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#range_css" title="Permanent link">#</a></h6> | `string` | <code>""</code> | CSS rules. See <a href="https://openstagecontrol.ammd.net/docs/customization/css-tips/">documentation</a>.<br/><br/>Some style-related properties can be set or read from css using css variables:<br/>- `--color-background`: `colorBg`<br/>- `--color-widget`: `colorWidget`<br/>- `--color-fill`: `colorFill`<br/>- `--color-stroke`: `colorStroke`<br/>- `--color-text`: `colorText`<br/>- `--widget-padding`: `padding`<br/>- `--line-width`: `lineWidth`<br/>- `--border-radius`: `borderRadius`<br/>- `--alpha-fill-on`: `alphaFillOn`<br/>- `--alpha-fill-off`: `alphaFillOff`<br/>- `--alpha-stroke`: `alphaStroke`<br/>- `--alpha-pips`: `alphaPips`<br/>- `--alpha-pips-text`: `alphaPipsText`<br/><br/>Canvas-based widget have their computed width and height available as css variables (read-only):<br/>- `--widget-width`<br/>- `--widget-height` |
|
||||
| <h6 id="range_design">design<a class="headerlink" href="#range_design" title="Permanent link">#</a></h6> | `string` | <code>"default"</code> | Design style<br/><br/>Choices: `default`, `round`, `compact` |
|
||||
| <h6 id="range_knobSize">knobSize<a class="headerlink" href="#range_knobSize" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Fader knob size |
|
||||
| <h6 id="range_colorKnob">colorKnob<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#range_colorKnob" title="Permanent link">#</a></h6> | `string` | <code>"auto"</code> | Fader knob color |
|
||||
| <h6 id="range_horizontal">horizontal<a class="headerlink" href="#range_horizontal" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to display the fader horizontally |
|
||||
| <h6 id="range_pips">pips<a class="headerlink" href="#range_pips" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | Set to `true` to show range breakpoints (ignored if `design` is `compact`) |
|
||||
| <h6 id="range_dashed">dashed<a class="headerlink" href="#range_dashed" title="Permanent link">#</a></h6> | `boolean`|<br/>`array` | <code>false</code> | Set to `true` to display a dashed gauge. Can be set as an `array` of two numbers : `[dash_size, gap_size]` |
|
||||
| <h6 id="range_gradient">gradient<a class="headerlink" href="#range_gradient" title="Permanent link">#</a></h6> | `array`|<br/>`object` | <code>[]</code> | When set, the meter's gauge will be filled with a linear color gradient<br/>- each item must be a CSS color string.<br/>- as an `object`: each key must be a number between 0 and 1<br/>- each item must be a CSS color string.<br/><br/>Examples: `['blue', 'red']`, {'0': 'blue', '0.9': 'blue', '1': 'red'} |
|
||||
|
||||
=== "range"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="range_snap">snap<a class="headerlink" href="#range_snap" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | By default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position |
|
||||
| <h6 id="range_touchZone">touchZone<a class="headerlink" href="#range_touchZone" title="Permanent link">#</a></h6> | `string` | <code>"all"</code> | Restrict interaction to a part of the widget:<br/>- `all`: touching the widget anywhere will start an interaction<br/>- `knob`: touching the knob will start an interaction<br/>- `gauge`: touching anywhere in the knob's moving range will start an interaction<br/><br/>This setting is ignored in containers with `traversing` set to `true`<br/><br/>Choices: `all`, `knob`, `gauge` |
|
||||
| <h6 id="range_spring">spring<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#range_spring" title="Permanent link">#</a></h6> | `boolean` | <code>false</code> | When set to `true`, the widget will go back to its `default` value when released |
|
||||
| <h6 id="range_doubleTap">doubleTap<a class="headerlink" href="#range_doubleTap" title="Permanent link">#</a></h6> | `boolean`|<br/>`string` | <code>false</code> | Set to `true` to make the knob reset to its `default` value when receiving a double tap.<br/><br/>Can be an osc address, in which case the widget will just send an osc message with no value (but `preArgs` included).<br/><br/>If set to "script", `onTouch` will be called with `event.type` set to `doubleTap`. <br/><br/>Choices: `false`, `true`, `script` |
|
||||
| <h6 id="range_range">range<a class="headerlink" href="#range_range" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the breakpoints of the fader's scale:<br/>- keys can be percentages and/or `min` / `max`<br/>- values can be `number` or `object` if a custom label is needed<br/><br/>Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`) |
|
||||
| <h6 id="range_logScale">logScale<a class="headerlink" href="#range_logScale" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale. Set to `-1` for exponential scale. |
|
||||
| <h6 id="range_sensitivity">sensitivity<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#range_sensitivity" title="Permanent link">#</a></h6> | `number` | <code>1</code> | Defines the fader's sensitivity when `snap` is `false` |
|
||||
| <h6 id="range_steps">steps<sup><i class="fas fa-bolt" title="dynamic"></i></sup><a class="headerlink" href="#range_steps" title="Permanent link">#</a></h6> | `number`|<br/>`array`|<br/>`string` | <code>""</code> | Restricts the widget's value:<br/>- `number`: define a number of evenly spaced steps<br/>- `array` of numbers: use arbitrary values as steps<br/>- `auto`: use values defined in `range` |
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="range_onValue">onValue<a class="headerlink" href="#range_onValue" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget's value updates. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>.<br/><br/>Canvas-based widget have their computed width and height available as local variables:<br/>- `locals.width`<br/>- `locals.height` |
|
||||
| <h6 id="range_onTouch">onTouch<a class="headerlink" href="#range_onTouch" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is touched and released. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
## Scripts
|
||||
|
||||
??? api "<div id="script">script<a class="headerlink" href="#script" title="Permanent link">#</a></div>"
|
||||
Scripting widget utility with keyboard bindings
|
||||
|
||||
=== "scripting"
|
||||
|
||||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="script_onCreate">onCreate<a class="headerlink" href="#script_onCreate" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed when the widget is created. See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
| <h6 id="script_onKeyboard">onKeyboard<a class="headerlink" href="#script_onKeyboard" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed whenever the widget receives a keyboard event if `keyBinding` is set). See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
| <h6 id="script_keyBinding">keyBinding<a class="headerlink" href="#script_keyBinding" title="Permanent link">#</a></h6> | `string`|<br/>`array` | <code>""</code> | Key combo `string` or `array` of strings (see <a href="https://github.com/RobertWHurst/KeyboardJS">KeyboardJS</a> documentation).<br/><br/>If the editor is enabled, some keys / combos will not work.<br/><br/>To process all keystroke events, write `['']` |
|
||||
| <h6 id="script_keyRepeat">keyRepeat<a class="headerlink" href="#script_keyRepeat" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to prevent keydown repeats when holding the key combo pressed |
|
||||
| <h6 id="script_keyType">keyType<a class="headerlink" href="#script_keyType" title="Permanent link">#</a></h6> | `string` | <code>"keydown"</code> | Determines which key event trigger the script's execution<br/><br/>Choices: `keydown`, `keyup`, `both` |
|
||||
|
||||
??? api "<div id="variable">variable<a class="headerlink" href="#variable" title="Permanent link">#</a></div>"
|
||||
Receives / stores a value, to be used in scripts (using the get function) or in properties (using the @{} syntax).
|
||||
|
|
@ -78,7 +78,23 @@ This script has access to the same variables and functions as the `script` prope
|
|||
- `type`: `"start"` or `"stop"`
|
||||
- `handle`: `undefined` if the event concerns the widget, `integer` if it concerns one of it's handles (`multixy` and `range` widgets only)
|
||||
|
||||
Note: the [canvas](../canvas/) widgets exposes more informations in its `onTouch` script.
|
||||
[Canvas](../canvas/) and containers expose more informations in their `onTouch` script.
|
||||
|
||||
??? infos "Containers onTouch"
|
||||
|
||||
Containers (root, panel, etc) can monitor touch events happening inside them, it works like with [Canvas](../canvas/#ontouch), with a few differences:
|
||||
|
||||
- `event.firstTarget` will return the id of the first touched widget
|
||||
- setting `event.preventDefault` to `true` will prevent the event from reaching widgets in the container ('start' and 'move' events only)
|
||||
- setting `event.allowScroll` to `true` will allow touch scrolling where it would normally be prevented ('start' event only)
|
||||
- setting `event.inertia` will affect 'move' events (works like widget `sensitivity` in reverse (1 = normal, 10 = slow move))
|
||||
- `width` and `height` are undefined
|
||||
|
||||
Containers with `traversing` enabled change how touch events are emitted:
|
||||
|
||||
- a new 'stop' event is emitted whenever the pointer exits a touchable widget while pressed.
|
||||
- a new 'start' event is emitted whenever the pointer enters a touchable widget while pressed.
|
||||
|
||||
|
||||
### `onDraw`
|
||||
|
||||
|
|
@ -107,6 +123,8 @@ The following variables are available in this context:
|
|||
|
||||
This script is specific to the root widget, it's called before any other widget is created and can be used to create global variables / functions accessible in other scripts.
|
||||
|
||||
In this script, all osc messages emissions are prevented and changing the value of a widget won't trigger widget synchronisation / scripts / advanced syntaxes updates.
|
||||
|
||||
## Available variables
|
||||
|
||||
The following variables and functions are accessible in this context.
|
||||
|
|
@ -145,7 +163,7 @@ Returns the value of the first matching widget. If the returned value is an obje
|
|||
- `sync: false`: prevents widgets from triggering synchronization and scripts
|
||||
- `script: false`: prevents scripts but not synchronization
|
||||
- `send: false`: prevents widgets from sending osc messages
|
||||
- `external: true`: simulates a value coming from an osc/midi message (implies `sync: false` automatically)
|
||||
- `external: true`: simulates a value coming from an osc/midi message (implies `send: false` automatically)
|
||||
|
||||
Sets the value of the first matching widget. If `ìd` contains wildcards, affects all matching widgets **except** the emitting widget.
|
||||
|
||||
|
|
@ -287,7 +305,7 @@ Reference:
|
|||
|
||||
- `id` (optional): widget `id` as a string
|
||||
|
||||
Gives focus to a widget (ie input widget).
|
||||
Gives focus to a widget (ie input widget). If `id` is omitted or falsy, currently focused element will be unfocused.
|
||||
|
||||
*Built-in client only*: tells the operating system to give the focus to the client window
|
||||
|
||||
|
|
@ -312,10 +330,6 @@ Gives focus to a widget (ie input widget).
|
|||
|
||||
Returns the scroll position of a container as a `[x, y]` array.
|
||||
|
||||
**Deprecated**
|
||||
|
||||
Scrollable panels expose their scroll position normalized between 0 and 1 with their value.
|
||||
|
||||
----
|
||||
|
||||
#### `setScroll(id, x, y)`
|
||||
|
|
@ -325,26 +339,50 @@ Scrollable panels expose their scroll position normalized between 0 and 1 with t
|
|||
|
||||
Sets the scroll state of a container.
|
||||
|
||||
**Deprecated**
|
||||
----
|
||||
|
||||
#### `scrollIntoView(id, option)`
|
||||
- `id`: widget `id` as a string. Can be `"this"` to target the host widget, or `"parent"` to target the parent widget.
|
||||
- `option`: `alignToTop` or `options` argument as defined in https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
|
||||
|
||||
Scroll containers to make widget(s) visible.
|
||||
|
||||
Scrollable panels expose their scroll position normalized between 0 and 1 with their value.
|
||||
|
||||
----
|
||||
|
||||
#### `toolbar(i1, i2, ...)`
|
||||
- `iX`: menu entry index
|
||||
#### `toolbar(id)`
|
||||
- `id` menu entry id (string)
|
||||
|
||||
Triggers toolbar action at specified index.
|
||||
Triggers toobar action if currently available (ie accessible from the menu). `id` can be one of the following:
|
||||
|
||||
!!! example "Examples"
|
||||
- `session-new`,`session-open`, `session-save`, `session-save-as`, `session-fragment`, `session-backup`, `session-import`, `session-export`
|
||||
- `state-store`, `state-recall`, `state-send`, `state-open`, `state-save`, `state-save-as`, `state-import`, `state-export`
|
||||
- `editor-enabled`, `editor-grid`, `editor-tree`, `editor-inspector`, `editor-percents`
|
||||
- `console-enabled`, `console-clear`
|
||||
- `fullscreen`, `notifictions`, `prevent-sleep`, `virtual-keyboard`
|
||||
|
||||
Some actions will only be triggered if initiated with a physical user interaction, check the console for errors if it doesn't work as expected.
|
||||
|
||||
|
||||
=== "Legacy syntax: `toolbar(i1, i2, ...)`"
|
||||
|
||||
- `iX`: menu entry index
|
||||
|
||||
Triggers toolbar action at specified index.
|
||||
|
||||
!!! example "Examples"
|
||||
|
||||
- `toolbar(0, 0)` -> Open a new session
|
||||
- `toolbar(4)` -> Toggle full screen
|
||||
|
||||
Actions will only be triggered if initiated with a user interaction. Fullscreen cannot be toggled with a simulated interaction (i.e. using `/SET`)
|
||||
|
||||
----
|
||||
|
||||
#### `getToolbar(id)`
|
||||
- `id` menu entry id (string)
|
||||
|
||||
Returns `true` if the toolbar entry exists and is currently activated.
|
||||
|
||||
#### `openUrl(url)`
|
||||
- `url`: http(s) url
|
||||
|
||||
|
|
@ -381,10 +419,19 @@ Returns the instance of [Navigator](https://developer.mozilla.org/en-US/docs/Web
|
|||
|
||||
#### `browseFile(options, callback)`
|
||||
|
||||
Opens the file file browser and pass selected file to a callback function (does not create nor read files by itself).
|
||||
Opens the server file browser and pass selected file to a callback function (does not create nor read files by itself).
|
||||
|
||||
- `options`: object with the following keys:
|
||||
- `extension`: allowed extension (default: "*")
|
||||
- `directory`: starting directory for browser (default: user's home)
|
||||
- `allowDir`: allow choosing a directory instead of a file (default: false)
|
||||
- `mode`: "save" or "open"
|
||||
- `callback`: function called with 1 argument (file path)
|
||||
|
||||
#### `uploadFile(options, callback)`
|
||||
|
||||
Opens the client file upload prompt and pass the raw content of selected file to a callback function.
|
||||
|
||||
- `options`: object with the following keys:
|
||||
- `types`: equivalent of HTML attribute [`accept`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/accept)
|
||||
- `callback`: function called with 1 argument (file content)
|
||||
|
|
|
|||
|
|
@ -3,66 +3,20 @@
|
|||
!!! tip ""
|
||||
[*Click here*](/docs/getting-started/introduction/#installation) to read the installation guide.
|
||||
|
||||
<a href="https://github.com/jean-emmanuel/open-stage-control/releases/latest"> Open Stage Control <span id="osc-version"span></a>
|
||||
<a href="https://framagit.org/jean-emmanuel/open-stage-control/-/releases/v{{config.latest_release}}">
|
||||
Open Stage Control v{{config.latest_release}}
|
||||
</a>
|
||||
|
||||
<div id="osc-assets">Loading assets...</div>
|
||||
<ul>
|
||||
<li><a href="/packages/open-stage-control-{{config.latest_release}}-1.x86_64.rpm"><i class="fa fa-download"></i>GNU/Linux RPM (64-bit)</a></li>
|
||||
<li><a href="/packages/open-stage-control_{{config.latest_release}}_amd64.deb"><i class="fa fa-download"></i>GNU/Linux Debian (64-bit)</a></li>
|
||||
<li><a href="/packages/open-stage-control_{{config.latest_release}}_linux-x64.zip"><i class="fa fa-download"></i>GNU/Linux (64-bit)</a></li>
|
||||
<li><a href="/packages/open-stage-control_{{config.latest_release}}_node.zip"><i class="fa fa-download"></i>Node.js</a></li>
|
||||
<li><a href="/packages/open-stage-control_{{config.latest_release}}_osx-x64.zip"><i class="fa fa-download"></i>MacOS x64</a></li>
|
||||
<li><a href="/packages/open-stage-control_{{config.latest_release}}_osx-arm64.zip"><i class="fa fa-download"></i>MacOS arm64</a></li>
|
||||
<li><a href="/packages/open-stage-control_{{config.latest_release}}_win32-x64.zip"><i class="fa fa-download"></i>Windows (64-bit)</a></li>
|
||||
|
||||
<script>
|
||||
|
||||
var oReq = new XMLHttpRequest();
|
||||
oReq.addEventListener('load', reqListener);
|
||||
oReq.open('GET', 'https://api.github.com/repos/jean-emmanuel/open-stage-control/releases/latest')
|
||||
oReq.send()
|
||||
|
||||
|
||||
function text(id, str) {
|
||||
var el = typeof id === 'string' ? document.getElementById(id) : id
|
||||
el.textContent = str
|
||||
}
|
||||
|
||||
var names = {
|
||||
'x86_64.rpm': 'GNU/Linux RPM (64-bit)',
|
||||
'amd64.deb': 'GNU/Linux Debian (64-bit)',
|
||||
'linux-x64.zip': 'GNU/Linux (64-bit)',
|
||||
'node.zip': 'Node.js',
|
||||
'osx.zip': 'MacOS',
|
||||
'win32-x64.zip': 'Windows (64-bit)'
|
||||
}
|
||||
|
||||
function reqListener () {
|
||||
|
||||
var data = JSON.parse(this.responseText)
|
||||
var date = new Date(data.published_at)
|
||||
|
||||
text('osc-version', data.tag_name + ' (' + date.toLocaleDateString() + ')')
|
||||
|
||||
var list = document.createElement('ul')
|
||||
for (var i in data.assets) {
|
||||
var item = document.createElement('li'),
|
||||
link = document.createElement('a'),
|
||||
name = data.assets[i].name
|
||||
|
||||
for (var k in names) {
|
||||
if (name.includes(k)) {
|
||||
name = names[k]
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
link.innerHTML = '<i class="fa fa-download"></i> ' + name + ' <span class="download-size">(' + (data.assets[i].size / 1024 / 1024).toFixed(0) + 'M)</span>'
|
||||
link.href = data.assets[i].browser_download_url
|
||||
|
||||
item.appendChild(link)
|
||||
list.appendChild(item)
|
||||
}
|
||||
var assets = document.getElementById('osc-assets')
|
||||
assets.innerHTML = ''
|
||||
assets.appendChild(list)
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</ul>
|
||||
|
||||
|
||||
<style>
|
||||
|
|
@ -98,7 +52,7 @@ li i {
|
|||
|
||||
<div>
|
||||
<a
|
||||
href="https://openstagecontrol.ammd.net/docs/changelog/"
|
||||
href="/docs/changelog/"
|
||||
class="md-button md-button-small"
|
||||
>
|
||||
Read the Changelog
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
font-style: normal;
|
||||
font-weight: 900;
|
||||
font-display: block;
|
||||
src: url("./fa-solid-900.woff2?__OSC_ASSET__=1") format("woff2"); }
|
||||
src: url("./fa-solid-900.woff2") format("woff2"); }
|
||||
|
||||
.fa,
|
||||
.fas,
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: url('./Roboto-Bold.woff2?__OSC_ASSET__=1') format('woff2');
|
||||
src: url('./Roboto-Bold.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
src: url('./Roboto-Medium.woff2?__OSC_ASSET__=1') format('woff2');
|
||||
src: url('./Roboto-Medium.woff2') format('woff2');
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -17,19 +17,19 @@
|
|||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url('./Roboto-Regular.woff2?__OSC_ASSET__=1') format('woff2');
|
||||
src: url('./Roboto-Regular.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 100;
|
||||
src: url('./Roboto-Light.woff2?__OSC_ASSET__=1') format('woff2');
|
||||
src: url('./Roboto-Light.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Roboto Mono';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
src: url('./roboto-mono.woff?__OSC_ASSET__=1') format('woff');
|
||||
src: url('./roboto-mono.woff') format('woff');
|
||||
}
|
||||
|
|
|
|||
BIN
resources/images/logo_tray.png
Normal file
BIN
resources/images/logo_tray.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 931 B |
BIN
resources/images/logo_tray@x2.png
Normal file
BIN
resources/images/logo_tray@x2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
|
|
@ -1,10 +1,11 @@
|
|||
site_name: Open Stage Control
|
||||
repo_name: open-stage-control
|
||||
repo_url: https://github.com/jean-emmanuel/open-stage-control
|
||||
repo_url: https://framagit.org/jean-emmanuel/open-stage-control
|
||||
edit_uri: tree/master/resources/docs/
|
||||
copyright: "Copyleft © Jean-Emmanuel Doucet @ <a href='http://ammd.net'>AMMD</a> (<a href='https://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE'>GNU/GPLv3</a>)"
|
||||
copyright: "Copyleft © Jean-Emmanuel Doucet @ <a href='http://ammd.net'>AMMD</a> (<a href='https://framagit.org/jean-emmanuel/open-stage-control/-/blob/master/LICENSE'>GNU/GPLv3</a>)"
|
||||
site_description: "Libre and modular OSC / MIDI controller"
|
||||
site_dir: '../app/docs/'
|
||||
latest_release: 1.31.2
|
||||
|
||||
theme:
|
||||
name: 'material'
|
||||
|
|
@ -63,9 +64,6 @@ nav:
|
|||
- Remote control: docs/remote-control.md
|
||||
- Credits: docs/credits.md
|
||||
- Changelog: docs/changelog.md
|
||||
|
||||
- Bug Tracker:
|
||||
- 'Bug Tracker': 'https://github.com/jean-emmanuel/open-stage-control/issues'
|
||||
- Community:
|
||||
- 'Community forums': 'https://openstagecontrol.discourse.group'
|
||||
|
||||
|
|
@ -96,3 +94,7 @@ markdown_extensions:
|
|||
- pymdownx.tabbed:
|
||||
alternate_style: true
|
||||
- pymdownx.details
|
||||
|
||||
|
||||
plugins:
|
||||
- macros
|
||||
|
|
|
|||
|
|
@ -1,98 +0,0 @@
|
|||
var build = require('./build'),
|
||||
path = require('path'),
|
||||
babelify = require('babelify'),
|
||||
nanohtml = require('nanohtml'),
|
||||
watch = process.argv.includes('--watch'),
|
||||
through = require('through'),
|
||||
minimatch = require('minimatch')
|
||||
|
||||
|
||||
var ignores = ['**/*.min.js', '**/jquery.ui.js', 'gyronorm.complete.min.js'],
|
||||
transformWrapper = function(transform){
|
||||
return function(file, opts){
|
||||
if (ignores.some(pattern => minimatch(file, pattern))) {
|
||||
return through()
|
||||
} else {
|
||||
return transform(file, opts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var transforms = [
|
||||
[transformWrapper(nanohtml)],
|
||||
[transformWrapper(babelify)]
|
||||
]
|
||||
|
||||
console.warn('\033[36m=> Building compressed client scripts...\033[0m')
|
||||
transforms.push([transformWrapper(require('uglifyify')), {global: true, safari10: true}])
|
||||
|
||||
var bundle = build({
|
||||
input: '../src/client/index.js',
|
||||
output: '../app/client/open-stage-control-client.js',
|
||||
options: {
|
||||
debug: true,
|
||||
insertGlobals: false,
|
||||
noParse: ['**/*.min.js', '**/jquery.ui.js'],
|
||||
cache: {},
|
||||
packageCache: {},
|
||||
},
|
||||
plugins: watch ? [require('watchify')] : [],
|
||||
transforms: transforms,
|
||||
ignore: [
|
||||
'postcss' // only needed by sanitize-html if <style> is allowed; somehow fails at object spread syntax transpilation
|
||||
]
|
||||
})
|
||||
|
||||
if (watch) {
|
||||
|
||||
var ansiHTML = require('ansi-html'),
|
||||
WS = require('../node_modules/ws')
|
||||
|
||||
function send(msg, data){
|
||||
var ipc = new WS('ws://127.0.0.1:8080/dev/')
|
||||
ipc.on('error', ()=>{})
|
||||
ipc.on('open', ()=>{
|
||||
ipc.send(JSON.stringify([msg, data]))
|
||||
ipc.close()
|
||||
})
|
||||
}
|
||||
|
||||
bundle.b.on('update', hotBundle)
|
||||
bundle.b.on('log', function(msg) {console.warn('\x1b[36m%s\x1b[0m', msg)})
|
||||
|
||||
function hotBundle() {
|
||||
|
||||
var output = bundle()
|
||||
|
||||
output.on('end', (err)=> {
|
||||
console.log('Build successful reloading...')
|
||||
send('reload')
|
||||
})
|
||||
|
||||
output.on('error', (err)=> {
|
||||
|
||||
console.error(err.stack)
|
||||
send('errorPopup',
|
||||
'<div class="error-stack">' +
|
||||
ansiHTML(
|
||||
err.stack
|
||||
.replace(/^ at .*/gm, '') // remove useless stack
|
||||
.replace(new RegExp(path.resolve(__dirname + '/..'), 'g'),'.') // shorten file path
|
||||
.trim()
|
||||
.replace('\n','\n\n') // add 1 new line after 1st line
|
||||
) +
|
||||
'</div>'
|
||||
)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
hotBundle()
|
||||
|
||||
} else {
|
||||
|
||||
bundle()
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +1,19 @@
|
|||
var sass = require('node-sass'),
|
||||
var sass = require('sass'),
|
||||
path = require('path'),
|
||||
fs = require('fs')
|
||||
|
||||
var indir = path.resolve(__dirname + '/../src/scss/'),
|
||||
outdir= path.resolve(__dirname + '/../app/assets/')
|
||||
|
||||
fs.mkdirSync(outdir + '/themes/', {recursive: true})
|
||||
|
||||
fs.readdirSync(indir + '/themes/').forEach(file => {
|
||||
|
||||
if (file.includes('.scss') && file !== 'default.scss') {
|
||||
let result = sass.renderSync({
|
||||
file: indir + '/themes/' + file,
|
||||
outputStyle: 'compressed'
|
||||
outputStyle: 'compressed',
|
||||
silenceDeprecations: ['mixed-decls', 'slash-div', 'import', 'legacy-js-api']
|
||||
})
|
||||
|
||||
fs.writeFileSync(outdir + '/themes/' + file.split('/').pop().replace('scss', 'css'), result.css)
|
||||
|
|
@ -22,7 +25,8 @@ var result = sass.renderSync({
|
|||
file: indir + '/index.scss',
|
||||
outFile: outdir + '/open-stage-control.css',
|
||||
outputStyle: 'compressed',
|
||||
sourceMap: true
|
||||
sourceMap: true,
|
||||
silenceDeprecations: ['mixed-decls', 'slash-div', 'import', 'legacy-js-api']
|
||||
})
|
||||
|
||||
fs.writeFileSync(outdir + '/open-stage-control.css', result.css)
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
var build = require('./build')
|
||||
|
||||
build({
|
||||
input: '../src/launcher/index.js',
|
||||
output: '../app/launcher/open-stage-control-launcher.js',
|
||||
options: {
|
||||
debug: true,
|
||||
ignoreMissing: false,
|
||||
detectGlobals: false,
|
||||
bare: true,
|
||||
noParse: ['**/mathjs/dist/math.min.js']
|
||||
},
|
||||
exclude: [
|
||||
'electron',
|
||||
]
|
||||
})()
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
var build = require('./build'),
|
||||
babelify = require('babelify')
|
||||
|
||||
build({
|
||||
input: '../src/server/index.js',
|
||||
output: '../app/server/open-stage-control-server.js',
|
||||
options: {
|
||||
commonDir: false,
|
||||
ignoreMissing: true,
|
||||
debug: true,
|
||||
builtins: false,
|
||||
commondir: false,
|
||||
insertGlobalVars: {
|
||||
__filename: true,
|
||||
__dirname: true,
|
||||
process: true,
|
||||
electron: true,
|
||||
global: true
|
||||
},
|
||||
browserField: false,
|
||||
},
|
||||
ignore: 'serialport',
|
||||
exclude: [
|
||||
'electron',
|
||||
'./fsevents.node' // osx binary module, to be copied as is
|
||||
]
|
||||
})()
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
var browserify = require('browserify'),
|
||||
exorcist = require('exorcist'),
|
||||
licensify = require('licensify'),
|
||||
fs = require('fs'),
|
||||
path = require('path')
|
||||
|
||||
|
||||
module.exports = (opt) => {
|
||||
|
||||
var {input, output, options, ignore, exclude, transforms, plugins} = opt,
|
||||
inputPath = path.resolve(__dirname + '/' + input),
|
||||
outputPath = path.resolve(__dirname + '/' + output),
|
||||
b
|
||||
|
||||
if (!plugins) plugins = []
|
||||
if (!plugins.includes(licensify)) plugins.push(licensify)
|
||||
|
||||
b = browserify(inputPath, options)
|
||||
|
||||
if (ignore) b.ignore(ignore)
|
||||
if (exclude) b.exclude(exclude)
|
||||
|
||||
for (var plugin of plugins) {
|
||||
b.plugin(plugin)
|
||||
}
|
||||
|
||||
if (transforms) {
|
||||
for (var transform of transforms) {
|
||||
var [t, opts] = transform
|
||||
b.transform(t, opts)
|
||||
}
|
||||
}
|
||||
|
||||
function bundle() {
|
||||
|
||||
var output = b.bundle()
|
||||
|
||||
var toWrite = output.pipe(exorcist(outputPath + '.map'))
|
||||
toWrite.pipe(fs.createWriteStream(outputPath))
|
||||
|
||||
return output
|
||||
|
||||
}
|
||||
|
||||
bundle.b = b
|
||||
|
||||
return bundle
|
||||
|
||||
}
|
||||
40
scripts/client.plugin-watch.js
Normal file
40
scripts/client.plugin-watch.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
var ansiHTML = require('ansi-html'),
|
||||
WS = require('../node_modules/ws'),
|
||||
path = require('path')
|
||||
|
||||
function send(msg, data){
|
||||
var ipc = new WS('ws://127.0.0.1:8080/dev/')
|
||||
ipc.on('error', ()=>{})
|
||||
ipc.on('open', ()=>{
|
||||
ipc.send(JSON.stringify([msg, data]))
|
||||
ipc.close()
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = function watchChangePlugin() {
|
||||
|
||||
var reloadClient = false
|
||||
|
||||
return {
|
||||
|
||||
buildEnd(error) {
|
||||
|
||||
if (error) {
|
||||
var msg = `<div class="error-stack">
|
||||
${error.message.replace(path.resolve(__dirname + '/..'),'')} at line ${error.loc.line}\n${error.frame}
|
||||
</div>`
|
||||
send('errorPopup', msg.trim())
|
||||
reloadClient = false
|
||||
} else {
|
||||
reloadClient = true
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
writeBundle() {
|
||||
if (reloadClient) {
|
||||
send('reload')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
98
scripts/client.rollup.config.js
Normal file
98
scripts/client.rollup.config.js
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
var commonjs = require('@rollup/plugin-commonjs'),
|
||||
nodeResolve = require('@rollup/plugin-node-resolve'),
|
||||
json = require('@rollup/plugin-json'),
|
||||
babel = require('@rollup/plugin-babel'),
|
||||
terser = require('@rollup/plugin-terser'),
|
||||
copy = require('rollup-plugin-copy'),
|
||||
license = require('rollup-plugin-license'),
|
||||
watchChange = require('./client.plugin-watch'),
|
||||
package = require('../package.json'),
|
||||
path = require('path'),
|
||||
watch = process.argv.includes('--watch')
|
||||
|
||||
module.exports = {
|
||||
input: 'src/client/index.mjs',
|
||||
output: [
|
||||
{
|
||||
dir: 'app/client/',
|
||||
chunkFileNames: `[name].js`,
|
||||
entryFileNames: `[name].js`,
|
||||
format: 'es',
|
||||
sourcemap: true,
|
||||
sourcemapExcludeSources: true
|
||||
},
|
||||
],
|
||||
treeshake: false,
|
||||
watch: {
|
||||
clearScreen: false
|
||||
},
|
||||
plugins: [
|
||||
json(),
|
||||
nodeResolve({
|
||||
browser: true
|
||||
}),
|
||||
commonjs(),
|
||||
watch ? {} : babel({
|
||||
babelHelpers: 'bundled',
|
||||
babelrc: false,
|
||||
exclude: [
|
||||
/node_modules\/core-js/,
|
||||
/node_modules\/ace-builds/
|
||||
],
|
||||
presets: [[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets: {
|
||||
ios: '11',
|
||||
chrome: '70'
|
||||
},
|
||||
useBuiltIns: 'usage',
|
||||
corejs: 3,
|
||||
modules:false
|
||||
}
|
||||
]]
|
||||
}),
|
||||
watch ? {} : terser({
|
||||
sourceMap: true,
|
||||
keep_classnames: true,
|
||||
keep_fnames: true,
|
||||
output: {
|
||||
comments: false,
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: 'remove-node-modules-from-source-map',
|
||||
enforce: 'post',
|
||||
transform(code, id) {
|
||||
if (id.includes('node_modules')) {
|
||||
return { code, map: { mappings: '' } }
|
||||
}
|
||||
}
|
||||
},
|
||||
watch ? {} :license({
|
||||
thirdParty: {
|
||||
includeSelf: true,
|
||||
output: 'app/client/LICENSES',
|
||||
},
|
||||
}),
|
||||
watch ? {} : copy({
|
||||
targets: [
|
||||
{src: 'resources/images/logo_nobadge.png', dest: 'app/assets/', rename: 'favicon.png'},
|
||||
{src: 'resources/images/logo.png', dest: 'app/assets/'},
|
||||
{src: 'resources/images/logo_tray.png', dest: 'app/assets/'},
|
||||
{src: 'resources/images/logo_tray@x2.png', dest: 'app/assets/'},
|
||||
{src: 'resources/images/logo_16x16.png', dest: 'app/assets/'},
|
||||
{src: 'resources/fonts/*', dest: 'app/assets/fonts/'},
|
||||
{src: 'node_modules/ace-builds/src-min/worker-css.js', dest: 'app/client/ace/'},
|
||||
{src: 'node_modules/ace-builds/src-min/worker-html.js', dest: 'app/client/ace/'},
|
||||
{src: 'node_modules/ace-builds/src-min/worker-javascript.js', dest: 'app/client/ace/'},
|
||||
{src: 'node_modules/ace-builds/src-min/ace.js', dest: 'app/client/ace/'},
|
||||
{src: 'src/html/client.html', dest: 'app/client/', rename: 'index.html', transform: (contents)=>{
|
||||
return contents.toString().replace(/\$\{([^\}]+)\}/g, (m, p1)=>{return package[p1]})
|
||||
}},
|
||||
|
||||
]
|
||||
}),
|
||||
watchChange()
|
||||
]
|
||||
};
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
var cpr = require('cpr'),
|
||||
fs = require('fs'),
|
||||
path = require('path'),
|
||||
files = [
|
||||
['../resources/images/logo_nobadge.png', '../app/assets/favicon.png'],
|
||||
['../resources/images/logo.png', '../app/assets/logo.png'],
|
||||
['../LICENSE', '../app/LICENSE'],
|
||||
['../src/python/', '../app/server/python/'],
|
||||
['../resources/fonts/', '../app/assets/fonts/'],
|
||||
['../src/html/launcher.html', '../app/launcher/index.html'],
|
||||
['../node_modules/fsevents/fsevents.node', '../app/server/fsevents.node'],
|
||||
['../node_modules/ace-builds/src-min/worker-css.js', '../app/client/workers/worker-css.js'],
|
||||
['../node_modules/ace-builds/src-min/worker-html.js', '../app/client/workers/worker-html.js'],
|
||||
['../node_modules/ace-builds/src-min/worker-javascript.js', '../app/client/workers/worker-javascript.js'],
|
||||
]
|
||||
|
||||
for (var i in files) {
|
||||
cpr(...files[i].map(f => path.resolve(__dirname + '/' + f)), {
|
||||
overwrite: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
var packageJson = require('../package.json'),
|
||||
appJson = {},
|
||||
copiedProps = [
|
||||
"name",
|
||||
"productName",
|
||||
"description",
|
||||
"version",
|
||||
"author",
|
||||
"repository",
|
||||
"homepage",
|
||||
"license",
|
||||
"yargs",
|
||||
"engines"
|
||||
]
|
||||
|
||||
for (var k of copiedProps) {
|
||||
appJson[k] = packageJson[k]
|
||||
}
|
||||
|
||||
appJson.main = appJson.bin = "index.js"
|
||||
appJson.scripts = {
|
||||
"start": "electron index.js",
|
||||
"start-node": "node index.js"
|
||||
}
|
||||
|
||||
appJson.optionalDependencies = {
|
||||
electron: packageJson.optionalDependencies.electron
|
||||
}
|
||||
|
||||
fs.writeFileSync(path.resolve(__dirname + '/../app/package.json'), JSON.stringify(appJson, null, ' '))
|
||||
|
||||
var clientHtml = fs.readFileSync(path.resolve(__dirname + '/../src/html/client.html'))
|
||||
.toString()
|
||||
.replace(/\$\{([^\}]+)\}/g, (m, p1)=>{return appJson[p1]})
|
||||
|
||||
fs.writeFileSync(path.resolve(__dirname + '/../app/client/index.html'), clientHtml)
|
||||
45
scripts/dist_packages.sh
Executable file
45
scripts/dist_packages.sh
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
#!/bin/bash
|
||||
|
||||
# clean
|
||||
rm -rf dist app
|
||||
|
||||
# buid
|
||||
npm run build
|
||||
npm run build-docs
|
||||
npm run package -- --all
|
||||
PLATFORM=darwin ARCH=arm64 npm run package
|
||||
npm run package-node
|
||||
|
||||
# get current version
|
||||
VERSION=$(sed -nE 's/^\s*"version":\ "(.*?)",$/\1/p' package.json)
|
||||
|
||||
cd dist
|
||||
|
||||
# fetch & copy midi bins
|
||||
mkdir tmp && cd tmp
|
||||
cp ../../bin/osc-midi-* ./
|
||||
chmod +x *
|
||||
touch .expect-midi-bin
|
||||
cp {.expect-midi-bin,osc-midi-linux} ../open-stage-control-linux-x64/resources/app/server/python/
|
||||
cp {.expect-midi-bin,osc-midi-windows.exe} ../open-stage-control-win32-x64/resources/app/server/python/
|
||||
cp {.expect-midi-bin,osc-midi-osx} ../open-stage-control-darwin-x64/open-stage-control.app/Contents/Resources/app/server/python/
|
||||
cp {.expect-midi-bin,osc-midi-osx} ../open-stage-control-darwin-arm64/open-stage-control.app/Contents/Resources/app/server/python/
|
||||
cd ..
|
||||
rm -rf tmp
|
||||
|
||||
# make packages
|
||||
mkdir packages
|
||||
npm run deb64
|
||||
npm run rpm64
|
||||
mv *.{deb,rpm} packages/
|
||||
|
||||
mv open-stage-control-node open-stage-control_${VERSION}_node
|
||||
mv open-stage-control-win32-x64 open-stage-control_${VERSION}_win32-x64
|
||||
mv open-stage-control-linux-x64 open-stage-control_${VERSION}_linux-x64
|
||||
|
||||
echo "Creating zip packages..."
|
||||
zip -q -r --symlinks packages/open-stage-control_${VERSION}_osx-x64.zip open-stage-control-darwin-x64/open-stage-control.app
|
||||
zip -q -r --symlinks packages/open-stage-control_${VERSION}_osx-arm64.zip open-stage-control-darwin-arm64/open-stage-control.app
|
||||
zip -q -r packages/open-stage-control_${VERSION}_node.zip open-stage-control_${VERSION}_node
|
||||
zip -q -r packages/open-stage-control_${VERSION}_win32-x64.zip open-stage-control_${VERSION}_win32-x64
|
||||
zip -q -r packages/open-stage-control_${VERSION}_linux-x64.zip open-stage-control_${VERSION}_linux-x64
|
||||
25
scripts/docs.rollup.config.js
Normal file
25
scripts/docs.rollup.config.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
var commonjs = require('@rollup/plugin-commonjs'),
|
||||
nodeResolve = require('@rollup/plugin-node-resolve'),
|
||||
json = require('@rollup/plugin-json')
|
||||
|
||||
module.exports = {
|
||||
input: 'src/docs/widgets-reference.mjs',
|
||||
output: [
|
||||
{
|
||||
file: 'src/docs/widgets-reference.js',
|
||||
inlineDynamicImports: true,
|
||||
format: 'commonjs',
|
||||
sourcemap: false,
|
||||
strict: false,
|
||||
indent: false,
|
||||
name: '_'
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
json(),
|
||||
nodeResolve({
|
||||
browser: true
|
||||
}),
|
||||
commonjs()
|
||||
]
|
||||
};
|
||||
48
scripts/launcher.rollup.config.js
Normal file
48
scripts/launcher.rollup.config.js
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
var commonjs = require('@rollup/plugin-commonjs'),
|
||||
nodeResolve = require('@rollup/plugin-node-resolve'),
|
||||
json = require('@rollup/plugin-json'),
|
||||
babel = require('@rollup/plugin-babel'),
|
||||
terser = require('@rollup/plugin-terser'),
|
||||
copy = require('rollup-plugin-copy'),
|
||||
license = require('rollup-plugin-license'),
|
||||
package = require('../package.json'),
|
||||
path = require('path')
|
||||
|
||||
module.exports = {
|
||||
input: 'src/launcher/index.mjs',
|
||||
output: [
|
||||
{
|
||||
dir: 'app/launcher/',
|
||||
chunkFileNames: `[name].js`,
|
||||
format: 'commonjs',
|
||||
sourcemap: true,
|
||||
sourcemapExcludeSources: true,
|
||||
strict: false
|
||||
},
|
||||
],
|
||||
treeshake: false,
|
||||
external: ['electron'],
|
||||
watch: {
|
||||
clearScreen: false
|
||||
},
|
||||
plugins: [
|
||||
json(),
|
||||
commonjs({
|
||||
ignoreGlobal: true,
|
||||
ignoreDynamicRequires: true
|
||||
}),
|
||||
nodeResolve(),
|
||||
terser(),
|
||||
license({
|
||||
thirdParty: {
|
||||
includeSelf: true,
|
||||
output: 'app/launcher/LICENSES',
|
||||
},
|
||||
}),
|
||||
copy({
|
||||
targets: [
|
||||
{src: 'src/html/launcher.html', dest: 'app/launcher/', rename: 'index.html'},
|
||||
]
|
||||
})
|
||||
]
|
||||
};
|
||||
|
|
@ -1,8 +1,4 @@
|
|||
var browserify = require('browserify'),
|
||||
exorcist = require('exorcist'),
|
||||
licensify = require('licensify'),
|
||||
fs = require('fs'),
|
||||
cpr = require('cpr'),
|
||||
var cpr = require('cpr'),
|
||||
path = require('path'),
|
||||
files = ['../app', '../dist/open-stage-control-node']
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
const packager = require('electron-packager'),
|
||||
const packager = require('@electron/packager'),
|
||||
path = require('path'),
|
||||
appData = require('../app/package.json'),
|
||||
safeFFMPEG = require('electron-packager-plugin-non-proprietary-codecs-ffmpeg').default,
|
||||
|
|
@ -12,7 +12,7 @@ packager({
|
|||
name: appData.name,
|
||||
platform: all ? ['linux', 'win32', 'darwin'] : process.env.PLATFORM,
|
||||
arch: process.env.ARCH || 'x64',
|
||||
electronVersion: process.env.ARCH === 'armv7l' ? '1.7.11' : require('../package.json').optionalDependencies.electron,
|
||||
electronVersion: process.env.ELECTRON_VERSION || require('../package.json').optionalDependencies.electron,
|
||||
overwrite: true,
|
||||
out: path.resolve(__dirname + '/../dist'),
|
||||
icon: path.resolve(__dirname + '/../resources/images/logo'),
|
||||
|
|
|
|||
65
scripts/server.rollup.config.js
Normal file
65
scripts/server.rollup.config.js
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
var commonjs = require('@rollup/plugin-commonjs'),
|
||||
nodeResolve = require('@rollup/plugin-node-resolve'),
|
||||
json = require('@rollup/plugin-json'),
|
||||
babel = require('@rollup/plugin-babel'),
|
||||
terser = require('@rollup/plugin-terser'),
|
||||
copy = require('rollup-plugin-copy'),
|
||||
license = require('rollup-plugin-license'),
|
||||
package = require('../package.json'),
|
||||
path = require('path')
|
||||
|
||||
module.exports = {
|
||||
input: {
|
||||
'node/index': 'src/server/node/index.mjs',
|
||||
'electron/index': 'src/server/electron/index.mjs'
|
||||
},
|
||||
output: [
|
||||
{
|
||||
dir: 'app/server/',
|
||||
chunkFileNames: `[name].js`,
|
||||
format: 'commonjs',
|
||||
sourcemap: true,
|
||||
sourcemapExcludeSources: true,
|
||||
strict: false
|
||||
},
|
||||
],
|
||||
treeshake: false,
|
||||
external: ['electron', '@serialport'],
|
||||
watch: {
|
||||
clearScreen: false
|
||||
},
|
||||
plugins: [
|
||||
json(),
|
||||
commonjs({
|
||||
ignoreGlobal: true,
|
||||
ignoreDynamicRequires: true
|
||||
}),
|
||||
nodeResolve({
|
||||
preferBuiltins: true
|
||||
}),
|
||||
license({
|
||||
thirdParty: {
|
||||
includeSelf: true,
|
||||
output: 'app/server/LICENSES',
|
||||
},
|
||||
}),
|
||||
terser({
|
||||
sourceMap: true,
|
||||
keep_classnames: true,
|
||||
keep_fnames: true,
|
||||
output: {
|
||||
comments: false,
|
||||
},
|
||||
}),
|
||||
copy({
|
||||
targets: [
|
||||
{src: 'src/index.js', dest: 'app/'},
|
||||
{src: 'src/server/index.js', dest: 'app/server/'},
|
||||
{src: 'src/server/python/*.py', dest: 'app/server/python/'},
|
||||
{src: 'node_modules/fsevents/fsevents.node', dest: 'app/server/'},
|
||||
{src: 'LICENSE', dest: 'app/'},
|
||||
{src: 'package.json', dest: 'app/'},
|
||||
]
|
||||
})
|
||||
]
|
||||
};
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
var cache = require('./managers/cache'),
|
||||
localBackup = cache.get('backup', false)
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
||||
exists: localBackup !== null,
|
||||
|
||||
save: ()=>{
|
||||
|
||||
var session = require('./managers/session/'),
|
||||
state = require('./managers/state'),
|
||||
editor = require('./editor/')
|
||||
|
||||
if (session.session) {
|
||||
cache.set('backup', {
|
||||
session: session.session.data,
|
||||
saveMode: session.saveMode,
|
||||
sessionPath: session.sessionPath,
|
||||
fragments: session.fragments,
|
||||
state: state.get(),
|
||||
history: editor.history,
|
||||
historyState: editor.historyState,
|
||||
editorEnabled: editor.enabled,
|
||||
}, false)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
load: ()=>{
|
||||
|
||||
var session = require('./managers/session/'),
|
||||
state = require('./managers/state'),
|
||||
editor = require('./editor/'),
|
||||
ipc = require('./ipc/')
|
||||
|
||||
if (localBackup) {
|
||||
|
||||
var data = localBackup
|
||||
|
||||
cache.remove('backup', false)
|
||||
for (let k in data.fragments) {
|
||||
session.setFragment({path: k, fileContent: JSON.parse(data.fragments[k])})
|
||||
}
|
||||
session.load(data.session, ()=>{
|
||||
|
||||
session.setSaveMode(data.saveMode)
|
||||
state.set(data.state, false)
|
||||
|
||||
editor.clearHistory()
|
||||
editor.history = data.history
|
||||
editor.historyState = data.historyState
|
||||
|
||||
if (data.editorEnabled) editor.enable()
|
||||
|
||||
|
||||
ipc.send('sessionSetPath', {path: data.sessionPath})
|
||||
session.setSessionPath(data.sessionPath)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
62
src/client/backup.mjs
Normal file
62
src/client/backup.mjs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
import cache from './managers/cache.mjs'
|
||||
|
||||
var session, state, editor, ipc
|
||||
;(async()=>{
|
||||
session = (await import('./managers/session/index.mjs')).default
|
||||
state = (await import('./managers/state.mjs')).default
|
||||
editor = (await import('./editor/index.mjs')).default
|
||||
ipc = (await import('./ipc/index.mjs')).default
|
||||
})()
|
||||
|
||||
var localBackup = cache.get('backup', false)
|
||||
|
||||
|
||||
export const exists = localBackup !== null
|
||||
|
||||
export function save() {
|
||||
|
||||
if (session.session) {
|
||||
cache.set('backup', {
|
||||
session: session.session.data,
|
||||
saveMode: session.saveMode,
|
||||
sessionPath: session.sessionPath,
|
||||
fragments: session.fragments,
|
||||
state: state.get(),
|
||||
history: editor.history,
|
||||
historyState: editor.historyState,
|
||||
editorEnabled: editor.enabled,
|
||||
}, false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export function load() {
|
||||
|
||||
if (localBackup) {
|
||||
|
||||
var data = localBackup
|
||||
|
||||
cache.remove('backup', false)
|
||||
for (let k in data.fragments) {
|
||||
session.setFragment({path: k, fileContent: data.fragments[k]})
|
||||
}
|
||||
session.load(data.session, ()=>{
|
||||
|
||||
session.setSaveMode(data.saveMode)
|
||||
state.set(data.state, false)
|
||||
|
||||
editor.clearHistory()
|
||||
editor.history = data.history
|
||||
editor.historyState = data.historyState
|
||||
|
||||
if (data.editorEnabled) editor.enable()
|
||||
|
||||
|
||||
ipc.send('sessionSetPath', {path: data.sessionPath})
|
||||
session.setSessionPath(data.sessionPath)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
var readyCallbacks = [],
|
||||
initState = false
|
||||
|
||||
module.exports = {
|
||||
|
||||
init: function() {
|
||||
|
||||
for (var i in readyCallbacks) {
|
||||
readyCallbacks[i]()
|
||||
}
|
||||
|
||||
initState = true
|
||||
|
||||
},
|
||||
|
||||
ready: function(callback) {
|
||||
if (initState) {
|
||||
callback()
|
||||
} else {
|
||||
readyCallbacks.push(callback)
|
||||
}
|
||||
},
|
||||
|
||||
dispatchEvent: function(element, name, data) {
|
||||
|
||||
var event = new CustomEvent(name, {
|
||||
detail: data,
|
||||
bubbles: true,
|
||||
cancelable: true
|
||||
})
|
||||
|
||||
element.dispatchEvent(event)
|
||||
|
||||
},
|
||||
|
||||
addEventListener: function(element, events, listener, capture) {
|
||||
|
||||
var eventsAsObject = typeof events == 'string' ? events.split(' ') : events
|
||||
|
||||
for (var i in eventsAsObject) {
|
||||
|
||||
element.addEventListener(eventsAsObject[i], listener, capture)
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
get: function(a, b) {
|
||||
|
||||
var context = b ? a : document,
|
||||
selector = b || a,
|
||||
nodes
|
||||
|
||||
if (selector.indexOf('>') === 0) selector = ':scope ' + selector
|
||||
|
||||
if (selector.indexOf(' ') === -1 && selector.indexOf(',') === -1 && selector.indexOf('[') === -1) {
|
||||
if (selector.indexOf('#') === 0 && context === document) {
|
||||
nodes = [document.getElementById(selector.substr(1, selector.length - 1))]
|
||||
} else if (selector.lastIndexOf('.') === 0) {
|
||||
nodes = context.getElementsByClassName(selector.substr(1, selector.length - 1))
|
||||
}
|
||||
}
|
||||
|
||||
if (!nodes) nodes = context.querySelectorAll(selector)
|
||||
|
||||
return [...nodes]
|
||||
|
||||
},
|
||||
|
||||
each: function(context, selector, callback) {
|
||||
|
||||
var nodes = module.exports.get(context, selector)
|
||||
|
||||
nodes.forEach(callback)
|
||||
|
||||
return nodes
|
||||
|
||||
},
|
||||
|
||||
index: function(element) {
|
||||
var parent = element.parentNode
|
||||
return parent ? Array.prototype.indexOf.call(parent.children, element) : -1
|
||||
},
|
||||
|
||||
offset: function(element, container) {
|
||||
|
||||
var offsetLeft = 0,
|
||||
offsetTop = 0
|
||||
|
||||
if (element) {
|
||||
do {
|
||||
if (!isNaN(element.offsetLeft)) {
|
||||
offsetLeft += element.offsetLeft - element.scrollLeft
|
||||
}
|
||||
if (!isNaN(element.offsetTop)) {
|
||||
offsetTop += element.offsetTop - element.scrollTop
|
||||
}
|
||||
} while ((element = element.offsetParent) && element !== container)
|
||||
}
|
||||
|
||||
return {
|
||||
left: offsetLeft,
|
||||
top: offsetTop
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
82
src/client/dom.mjs
Normal file
82
src/client/dom.mjs
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
export function dispatchEvent(element, name, data) {
|
||||
|
||||
var event = new CustomEvent(name, {
|
||||
detail: data,
|
||||
bubbles: true,
|
||||
cancelable: true
|
||||
})
|
||||
|
||||
element.dispatchEvent(event)
|
||||
|
||||
}
|
||||
|
||||
export function addEventListener(element, events, listener, capture) {
|
||||
|
||||
var eventsAsObject = typeof events == 'string' ? events.split(' ') : events
|
||||
|
||||
for (var i in eventsAsObject) {
|
||||
|
||||
element.addEventListener(eventsAsObject[i], listener, capture)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export function get(a, b) {
|
||||
|
||||
var context = b ? a : document,
|
||||
selector = b || a,
|
||||
nodes
|
||||
|
||||
if (selector.indexOf('>') === 0) selector = ':scope ' + selector
|
||||
|
||||
if (selector.indexOf(' ') === -1 && selector.indexOf(',') === -1 && selector.indexOf('[') === -1) {
|
||||
if (selector.indexOf('#') === 0 && context === document) {
|
||||
nodes = [document.getElementById(selector.substr(1, selector.length - 1))]
|
||||
} else if (selector.lastIndexOf('.') === 0) {
|
||||
nodes = context.getElementsByClassName(selector.substr(1, selector.length - 1))
|
||||
}
|
||||
}
|
||||
|
||||
if (!nodes) nodes = context.querySelectorAll(selector)
|
||||
|
||||
return [...nodes]
|
||||
|
||||
}
|
||||
|
||||
export function each(context, selector, callback) {
|
||||
|
||||
var nodes = get(context, selector)
|
||||
|
||||
nodes.forEach(callback)
|
||||
|
||||
return nodes
|
||||
|
||||
}
|
||||
|
||||
export function index(element) {
|
||||
var parent = element.parentNode
|
||||
return parent ? Array.prototype.indexOf.call(parent.children, element) : -1
|
||||
}
|
||||
|
||||
export function offset(element, container) {
|
||||
|
||||
var offsetLeft = 0,
|
||||
offsetTop = 0
|
||||
|
||||
if (element) {
|
||||
do {
|
||||
if (!isNaN(element.offsetLeft)) {
|
||||
offsetLeft += element.offsetLeft - element.scrollLeft
|
||||
}
|
||||
if (!isNaN(element.offsetTop)) {
|
||||
offsetTop += element.offsetTop - element.scrollTop
|
||||
}
|
||||
} while ((element = element.offsetParent) && element !== container)
|
||||
}
|
||||
|
||||
return {
|
||||
left: offsetLeft,
|
||||
top: offsetTop
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +1,19 @@
|
|||
var {updateWidget} = require('./data-workers'),
|
||||
{categories} = require('../widgets/'),
|
||||
widgetManager = require('../managers/widgets'),
|
||||
{icon} = require('../ui/utils'),
|
||||
editor = require('./'),
|
||||
locales = require('../locales'),
|
||||
ContextMenu = require('../ui/context-menu'),
|
||||
contextMenu = new ContextMenu(),
|
||||
sessionManager
|
||||
import {updateWidget} from './data-workers.mjs'
|
||||
import {categories} from '../widgets/index.mjs'
|
||||
import widgetManager from '../managers/widgets.mjs'
|
||||
import {icon} from '../ui/utils.mjs'
|
||||
import editor from './index.mjs'
|
||||
import locales from '../locales/index.mjs'
|
||||
import ContextMenu from '../ui/context-menu.mjs'
|
||||
import {GRIDWIDTH, PXSCALE} from '../globals.mjs'
|
||||
|
||||
var sessionManager
|
||||
;(async()=>{
|
||||
sessionManager = (await import('../managers/session/index.mjs')).default
|
||||
})()
|
||||
|
||||
|
||||
var contextMenu = new ContextMenu()
|
||||
|
||||
var multiSelectKey = (navigator.platform || '').match('Mac') ? 'metaKey' : 'ctrlKey'
|
||||
|
||||
|
|
@ -30,7 +35,7 @@ var handleClick = function(event) {
|
|||
|
||||
if (!targetWidget) return
|
||||
|
||||
while (targetWidget._not_editable && targetWidget.parent) {
|
||||
while (targetWidget.meta.not_editable && targetWidget.parent) {
|
||||
targetWidget = targetWidget.parent
|
||||
}
|
||||
|
||||
|
|
@ -332,7 +337,6 @@ var handleClick = function(event) {
|
|||
actions.push({
|
||||
label: icon('file-download') + ' ' + locales('editor_fragment_export'),
|
||||
action: ()=>{
|
||||
sessionManager = sessionManager || require('../managers/session')
|
||||
sessionManager.saveFragment(editor.selectedWidgets[0].props)
|
||||
}
|
||||
})
|
||||
|
|
@ -1,29 +1,28 @@
|
|||
var widgetManager = require('../managers/widgets'),
|
||||
resize = require('../events/resize'),
|
||||
stateManager = require('../managers/state'),
|
||||
parser = require('../parser'),
|
||||
Panel, Matrix,
|
||||
editor,
|
||||
scrollState = {}
|
||||
import widgetManager from '../managers/widgets.mjs'
|
||||
import stateManager from '../managers/state.mjs'
|
||||
import parser from '../parser.mjs'
|
||||
import * as resize from '../events/resize.mjs'
|
||||
|
||||
setTimeout(()=>{
|
||||
editor = require('./')
|
||||
Panel = require('../widgets/containers/panel')
|
||||
Matrix = require('../widgets/containers/matrix')
|
||||
})
|
||||
var Panel, Matrix, editor
|
||||
;(async()=>{
|
||||
Panel = (await import('../widgets/containers/panel.mjs')).default
|
||||
Matrix = (await import('../widgets/containers/matrix.mjs')).default
|
||||
editor = (await import('./index.mjs')).default
|
||||
})()
|
||||
|
||||
var scrollState = {}
|
||||
|
||||
function updateWidget(widget, options={}) {
|
||||
|
||||
if (options.changedProps) {
|
||||
if (options.editedProps) {
|
||||
// alternate routine for small edits
|
||||
var propNames = options.changedProps
|
||||
var propNames = options.editedProps
|
||||
|
||||
if (
|
||||
// if non dynamic props have changed, skip this and use rebuild routine
|
||||
!propNames.some(n => !widget.isDynamicProp(n))
|
||||
) {
|
||||
|
||||
var edited = widget.updateProps(options.changedProps, null, {fromEditor: true}) || widget
|
||||
var edited = widget.updateProps(options.editedProps, null, {fromEditor: true}) || widget
|
||||
|
||||
editor.widgetTree.updateTree(editor.selectedWidgets)
|
||||
|
||||
|
|
@ -110,7 +109,8 @@ function updateWidget(widget, options={}) {
|
|||
variables: widget.variables,
|
||||
hash: widget.hash,
|
||||
children: children,
|
||||
index: index
|
||||
index: index,
|
||||
meta: widget.meta
|
||||
})
|
||||
|
||||
newWidget.container.parentNode.replaceChild(newWidget.container, widget.container)
|
||||
|
|
@ -235,7 +235,7 @@ var incrementWidget = function(data, root){
|
|||
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
updateWidget:updateWidget,
|
||||
incrementWidget:incrementWidget
|
||||
export {
|
||||
updateWidget,
|
||||
incrementWidget
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
module.exports = {
|
||||
|
||||
diff: require('jsondiffpatch'),
|
||||
|
||||
diffToWidget: function(widget, diff) {
|
||||
|
||||
// traverse a diff patch and the associated widget
|
||||
// to return the first node (widget and sub-patch) with actual changes
|
||||
|
||||
var children = diff.tabs || diff.widgets
|
||||
|
||||
if (children) {
|
||||
var childrenKeys = Object.keys(children),
|
||||
deletedChildren = childrenKeys.filter(x => typeof x === 'string' && x.match(/_[0-9]+/)),
|
||||
changedChildren = childrenKeys.filter(x => !isNaN(x))
|
||||
}
|
||||
|
||||
if (
|
||||
!children ||
|
||||
Array.isArray(children) || // 'tabs' or 'widgets' property created
|
||||
deletedChildren.length || // 'tabs' or 'widgets' property created
|
||||
changedChildren.length !== 1 || // children reordered (or same property edited in multiple widgets, but case ignored)
|
||||
Array.isArray(children[changedChildren[0]]) // child item created
|
||||
) {
|
||||
return [widget, diff]
|
||||
}
|
||||
|
||||
return module.exports.diffToWidget(widget.children[changedChildren[0]], children[changedChildren[0]])
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
29
src/client/editor/diff.mjs
Normal file
29
src/client/editor/diff.mjs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import diff from 'jsondiffpatch'
|
||||
|
||||
export {diff}
|
||||
export function diffToWidget(widget, diff) {
|
||||
|
||||
// traverse a diff patch and the associated widget
|
||||
// to return the first node (widget and sub-patch) with actual changes
|
||||
|
||||
var children = diff.tabs || diff.widgets
|
||||
|
||||
if (children) {
|
||||
var childrenKeys = Object.keys(children),
|
||||
deletedChildren = childrenKeys.filter(x => typeof x === 'string' && x.match(/_[0-9]+/)),
|
||||
changedChildren = childrenKeys.filter(x => !isNaN(x))
|
||||
}
|
||||
|
||||
if (
|
||||
!children ||
|
||||
Array.isArray(children) || // 'tabs' or 'widgets' property created
|
||||
deletedChildren.length || // 'tabs' or 'widgets' property created
|
||||
changedChildren.length !== 1 || // children reordered (or same property edited in multiple widgets, but case ignored)
|
||||
Array.isArray(children[changedChildren[0]]) // child item created
|
||||
) {
|
||||
return [widget, diff]
|
||||
}
|
||||
|
||||
return diffToWidget(widget.children[changedChildren[0]], children[changedChildren[0]])
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +1,36 @@
|
|||
var {updateWidget, incrementWidget} = require('./data-workers'),
|
||||
keyboardJS = require('keyboardjs/dist/keyboard.min.js'),
|
||||
{diff, diffToWidget} = require('./diff'),
|
||||
widgetManager = require('../managers/widgets'),
|
||||
{deepCopy} = require('../utils'),
|
||||
{defaults} = require('../widgets/'),
|
||||
macOs = (navigator.platform || '').match('Mac'),
|
||||
UiSelectArea = require('../ui/ui-selectarea'),
|
||||
UiInspector = require('../ui/ui-inspector'),
|
||||
UiTree = require('../ui/ui-tree'),
|
||||
UiDragResize = require('../ui/ui-dragresize'),
|
||||
uiConsole = require('../ui/ui-console'),
|
||||
notifications = require('../ui/notifications'),
|
||||
locales = require('../locales'),
|
||||
{leftUiSidePanel, rightUiSidePanel} = require('../ui/'),
|
||||
ipc = require('../ipc'),
|
||||
sessionManager
|
||||
import keyboardJS from 'keyboardjs/dist/keyboard.min.js'
|
||||
import {updateWidget, incrementWidget} from './data-workers.mjs'
|
||||
import {diff, diffToWidget} from './diff.mjs'
|
||||
import widgetManager from '../managers/widgets.mjs'
|
||||
import {deepCopy} from '../utils.mjs'
|
||||
import {defaults, widgets} from '../widgets/index.mjs'
|
||||
import UiSelectArea from '../ui/ui-selectarea.mjs'
|
||||
import UiInspector from '../ui/ui-inspector.mjs'
|
||||
import UiTree from '../ui/ui-tree.mjs'
|
||||
import UiDragResize from '../ui/ui-dragresize.mjs'
|
||||
import uiConsole from '../ui/ui-console.mjs'
|
||||
import notifications from '../ui/notifications.mjs'
|
||||
import locales from '../locales/index.mjs'
|
||||
import {leftUiSidePanel, rightUiSidePanel} from '../ui/index.mjs'
|
||||
import ipc from '../ipc/index.mjs'
|
||||
import {DOM, GRIDWIDTH, GRIDWIDTH_CSS, ENV, PXSCALE, setGRIDWIDTH, READ_ONLY} from '../globals.mjs'
|
||||
import zoom from '../ui/zoom.mjs'
|
||||
|
||||
setTimeout(()=>{
|
||||
sessionManager = require('../managers/session/')
|
||||
})
|
||||
var sessionManager
|
||||
;(async()=>{
|
||||
sessionManager = (await import('../managers/session/index.mjs')).default
|
||||
await import('./context-menu.mjs')
|
||||
})()
|
||||
|
||||
const macOs = (navigator.platform || '').match('Mac')
|
||||
const HISTORY_SIZE = 50
|
||||
|
||||
class Editor {
|
||||
|
||||
constructor() {
|
||||
|
||||
zoom.editor = this
|
||||
|
||||
this.inspector = new UiInspector({selector: '#osc-inspector'})
|
||||
this.inspector.on('update', (event)=>{
|
||||
|
||||
|
|
@ -50,12 +55,12 @@ class Editor {
|
|||
|
||||
try {
|
||||
|
||||
newWidgets.push(updateWidget(w, {changedProps: [propName], preventSelect: this.selectedWidgets.length > 1}))
|
||||
newWidgets.push(updateWidget(w, {editedProps: [propName], preventSelect: this.selectedWidgets.length > 1}))
|
||||
|
||||
} catch (e) {
|
||||
|
||||
w.props[propName] = previousValue
|
||||
updateWidget(w, {changedProps: [propName], preventSelect: this.selectedWidgets.length > 1})
|
||||
updateWidget(w, {editedProps: [propName], preventSelect: this.selectedWidgets.length > 1})
|
||||
|
||||
if (uiConsole.minimized) notifications.add({
|
||||
class: 'error',
|
||||
|
|
@ -277,7 +282,7 @@ class Editor {
|
|||
|
||||
if (
|
||||
this.inspector.helpModalOpened ||
|
||||
e && e.target && e.target.tagName.match(/INPUT|TEXTAREA|SELECT/)
|
||||
e && e.target && e.target.tagName.match(/INPUT|TEXTAREA|SELECT|OSC-CONSOLE/)
|
||||
) return
|
||||
|
||||
if (e) e.preventDefault()
|
||||
|
|
@ -396,7 +401,7 @@ class Editor {
|
|||
|
||||
} else if (e.key === 'ArrowRight') {
|
||||
|
||||
if (curWidget.children[0] && !curWidget.children[0]._not_editable) {
|
||||
if (curWidget.children[0] && !curWidget.children[0].meta.not_editable) {
|
||||
toSelect = curWidget.children[0]
|
||||
}
|
||||
|
||||
|
|
@ -518,7 +523,7 @@ class Editor {
|
|||
|
||||
this.grid = !this.grid
|
||||
|
||||
GRIDWIDTH = this.grid ? GRIDWIDTH_CSS : 1
|
||||
setGRIDWIDTH(this.grid ? GRIDWIDTH_CSS : 1)
|
||||
|
||||
document.body.style.setProperty('--grid-width', GRIDWIDTH)
|
||||
document.body.classList.toggle('no-grid', GRIDWIDTH == 1)
|
||||
|
|
@ -667,6 +672,9 @@ class Editor {
|
|||
}
|
||||
this.widgetTree.select(this.selectedWidgets)
|
||||
this.widgetDragResize.create(this.selectedWidgets)
|
||||
if (!this.widgetTree.parent.minimized) {
|
||||
this.widgetTree.showWidget(editor.selectedWidgets[editor.selectedWidgets.length-1])
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -897,6 +905,17 @@ class Editor {
|
|||
|
||||
}
|
||||
|
||||
/* Utility function to retrieve the first sizable node */
|
||||
getWidgetParentContainer(widget) {
|
||||
|
||||
while (widget.parent instanceof widgets.folder) {
|
||||
widget = widget.parent
|
||||
}
|
||||
|
||||
return widget.container.parentNode
|
||||
|
||||
}
|
||||
|
||||
resizeWidget(deltaW, deltaH) {
|
||||
|
||||
if (!this.selectedWidgets.length) return
|
||||
|
|
@ -908,7 +927,7 @@ class Editor {
|
|||
|
||||
var newWidgets = [],
|
||||
area = this.widgetDragResize,
|
||||
changedProps = []
|
||||
editedProps = []
|
||||
|
||||
for (var i = 0; i < this.selectedWidgets.length; i++) {
|
||||
|
||||
|
|
@ -926,20 +945,20 @@ class Editor {
|
|||
if (deltaW !== 0 && w.props.width !== undefined && w.parent.getProp('layout') !== 'vertical') {
|
||||
var newWidth = Math.max(nW, GRIDWIDTH) / PXSCALE
|
||||
if (typeof w.props.width === 'string' && w.props.width.indexOf('%') > -1) {
|
||||
w.props.width = (100 * PXSCALE * newWidth / w.container.parentNode.offsetWidth).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
w.props.width = (100 * PXSCALE * newWidth / this.getWidgetParentContainer(w).offsetWidth).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
} else {
|
||||
w.props.width = newWidth
|
||||
}
|
||||
changedProps.push('width')
|
||||
editedProps.push('width')
|
||||
|
||||
if (this.selectedWidgets.length > 1) {
|
||||
var newLeft = Math.max(nL, GRIDWIDTH) / PXSCALE
|
||||
if (typeof w.props.left === 'string' && w.props.left.indexOf('%') > -1) {
|
||||
w.props.left = (100 * PXSCALE * newLeft / w.container.parentNode.offsetWidth).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
w.props.left = (100 * PXSCALE * newLeft / this.getWidgetParentContainer(w).offsetWidth).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
} else if (w.props.left !== 'auto'){
|
||||
w.props.left = newLeft
|
||||
}
|
||||
changedProps.push('left')
|
||||
editedProps.push('left')
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -947,24 +966,24 @@ class Editor {
|
|||
if (deltaH !== 0 && w.props.height !== undefined && w.parent.getProp('layout') !== 'horizontal') {
|
||||
var newHeight = Math.max(nH, GRIDWIDTH) / PXSCALE
|
||||
if (typeof w.props.height === 'string' && w.props.height.indexOf('%') > -1) {
|
||||
w.props.height = (100 * PXSCALE * newHeight / w.container.parentNode.offsetHeight).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
w.props.height = (100 * PXSCALE * newHeight / this.getWidgetParentContainer(w).offsetHeight).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
} else {
|
||||
w.props.height = newHeight
|
||||
}
|
||||
changedProps.push('height')
|
||||
editedProps.push('height')
|
||||
|
||||
if (this.selectedWidgets.length > 1) {
|
||||
var newTop = Math.max(nT, GRIDWIDTH) / PXSCALE
|
||||
if (typeof w.props.top === 'string' && w.props.top.indexOf('%') > -1) {
|
||||
w.props.top = (100 * PXSCALE * newTop / w.container.parentNode.offsetHeight).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
w.props.top = (100 * PXSCALE * newTop / this.getWidgetParentContainer(w).offsetHeight).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
} else if (w.props.top !== 'auto'){
|
||||
w.props.top = newTop
|
||||
}
|
||||
changedProps.push('top')
|
||||
editedProps.push('top')
|
||||
}
|
||||
}
|
||||
|
||||
if (w.props.width !== undefined || w.props.height !== undefined) newWidgets.push(updateWidget(w, {changedProps: changedProps, preventSelect: this.selectedWidgets.length > 1}))
|
||||
if (w.props.width !== undefined || w.props.height !== undefined) newWidgets.push(updateWidget(w, {editedProps: editedProps, preventSelect: this.selectedWidgets.length > 1}))
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -990,18 +1009,18 @@ class Editor {
|
|||
|
||||
var newTop = Math.max(parseInt(w.container.offsetTop) / PXSCALE + deltaY, 0)
|
||||
if (typeof w.props.top === 'string' && w.props.top.indexOf('%') > -1) {
|
||||
w.props.top = (100 * PXSCALE * newTop / w.container.parentNode.offsetHeight).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
w.props.top = (100 * PXSCALE * newTop / this.getWidgetParentContainer(w).offsetHeight).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
} else {
|
||||
w.props.top = newTop
|
||||
}
|
||||
var newLeft = Math.max(parseInt(w.container.offsetLeft) / PXSCALE + deltaX, 0)
|
||||
if (typeof w.props.left === 'string' && w.props.left.indexOf('%') > -1) {
|
||||
w.props.left = (100 * PXSCALE * newLeft / w.container.parentNode.offsetWidth).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
w.props.left = (100 * PXSCALE * newLeft / this.getWidgetParentContainer(w).offsetWidth).toFixed(2).replace(/\.?0+$/, '') + '%'
|
||||
} else {
|
||||
w.props.left = newLeft
|
||||
}
|
||||
|
||||
newWidgets.push(updateWidget(w, {changedProps: ['top', 'left'], preventSelect: this.selectedWidgets.length > 1}))
|
||||
newWidgets.push(updateWidget(w, {editedProps: ['top', 'left'], preventSelect: this.selectedWidgets.length > 1}))
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1016,7 +1035,9 @@ class Editor {
|
|||
|
||||
pushHistory(indexes) {
|
||||
|
||||
this.unsavedSession = true
|
||||
if (!ENV.noWarning) {
|
||||
this.unsavedSession = true
|
||||
}
|
||||
|
||||
if (this.historyState > -1) {
|
||||
this.history.splice(0, this.historyState + 1)
|
||||
|
|
@ -1089,7 +1110,7 @@ class Editor {
|
|||
if (indexes) {
|
||||
options = {...indexes}
|
||||
} else {
|
||||
options.changedProps = Object.keys(subpatch)
|
||||
options.editedProps = Object.keys(subpatch)
|
||||
options.reuseChildren = false
|
||||
}
|
||||
|
||||
|
|
@ -1112,6 +1133,4 @@ class Editor {
|
|||
|
||||
var editor = new Editor()
|
||||
|
||||
module.exports = editor
|
||||
|
||||
require('./context-menu')
|
||||
export default editor
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
const iOS = require('../ui/ios')
|
||||
const editor = require('../editor')
|
||||
import iOS from '../ui/ios.mjs'
|
||||
import editor from '../editor/index.mjs'
|
||||
import {DOM, FOCUSABLE, ENV} from '../globals.mjs'
|
||||
|
||||
const macOs = (navigator.platform || '').match('Mac')
|
||||
|
||||
var longTouchTimer = false,
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = function(eventName, options={}){
|
||||
export default function(eventName, options={}){
|
||||
|
||||
var widget_storage_key = '_' + eventName + '_widget'
|
||||
|
||||
|
|
@ -19,13 +19,9 @@ module.exports = function(eventName, options={}){
|
|||
if (container) container[widget_storage_key].trigger(eventName, event)
|
||||
}
|
||||
|
||||
DOM.ready(()=>{
|
||||
|
||||
document.addEventListener(eventName, (event)=>{
|
||||
triggerWidgetEvent(event.target, event)
|
||||
}, {passive: !!options.passive, capture: !!options.capture})
|
||||
|
||||
})
|
||||
document.addEventListener(eventName, (event)=>{
|
||||
triggerWidgetEvent(event.target, event)
|
||||
}, {passive: !!options.passive, capture: !!options.capture})
|
||||
|
||||
return {
|
||||
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
module.exports = (element, callback, options={})=>{
|
||||
import {DOUBLE_TAP_TIME} from '../globals.mjs'
|
||||
|
||||
export default (element, callback, options={})=>{
|
||||
|
||||
var lastTapTime = 0,
|
||||
lastTapX,
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
const {normalizeDragEvent, resetEventOffset, TRAVERSING_SAMEWIDGET} = require('./utils')
|
||||
const iOS = require('../ui/ios')
|
||||
import {normalizeDragEvent, resetEventOffset, TRAVERSING_SAMEWIDGET} from './utils.mjs'
|
||||
import iOS from '../ui/ios.mjs'
|
||||
import {DOM} from '../globals.mjs'
|
||||
|
||||
var targets = {},
|
||||
previousPointers = {}
|
||||
|
|
@ -15,6 +16,7 @@ function pointerDownHandler(event) {
|
|||
}
|
||||
|
||||
event = normalizeDragEvent(event)
|
||||
event.stopPropagation = true
|
||||
|
||||
var target = closestDragContainer(event.target)
|
||||
|
||||
|
|
@ -25,13 +27,16 @@ function pointerDownHandler(event) {
|
|||
var widget = target._drag_widget,
|
||||
local = event.traversingStack.stack[event.traversingStack.stack.length - 1]
|
||||
|
||||
if (widget.getProp) event.traversingStack.firstType = widget.getProp('type')
|
||||
if (widget.getProp) {
|
||||
// if first touched widget is a container, wait until another widget is touched while moving
|
||||
event.traversingStack.firstType = widget.isContainer ? '?' : widget.getProp('type')
|
||||
}
|
||||
|
||||
if (local.mode === TRAVERSING_SAMEWIDGET) {
|
||||
if (local.type === '') {
|
||||
local.type = event.traversingStack.firstType
|
||||
}
|
||||
event.traversing = local.type === event.traversingStack.firstType
|
||||
event.traversing = local.type === event.traversingStack.firstType || event.traversingStack.firstType === '?'
|
||||
} else {
|
||||
event.traversing = true
|
||||
}
|
||||
|
|
@ -67,7 +72,10 @@ function pointerMoveHandler(event) {
|
|||
|
||||
if (target) target = closestDragContainer(target)
|
||||
|
||||
var local = null
|
||||
var local = null,
|
||||
containersOnly = false,
|
||||
backupTarget = target
|
||||
|
||||
if (target && event.traversingStack) {
|
||||
for (var i = event.traversingStack.stack.length - 1; i > -1; i--) {
|
||||
if (event.traversingStack.stack[i].container.contains(target)) {
|
||||
|
|
@ -77,8 +85,9 @@ function pointerMoveHandler(event) {
|
|||
}
|
||||
if (!local) {
|
||||
target = null
|
||||
} else if (local.mode === TRAVERSING_SAMEWIDGET && local.type) {
|
||||
} else if (local.mode === TRAVERSING_SAMEWIDGET) {
|
||||
var widget = target._drag_widget
|
||||
if (local.type === '?' && widget.getProp && !widget.isContainer) local.type = widget.getProp('type')
|
||||
if (widget.getProp && local.type !== widget.getProp('type')) target = null
|
||||
}
|
||||
}
|
||||
|
|
@ -90,13 +99,27 @@ function pointerMoveHandler(event) {
|
|||
resetEventOffset(event, target)
|
||||
}
|
||||
|
||||
if (previousTarget !== target) {
|
||||
if (previousTarget !== target && !containersOnly) {
|
||||
triggerWidgetEvent(previousTarget, 'dragend', event)
|
||||
}
|
||||
|
||||
|
||||
if (target && event.traversing) {
|
||||
triggerWidgetEvent(target, previousTarget !== target ? 'draginit' : 'drag', event)
|
||||
if (target) {
|
||||
|
||||
if (previousTarget === target) {
|
||||
|
||||
triggerWidgetEvent(target, 'drag', event)
|
||||
|
||||
} else {
|
||||
triggerWidgetEvent(target, 'draginit', event)
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// notify container of move events if no draggable widget is under the pointer
|
||||
triggerWidgetEvent(backupTarget, 'drag', event, true)
|
||||
|
||||
}
|
||||
|
||||
targets[event.pointerId] = target
|
||||
|
|
@ -113,6 +136,7 @@ function pointerMoveHandler(event) {
|
|||
function pointerUpHandler(event) {
|
||||
|
||||
event = normalizeDragEvent(event, previousPointers[event.pointerId])
|
||||
event.stopPropagation = true
|
||||
|
||||
triggerWidgetEvent(targets[event.pointerId], 'dragend', event)
|
||||
|
||||
|
|
@ -157,6 +181,7 @@ function pointerUpFilter(event) {
|
|||
|
||||
function mouseDownCapture(event) {
|
||||
if (event.pointerType === 'touch') return
|
||||
event.stopPropagation()
|
||||
// event.pointerId = 'mouse'
|
||||
pointerDownHandler(event)
|
||||
}
|
||||
|
|
@ -213,6 +238,9 @@ domObserver.deactivate = ()=>{
|
|||
function touchDownCapture(event) {
|
||||
|
||||
var preventDefault = true
|
||||
|
||||
event.stopPropagation()
|
||||
|
||||
for (var i in event.changedTouches) {
|
||||
if (isNaN(i) || !event.changedTouches[i]) continue
|
||||
var touchEvent = event.changedTouches[i]
|
||||
|
|
@ -225,7 +253,8 @@ function touchDownCapture(event) {
|
|||
|
||||
touchEvent = pointerDownHandler(touchEvent)
|
||||
|
||||
if (touchEvent.cancelDragEvent) preventDefault = false
|
||||
// allow scroll if drag is cancelled or widget is a container
|
||||
if (touchEvent.cancelDragEvent || touchEvent.allowScroll) preventDefault = false
|
||||
}
|
||||
if (preventDefault) event.preventDefault()
|
||||
}
|
||||
|
|
@ -234,15 +263,10 @@ function touchMoveCapture(event) {
|
|||
for (var i in event.changedTouches) {
|
||||
if (isNaN(i) || !event.changedTouches[i]) continue
|
||||
var touchEvent = event.changedTouches[i]
|
||||
|
||||
var fingers = 0
|
||||
touchEvent.fingers = 0
|
||||
for (var j in event.touches) {
|
||||
if (event.touches[j].target && event.touches[j].target.isSameNode(touchEvent.target)) {
|
||||
fingers += 1
|
||||
if (fingers == 2) {
|
||||
touchEvent.inertia = 10
|
||||
break
|
||||
}
|
||||
touchEvent.fingers += 1
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -261,6 +285,20 @@ function touchUpCapture(event) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
function ancestorDragContainers(target) {
|
||||
var containers = [],
|
||||
container = target
|
||||
while (container !== null) {
|
||||
if (container._drag_widget) {
|
||||
containers.splice(0, 0, container._drag_widget)
|
||||
if (container._drag_widget.root) break
|
||||
}
|
||||
container = container.parentNode
|
||||
}
|
||||
return containers
|
||||
}
|
||||
|
||||
function closestDragContainer(target) {
|
||||
var container = target
|
||||
while (container !== null) {
|
||||
|
|
@ -275,112 +313,114 @@ function closestDragContainer(target) {
|
|||
|
||||
// Callback trigger
|
||||
|
||||
function triggerWidgetEvent(target, name, event) {
|
||||
var container = closestDragContainer(target)
|
||||
if (container) container._drag_widget.trigger(name, event)
|
||||
function triggerWidgetEvent(target, name, event, containersOnly) {
|
||||
|
||||
// trigger drag events from parent to child
|
||||
var widgets = ancestorDragContainers(target),
|
||||
widget
|
||||
|
||||
for (widget of widgets) {
|
||||
if (containersOnly && !widget.isContainer) continue
|
||||
widget.trigger(name, event)
|
||||
if (event.preventDefault) break
|
||||
}
|
||||
|
||||
// if child is a container, let it scroll
|
||||
if (widget && widget.scroll) event.allowScroll = true
|
||||
}
|
||||
|
||||
// init
|
||||
if (!iOS) {
|
||||
document.addEventListener('pointermove', mouseMoveCapture, true)
|
||||
if ('onwebkitmouseforcechanged' in document) document.addEventListener('webkitmouseforcechanged', mouseMoveCapture, true)
|
||||
}
|
||||
if (!iOS) document.addEventListener('pointerup', mouseUpCapture, true)
|
||||
|
||||
DOM.ready(()=>{
|
||||
document.addEventListener('touchmove', touchMoveCapture, true)
|
||||
|
||||
if (!iOS) {
|
||||
document.addEventListener('pointermove', mouseMoveCapture, true)
|
||||
if ('onwebkitmouseforcechanged' in document) document.addEventListener('webkitmouseforcechanged', mouseMoveCapture, true)
|
||||
if ('ontouchforcechange' in document) document.addEventListener('touchforcechange', touchMoveCapture, true)
|
||||
|
||||
DOM.addEventListener(document, 'touchend touchcancel', touchUpCapture, true)
|
||||
|
||||
if (!iOS) document.addEventListener('pointerdown', mouseDownCapture)
|
||||
|
||||
export function setup(options) {
|
||||
|
||||
if (
|
||||
this._customBindings['drag'] !== 0 ||
|
||||
this._customBindings['draginit'] !== 0 ||
|
||||
this._customBindings['dragend'] !== 0 ||
|
||||
!options || options.ignoreCustomBindings
|
||||
) {
|
||||
return
|
||||
}
|
||||
if (!iOS) document.addEventListener('pointerup', mouseUpCapture, true)
|
||||
|
||||
document.addEventListener('touchmove', touchMoveCapture, true)
|
||||
var {element, multitouch} = options
|
||||
|
||||
if ('ontouchforcechange' in document) document.addEventListener('touchforcechange', touchMoveCapture, true)
|
||||
|
||||
DOM.addEventListener(document, 'touchend touchcancel', touchUpCapture, true)
|
||||
|
||||
if (!iOS) document.addEventListener('pointerdown', mouseDownCapture)
|
||||
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
|
||||
setup: function(options) {
|
||||
|
||||
if (
|
||||
this._customBindings['drag'] !== 0 ||
|
||||
this._customBindings['draginit'] !== 0 ||
|
||||
this._customBindings['dragend'] !== 0 ||
|
||||
!options || options.ignoreCustomBindings
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
var {element, multitouch} = options
|
||||
|
||||
element.addEventListener('touchstart', touchDownCapture, false)
|
||||
element._drag_widget = this
|
||||
element._drag_multitouch = multitouch
|
||||
|
||||
},
|
||||
|
||||
teardown: function(options) {
|
||||
|
||||
if (
|
||||
this._customBindings['drag'] !== 0 ||
|
||||
this._customBindings['draginit'] !== 0 ||
|
||||
this._customBindings['dragend'] !== 0 ||
|
||||
!options || options.ignoreCustomBindings
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
var {element} = options
|
||||
|
||||
element.style.touchAction = ''
|
||||
element.removeEventListener('touchstart', touchDownCapture, false)
|
||||
delete element._drag_widget
|
||||
delete element._drag_multitouch
|
||||
|
||||
},
|
||||
|
||||
enableTraversingGestures: function(element, options={}) {
|
||||
|
||||
if (element._traversing) return
|
||||
|
||||
var traversing = options.type ? TRAVERSING_SAMEWIDGET : true,
|
||||
traversingType = options.type === 'smart' || options.type === 'auto' ? '' : options.type
|
||||
|
||||
element._traversing = traversing
|
||||
|
||||
function makeEventTraversing(event) {
|
||||
if (event.ctrlKey) return
|
||||
if (!event.traversingStack) event.traversingStack = {firstType: '', stack: []}
|
||||
event.traversingStack.stack.push({
|
||||
container: element,
|
||||
mode: traversing,
|
||||
type: traversingType
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if (!iOS) element.addEventListener('pointerdown', makeEventTraversing, true)
|
||||
element.addEventListener('touchstart', makeEventTraversing, true)
|
||||
|
||||
element.addEventListener('disableTraversingGestures', (e)=>{
|
||||
e.stopPropagation()
|
||||
if (!iOS) element.removeEventListener('pointerdown', makeEventTraversing, true)
|
||||
element.removeEventListener('touchstart', makeEventTraversing, true)
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
disableTraversingGestures: function(element) {
|
||||
|
||||
if (!element._traversing) return
|
||||
|
||||
delete element._traversing
|
||||
|
||||
DOM.dispatchEvent(element, 'disableTraversingGestures')
|
||||
|
||||
}
|
||||
element.addEventListener('touchstart', touchDownCapture, false)
|
||||
element._drag_widget = this
|
||||
element._drag_multitouch = multitouch
|
||||
|
||||
}
|
||||
|
||||
export function teardown(options) {
|
||||
|
||||
if (
|
||||
this._customBindings['drag'] !== 0 ||
|
||||
this._customBindings['draginit'] !== 0 ||
|
||||
this._customBindings['dragend'] !== 0 ||
|
||||
!options || options.ignoreCustomBindings
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
var {element} = options
|
||||
|
||||
element.style.touchAction = ''
|
||||
element.removeEventListener('touchstart', touchDownCapture, false)
|
||||
delete element._drag_widget
|
||||
delete element._drag_multitouch
|
||||
|
||||
}
|
||||
|
||||
export function enableTraversingGestures(element, options={}) {
|
||||
|
||||
if (element._traversing) return
|
||||
|
||||
var traversing = options.type ? TRAVERSING_SAMEWIDGET : true,
|
||||
traversingType = options.type === 'smart' || options.type === 'auto' ? '' : options.type
|
||||
|
||||
element._traversing = traversing
|
||||
|
||||
function makeEventTraversing(event) {
|
||||
if (event.ctrlKey) return
|
||||
if (!event.traversingStack) event.traversingStack = {firstType: '', stack: []}
|
||||
event.traversingStack.stack.push({
|
||||
container: element.parentNode,
|
||||
mode: traversing,
|
||||
type: traversingType
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if (!iOS) element.addEventListener('pointerdown', makeEventTraversing, true)
|
||||
element.addEventListener('touchstart', makeEventTraversing, true)
|
||||
|
||||
element.addEventListener('disableTraversingGestures', (e)=>{
|
||||
e.stopPropagation()
|
||||
if (!iOS) element.removeEventListener('pointerdown', makeEventTraversing, true)
|
||||
element.removeEventListener('touchstart', makeEventTraversing, true)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
export function disableTraversingGestures(element) {
|
||||
|
||||
if (!element._traversing) return
|
||||
|
||||
delete element._traversing
|
||||
|
||||
DOM.dispatchEvent(element, 'disableTraversingGestures')
|
||||
|
||||
}
|
||||
|
|
@ -1,20 +1,25 @@
|
|||
var customEvents = {}
|
||||
setTimeout(()=>{
|
||||
customEvents['draginit'] = customEvents['drag'] = customEvents['dragend'] = require('./drag')
|
||||
customEvents['resize'] = require('./resize')
|
||||
customEvents['wheel'] = require('./dom-event')('wheel')
|
||||
customEvents['scroll'] = require('./dom-event')('scroll', {capture: true})
|
||||
customEvents['click'] = require('./dom-event')('click')
|
||||
customEvents['fast-click'] = require('./dom-event')('fast-click')
|
||||
customEvents['focus'] = require('./dom-event')('focus', {capture: true})
|
||||
customEvents['blur'] = require('./dom-event')('blur', {capture: true})
|
||||
customEvents['change'] = require('./dom-event')('change')
|
||||
})
|
||||
import domEvent from './dom-event.mjs'
|
||||
import * as drag from './drag.mjs'
|
||||
import * as resize from './resize.mjs'
|
||||
|
||||
var customEvents = {
|
||||
'draginit': drag,
|
||||
'drag': drag,
|
||||
'dragend': drag,
|
||||
'resize': resize,
|
||||
'wheel': domEvent('wheel'),
|
||||
'scroll': domEvent('scroll', {capture: true}),
|
||||
'click': domEvent('click'),
|
||||
'fast-click': domEvent('fast-click'),
|
||||
'focus': domEvent('focus', {capture: true}),
|
||||
'blur': domEvent('blur', {capture: true}),
|
||||
'change': domEvent('change')
|
||||
}
|
||||
|
||||
// micro optimisation from eventemitter3
|
||||
var has = Object.prototype.hasOwnProperty
|
||||
|
||||
module.exports = class EventEmitter {
|
||||
export default class EventEmitter {
|
||||
|
||||
constructor() {
|
||||
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
var fastdom = require('fastdom')
|
||||
import fastdom from 'fastdom'
|
||||
|
||||
var elements = []
|
||||
|
||||
function checkResizes(context, force){
|
||||
export function check(context, force){
|
||||
fastdom.measure(()=>{
|
||||
// Iterate over all elements to which the 'resize' event is bound.
|
||||
let resizedElems = [],
|
||||
|
|
@ -38,30 +39,25 @@ function checkResizes(context, force){
|
|||
|
||||
}
|
||||
|
||||
window.addEventListener('resize', ()=>{checkResizes(document)})
|
||||
window.addEventListener('resize', ()=>{check(document)})
|
||||
|
||||
module.exports = {
|
||||
export function setup(options) {
|
||||
|
||||
setup: function(options) {
|
||||
|
||||
if (!options) return
|
||||
if (elements.indexOf(options.element) == -1) {
|
||||
elements.push(options.element)
|
||||
options.element._resize_widget = this
|
||||
}
|
||||
|
||||
},
|
||||
teardown: function(options) {
|
||||
|
||||
if (!options) return
|
||||
|
||||
if (elements.indexOf(options.element) != -1) {
|
||||
elements.splice(elements.indexOf(options.element), 1)
|
||||
delete options.element._resize_widget
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
check: checkResizes
|
||||
if (!options) return
|
||||
if (elements.indexOf(options.element) == -1) {
|
||||
elements.push(options.element)
|
||||
options.element._resize_widget = this
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export function teardown(options) {
|
||||
|
||||
if (!options) return
|
||||
|
||||
if (elements.indexOf(options.element) != -1) {
|
||||
elements.splice(elements.indexOf(options.element), 1)
|
||||
delete options.element._resize_widget
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -4,9 +4,12 @@
|
|||
|
||||
Disabled for now
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* global WebKitCSSMatrix */
|
||||
var I = new WebKitCSSMatrix()
|
||||
|
||||
function Point(x, y, z) {
|
||||
|
|
@ -45,7 +48,7 @@ function getTransformationMatrix(w) {
|
|||
|
||||
}
|
||||
|
||||
module.exports = function cssTransformCoords(node, x, y) {
|
||||
export default function cssTransformCoords(node, x, y) {
|
||||
|
||||
return new Point(x, y, 0).transformBy(getTransformationMatrix(node).inverse())
|
||||
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
const Touch = window.Touch || class Touch {}
|
||||
const zoom = require('../ui/zoom')
|
||||
|
||||
// const cssTransformCoords = require('./transform-coords')
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
||||
fix: function(e) {
|
||||
|
||||
return {
|
||||
|
||||
target: e.target,
|
||||
firstTarget: null,
|
||||
offsetX: e.offsetX,
|
||||
offsetY: e.offsetY,
|
||||
pageX: e.pageX,
|
||||
pageY: e.pageY,
|
||||
clientX: e.clientX,
|
||||
clientY: e.clientY,
|
||||
movementX: e.movementX === undefined ? undefined : e.movementX / zoom.localZoom,
|
||||
movementY: e.movementY === undefined ? undefined : e.movementY / zoom.localZoom,
|
||||
pointerId: e.pointerId,
|
||||
pointerType: e.pointerType,
|
||||
button: e.button,
|
||||
altKey: e.altKey,
|
||||
ctrlKey: e.ctrlKey,
|
||||
shiftKey: e.shiftKey,
|
||||
inertia: e.multitouch ? 1 : e.inertia,
|
||||
traversing: e.traversing,
|
||||
traversingStack: e.traversingStack,
|
||||
multitouch: e.multitouch,
|
||||
isTouch: e instanceof Touch,
|
||||
force: e.webkitForce || e.force || 0,
|
||||
radiusX: e.radiusX,
|
||||
radiusY: e.radiusY,
|
||||
rotationAngle: e.rotationAngle,
|
||||
// iOS only
|
||||
altitudeAngle: e.altitudeAngle,
|
||||
azimuthAngle: e.azimuthAngle,
|
||||
touchType: e.touchType
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
normalizeDragEvent: function(event, previousEvent) {
|
||||
|
||||
event = module.exports.fix(event)
|
||||
|
||||
event.firstTarget = previousEvent ? previousEvent.firstTarget : event.target
|
||||
|
||||
if (event.movementX === undefined) {
|
||||
|
||||
event.movementX = previousEvent ? event.pageX - previousEvent.pageX : 0
|
||||
event.movementY = previousEvent ? event.pageY - previousEvent.pageY : 0
|
||||
|
||||
}
|
||||
|
||||
if (event.isTouch && !previousEvent) {
|
||||
|
||||
module.exports.resetEventOffset(event, event.target)
|
||||
|
||||
} else if (event.isTouch && previousEvent) {
|
||||
|
||||
event.offsetX = previousEvent.offsetX + event.movementX
|
||||
event.offsetY = previousEvent.offsetY + event.movementY
|
||||
|
||||
}
|
||||
|
||||
if (event.inertia === undefined) {
|
||||
|
||||
event.inertia = 1
|
||||
|
||||
}
|
||||
|
||||
if (previousEvent) {
|
||||
|
||||
if (previousEvent.traversing) event.traversing = previousEvent.traversing
|
||||
if (previousEvent.traversingStack) event.traversingStack = previousEvent.traversingStack
|
||||
|
||||
if (previousEvent.multitouch) {
|
||||
event.multitouch = previousEvent.multitouch
|
||||
event.inertia = 1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// if (!event.traversing) {
|
||||
// // css transform fix (doesn't work well with traversing gestures)
|
||||
// var transformedCoords = cssTransformCoords(event.firstTarget, event.movementX, event.movementY)
|
||||
// event.movementX = transformedCoords.x
|
||||
// event.movementY = transformedCoords.y
|
||||
// }
|
||||
|
||||
return event
|
||||
|
||||
},
|
||||
|
||||
resetEventOffset: function(event, target) {
|
||||
|
||||
var off = DOM.offset(target)
|
||||
|
||||
event.offsetX = event.pageX - off.left
|
||||
event.offsetY = event.pageY - off.top
|
||||
|
||||
// if (!event.traversing) {
|
||||
// // css transform fix (doesn't work well with traversing gestures)
|
||||
// var transformedCoords = cssTransformCoords(event.firstTarget, event.offsetX, event.offsetY)
|
||||
// event.offsetX = transformedCoords.x
|
||||
// event.offsetY = transformedCoords.y
|
||||
// }
|
||||
|
||||
},
|
||||
|
||||
TRAVERSING_SAMEWIDGET: 1
|
||||
|
||||
}
|
||||
123
src/client/events/utils.mjs
Normal file
123
src/client/events/utils.mjs
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
import {DOM} from '../globals.mjs'
|
||||
|
||||
var zoom
|
||||
setTimeout(async()=>{
|
||||
// use setTimeout to fix init order in safari...
|
||||
zoom = (await import('../ui/zoom.mjs')).default
|
||||
})
|
||||
|
||||
// impot cssTransformCoords from './transform-coords.mjs'
|
||||
|
||||
const Touch = window.Touch || class Touch {}
|
||||
|
||||
|
||||
export function fix(e) {
|
||||
|
||||
var localZoom = zoom.editor && zoom.editor.enabled ? zoom.localZoom : 1
|
||||
|
||||
return {
|
||||
|
||||
target: e.target === document ? null : e.target, // firefox passes document when outside the page
|
||||
firstTarget: null,
|
||||
offsetX: e.offsetX,
|
||||
offsetY: e.offsetY,
|
||||
pageX: e.pageX,
|
||||
pageY: e.pageY,
|
||||
clientX: e.clientX,
|
||||
clientY: e.clientY,
|
||||
movementX: e.movementX === undefined ? undefined : e.movementX / localZoom,
|
||||
movementY: e.movementY === undefined ? undefined : e.movementY / localZoom,
|
||||
pointerId: e.pointerId,
|
||||
pointerType: e.pointerType,
|
||||
button: e.button,
|
||||
altKey: e.altKey,
|
||||
ctrlKey: e.ctrlKey,
|
||||
shiftKey: e.shiftKey,
|
||||
inertia: e.multitouch ? 1 : e.inertia,
|
||||
traversing: e.traversing,
|
||||
traversingStack: e.traversingStack,
|
||||
multitouch: e.multitouch,
|
||||
isTouch: e instanceof Touch,
|
||||
force: e.webkitForce || e.force || 0,
|
||||
radiusX: e.radiusX,
|
||||
radiusY: e.radiusY,
|
||||
rotationAngle: e.rotationAngle,
|
||||
// iOS only
|
||||
altitudeAngle: e.altitudeAngle,
|
||||
azimuthAngle: e.azimuthAngle,
|
||||
touchType: e.touchType
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export function normalizeDragEvent(event, previousEvent) {
|
||||
|
||||
event = fix(event)
|
||||
|
||||
event.firstTarget = previousEvent ? previousEvent.firstTarget : event.target
|
||||
|
||||
if (event.movementX === undefined) {
|
||||
|
||||
event.movementX = previousEvent ? event.pageX - previousEvent.pageX : 0
|
||||
event.movementY = previousEvent ? event.pageY - previousEvent.pageY : 0
|
||||
|
||||
}
|
||||
|
||||
if (event.isTouch && !previousEvent) {
|
||||
|
||||
resetEventOffset(event, event.target)
|
||||
|
||||
} else if (previousEvent) {
|
||||
|
||||
event.offsetX = previousEvent.offsetX + event.movementX
|
||||
event.offsetY = previousEvent.offsetY + event.movementY
|
||||
|
||||
}
|
||||
|
||||
if (event.inertia === undefined) {
|
||||
|
||||
event.inertia = 1
|
||||
|
||||
}
|
||||
|
||||
if (previousEvent) {
|
||||
|
||||
if (previousEvent.traversing) event.traversing = previousEvent.traversing
|
||||
if (previousEvent.traversingStack) event.traversingStack = previousEvent.traversingStack
|
||||
|
||||
if (previousEvent.multitouch) {
|
||||
event.multitouch = previousEvent.multitouch
|
||||
event.inertia = 1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// if (!event.traversing) {
|
||||
// // css transform fix (doesn't work well with traversing gestures)
|
||||
// var transformedCoords = cssTransformCoords(event.firstTarget, event.movementX, event.movementY)
|
||||
// event.movementX = transformedCoords.x
|
||||
// event.movementY = transformedCoords.y
|
||||
// }
|
||||
|
||||
return event
|
||||
|
||||
}
|
||||
|
||||
export function resetEventOffset(event, target) {
|
||||
|
||||
var off = DOM.offset(target)
|
||||
|
||||
event.offsetX = event.pageX - off.left
|
||||
event.offsetY = event.pageY - off.top
|
||||
|
||||
// if (!event.traversing) {
|
||||
// // css transform fix (doesn't work well with traversing gestures)
|
||||
// var transformedCoords = cssTransformCoords(event.firstTarget, event.offsetX, event.offsetY)
|
||||
// event.offsetX = transformedCoords.x
|
||||
// event.offsetY = transformedCoords.y
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
export const TRAVERSING_SAMEWIDGET = 1
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
window.IP = window.IP || ''
|
||||
window.ENV = window.ENV || {}
|
||||
location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, (s,k,v)=>{
|
||||
ENV[k]=v
|
||||
})
|
||||
for (var k in ENV) {
|
||||
ENV[k.toLowerCase()] = ENV[k]
|
||||
}
|
||||
|
||||
window.LANG = ENV.lang === 'debug' ? 'debug' : (ENV.lang || navigator.language || '').substr(0, 2).toLowerCase()
|
||||
|
||||
window.PACKAGE = require('../../package.json')
|
||||
|
||||
window.LOADING = null
|
||||
|
||||
window.READ_ONLY = window.READ_ONLY || false
|
||||
window.GRIDWIDTH_CSS = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--grid-width'))
|
||||
window.GRIDWIDTH = GRIDWIDTH_CSS
|
||||
|
||||
|
||||
|
||||
window.ELECTRON_NOGPU = false
|
||||
window.CANVAS_FRAMERATE = parseFloat(ENV.framerate || 60)
|
||||
window.CANVAS_SCALING = parseFloat(ENV.forcehdpi) || ( ENV.hdpi ? window.devicePixelRatio : 1 )
|
||||
window.INITIALZOOM = ENV.zoom ? parseFloat(ENV.zoom) : 1
|
||||
window.PXSCALE = INITIALZOOM
|
||||
document.documentElement.style.setProperty('font-size', PXSCALE + 'px')
|
||||
|
||||
window.DOUBLE_TAP_TIME = ENV.doubletap ? parseInt(ENV.doubletap) : 375
|
||||
|
||||
window.CLIENT_SYNC = parseInt(ENV.clientSync) !== 0
|
||||
|
||||
window.TOGGLE_ALT_TRAVERSING = !!ENV.altTraversing
|
||||
|
||||
window.VIRTUAL_KEYBOARD = !!ENV.virtualKeyboard
|
||||
|
||||
window.FOCUSABLE = !ENV.noFocus
|
||||
if (!FOCUSABLE) console.debug('ELECTRON.SETFOCUSABLE(0)')
|
||||
else console.debug('ELECTRON.SETFOCUSABLE(1)')
|
||||
|
||||
window.JSON.parseFlex = require('json5').parse
|
||||
|
||||
window.DOM = require('./dom')
|
||||
|
||||
window.TITLE = PACKAGE.productName + ' v' + PACKAGE.version
|
||||
61
src/client/globals.mjs
Normal file
61
src/client/globals.mjs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import json5 from 'json5'
|
||||
import pkg from '../../package.json'
|
||||
import * as dom from './dom.mjs'
|
||||
|
||||
export var IP = window.IP || ''
|
||||
export var ENV = window.ENV || {}
|
||||
location.search.replace(/[?&]+([^=&j]+)=([^&]*)/gi, (s,k,v)=>{
|
||||
ENV[k]=v
|
||||
})
|
||||
for (var k in ENV) {
|
||||
ENV[k.toLowerCase()] = ENV[k]
|
||||
}
|
||||
|
||||
export var LANG = ENV.lang === 'debug' ? 'debug' : (ENV.lang || navigator.language || '').substr(0, 2).toLowerCase()
|
||||
|
||||
export var PACKAGE = pkg
|
||||
|
||||
export var LOADING = null
|
||||
|
||||
export var READ_ONLY = window.READ_ONLY || false
|
||||
export var KIOSK = window.KIOSK || false
|
||||
export var GRIDWIDTH_CSS = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--grid-width'))
|
||||
export function setGRIDWIDTH_CSS(x) {GRIDWIDTH_CSS = x}
|
||||
export var GRIDWIDTH = GRIDWIDTH_CSS
|
||||
export function setGRIDWIDTH(x) {GRIDWIDTH = x}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export var ELECTRON_NOGPU = false
|
||||
export var CANVAS_FRAMERATE = parseFloat(ENV.framerate || 60)
|
||||
export var CANVAS_SCALING = parseFloat(ENV.forcehdpi) || ( ENV.hdpi ? window.devicePixelRatio : 1 )
|
||||
export var INITIALZOOM = ENV.zoom ? parseFloat(ENV.zoom) : 1
|
||||
export var PXSCALE = INITIALZOOM
|
||||
export function setPXSCALE(x) {PXSCALE = x}
|
||||
document.documentElement.style.setProperty('font-size', PXSCALE + 'px')
|
||||
|
||||
export var DOUBLE_TAP_TIME = ENV.doubletap ? parseInt(ENV.doubletap) : 375
|
||||
|
||||
export var CLIENT_SYNC = parseInt(ENV.clientSync) !== 0
|
||||
|
||||
export var TOGGLE_ALT_TRAVERSING = !!ENV.altTraversing
|
||||
|
||||
export var VIRTUAL_KEYBOARD = !!ENV.virtualKeyboard
|
||||
export function setVIRTUAL_KEYBOARD(x) {
|
||||
VIRTUAL_KEYBOARD = x
|
||||
}
|
||||
|
||||
export var FOCUSABLE = !ENV.noFocus
|
||||
if (!FOCUSABLE) console.debug('ELECTRON.SETFOCUSABLE(0)')
|
||||
else console.debug('ELECTRON.SETFOCUSABLE(1)')
|
||||
export function setFOCUSABLE(x) {FOCUSABLE = x}
|
||||
|
||||
|
||||
export var JSON5 = json5
|
||||
|
||||
export var DOM = dom
|
||||
|
||||
export var TITLE = ENV.title || (PACKAGE.productName + ' v' + PACKAGE.version)
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
document.addEventListener('DOMContentLoaded', function(event) {
|
||||
|
||||
require('./globals')
|
||||
require('./stacktrace')
|
||||
|
||||
var locales = require('./locales')
|
||||
|
||||
DOM.init()
|
||||
|
||||
var uiLoading = require('./ui/ui-loading')
|
||||
uiLoading(locales('loading_server'))
|
||||
|
||||
function init() {
|
||||
|
||||
setTimeout(()=>{
|
||||
|
||||
var ipc = require('./ipc/'),
|
||||
backup = require('./backup')
|
||||
|
||||
ipc.init()
|
||||
|
||||
|
||||
require('./ui/init')
|
||||
|
||||
document.title = TITLE
|
||||
|
||||
ipc.send('open', {hotReload: backup.exists})
|
||||
|
||||
window.onunload = ()=>{
|
||||
ipc.send('close')
|
||||
}
|
||||
|
||||
backup.load()
|
||||
|
||||
|
||||
}, 100)
|
||||
|
||||
}
|
||||
|
||||
if (document.requestStorageAccess) {
|
||||
document.requestStorageAccess().then(init, init)
|
||||
} else {
|
||||
init()
|
||||
}
|
||||
|
||||
})
|
||||
25
src/client/index.mjs
Normal file
25
src/client/index.mjs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import {TITLE} from './globals.mjs'
|
||||
import './stacktrace.mjs'
|
||||
import './ui/init.mjs'
|
||||
|
||||
import locales from './locales/index.mjs'
|
||||
import uiLoading from './ui/ui-loading.mjs'
|
||||
import ipc from './ipc/index.mjs'
|
||||
import * as backup from './backup.mjs'
|
||||
|
||||
uiLoading(locales('loading_server'))
|
||||
|
||||
ipc.init(()=>{
|
||||
|
||||
|
||||
document.title = TITLE
|
||||
|
||||
ipc.send('open', {hotReload: backup.exists})
|
||||
|
||||
window.onunload = ()=>{
|
||||
ipc.send('close')
|
||||
}
|
||||
|
||||
backup.load()
|
||||
|
||||
})
|
||||
|
|
@ -1,18 +1,19 @@
|
|||
var utils = require('../ui/utils'),
|
||||
osc = require('../osc'),
|
||||
session = require('../managers/session/'),
|
||||
widgetManager = require('../managers/widgets'),
|
||||
state = require('../managers/state'),
|
||||
editor = require('../editor/'),
|
||||
locales = require('../locales'),
|
||||
UiModal = require('../ui/ui-modal'),
|
||||
uiLoading = require('../ui/ui-loading'),
|
||||
notifications = require('../ui/notifications'),
|
||||
raw = require('nanohtml/raw'),
|
||||
backup = require('../backup'),
|
||||
{updateMobileThemeColor} = require('../ui/utils')
|
||||
import raw from 'nanohtml/raw'
|
||||
import fastdom from 'fastdom'
|
||||
import osc from '../osc.mjs'
|
||||
import session from '../managers/session/index.mjs'
|
||||
import widgetManager from '../managers/widgets.mjs'
|
||||
import state from '../managers/state.mjs'
|
||||
import editor from '../editor/index.mjs'
|
||||
import locales from '../locales/index.mjs'
|
||||
import UiModal from '../ui/ui-modal.mjs'
|
||||
import uiLoading from '../ui/ui-loading.mjs'
|
||||
import notifications from '../ui/notifications'
|
||||
import * as backup from '../backup.mjs'
|
||||
import {updateMobileThemeColor, icon} from '../ui/utils.mjs'
|
||||
import {CLIENT_SYNC, DOM, ENV, TITLE, setGRIDWIDTH_CSS} from '../globals.mjs'
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
|
||||
bundle: function(data) {
|
||||
for (let i in data) {
|
||||
|
|
@ -85,7 +86,7 @@ module.exports = {
|
|||
},
|
||||
|
||||
error: function(data){
|
||||
new UiModal({title: raw(utils.icon('exclamation-triangle') + ' ' + locales('error')), content: raw(data), closable:true})
|
||||
new UiModal({title: raw(icon('exclamation-triangle') + ' ' + locales('error')), content: raw(data), closable:true})
|
||||
},
|
||||
|
||||
errorLog: function(data) {
|
||||
|
|
@ -114,7 +115,7 @@ module.exports = {
|
|||
var root = widgetManager.getWidgetById('root')[0]
|
||||
if (root) root.onPropChanged('colorWidget')
|
||||
fastdom.measure(()=>{
|
||||
GRIDWIDTH_CSS = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--grid-width'))
|
||||
setGRIDWIDTH_CSS(parseInt(getComputedStyle(document.documentElement).getPropertyValue('--grid-width')))
|
||||
fastdom.mutate(()=>{
|
||||
editor.toggleGrid()
|
||||
editor.toggleGrid()
|
||||
|
|
@ -155,6 +156,8 @@ module.exports = {
|
|||
|
||||
setTitle: function(data) {
|
||||
|
||||
if (ENV.title) return
|
||||
|
||||
document.title = TITLE + (data ? ' (' + data + ')' : '')
|
||||
|
||||
},
|
||||
|
|
@ -1,10 +1,22 @@
|
|||
var EventEmitter = require('../events/event-emitter'),
|
||||
cache = require('../managers/cache'),
|
||||
{nanoid} = require('nanoid'), uuid,
|
||||
notifications,
|
||||
locales
|
||||
import {nanoid} from 'nanoid'
|
||||
import EventEmitter from '../events/event-emitter.mjs'
|
||||
import cache from '../managers/cache.mjs'
|
||||
import {ENV} from '../globals.mjs'
|
||||
|
||||
var localUuid = ENV.id || cache.get('osc.uuid', false)
|
||||
var notifications, locales, callbacks
|
||||
|
||||
var loadDeps = (async()=>{
|
||||
notifications = (await import('../ui/notifications.mjs')).default
|
||||
locales = (await import('../locales/index.mjs')).default
|
||||
callbacks = (await import('./callbacks.mjs')).default
|
||||
|
||||
// wait for other js chunks too since we'll connect to the server once this provise resolves
|
||||
await import('../editor/context-menu.mjs')
|
||||
await import('../remote-control.mjs')
|
||||
await import('../ui/ui-keyboard.mjs')
|
||||
})()
|
||||
|
||||
var uuid, localUuid = ENV.id || cache.get('uuid', false)
|
||||
if (localUuid) {
|
||||
uuid = localUuid
|
||||
} else {
|
||||
|
|
@ -12,11 +24,6 @@ if (localUuid) {
|
|||
cache.set('uuid', uuid, false)
|
||||
}
|
||||
|
||||
setTimeout(()=>{
|
||||
notifications = require('../ui/notifications')
|
||||
locales = require('../locales')
|
||||
})
|
||||
|
||||
var reconnectTimeout = 500,
|
||||
hearbeatInterval = 5000,
|
||||
hearbeatTimeout = 3000,
|
||||
|
|
@ -48,26 +55,30 @@ class Ipc extends EventEmitter {
|
|||
|
||||
document.cookie = 'client_id=' + uuid + ';samesite=strict'
|
||||
|
||||
try {
|
||||
this.open()
|
||||
} catch(e) {
|
||||
console.warn('Could not open a WebSocket connection')
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
init() {
|
||||
init(callback) {
|
||||
|
||||
var callbacks = require('./callbacks')
|
||||
loadDeps.then(()=>{
|
||||
|
||||
for (let i in callbacks) {
|
||||
let callback = callbacks[i]
|
||||
this.on(i, (data)=>{
|
||||
callback(data)
|
||||
})
|
||||
}
|
||||
for (let i in callbacks) {
|
||||
let callback = callbacks[i]
|
||||
this.on(i, (data)=>{
|
||||
callback(data)
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
this.open()
|
||||
} catch(e) {
|
||||
console.warn('Could not open a WebSocket connection')
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
callback()
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -192,4 +203,4 @@ class Ipc extends EventEmitter {
|
|||
|
||||
var ipc = new Ipc()
|
||||
|
||||
module.exports = ipc
|
||||
export default ipc
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = {
|
||||
export default {
|
||||
|
||||
// console
|
||||
console: 'Konsole',
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = {
|
||||
export default {
|
||||
|
||||
// console
|
||||
console: 'Console',
|
||||
|
|
@ -96,7 +96,7 @@ module.exports = {
|
|||
|
||||
// notifications
|
||||
notifications: 'Notifications',
|
||||
|
||||
|
||||
// remote save
|
||||
remotesave_open: 'Open (on the server)',
|
||||
remotesave_save: 'Save (on the server)',
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = {
|
||||
export default {
|
||||
|
||||
// console
|
||||
console: 'Console',
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
var locales = {
|
||||
en: require('./en'),
|
||||
fr: require('./fr'),
|
||||
de: require('./de'),
|
||||
ok: require('./pl'),
|
||||
debug: {
|
||||
/* empty */
|
||||
keyboard_layout: require('./en').keyboard_layout
|
||||
}
|
||||
}
|
||||
|
||||
var lang = locales[LANG] ? LANG : 'en'
|
||||
|
||||
module.exports = key=>locales[lang][key] || `!${key}!`
|
||||
17
src/client/locales/index.mjs
Normal file
17
src/client/locales/index.mjs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import en from './en.mjs'
|
||||
import fr from './fr.mjs'
|
||||
import de from './de.mjs'
|
||||
import pl from './pl.mjs'
|
||||
import {LANG} from '../globals.mjs'
|
||||
|
||||
var locales = {
|
||||
en, fr, de, pl,
|
||||
debug: {
|
||||
/* empty */
|
||||
keyboard_layout: en.keyboard_layout
|
||||
}
|
||||
}
|
||||
|
||||
var lang = locales[LANG] ? LANG : 'en'
|
||||
|
||||
export default key=>locales[lang][key] || `!${key}!`
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = {
|
||||
export default {
|
||||
|
||||
// console
|
||||
console: 'Terminal',
|
||||
|
|
@ -4,17 +4,33 @@ class Cache {
|
|||
|
||||
set(key, value, persistent = true) {
|
||||
|
||||
var storage = persistent ? localStorage : sessionStorage
|
||||
try {
|
||||
|
||||
var storage = persistent ? localStorage : sessionStorage
|
||||
|
||||
storage.setItem(keyPrefix + key, JSON.stringify(value))
|
||||
|
||||
} catch(e){
|
||||
console.error(`Could not write to ${persistent ? 'localStorage' : 'sessionStorage'}: ${e}`)
|
||||
console.debug(e)
|
||||
}
|
||||
|
||||
storage.setItem(keyPrefix + key, JSON.stringify(value))
|
||||
|
||||
}
|
||||
|
||||
get(key, persistent = true) {
|
||||
|
||||
var storage = persistent ? localStorage : sessionStorage
|
||||
try {
|
||||
|
||||
return JSON.parse(storage.getItem(keyPrefix + key))
|
||||
var storage = persistent ? localStorage : sessionStorage
|
||||
|
||||
return JSON.parse(storage.getItem(keyPrefix + key))
|
||||
|
||||
} catch(e){
|
||||
console.error(`Could not read from ${persistent ? 'localStorage' : 'sessionStorage'}: ${e}`)
|
||||
console.debug(e)
|
||||
return null
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -52,4 +68,4 @@ class Cache {
|
|||
|
||||
}
|
||||
|
||||
module.exports = new Cache()
|
||||
export default new Cache()
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
var ipc = require('../../ipc/'),
|
||||
parser = require('../../parser'),
|
||||
editor = require('../../editor/'),
|
||||
uiFilebrowser = require('../../ui/ui-filebrowser'),
|
||||
uiFileupload = require('../../ui/ui-fileupload'),
|
||||
UiModal = require('../../ui/ui-modal'),
|
||||
uiLoading = require('../../ui/ui-loading'),
|
||||
uiConsole = require('../../ui/ui-console'),
|
||||
{saveAs} = require('file-saver'),
|
||||
widgetManager = require('../widgets'),
|
||||
locales = require('../../locales'),
|
||||
Session = require('./session'),
|
||||
EventEmitter = require('../../events/event-emitter'),
|
||||
{deepEqual} = require('../../utils')
|
||||
|
||||
import {saveAs} from 'file-saver'
|
||||
import ipc from '../../ipc/index.mjs'
|
||||
import parser from '../../parser.mjs'
|
||||
import editor from '../../editor/index.mjs'
|
||||
import uiFilebrowser from '../../ui/ui-filebrowser.mjs'
|
||||
import uiFileupload from '../../ui/ui-fileupload.mjs'
|
||||
import UiModal from '../../ui/ui-modal.mjs'
|
||||
import uiLoading from '../../ui/ui-loading.mjs'
|
||||
import uiConsole from '../../ui/ui-console'
|
||||
import widgetManager from '../widgets.mjs'
|
||||
import locales from '../../locales/index.mjs'
|
||||
import Session from './session.mjs'
|
||||
import EventEmitter from '../../events/event-emitter.mjs'
|
||||
import {deepEqual} from '../../utils.mjs'
|
||||
import {DOM, READ_ONLY, PACKAGE, CLIENT_SYNC} from '../../globals.mjs'
|
||||
|
||||
var SessionManager = class SessionManager extends EventEmitter {
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ var SessionManager = class SessionManager extends EventEmitter {
|
|||
|
||||
this.load(data.fileContent, ()=>{
|
||||
this.setSessionPath(data.path)
|
||||
ipc.send('sessionOpened', {path: data.path})
|
||||
ipc.send('sessionOpened', {path: data.path, sync: CLIENT_SYNC})
|
||||
})
|
||||
|
||||
}
|
||||
|
|
@ -295,4 +295,4 @@ var SessionManager = class SessionManager extends EventEmitter {
|
|||
|
||||
var sessionManager = new SessionManager()
|
||||
|
||||
module.exports = sessionManager
|
||||
export default sessionManager
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
var semver = require('semver'),
|
||||
UiModal = require('../../ui/ui-modal'),
|
||||
locales = require('../../locales')
|
||||
import semver from 'semver'
|
||||
import UiModal from '../../ui/ui-modal.mjs'
|
||||
import locales from '../../locales/index.mjs'
|
||||
import {PACKAGE} from '../../globals.mjs'
|
||||
|
||||
class Session {
|
||||
|
||||
|
|
@ -347,4 +348,4 @@ for (var i in converters) {
|
|||
Session.converters[converters[i].version] = converters[i]
|
||||
}
|
||||
|
||||
module.exports = Session
|
||||
export default Session
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
var ipc = require('../ipc'),
|
||||
widgetManager = require('./widgets'),
|
||||
cache = require('./cache'),
|
||||
uiFilebrowser = require('../ui/ui-filebrowser'),
|
||||
uiFileupload = require('../ui/ui-fileupload'),
|
||||
notifications = require('../ui/notifications'),
|
||||
{saveAs} = require('file-saver'),
|
||||
locales = require('../locales'),
|
||||
{deepCopy} = require('../utils')
|
||||
import {saveAs} from 'file-saver'
|
||||
import ipc from '../ipc/index.mjs'
|
||||
import widgetManager from './widgets.mjs'
|
||||
import cache from './cache.mjs'
|
||||
import uiFilebrowser from '../ui/ui-filebrowser.mjs'
|
||||
import uiFileupload from '../ui/ui-fileupload.mjs'
|
||||
import notifications from '../ui/notifications.mjs'
|
||||
import locales from '../locales/index.mjs'
|
||||
import {deepCopy} from '../utils.mjs'
|
||||
|
||||
|
||||
var StateManager = class StateManager {
|
||||
|
|
@ -65,7 +65,7 @@ var StateManager = class StateManager {
|
|||
|
||||
if (widgets[j].setValue && !widgets[j].noValueState) {
|
||||
|
||||
widgets[j].setValue(value, {send:send, sync:true, fromState:true})
|
||||
widgets[j].setValue(value, {send:send, sync:true})
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ var StateManager = class StateManager {
|
|||
if (this.valueStateQueue[id] !== undefined) {
|
||||
for (let w of widgetManager.getWidgetById(id)) {
|
||||
if (w.noValueState) continue
|
||||
w.setValue(this.valueStateQueue[id], {sync: true, fromState:true, fromEdit: true})
|
||||
w.setValue(this.valueStateQueue[id], {sync: true, script: false})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -235,7 +235,7 @@ var StateManager = class StateManager {
|
|||
if (this.valueNewPropQueue[id] != this.valueOldPropQueue[id]) {
|
||||
for (let w of widgetManager.getWidgetById(id)) {
|
||||
if (w.noValueState) continue
|
||||
w.setValue(w.getProp('value'), {sync: true, fromState:true})
|
||||
w.setValue(w.getProp('value'), {sync: true})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -260,4 +260,4 @@ var StateManager = class StateManager {
|
|||
|
||||
var stateManager = new StateManager()
|
||||
|
||||
module.exports = stateManager
|
||||
export default stateManager
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
var EventEmitter = require('../events/event-emitter'),
|
||||
ipc = require('../ipc/')
|
||||
import EventEmitter from '../events/event-emitter.mjs'
|
||||
import ipc from '../ipc/index.mjs'
|
||||
|
||||
class WidgetManager extends EventEmitter {
|
||||
|
||||
|
|
@ -38,6 +38,8 @@ class WidgetManager extends EventEmitter {
|
|||
if (linkId) {
|
||||
if (!Array.isArray(linkId)) linkId = [linkId]
|
||||
linkId = linkId.map(x=>String(x).replace(/^>>\s*/, '')).filter(x=>x.indexOf('<<') < 0)
|
||||
// scopable; prefix linkId with the closest (most restrictive) scope
|
||||
if (widget.scopes.length) linkId = linkId.map(x => x + widget.scopes[0])
|
||||
linkId = linkId.filter(x=>this.linkIdLock.indexOf(x)<0)
|
||||
this.linkIdLock = this.linkIdLock.concat(linkId)
|
||||
this.linkIdLockDepth++
|
||||
|
|
@ -117,6 +119,8 @@ class WidgetManager extends EventEmitter {
|
|||
if (linkId) {
|
||||
if (!Array.isArray(linkId)) linkId = [linkId]
|
||||
linkId = linkId.map(x=>String(x).replace(/^<<\s*/, '')).filter(x=>x.indexOf('>>') < 0)
|
||||
// scopable; prefix linkId with the closest (most restrictive) scope
|
||||
if (widget.scopes.length) linkId = linkId.map(x => x + widget.scopes[0])
|
||||
for (var i in linkId) {
|
||||
if (linkId[i]) {
|
||||
if (!this.linkIdRoute[linkId[i]]) this.linkIdRoute[linkId[i]] = []
|
||||
|
|
@ -180,7 +184,9 @@ class WidgetManager extends EventEmitter {
|
|||
if (address && this.addressRoute[address].indexOf(hash) != -1) this.addressRoute[address].splice(this.addressRoute[address].indexOf(hash), 1)
|
||||
|
||||
if (!Array.isArray(linkId)) linkId = [linkId]
|
||||
linkId = linkId.map(x=>String(x))
|
||||
linkId = linkId.map(x=>String(x).replace(/^<<\s*/, '')).filter(x=>x.indexOf('>>') < 0)
|
||||
// scopable; prefix linkId with the closest (most restrictive) scope
|
||||
if (widget.scopes.length) linkId = linkId.map(x => x + widget.scopes[0])
|
||||
for (var i in linkId) {
|
||||
if (linkId[i] && this.linkIdRoute[linkId[i]] && this.linkIdRoute[linkId[i]].indexOf(hash) != -1) this.linkIdRoute[linkId[i]].splice(this.linkIdRoute[linkId[i]].indexOf(hash), 1)
|
||||
}
|
||||
|
|
@ -260,7 +266,22 @@ class WidgetManager extends EventEmitter {
|
|||
|
||||
}
|
||||
|
||||
getWidgetById(id) {
|
||||
getWidgetById(id, scope) {
|
||||
|
||||
/*
|
||||
scopable: return matching widgets only for the closest scope with results
|
||||
*/
|
||||
if (scope && scope.length) {
|
||||
if (!Array.isArray(scope)) scope = [scope]
|
||||
for (var prefix of scope) {
|
||||
var prefixedId = Array.isArray(id) ? id.map(i=>prefix + i) : prefix + id
|
||||
|
||||
var widgets = this.getWidgetBy(prefixedId, this.idRoute)
|
||||
|
||||
if (widgets.length) return widgets
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
return this.getWidgetBy(id, this.idRoute)
|
||||
|
||||
|
|
@ -326,4 +347,4 @@ class WidgetManager extends EventEmitter {
|
|||
|
||||
var widgetManager = new WidgetManager()
|
||||
|
||||
module.exports = widgetManager
|
||||
export default widgetManager
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
var widgetManager = require('./managers/widgets'),
|
||||
EventEmitter = require('./events/event-emitter'),
|
||||
ipc = require('./ipc/'),
|
||||
{deepEqual} = require('./utils')
|
||||
import widgetManager from './managers/widgets.mjs'
|
||||
import EventEmitter from './events/event-emitter.mjs'
|
||||
import ipc from './ipc/index.mjs'
|
||||
import {deepEqual} from './utils.mjs'
|
||||
import {CLIENT_SYNC} from './globals.mjs'
|
||||
|
||||
var Osc = class Osc extends EventEmitter {
|
||||
|
||||
|
|
@ -13,9 +14,9 @@ var Osc = class Osc extends EventEmitter {
|
|||
this.remoteControl = {}
|
||||
this.serverTargets = []
|
||||
|
||||
setTimeout(()=>{
|
||||
osc.remoteControl = require('./remote-control')
|
||||
})
|
||||
;(async()=>{
|
||||
this.remoteControl = (await import('./remote-control.mjs')).default
|
||||
})()
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -90,4 +91,4 @@ var Osc = class Osc extends EventEmitter {
|
|||
|
||||
var osc = new Osc()
|
||||
|
||||
module.exports = osc
|
||||
export default osc
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
var widgetManager = require('./managers/widgets'),
|
||||
stateManager = require('./managers/state'),
|
||||
{deepCopy} = require('./utils')
|
||||
import widgetManager from './managers/widgets.mjs'
|
||||
import stateManager from './managers/state.mjs'
|
||||
import {deepCopy} from './utils.mjs'
|
||||
|
||||
var Parser = class Parser {
|
||||
|
||||
|
|
@ -10,6 +10,13 @@ var Parser = class Parser {
|
|||
this.widgets = {}
|
||||
this.defaults = {}
|
||||
|
||||
;(async()=>{
|
||||
this.widgets = (await import('./widgets/index.mjs')).widgets
|
||||
for (var k in this.widgets) {
|
||||
this.defaults[k] = this.widgets[k].defaults()._props()
|
||||
}
|
||||
})()
|
||||
|
||||
}
|
||||
|
||||
getIterator(id) {
|
||||
|
|
@ -38,7 +45,8 @@ var Parser = class Parser {
|
|||
index,
|
||||
hash,
|
||||
locals,
|
||||
variables
|
||||
variables,
|
||||
meta
|
||||
} = options
|
||||
|
||||
var props = data
|
||||
|
|
@ -82,7 +90,8 @@ var Parser = class Parser {
|
|||
children,
|
||||
hash,
|
||||
locals,
|
||||
variables
|
||||
variables,
|
||||
meta
|
||||
})
|
||||
|
||||
widgetManager.addWidget(widget)
|
||||
|
|
@ -116,9 +125,4 @@ var Parser = class Parser {
|
|||
|
||||
var parser = new Parser()
|
||||
|
||||
module.exports = parser
|
||||
|
||||
parser.widgets = require('./widgets/').widgets
|
||||
for (var k in parser.widgets) {
|
||||
parser.defaults[k] = parser.widgets[k].defaults()._props()
|
||||
}
|
||||
export default parser
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
var {updateWidget} = require('./editor/data-workers'),
|
||||
editor = require('./editor'),
|
||||
widgetManager = require('./managers/widgets'),
|
||||
stateManager = require('./managers/state'),
|
||||
sessionManager = require('./managers/session'),
|
||||
deepExtend = require('deep-extend'),
|
||||
notifications = require('./ui/notifications'),
|
||||
uiConsole = require('./ui/ui-console')
|
||||
import deepExtend from 'deep-extend'
|
||||
import {updateWidget} from './editor/data-workers.mjs'
|
||||
import editor from './editor/index.mjs'
|
||||
import widgetManager from './managers/widgets.mjs'
|
||||
import stateManager from './managers/state.mjs'
|
||||
import sessionManager from './managers/session'
|
||||
import notifications from './ui/notifications.mjs'
|
||||
import uiConsole from './ui/ui-console.mjs'
|
||||
import {READ_ONLY, JSON5} from './globals.mjs'
|
||||
|
||||
var callbacks = {
|
||||
'/EDIT': function(args, custom_module) {
|
||||
|
|
@ -13,8 +14,8 @@ var callbacks = {
|
|||
if (READ_ONLY && !custom_module) return
|
||||
|
||||
var [id, json, opts] = args,
|
||||
newdata = typeof json == 'string' ? JSON.parseFlex(json) : json,
|
||||
options = typeof opts == 'string' ? JSON.parseFlex(opts) : {},
|
||||
newdata = typeof json == 'string' ? JSON5.parse(json) : json,
|
||||
options = typeof opts == 'string' ? JSON5.parse(opts) : {},
|
||||
widgets = widgetManager.getWidgetById(id)
|
||||
|
||||
if (!widgets.length) return
|
||||
|
|
@ -30,7 +31,7 @@ var callbacks = {
|
|||
|
||||
updateWidget(widget, {
|
||||
reuseChildren: !(newdata.widgets || newdata.tabs),
|
||||
changedProps: Object.keys(newdata)
|
||||
editedProps: Object.keys(newdata)
|
||||
})
|
||||
|
||||
}
|
||||
|
|
@ -45,8 +46,8 @@ var callbacks = {
|
|||
if (READ_ONLY && !custom_module) return
|
||||
|
||||
var [id, json, opts] = args,
|
||||
newdata = typeof json == 'string' ? JSON.parseFlex(json) : json,
|
||||
options = typeof opts == 'string' ? JSON.parseFlex(opts) : {},
|
||||
newdata = typeof json == 'string' ? JSON5.parse(json) : json,
|
||||
options = typeof opts == 'string' ? JSON5.parse(opts) : {},
|
||||
widgets = widgetManager.getWidgetById(id)
|
||||
|
||||
if (!widgets.length) return
|
||||
|
|
@ -60,7 +61,7 @@ var callbacks = {
|
|||
|
||||
updateWidget(widget, {
|
||||
reuseChildren: !(newdata.widgets || newdata.tabs),
|
||||
changedProps: Object.keys(newdata)
|
||||
editedProps: Object.keys(newdata)
|
||||
})
|
||||
|
||||
}
|
||||
|
|
@ -209,7 +210,7 @@ var callbacks = {
|
|||
if (!Array.isArray(args)) args = [args]
|
||||
|
||||
var json = args[0],
|
||||
data = typeof json == 'string' ? JSON.parseFlex(json) : json,
|
||||
data = typeof json == 'string' ? JSON5.parse(json) : json,
|
||||
send = !(args[1] === 0 || args[1] === false)
|
||||
|
||||
stateManager.set(data, send)
|
||||
|
|
@ -313,7 +314,7 @@ var callbacks = {
|
|||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
exec: function(name, args, custom_module){
|
||||
if (callbacks[name]) {
|
||||
callbacks[name](args, custom_module)
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
var StackTrace = require('stacktrace-js'),
|
||||
ipc = require('./ipc'),
|
||||
uiConsole
|
||||
|
||||
window.onerror = function(msg,url,row,col, error) {
|
||||
|
||||
StackTrace.fromError(error).then((stackframes)=>{
|
||||
|
||||
var stringifiedStack = stackframes.filter((sf)=>{
|
||||
|
||||
return !sf.fileName.match('browser-pack')
|
||||
|
||||
}).map(function(sf) {
|
||||
|
||||
if (sf.functionName.match(/Object\./)) sf.functionName = 'require'
|
||||
|
||||
return ` at ${sf.functionName} (${sf.fileName}:${sf.lineNumber}:${sf.columnNumber})`
|
||||
|
||||
}).join('\n')
|
||||
|
||||
if (!uiConsole) uiConsole = require('./ui/ui-console')
|
||||
uiConsole.log('error', `${msg}\n${stringifiedStack}`)
|
||||
ipc.send('errorLog', `(ERROR, CLIENT) ${msg}\n${stringifiedStack}`)
|
||||
|
||||
}).catch(()=>{
|
||||
|
||||
if (!uiConsole) uiConsole = require('./ui/ui-console')
|
||||
uiConsole.log('error', `${msg}\n at ${url}:${row}:${col}\n (no stacktrace available)`)
|
||||
ipc.send('errorLog', `(ERROR, CLIENT) ${msg}\n at ${url}:${row}:${col}\n (no stacktrace available)`)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
21
src/client/stacktrace.mjs
Normal file
21
src/client/stacktrace.mjs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import StackTrace from 'stacktrace-js'
|
||||
import ipc from './ipc/index.mjs'
|
||||
import uiConsole from './ui/ui-console.mjs'
|
||||
|
||||
window.onerror = function(msg,url,row,col, error) {
|
||||
|
||||
StackTrace.fromError(error).then((stackframes)=>{
|
||||
|
||||
var stringifiedStack = ' ' + stackframes.join('\n ')
|
||||
|
||||
uiConsole.log('error', `${msg}\n${stringifiedStack}`)
|
||||
ipc.send('errorLog', `(ERROR, CLIENT) ${msg}\n${stringifiedStack}`)
|
||||
|
||||
}).catch(()=>{
|
||||
|
||||
uiConsole.log('error', `${msg}\n at ${url}:${row}:${col}\n (no stacktrace available)`)
|
||||
ipc.send('errorLog', `(ERROR, CLIENT) ${msg}\n at ${url}:${row}:${col}\n (no stacktrace available)`)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
var html = require('nanohtml'),
|
||||
raw = require('nanohtml/raw'),
|
||||
keyboardJS = require('keyboardjs/dist/keyboard.min.js'),
|
||||
UiWidget = require('./ui-widget'),
|
||||
mod = (navigator.platform || '').match('Mac') ? 'cmd' : 'ctrl',
|
||||
MENU_CONTAINER
|
||||
import html from 'nanohtml'
|
||||
import raw from 'nanohtml/raw'
|
||||
import keyboardJS from 'keyboardjs/dist/keyboard.min.js'
|
||||
import UiWidget from './ui-widget.mjs'
|
||||
import {DOM, PXSCALE} from '../globals.mjs'
|
||||
|
||||
var mod = (navigator.platform || '').match('Mac') ? 'cmd' : 'ctrl',
|
||||
MENU_CONTAINER
|
||||
|
||||
class ContextMenu extends UiWidget {
|
||||
|
||||
|
|
@ -217,4 +218,4 @@ class ContextMenu extends UiWidget {
|
|||
|
||||
}
|
||||
|
||||
module.exports = ContextMenu
|
||||
export default ContextMenu
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
var screenfull = require('screenfull'),
|
||||
UiModal = require('./ui-modal'),
|
||||
locales = require('../locales'),
|
||||
iOS = require('./ios')
|
||||
import screenfull from 'screenfull'
|
||||
import UiModal from './ui-modal.mjs'
|
||||
import locales from '../locales/index.mjs'
|
||||
import iOS from './ios.mjs'
|
||||
|
||||
var fullscreen
|
||||
|
||||
|
|
@ -40,4 +40,4 @@ if (screenfull.isEnabled && !iOS) {
|
|||
|
||||
window.ELECTRON_FULLSCREEN = ()=>{fullscreen.toggle()}
|
||||
|
||||
module.exports = fullscreen
|
||||
export default fullscreen
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
var UiSidePanel = require('./ui-sidepanel'),
|
||||
locales = require('../locales')
|
||||
|
||||
module.exports = {
|
||||
leftUiSidePanel: new UiSidePanel({selector: 'osc-panel-container.left', label: locales('editor_tree')}),
|
||||
rightUiSidePanel: new UiSidePanel({selector: 'osc-panel-container.right', label: locales('editor_inspector')})
|
||||
}
|
||||
5
src/client/ui/index.mjs
Normal file
5
src/client/ui/index.mjs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import UiSidePanel from './ui-sidepanel.mjs'
|
||||
import locales from '../locales/index.mjs'
|
||||
|
||||
export const leftUiSidePanel = new UiSidePanel({selector: 'osc-panel-container.left', label: locales('editor_tree')})
|
||||
export const rightUiSidePanel= new UiSidePanel({selector: 'osc-panel-container.right', label: locales('editor_inspector')})
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue