Expand all

mw.Upload.Dialog

Controls a BookletLayout.

Usage

To use, set up a window manager like for normal dialogs:

var uploadDialog = new mw.Upload.Dialog();
var windowManager = new OO.ui.WindowManager();
$( document.body ).append( windowManager.$element );
windowManager.addWindows( [ uploadDialog ] );
windowManager.openWindow( uploadDialog );

The dialog's closing promise can be used to get details of the upload.

If you want to use a different OO.ui.BookletLayout, for example the mw.ForeignStructuredUpload.BookletLayout, like in the case of the upload interface in VisualEditor, you can pass it in through the bookletClass config option:

var uploadDialog = new mw.Upload.Dialog( {
    bookletClass: mw.ForeignStructuredUpload.BookletLayout
} );

Extends

Constructor

new mw.Upload.Dialog([config]) #

Create an instance of mw.Upload.Dialog.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
bookletClass function optional
mw.Upload.BookletLayout

Booklet class to be used for the steps

booklet Object optional

Booklet constructor configuration

Source:

Properties

actionsstatic #

Properties:

Name Type Description
actions Array.<Object>
Source:

namestatic #

Properties:

Name Type Description
name string
Source:

titlestatic #

Properties:

Name Type Description
title function | string
Source:

Methods

createUploadBooklet() → {mw.Upload.BookletLayout}protected #

Create an upload booklet.

Source:

Returns:

An upload booklet

Type
mw.Upload.BookletLayout
Create an upload booklet.

onInfoValid(isValid)protected #

Handle infoValid events.

Sets abilities for the dialog accordingly.

Parameters:

Name Type Description
isValid boolean

The panel is complete and valid

Source:
Handle infoValid events.

onUploadBookletSet(page)protected #

Handle panelNameSet events from the upload booklet.

Parameters:

Name Type Description
page OO.ui.PageLayout

Current page

Source:
Handle panelNameSet events from the upload booklet.

onUploadValid(isValid)protected #

Handle uploadValid events.

Sets abilities for the dialog accordingly.

Parameters:

Name Type Description
isValid boolean

The panel is complete and valid

Source:
Handle uploadValid events.