diff --git a/CHANGELOG.md b/CHANGELOG.md index f00ab713..f2caf49c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.18.0 + +- remote control + - `/NOTIFY`: if multiple arguments are provided, interpret the first one as the icon's name for the client notification + + ## 1.17.0 - bug fixes diff --git a/resources/docs/docs/remote-control.md b/resources/docs/docs/remote-control.md index a1799e1f..30ad24ca 100644 --- a/resources/docs/docs/remote-control.md +++ b/resources/docs/docs/remote-control.md @@ -117,10 +117,14 @@ Same as `/GET` but uses the widget's address instead of `/GET` to reply. ---- -#### `/NOTIFY message` +#### `/NOTIFY icon message` Sends a notification message to the client. +- `icon`: icon for the notification, for example : `^play`, `^pause`, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free) +- `message`: message content + + ---- #### `/LOG message` diff --git a/src/client/remote-control.js b/src/client/remote-control.js index ed04c3e4..b87a6d92 100644 --- a/src/client/remote-control.js +++ b/src/client/remote-control.js @@ -247,8 +247,14 @@ var callbacks = { if (!Array.isArray(args)) args = [args] + var icon + if (args.length > 1 && typeof args[0] === 'string' && args[0].indexOf(' ') === -1) { + icon = args.shift() + } + notifications.add({ - message: args.join('\n') || ' ' + message: args.join('\n') || ' ', + icon: icon }) }, diff --git a/src/client/widgets/basics/button.js b/src/client/widgets/basics/button.js index ec61a7a4..1850b343 100644 --- a/src/client/widgets/basics/button.js +++ b/src/client/widgets/basics/button.js @@ -20,7 +20,7 @@ class Button extends Widget { colorTextOn: {type: 'string', value: 'auto', help: 'Defines the widget\'s text color when active.'}, label: {type: 'string|boolean', value: 'auto', help: [ 'Set to `false` to hide completely', - '- 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)', + '- Insert icons using the prefix ^ followed by the icon\'s name : `^play`, `^pause`, etc (see https://fontawesome.com/search?m=free&s=solid', '- Icons can be transformed with the following suffixes: `.flip-[horizontal|vertical|both]`, `.rotate-[90|180|270]`, `.spin`, `.pulse`. Example: `^play.flip-horizontal`', ]}, vertical: {type: 'boolean', value: false, help: 'Set to `true` to display the text vertically'},