From f38bcb9ea05f9de684852ede94a56f4c7726928b Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 5 Aug 2025 15:31:12 +0200 Subject: [PATCH] client: add title client option --- CHANGELOG.md | 5 +++++ package.json | 2 +- resources/docs/docs/client-options.md | 1 + src/client/globals.js | 2 +- src/client/ipc/callbacks.js | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de8395e9..6872f2e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.29.8 + +- client + - add `title` client option + ## 1.29.7 - launcher diff --git a/package.json b/package.json index 7e352089..53e3d61f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.7", + "version": "1.29.8", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/resources/docs/docs/client-options.md b/resources/docs/docs/client-options.md index 41b046ae..d653890f 100644 --- a/resources/docs/docs/client-options.md +++ b/resources/docs/docs/client-options.md @@ -18,6 +18,7 @@ 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 | Example: diff --git a/src/client/globals.js b/src/client/globals.js index 4503ceee..c5213fc4 100644 --- a/src/client/globals.js +++ b/src/client/globals.js @@ -43,4 +43,4 @@ window.JSON.parseFlex = require('json5').parse window.DOM = require('./dom') -window.TITLE = PACKAGE.productName + ' v' + PACKAGE.version +window.TITLE = ENV.title || (PACKAGE.productName + ' v' + PACKAGE.version) diff --git a/src/client/ipc/callbacks.js b/src/client/ipc/callbacks.js index b6dff81f..e8134030 100644 --- a/src/client/ipc/callbacks.js +++ b/src/client/ipc/callbacks.js @@ -155,6 +155,8 @@ module.exports = { setTitle: function(data) { + if (ENV.title) return + document.title = TITLE + (data ? ' (' + data + ')' : '') },