Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Hooks JS

This file describes JavaScript hooks defined by the Wikibase extensions.

wikibase.entityPage.entityView.rendered

  • Called after the Wikibase UI is initialized.

View source

wikibase.entityPage.entityLoaded

  • Called as soon as the JSON representing the entity stored on the current entity page is loaded.
  • Listener callbacks should expect the entity as a native JavaScript object (the parsed JSON serialization) passed as the first argument.

View source

wikibase.statement.saved

View source

wikibase.statement.removed

  • Called after a statement has been removed. Entity ID and statement ID are passed as arguments.

View source

wikibase.entityselector.search

  • Called when entity selector fetches suggestions.
  • An object containing the following elements is passed as first argument :element, term and options. As second argument a function is passed allowing to add promises that return additional suggestion items. Those items will replace existing items with the same ID and will be placed on top of the list. If an item has a property rating then this property will be used for sorting the list by it descending (higher rating on top). The range of the rating should be between 0-1.

View source

wikibase.statement.startEditing

  • Called when entering the edit mode for an existing statement. Gets the statement's guid passed as parameter.

View source

wikibase.statement.stopEditing

  • Called when leaving the edit mode for an existing statement. Gets the statement's guid passed as parameter.

View source