Home Reference Source
public class | source

TIOExec

Extends:

js/controllers/controllers/ViewController.js~ViewController → TIOExec

Adds a TIO-execute button for a client-side class. This relies on structure:

.exec-target[data-lang=LANG_ID]
    code: CODE
    #trigger

Constructor Summary

Public Constructor
public

constructor(tio: TIO, target: HTMLElement, trigger: Template, context: HTMLElement)

Adds a TIO exec to an element.

Method Summary

Public Methods
public

run()

Runs the code

public

Handle completion

Public Constructors

public constructor(tio: TIO, target: HTMLElement, trigger: Template, context: HTMLElement) source

Adds a TIO exec to an element.

Params:

NameTypeAttributeDescription
tio TIO

The TIO instance.

target HTMLElement

Element to append TIO execution from.

trigger Template

Element to trigger run

context HTMLElement
  • optional
  • default: target

Context to append execution results in.

Public Methods

public run() source

Runs the code

public setState(state: TIOResult) source

Handle completion

Params:

NameTypeAttributeDescription
state TIOResult

Result of the TIO request.