Expand all

mw.widgets.StashedFileWidget

Accepts a stashed file and displays the information for purposes of publishing the file at the behest of the user.

Note that this widget will not finish an upload for you. Use mw.Upload and mw.Upload#setFilekey, then mw.Upload#finishStashUpload to accomplish that.

Example

const widget = new mw.widgets.StashedFileWidget( {
  filekey: '12r9e4rugeec.ddtmmp.1.jpg',
} );

widget.getValue(); // '12r9e4rugeec.ddtmmp.1.jpg'
widget.setValue( '12r9epfbnskk.knfiy7.1.jpg' );
widget.getValue(); // '12r9epfbnskk.knfiy7.1.jpg'

Extends

Constructor

new mw.widgets.StashedFileWidget(config) #

Parameters:

Name Type Description
config Object

Configuration options

Properties:
Name Type Attributes Description
filekey string optional

The filekey of the stashed file.

api Object optional

API to use for thumbnails.

Source:

Methods

getValue() → {string|null} #

Get the current filekey.

Source:

Returns:

Type
string | null
Get the current filekey.

setValue(filekey) #

Set the filekey.

Parameters:

Name Type Description
filekey string | null
Source:
Set the filekey.