Difference between revisions of "Code Panel"
| (13 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
== Usage == | == Usage == | ||
| − | There are various actions for opening the code panel. Depending on the | + | There are various actions for opening the code panel. The code is processed according to the specific action. Depending on the configuration, the entered code can have the following lengths. |
| + | |||
| + | * Default: '''1 to 32 digits''' | ||
| + | * Secured (<code>secure</code> property is set to <code>true</code>): '''1 to 16 digits''' | ||
| + | * Specified (<code>digits</code> property is set): '''1 to 8 digits''' | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
| − | |+ Action syntax of code actions | + | |+ Action syntax of code panel actions |
|- | |- | ||
! Syntax !! Example !! Since Version !! class="unsortable" | Description | ! Syntax !! Example !! Since Version !! class="unsortable" | Description | ||
| Line 58: | Line 62: | ||
== Syntax == | == Syntax == | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
| − | |+ Property syntax of code data object | + | |+ Property syntax of code panel data object |
|- | |- | ||
! Property !! Type !! Default Value !! Mandatory !! Since Version !! class="unsortable" | Description | ! Property !! Type !! Default Value !! Mandatory !! Since Version !! class="unsortable" | Description | ||
| Line 80: | Line 84: | ||
|- | |- | ||
| <code>value</code> || <code>string</code> || <code>null</code> || No || data-sort-value=0|0.1.0 || | | <code>value</code> || <code>string</code> || <code>null</code> || No || data-sort-value=0|0.1.0 || | ||
| − | The | + | The initial value of the code panel. The value must consist only of numbers and must not exceed the maximum length, otherwise it is ignored. |
|- | |- | ||
| <code>placeholder</code> || <code>string</code> || <code>"Code"</code> || No || data-sort-value=0|0.1.0 || | | <code>placeholder</code> || <code>string</code> || <code>"Code"</code> || No || data-sort-value=0|0.1.0 || | ||
| Line 93: | Line 97: | ||
|- | |- | ||
| <code>digits</code> || <code>number</code> || <code>-1</code> || No || data-sort-value=167|'''0.1.167''' || | | <code>digits</code> || <code>number</code> || <code>-1</code> || No || data-sort-value=167|'''0.1.167''' || | ||
| − | Specifies | + | Specifies a number of digits that should be entered. The value must be between <code>1</code> and <code>8</code>, otherwise it is ignored. |
When using this property, a <code>description</code> can also be specified. The confirmation button is omitted when using this property, and there is also no placeholder. | When using this property, a <code>description</code> can also be specified. The confirmation button is omitted when using this property, and there is also no placeholder. | ||
The code is processed immediately once all the digits have been entered. | The code is processed immediately once all the digits have been entered. | ||
|- | |- | ||
| <code>clear</code> || <code>boolean</code> || <code>false{{pipe}}true</code> || No || data-sort-value=167|'''0.1.167''' || | | <code>clear</code> || <code>boolean</code> || <code>false{{pipe}}true</code> || No || data-sort-value=167|'''0.1.167''' || | ||
| − | Indicates if the code should be cleared when it has been processed. | + | Indicates if the code should be cleared when it has been processed (or the context has been lost, e.g. the context menu was opened during input). |
By default, the code is retained if the <code>digits</code> property is not used and cleared if the <code>digits</code> property is used. | By default, the code is retained if the <code>digits</code> property is not used and cleared if the <code>digits</code> property is used. | ||
|- | |- | ||
| Line 136: | Line 140: | ||
"action": "execute:code:http://msx.benzac.de/services/echo.php" | "action": "execute:code:http://msx.benzac.de/services/echo.php" | ||
}, { | }, { | ||
| − | "label": "Secret", | + | "label": "Secret + Clear", |
"action": "execute:code:http://msx.benzac.de/services/echo.php", | "action": "execute:code:http://msx.benzac.de/services/echo.php", | ||
"data": { | "data": { | ||
| Line 210: | Line 214: | ||
=== Demo === | === Demo === | ||
| − | * Launch via App: https://msx.benzac.de/?start= | + | * Launch via App: https://msx.benzac.de/?start=content:https://msx.benzac.de/info/xp/data/hidden_feature_20.json |
| − | * Launch via Demo Page: https://msx.benzac.de/info/?start= | + | * Launch via Demo Page: https://msx.benzac.de/info/?start=content:https://msx.benzac.de/info/xp/data/hidden_feature_20.json |
Latest revision as of 14:45, 25 September 2026
It is possible to enter codes (i.e. numbers) with the integrated code panel. These codes can either be processed at the server or plugin level or embedded directly into action strings. This feature is available since version 0.1.0, but was significantly expanded in version 0.1.167.
Usage[edit]
There are various actions for opening the code panel. The code is processed according to the specific action. Depending on the configuration, the entered code can have the following lengths.
- Default: 1 to 32 digits
- Secured (
secureproperty is set totrue): 1 to 16 digits - Specified (
digitsproperty is set): 1 to 8 digits
| Syntax | Example | Since Version | Description |
|---|---|---|---|
enter
|
enter
|
0.1.167 |
The entered code is embedded in the indicated action by replacing the keyword |
enter:{CODE}
|
enter:1234
|
0.1.0 |
If the entered code is correct, the indicated action is executed. The data must contain an |
|
|
|
0.1.30 |
Executes an action on server side, the player, or the interaction plugin with an entered code and returns an action to be executed (e.g. to show a success/error message). Please see Actions#Server Actions for more information. |
interaction:commit:code
|
interaction:commit:code
|
0.1.82 |
Commits a code to the interaction plugin. |
player:commit:code
|
player:commit:code
|
0.1.40 |
Commits a code to the video/audio plugin. |
Syntax[edit]
| Property | Type | Default Value | Mandatory | Since Version | Description |
|---|---|---|---|---|---|
headline |
string |
"Enter Code" |
No | 0.1.0 |
The headline of the code panel. This property supports Inline Expressions. |
extension |
string |
null |
No | 0.1.0 |
The extension of the code panel. This property can be used to display a small label in the upper right corner. This property supports Inline Expressions and Live Inline Expressions. |
description |
string |
null |
No | 0.1.167 |
The description of the code panel. This property supports Inline Expressions. Note: This property is only used if the |
value |
string |
null |
No | 0.1.0 |
The initial value of the code panel. The value must consist only of numbers and must not exceed the maximum length, otherwise it is ignored. |
placeholder |
string |
"Code" |
No | 0.1.0 |
The placeholder value of the code panel. This value is displayed if no code is entered. This property supports Inline Expressions. Note: This property is ignored if the |
secret |
boolean |
false |
No | 0.1.0 |
Indicates if the code is secret and should not be displayed. |
digits |
number |
-1 |
No | 0.1.167 |
Specifies a number of digits that should be entered. The value must be between |
clear |
boolean |
false|true |
No | 0.1.167 |
Indicates if the code should be cleared when it has been processed (or the context has been lost, e.g. the context menu was opened during input).
By default, the code is retained if the |
delay |
number |
-1 |
No | 0.1.167 |
Specifies a delay in milliseconds after which the entered code should be automatically processed. Note: This property is ignored if the |
action |
string |
null |
Only if enter or enter:{CODE} action is used |
0.1.0 |
The code action that is executed if the Please see Actions for possible values. |
data |
object |
null |
No | 0.1.0 |
The additional data of the code action that is used if the action is executed. Please see Actions for possible values. |
Example[edit]
Screenshot[edit]
Code[edit]
{
"type": "list",
"headline": "Code Panel",
"template": {
"enumerate": false,
"icon": "dialpad",
"type": "button",
"layout": "0,0,3,3"
},
"items": [{
"label": "Default",
"action": "execute:code:http://msx.benzac.de/services/echo.php"
}, {
"label": "Secret + Clear",
"action": "execute:code:http://msx.benzac.de/services/echo.php",
"data": {
"headline": "Enter Secret Code",
"placeholder": "Secret Code",
"secret": true,
"clear": true
}
}, {
"label": "Prefilled + Extension",
"action": "execute:code:http://msx.benzac.de/services/echo.php",
"data": {
"value": "1234",
"extension": "Prefilled"
}
}, {
"label": "1 Digit",
"titleFooter": "0.1.167+{br}{br}{br}",
"alignment": "center",
"action": "execute:code:http://msx.benzac.de/services/echo.php",
"data": {
"headline": "Enter 1 Digit",
"digits": 1
}
}, {
"label": "3 Digits + Decription",
"titleFooter": "0.1.167+{br}{br}{br}",
"alignment": "center",
"action": "execute:code:http://msx.benzac.de/services/echo.php",
"data": {
"headline": "Enter 3 Digits",
"description": "Execution takes place automatically as soon as all digits have been entered.",
"digits": 3
}
}, {
"label": "6 Secret Digits",
"titleFooter": "0.1.167+{br}{br}{br}",
"alignment": "center",
"action": "execute:code:http://msx.benzac.de/services/echo.php",
"data": {
"headline": "Enter 6 Secret Digits",
"digits": 6,
"secret": true
}
}, {
"badge": "Enter Action",
"label": "Switch Channel",
"titleFooter": "0.1.167+{br}{br}{br}",
"alignment": "center",
"action": "enter",
"data": {
"headline": "Switch Channel",
"placeholder": "Channel Number",
"extension": "Delay: 3 sec",
"action": "player:goto:number:{CODE}",
"delay": 3000
}
}, {
"badge": "Enter Action",
"label": "Switch Channel",
"titleFooter": "0.1.167+{br}{br}{br}",
"alignment": "center",
"action": "enter",
"data": {
"headline": "Switch Channel",
"description": "Enter the channel number to switch to this channel. Please load a playlist first so that this action can be executed.",
"action": "player:goto:number:{CODE}",
"digits": 4
}
}]
}