Extends
Constructor
new mw.ForeignStructuredUpload.BookletLayout(config)
#
Properties
infoForm :OO.ui.FormLayout
#
The form rendered in the second step to get metadata.
Rendered in renderInfoForm
.
Type:
- Inherited from:
- Source:
insertForm :OO.ui.FormLayout
#
The form rendered in the third step to show usage.
Rendered in renderInsertForm
.
Type:
- Inherited from:
- Source:
uploadForm :OO.ui.FormLayout
#
The form rendered in the first step to get the file object.
Rendered in renderUploadForm
.
Type:
- Inherited from:
- Source:
Methods
clear()protected
#
Clear the values of all fields.
- Overrides:
- Source:
createUpload() → {mw.Upload}protected
#
Returns a mw.ForeignStructuredUpload
with the target
specified in config.
- Overrides:
- Source:
Returns:
- Type
- mw.Upload
Returns a mw.ForeignStructuredUpload
with the target
specified in config.
getDateFromExif(file) → {jQuery.Promise}
#
Get original date from EXIF data.
Parameters:
Name | Type | Description |
---|---|---|
file |
File |
Returns:
Promise resolved with the EXIF date
- Type
- jQuery.Promise
getDateFromLastModified(file) → {string|undefined
}
#
undefined
}
#
getErrorMessageForStateDetails() → {jQuery.Promise|undefined
}protected
#
undefined
}protected
#
Get an error message (as OO.ui.Error object) that should be displayed to the user for current state and state details.
- Inherited from:
- Source:
Returns:
A Promise that will be resolved with an OO.ui.Error.
- Type
-
jQuery.Promise
|
undefined
Get an error message (as OO.ui.Error object) that should be displayed to the user for current state and state details.
getFile() → {File|null
}protected
#
null
}protected
#
Gets the file object from the
upload form
.
getFileWidget() → {OO.ui.SelectFileInputWidget|mw.widgets.StashedFileWidget}
#
Gets the widget for displaying or inputting the file to upload.
- Inherited from:
- Source:
Returns:
getFilename() → {string}protected
#
Gets the file name from the
information form
.
getText() → {string}protected
#
Gets the page text from the
information form
.
initialize() → {jQuery.Promise}
#
Initialize for a new upload.
- Overrides:
- Source:
Returns:
Promise resolved when everything is initialized
- Type
- jQuery.Promise
onInfoFormChange()protected
#
Handle change events to the info form.
- Overrides:
- Source:
Fires:
onUploadFormChange()protected
#
Handle change events to the upload form.
- Overrides:
- Source:
Fires:
renderInfoForm() → {OO.ui.FormLayout}protected
#
Renders and returns the information form for collecting
metadata and sets the infoForm
property.
- Overrides:
- Source:
Returns:
- Type
- OO.ui.FormLayout
Renders and returns the information form for collecting
metadata and sets the infoForm
property.
renderInsertForm() → {OO.ui.FormLayout}protected
#
Renders and returns the insert form to show file usage and
sets the insertForm
property.
- Inherited from:
- Source:
Returns:
- Type
- OO.ui.FormLayout
Renders and returns the insert form to show file usage and
sets the insertForm
property.
renderUploadForm() → {OO.ui.FormLayout}protected
#
Renders and returns the upload form and sets the
uploadForm
property.
- Overrides:
- Source:
Returns:
- Type
- OO.ui.FormLayout
Renders and returns the upload form and sets the
uploadForm
property.
saveFile() → {jQuery.Promise}protected
#
Saves the stash finalizes upload. Uses
getFilename
, and
getText
to get details from
the form.
- Overrides:
- Source:
Returns:
Rejects the promise with an
error
, or resolves if the upload was successful.
- Type
- jQuery.Promise
Fires:
setFile(file)protected
#
Sets the file object.
Parameters:
Name | Type | Description |
---|---|---|
file |
File
|
null
|
File to select |
- Inherited from:
- Source:
setFilekey(filekey)protected
#
Sets the filekey of a file already stashed on the server as the target of this upload operation.
Parameters:
Name | Type | Description |
---|---|---|
filekey |
string |
- Inherited from:
- Source:
Sets the filekey of a file already stashed on the server as the target of this upload operation.
setFilename(filename)protected
#
Prefills the information form
with the given filename.
Parameters:
Name | Type | Description |
---|---|---|
filename |
string |
- Inherited from:
- Source:
information form
with the given filename.
updateFilePreview()protected
#
Updates the file preview on the info form when a file is added.
- Inherited from:
- Source:
uploadFile() → {jQuery.Promise}protected
#
Uploads the file that was added in the upload form. Uses
getFile
to get the HTML5
file object.
- Inherited from:
- Source:
Returns:
- Type
- jQuery.Promise
Fires:
validateFilename(filename) → {jQuery.Promise}
#
Parameters:
Name | Type | Description |
---|---|---|
filename |
mw.Title |
Returns:
Resolves (on success) or rejects with OO.ui.Error
- Type
- jQuery.Promise