Fandom Developers Wiki
Advertisement

This is a library tool. Provides a function to quickly add buttons to the .page-side-tools area.

Installation

Usage

addSideTool(icon: string | Element | JQuery<Element>, tooltip?: string | Element | JQuery<Element>): {
  $button: JQuery<HTMLButtonElement>
  $tooltip: JQuery<HTMLDivElement>
}

Example

mw.hook('dev.addSideTool').add(function (addSideTool) {
  const sideTool = addSideTool('A'),
    $button = sideTool.$button,
    $tooltip = sideTool.$tooltip;

  $tooltip.text('Click me!');
  $button.on('click', function() {
    alert('hello, world');
  });
});
Text above can be found here (edit)
Advertisement