Constructor
new MultimediaViewerBootstrap()
#
- Source:
Properties
eventHandlersHaveBeenSetUp
#
Properties:
| Name | Type | Description |
|---|---|---|
eventHandlersHaveBeenSetUp |
boolean | tracks domready event handler state |
- Source:
thumbs
#
viewerIsBroken
#
This flag is set to true when we were unable to load the viewer.
Properties:
| Type | Description |
|---|---|
| boolean |
- Source:
Methods
cleanupEventHandlers()
#
Cleans up event handlers, used for tests
- Source:
cleanupOverlay()
#
Cleans up the overlay
- Source:
click(e, image) → {boolean}
#
Handles a click event on a link
Parameters:
| Name | Type | Description |
|---|---|---|
e |
jQuery.Event | jQuery event object |
image |
LightboxImage | Image |
Returns:
a value suitable for an event handler (ie. true if the click should be handled by the browser).
- Type
- boolean
- Source:
ensureEventHandlersAreSetUp()
#
Makes sure event handlers are set up properly via MultimediaViewerBootstrap.setupEventHandlers(). Called before loading the main mmv module. At this point, event handlers for MultimediaViewerBootstrap should have been set up, but due to bug 70756 it cannot be guaranteed.
- Source:
findCaption($thumbContainer, $link) → {string|undefined}
#
undefined}
#
hash()
#
Handles the browser location hash on pageload or hash change
- Source:
isAllowedThumb($thumb) → {boolean}
#
Check if this thumbnail should be handled by MediaViewer
Parameters:
| Name | Type | Description |
|---|---|---|
$thumb |
jQuery | the thumbnail (an |
Returns:
- Type
- boolean
- Source:
isValidExtension(title) → {boolean}
#
loadViewer() → {jQuery.Promise}
#
Loads the mmv module asynchronously and passes the thumb data to it
Returns:
- Type
- jQuery.Promise
- Source:
openImage(image)
#
Opens MediaViewer and loads the given thumbnail. Requires processThumb() to be called first.
Parameters:
| Name | Type | Description |
|---|---|---|
image |
LightboxImage | Image |
- Source:
preloadAssets($thumbContainer)
#
Preload JS/CSS when the mouse cursor hovers the thumb container (thumb image + caption + border)
Parameters:
| Name | Type | Description |
|---|---|---|
$thumbContainer |
jQuery |
- Source:
Preload JS/CSS when the mouse cursor hovers the thumb container (thumb image + caption + border)
processFilePageThumb($thumb, title)
#
Processes the main thumbnail of a file page by adding some buttons below to open MediaViewer.
Parameters:
- Source:
Processes the main thumbnail of a file page by adding some buttons below to open MediaViewer.
processParsoidThumb(thumb)
#
Processes a Parsoid thumb, making use of the specified structure, https://www.mediawiki.org/wiki/Specs/HTML#Media
Parameters:
| Name | Type | Description |
|---|---|---|
thumb |
Object |
- Source:
Processes a Parsoid thumb, making use of the specified structure, https://www.mediawiki.org/wiki/Specs/HTML#Media
processThumbs($content)
#
Processes all thumbs found on the page
Parameters:
| Name | Type | Description |
|---|---|---|
$content |
jQuery | Element to search for thumbs |
- Source:
route(fileName)
#
Routes to a given file.
Parameters:
| Name | Type | Description |
|---|---|---|
fileName |
string |
- Source:
setupEventHandlers()
#
Listens to events on the window/document
- Source:
setupOverlay()
#
Sets up the overlay while the viewer loads
- Source:
setupRouter(router)
#
showStatusInfo()
#
Shows a popup notifying the user
- Source: