Expand all

ve.ui.MWGalleryDialog

Extends

Constructor

new ve.ui.MWGalleryDialog([config]) #

Dialog for editing MediaWiki galleries.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Source:
Dialog for editing MediaWiki galleries.

Methods

addNewImage(title) #

Request a new image and highlight it

Parameters:

Name Type Description
title string

Normalized title of the new image

Source:
Request a new image and highlight it

createCaptionDocument(captionNode) → {ve.dm.Document}private #

Get a new caption document for the gallery caption or an image caption.

Parameters:

Name Type Description
captionNode ve.dm.MWGalleryCaptionNode | ve.dm.MWGalleryImageCaptionNode | null
Source:

Returns:

Type
ve.dm.Document
Get a new caption document for the gallery caption or an image caption.

getTeardownProcess() #

insertOrUpdateNode() #

Insert or update the node in the document model from the new values

Source:
Insert or update the node in the document model from the new values

isHighlightedItemModified() → {boolean} #

Check if currently highlighted item's attributes or contents would be modified if changes were applied.

Source:

Returns:

Type
boolean

Check if currently highlighted item's attributes or contents would be modified if changes were applied.

isSaveable() → {boolean} #

Check if gallery attributes or contents would be modified if changes were applied.

Source:

Returns:

Type
boolean
Check if gallery attributes or contents would be modified if changes were applied.

onAltTextSameAsCaptionChange() #

Handle change event for this.altTextSameAsCaption

Source:
Handle change event for this.altTextSameAsCaption

onHighlightItem([item]) #

Handle clicking on an image in the menu

Parameters:

Name Type Attributes Description
item ve.ui.MWGalleryItemWidget optional

The item that was clicked on

Source:
Handle clicking on an image in the menu

onHighlightedCaptionTargetChange() #

Handle change event for this.highlightedCaptionTarget

Source:
Handle change event for this.highlightedCaptionTarget

onModeDropdownChange() #

Handle change event for this.modeDropdown

Source:
Handle change event for this.modeDropdown

onRemoveItem() #

Handle click event for the remove button

Source:
Handle click event for the remove button

onRequestImagesSuccess(response) #

Create items for the returned images and add them to the gallery group

Parameters:

Name Type Description
response Object

jQuery response object

Source:
Create items for the returned images and add them to the gallery group

onSearchResultsChoose(item) #

Handle search results choose event.

Parameters:

Name Type Description
item mw.widgets.MediaResultWidget

Chosen item

Source:
Handle search results choose event.

onShowSearchPanelButtonClick() #

Handle click event for showSearchPanelButton

Source:
Handle click event for showSearchPanelButton

requestImages(options) → {jQuery.Promise} #

Request the images for the images tab panel menu

Parameters:

Name Type Description
options Object

Options for the request

Source:

Returns:

Promise which resolves when image data has been fetched

Type
jQuery.Promise
Request the images for the images tab panel menu

toggleEmptyGalleryMessage(empty) #

Toggle the empty gallery message

Parameters:

Name Type Description
empty boolean

The gallery is empty

Source:
Toggle the empty gallery message

toggleSearchPanel([visible]) #

Toggle the search panel (and the edit panel, the opposite way)

Parameters:

Name Type Attributes Description
visible boolean optional

The search panel is visible

Source:
Toggle the search panel (and the edit panel, the opposite way)

updateActions() #

Disable the "Done" button if the gallery is empty, otherwise enable it

TODO Disable the button until the user makes any changes

Source:

Disable the "Done" button if the gallery is empty, otherwise enable it

TODO Disable the button until the user makes any changes

updateDialogSize() #

Resize the dialog according to which panel is focused

Source:
Resize the dialog according to which panel is focused

updateHighlightedItem() #

Update the image currently being edited (ve.ui.MWGalleryItemWidget) with the values from inputs in this dialog (currently only the image caption).

Source:

Update the image currently being edited (ve.ui.MWGalleryItemWidget) with the values from inputs in this dialog (currently only the image caption).

updateMwData(mwData)private #

Update the 'mw' attribute with data from inputs in the dialog.

Parameters:

Name Type Description
mwData Object

Value of the 'mw' attribute, updated in-place

Source:
Update the 'mw' attribute with data from inputs in the dialog.

getImportRules() → {Object}static #

Get the import rules for the surface widget in the dialog

Source:
See:

Returns:

Import rules

Type
Object
Get the import rules for the surface widget in the dialog