Difference between revisions of "MediaWiki:Gadgets-definition"

From WikiAnesthesia
Tag: 2017 source edit
Tag: 2017 source edit
Line 9: Line 9:
Gadgets are loaded using the '''<calculator id="''X''" />''' tag. The value for ''X'' must exactly match the declared gadget name (after ''calculator-'').
Gadgets are loaded using the '''<calculator id="''X''" />''' tag. The value for ''X'' must exactly match the declared gadget name (after ''calculator-'').


For example, to load the "drugdosages" calculator, place <calculator id='drugdosages'> in the article at the location where the calculator should appear.
For example, to load the "drugdosages" calculator, place <calculator id='drugdosages' /> in the article at the location where the calculator should appear.


Note: Gadgets are loaded by the calculator-core gadget and thus do not need to declare this as a dependency.
Note: Gadgets are loaded by the calculator-core gadget and thus do not need to declare this as a dependency.

Revision as of 16:38, 22 July 2021

Calculators

Calculators must have gadgets defined in this file in order to be loaded. See the Gadgets extension for usage details.

Core gadgets

This is the core gadget required by all calculators

  • calculator-core[ResourceLoader|dependencies=ext.calculators.math.js|hidden|targets=desktop,mobile|type=general]|calculator-core.js|calculator-core.css

Calculator gadgets

Gadgets are loaded using the <calculator id="X" /> tag. The value for X must exactly match the declared gadget name (after calculator-).

For example, to load the "drugdosages" calculator, place <calculator id='drugdosages' /> in the article at the location where the calculator should appear.

Note: Gadgets are loaded by the calculator-core gadget and thus do not need to declare this as a dependency.

Drug gadgets

  • calculator-drugs[ResourceLoader|hidden|default|targets=desktop,mobile|type=general]|calculator-drugs.js
  • calculator-drugdosages[ResourceLoader|dependencies=ext.gadget.calculator-patientinput|hidden|targets=desktop,mobile|type=general]|calculator-drugdosages.js|calculator-drugdosages.css

Patient gadgets

  • calculator-patientinput[ResourceLoader|hidden|targets=desktop,mobile|type=general]|calculator-patientinput.js|calculator-patientinput.css
  • calculator-patientstats[ResourceLoader|dependencies=ext.gadget.calculator-patientinput|hidden|targets=desktop,mobile|type=general]|calculator-patientstats.js|calculator-patientstats.css