ForeignStructuredUploadBookletLayout

ForeignStructuredUploadBookletLayout

Class extending mw.ForeignStructuredUpload.BookletLayout and adding more details to the process of uploading a file using the ForeignStructuredUpload model. See UploadDialog for the dialog itself.

Constructor

new ForeignStructuredUploadBookletLayout(…args)

Source:

Create a booklet layout for foreign structured upload.

Parameters:
Name Type Attributes Description
args any <repeatable>

Extends

Methods

(protected, static) generateHistoryText(hostname, pageName) → {string}

Source:

Generate the end part of text for the author input, linking page history.

Parameters:
Name Type Description
hostname string
pageName string
Returns:
Type
string

(static) getTemplateForHostname(hostname) → {string}

Source:

Get the template markup for the hostname of a screenshot.

Parameters:
Name Type Description
hostname string
Returns:
Type
string

(protected) areAddedInputsDisabled() → {boolean}

Source:

Find out whether the inputs we added to the information form should be disabled.

Returns:
Type
boolean

(protected) cancelUpload()

Source:

Cancel the upload. (This method is not in the parent class - it's our own.)

(protected) clear()

Source:
See:

Clear the values of the information form fields. Unlike the original dialog, we don't clear the upload form, including the file input, when the user presses "Back". We don't clear the date too. In the original dialog, there is not much to select on the first page apart from the file, so clearing the file input would make sense there.

(protected) createUpload() → {ForeignStructuredUpload}

Source:

Returns a mw.ForeignStructuredUpload with the target specified in config.

Returns:
Type
ForeignStructuredUpload

(protected) getDateFromLastModified(fileopt) → {string|undefined}

Source:
See:

Native method that gets last modified date from file.

We make the last modified date to use UTC to make it precise and avoid leaking the user's timezone. This is for screenshots and files on the computer; we keep the original behavior for EXIF.

See also getExactDateFromLastModified.

Parameters:
Name Type Attributes Description
file File <optional>
Returns:

Last modified date from file

Type
string | undefined

(protected) getExactDateFromLastModified(file) → {string|undefined}

Source:

Get the last modified date from file in UTC, including hours, minutes, and seconds.

See also getDateFromLastModified.

Parameters:
Name Type Description
file File
Returns:

Last modified date from file

Type
string | undefined

(protected) getText() → {string}

Source:
See:

Native method that gets the page text from the information form.

Returns:
Type
string

(protected) isInfoFormOmitted() → {boolean}

Source:

Find out whether the information form should be omitted given the current state of controls.

Returns:
Type
boolean

(protected) modifyInfoForm()

Source:

Add content and logic to the information form.

(protected) modifyUploadForm()

Source:

Add content and logic to the upload form.

(async, protected) onInfoFormChange()

Source:
See:

Handle change events to the information form.

(protected) onPresetChange(itemOrSelected)

Source:

Handle events changing the preset.

Parameters:
Name Type Description
itemOrSelected module:utilsOoui~RadioOptionWidget | boolean

(async, protected) onUploadFormChange()

Source:
See:

Handle change events to the upload form.

(protected) saveFile() → {external:jQueryPromise}

Source:
See:

Native method that saves the stash finalizes upload. Uses getFilename, and getText to get details from the form.

Returns:
Type
external:jQueryPromise

setup(file, enProjectName)

Source:

Setup the booklet with some data. (This method is not in the parent class - it's our own.)

Parameters:
Name Type Description
file File
enProjectName string

(protected) uploadFile() → {external:jQueryPromise}

Source:
See:

Native methods that uploads the file that was added in the upload form. Uses getFile to get the HTML5 file object.

We add logic that changes the information form according to the user input in the upload form.

Returns:
Type
external:jQueryPromise