Expand all

MultimediaViewer

Analyses the page, looks for image content and sets up the hooks to manage the viewing experience of such content.

Constructor

new MultimediaViewer() #

Source:

Properties

currentIndex :number #

Image index on page.

Type:

  • number
Source:
Image index on page.

documentTitle :string #

base document title, MediaViewer will expand this

Type:

  • string
Source:
base document title, MediaViewer will expand this

router :OO.Router #

Type:

Source:

viewLogger :ViewLogger #

Type:

Source:

Methods

cleanupEventHandlers() #

Unregisters all event handlers. Currently only used in tests.

Source:
Unregisters all event handlers.

close() #

Handles close event coming from the lightbox

Source:
Handles close event coming from the lightbox

createDocumentTitle(imageTitle) → {string} #

Creates a string which can be shown as document title (the text at the top of the browser window).

Parameters:

Name Type Description
imageTitle mw.Title | null

the title object for the image which is displayed; null when the viewer is being closed

Returns:

Type
string
Source:
Creates a string which can be shown as document title (the text at the top of the browser window).

displayPlaceholderThumbnail(image, $initialImage, [recursion]) #

Display the thumbnail from the page

Parameters:

Name Type Attributes Default Description
image LightboxImage
$initialImage jQuery

The thumbnail from the page

recursion boolean optional
false

for internal use, never set this when calling from outside

Source:
Display the thumbnail from the page

fetchImageInfo(image) → {jQuery.Promise.<ImageModel>} #

Loads all the size-independent information needed by the lightbox (image metadata, repo information).

Parameters:

Name Type Description
image LightboxImage

Returns:

Type
jQuery.Promise.<ImageModel>
Source:

Loads all the size-independent information needed by the lightbox (image metadata, repo information).

firstImage() #

Opens the last image

Source:
Opens the last image

initWithThumbs(thumbs) #

Initialize the lightbox interface given an array of thumbnail objects.

Parameters:

Name Type Description
thumbs Array.<LightboxImage>
Source:

Initialize the lightbox interface given an array of thumbnail objects.

lastImage() #

Opens the last image

Source:
Opens the last image

loadExtensionPlugins(extension) → {jQuery.Promise} #

Loads the RL module defined for a given file extension, if any

Parameters:

Name Type Description
extension string

File extension

Returns:

Type
jQuery.Promise
Source:
Loads the RL module defined for a given file extension, if any

loadImage(image) #

Loads a specified image.

Parameters:

Name Type Description
image LightboxImage
Source:
Loads a specified image.

loadImageByTitle(title, [position]) #

Loads an image by its title

Parameters:

Name Type Attributes Description
title mw.Title
position number optional
Source:
Loads an image by its title

loadIndex(index) #

Loads an image at a specified index in the viewer's thumbnail array.

Parameters:

Name Type Description
index number
Source:
Loads an image at a specified index in the viewer's thumbnail array.

nextImage() #

Opens the next image

Source:
Opens the next image

preloadImagesMetadata() #

Preload metadata for current and next image.

Source:
Preload metadata for current and next image.

prevImage() #

Opens the previous image

Source:
Opens the previous image

resize() #

Handles resize events in viewer.

Source:
Handles resize events in viewer.

setTitle() #

Updates the page title to reflect the current title.

Source:
Updates the page title to reflect the current title.

setupEventHandlers() #

Registers all event handlers

Source:
Registers all event handlers

Events

mmv-close() #

Fired when the viewer is closed. This is used by the lightbox to notify the main app.

Source:
Fired when the viewer is closed.

mmv-next() #

Fired when the user requests the next image.

Source:
Fired when the user requests the next image.

mmv-prev() #

Fired when the user requests the previous image.

Source:
Fired when the user requests the previous image.

mmv-resize-end() #

Fired when the screen size changes. Debounced to avoid continuous triggering while resizing with a mouse.

Source:
Fired when the screen size changes.

mmv-resize-end() #

Fired when the screen size changes. Debounced to avoid continuous triggering while resizing with a mouse.

Source:
Fired when the screen size changes.