Extends
Methods
attachImageModel()
#
Attach the image model to the dialog
buildMediaInfoPanel(imageinfo)
#
Build the image info panel from the information in the API. Use the metadata info if it exists. Note: Some information in the metadata object needs to be safely stripped from its html wrappers.
Parameters:
Name | Type | Description |
---|---|---|
imageinfo |
Object | Image info |
checkChanged()
#
When changes occur, enable the apply button.
chooseImageInfo(info)
#
cleanAPIresponse(html) → {string}
#
Clean the API responses and return it in plaintext. If needed, truncate.
Parameters:
Name | Type | Description |
---|---|---|
html |
string | Raw response from the API |
Returns:
Plaintext clean response
- Type
- string
confirmSelectedImage(item)
#
Handle new image being chosen.
Parameters:
Name | Type | Description |
---|---|---|
item |
mw.widgets.MediaResultWidget
|
null
|
Selected item |
fetchThumbnail(imageName, dimensions) → {jQuery.Promise}
#
Fetch a bigger image thumbnail from the API.
Parameters:
Name | Type | Description |
---|---|---|
imageName |
string | Image source |
dimensions |
Object | Image dimensions |
Returns:
Thumbnail promise that resolves with new thumb url
- Type
- jQuery.Promise
getActionProcess()
#
getBodyHeight()
#
getFileType(url) → {string}
#
Get the file type from the suffix of the url
Parameters:
Name | Type | Description |
---|---|---|
url |
string | Full file url |
Returns:
File type
- Type
- string
getLicenseIcon(license) → {string}
#
Get the proper icon for the license if it is recognized or general info icon if it is not recognized.
Parameters:
Name | Type | Description |
---|---|---|
license |
string | License short name |
Returns:
Icon name
- Type
- string
Get the proper icon for the license if it is recognized or general info icon if it is not recognized.
getReadyProcess()
#
getSetupProcess()
#
getTeardownProcess()
#
initialize()
#
onAlternateTextChange(text)
#
Respond to change in alternate text
Parameters:
Name | Type | Description |
---|---|---|
text |
string | New alternate text |
onBorderCheckboxChange(isSelected)
#
Handle change event on the positionCheckbox element.
Parameters:
Name | Type | Description |
---|---|---|
isSelected |
boolean | Checkbox status |
onChangeSizeType(sizeType)
#
Handle changeSizeType events from the MediaSizeWidget
Parameters:
Name | Type | Description |
---|---|---|
sizeType |
string | Size type |
onImageModelAlignmentChange(alignment)
#
Handle image model alignment change
Parameters:
Name | Type | Description |
---|---|---|
alignment |
string | Image alignment |
onImageModelTypeChange(type)
#
Handle image model type change
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Image type |
onInfoValid(isValid)
#
Handle infoValid events
Parameters:
Name | Type | Description |
---|---|---|
isValid |
boolean | The panel is complete and valid |
onMediaUploadBookletSet(page)
#
Handle panelNameSet events from the upload stack
Parameters:
Name | Type | Description |
---|---|---|
page |
OO.ui.PageLayout | Current page |
onPositionCheckboxChange(isSelected)
#
Handle change event on the positionCheckbox element.
Parameters:
Name | Type | Description |
---|---|---|
isSelected |
boolean | Checkbox status |
onPositionSelectChoose(item)
#
Handle change event on the positionSelect element.
Parameters:
Name | Type | Description |
---|---|---|
item |
OO.ui.ButtonOptionWidget | Selected item |
onSearchQueryChange(query)
#
Handle query change events from the search input widget
Parameters:
Name | Type | Description |
---|---|---|
query |
string |
onSearchQueryClear()
#
Handle clearing of search query by user clicking on indicator
onSearchResultsChoose(item)
#
Handle search results choose event.
Parameters:
Name | Type | Description |
---|---|---|
item |
mw.widgets.MediaResultWidget | Chosen item |
onSearchTabsSet(tabPanel)
#
Handle set events from the search tabs
Parameters:
Name | Type | Description |
---|---|---|
tabPanel |
OO.ui.TabPanelLayout | Current tabPanel |
onTypeSelectChoose(item)
#
Handle change event on the typeSelect element.
Parameters:
Name | Type | Description |
---|---|---|
item |
OO.ui.MenuOptionWidget | Selected item |
onUploadValid(isValid)
#
Handle uploadValid events
Parameters:
Name | Type | Description |
---|---|---|
isValid |
boolean | The panel is complete and valid |
resetCaption()
#
Reset the caption surface
switchPanels(panel, [noFocus])
#
Switch between the edit and insert/search panels
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
panel |
string | Panel name |
||
noFocus |
boolean |
optional |
false | Do not put focus into the default field of the panel |
updateFilenameFieldset()
#
Update the filename fieldset (link to media page)
uploadPageNameSet(pageName)
#
The upload booklet's page name has changed
Parameters:
Name | Type | Description |
---|---|---|
pageName |
string | Page name |