Difference between revisions of "Code Panel"

From MSX - Wiki
Jump to navigation Jump to search
(Created page with "It is possible to enter codes (i.e. numbers) with the integrated code panel. These codes can either be processed at the service or plugin level or embedded directly into actio...")
 
Line 27: Line 27:
 
| <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 ||  
 
The placeholder value of the code panel. This value is displayed if no code is entered.
 
The placeholder value of the code panel. This value is displayed if no code is entered.
 +
This property is ignored if the <code>digits</code> property is set.
  
 
This property supports [[Inline Expressions]].
 
This property supports [[Inline Expressions]].

Revision as of 12:05, 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 service 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.

Syntax[edit]

Property syntax of code data object
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 is only used if the digits property is set.

This property supports Inline Expressions.

value string null No 0.1.0

The prefilled 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 is ignored if the digits property is set.

This property supports Inline Expressions.

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 if a specific number of digits that should be entered. The value must be between 1 and 8, otherwise, it is ignored. When using this property, a description 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.

clear boolean false|true No 0.1.167

Indicates if the code should be cleared when it has been processed. By default, the code is retained if the digits property is not used and cleared if the digits property is used.

delay number -1 No 0.1.167

Specifies a delay in milliseconds after which the entered code should be automatically processed. If the digits property is used, this property is ignored.

action string null No 0.1.0

The code action that is executed if the enter or enter:{CODE} action is used.

data object null No 0.1.0

The additional data of the code action that is used if the action is executed.

Example[edit]

Screenshot[edit]

Example Screenshot (Code Panel)

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",
            "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
            }
        }]
}

Demo[edit]