Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\Utilities\JsSelectToInput Class Reference

Code for JavaScript enhanced <option> selectors. More...

Public Member Functions

 __construct (XmlSelect $select)
 
 getSourceId ()
 
 setTargetId (string $id)
 
 getTargetId ()
 
 setMessage (string $message)
 Set the message key.
 
 getMessage ()
 
 getHtmlAndPrepareJS ()
 Returns the whole input element and injects needed JavaScript.
 

Static Public Member Functions

static injectJs ()
 Inject needed JavaScript in the page.
 

Protected Member Functions

 getButton (string $msg, string $source, string $target)
 Constructs the append button.
 

Protected Attributes

 $targetId
 Id of the text field where stuff is appended.
 
 $sourceId
 Id of the <option> field.
 
 $select
 
 $buttonId
 Id on the button.
 
 $msg = 'translate-jssti-add'
 

Detailed Description

Code for JavaScript enhanced <option> selectors.

Author
Niklas Laxström @license GPL-2.0-or-later

Definition at line 16 of file JsSelectToInput.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::__construct ( XmlSelect $select)

Definition at line 28 of file JsSelectToInput.php.

Member Function Documentation

◆ getButton()

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::getButton ( string $msg,
string $source,
string $target )
protected

Constructs the append button.

Parameters
string$msgMessage key.
string$sourceHtml id.
string$targetHtml id.
Returns
string

Definition at line 79 of file JsSelectToInput.php.

◆ getHtmlAndPrepareJS()

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::getHtmlAndPrepareJS ( )

Returns the whole input element and injects needed JavaScript.

Returns
string Html code.

Definition at line 58 of file JsSelectToInput.php.

◆ getMessage()

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::getMessage ( )
Returns
string a message key.

Definition at line 50 of file JsSelectToInput.php.

◆ getSourceId()

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::getSourceId ( )

Definition at line 32 of file JsSelectToInput.php.

◆ getTargetId()

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::getTargetId ( )

Definition at line 40 of file JsSelectToInput.php.

◆ injectJs()

static MediaWiki\Extension\Translate\Utilities\JsSelectToInput::injectJs ( )
static

Inject needed JavaScript in the page.

Definition at line 92 of file JsSelectToInput.php.

◆ setMessage()

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::setMessage ( string $message)

Set the message key.

Definition at line 45 of file JsSelectToInput.php.

◆ setTargetId()

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::setTargetId ( string $id)

Definition at line 36 of file JsSelectToInput.php.

Member Data Documentation

◆ $buttonId

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::$buttonId
protected

Id on the button.

Definition at line 24 of file JsSelectToInput.php.

◆ $msg

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::$msg = 'translate-jssti-add'
protected

Definition at line 26 of file JsSelectToInput.php.

◆ $select

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::$select
protected

Definition at line 22 of file JsSelectToInput.php.

◆ $sourceId

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::$sourceId
protected

Id of the <option> field.

Definition at line 20 of file JsSelectToInput.php.

◆ $targetId

MediaWiki\Extension\Translate\Utilities\JsSelectToInput::$targetId
protected

Id of the text field where stuff is appended.

Definition at line 18 of file JsSelectToInput.php.


The documentation for this class was generated from the following file: