add icons support to ui:show_buttons
This commit is contained in:
@@ -47,6 +47,8 @@ First line<br/> Second line
|
||||
<span style="background-color: #00FF00">Text on green background</span>
|
||||
```
|
||||
|
||||
The `ui:show_buttons()` function supports Fontawesome icons. Simply specify `fa:icon_name` as the button name, for example: `fa:play`.
|
||||
|
||||
# Dialogs
|
||||
|
||||
* `ui:show_dialog(title, text, [button1_text], [button2_text])` - show dialog, the first argument is the title, the second is the text, button1\_text is the name of the first button, button2\_text is the name of the second button;
|
||||
|
||||
@@ -47,6 +47,8 @@ First line<br/>Second line
|
||||
<span style="background-color: #00FF00">Text on green background</span>
|
||||
```
|
||||
|
||||
Функция `ui:show_buttons()` поддерживает иконки Fontawesome. Просто укажите в качестве имени кнопки `fa:имя_иконки`, например: `fa:play`.
|
||||
|
||||
# Диалоги
|
||||
|
||||
* `ui:show_dialog(title, text, [button1_text], [button2_text])` - показать диалог; первый аргумент - заголовок, второй - текст, button1\_text - имя первой кнопки, button2\_text - имя второй кнопки;
|
||||
|
||||
@@ -14,13 +14,14 @@ local media_type = "application/json"
|
||||
|
||||
local get_players_cmd = [[ { "id": 1, "jsonrpc": "2.0", "method": "Player.GetActivePlayers" } ]]
|
||||
local play_cmd = [[ {"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": XXX }, "id": 1} ]]
|
||||
local stop_cmd = [[ {"jsonrpc": "2.0", "method": "Player.Stop", "params": { "playerid": XXX }, "id": 1} ]]
|
||||
local prev_cmd = [[ {"jsonrpc": "2.0", "method": "Player.GoTo", "params": {"playerid": XXX,"to":"previous"}, "id":1} ]]
|
||||
local next_cmd = [[ {"jsonrpc": "2.0", "method": "Player.GoTo", "params": {"playerid": XXX,"to":"next"}, "id":1} ]]
|
||||
local forward_cmd = [[ {"jsonrpc": "2.0", "method": "Player.Seek", "params": { "playerid": XXX, "value": { "seconds": 300 } }, "id": 1} ]]
|
||||
local backward_cmd = [[ {"jsonrpc": "2.0", "method": "Player.Seek", "params": { "playerid": XXX, "value": { "seconds": -300 } }, "id": 1} ]]
|
||||
|
||||
local buttons = { "ᐊᐊ", "-5m", "ᐅ", "+5m", "ᐅᐅ", "Open Kore" }
|
||||
local buttons_cmds = { prev_cmd, backward_cmd, play_cmd, forward_cmd, next_cmd }
|
||||
local buttons = { "fa:fast-backward", "-5m", "fa:play", "fa:stop", "+5m", "fa:fast-forward", "Open Kore" }
|
||||
local buttons_cmds = { prev_cmd, backward_cmd, play_cmd, stop_cmd, forward_cmd, next_cmd }
|
||||
|
||||
-- global vars
|
||||
|
||||
|
||||
Reference in New Issue
Block a user