Document toolboxDocument toolbox

jQuery plugins

.expandInput(options)

This overlays a textarea on the selected input to make it appear as the input area got larger, when the input field is focused. The plugin can be configured as follows:

height: Height of the textarea (default: 50px)
width: Width of the textarea (default: 150px)

This works totally transparent and is also tab-save.

.stddialog(buttons, options)

This is a wrapper for creating jqueryUI dialogs, since almost all dialogs in MB has the same properties. Using this will produce a dialog with the following properties:

autoOpen: false
modal: true
zIndex: 13000
width: 450

Per default the dialog will have a cancel button which just closes the dialog. Further buttons can be added using the buttons variable, and the dialog can be further modified using the options parameter. The parameters for these functions completely matches the dialog interface. When the dialog is created use the .dialog() method and not the .stddialog() function to further manipulate the dialog.

.tooltip(function)

Can be used to produce a tooltip over a DOM element. A function is passed which is responsible for generating the tooltip. The element which is hovered over, is passed to this function.

You may add the class autotooltip to an element and add either of the attributes data-autotooltipurl or data-autotooltiphtml; that way you don't have to provide javascript for initializing the tooltip, f.ex.

<span class="autotooltip" data-autotooltipurl="/sys/mytooltip.php?x=1">My tooltip</span>
<span class="autotooltip" data-autotooltiphtml="&lt;span&gt;Some HTML&lt;/span&gt;">My tooltip</span>