User talk:The Transhumanist/ViewAnnotationToggler.js: Difference between revisions

Content deleted Content added
Bug reports
Line 332:
 
General usage:
<source lang="javascript">
<code>mw.util.addPortletLink( 'portletId', 'href', 'text [', 'id [', 'tooltip [', 'accesskey [', 'nextnode ]]]] ');</code>
</source>
 
It's components:
<code>mw.util.addPortletLink( portletId, href, text [, id [, tooltip [, accesskey [, nextnode ]]]] );</code>
* <code>mw.util.addPortletLink</code>: the ResourceLoader module to add links to the portlets.
* <code>portletId</code>: portlet id— the section where the new menu item is to be placed. Valid values:
** <code>p-navigation</code>: Navigation section in left sidebar
** <code>p-interaction</code>: Interaction section in left sidebar
** <code>p-tb</code>: Toolbox section in left sidebar
** <code>coll-print_export</code>: Print/export section in left sidebar
** <code>p-personal</code> Personal toolbar at the top of the page
** <code>p-views</code> Upper right tabs in Vector only (read, edit, history, watch, etc.)
** <code>p-cactions</code> Drop-down menu containing move, etc. (in Vector); subject/talk links and action links in other skins
* <code>href</code>: Link to the Wikipedia or external page
* <code>text</code>: Text that displays
* <code>id</code>: HTML id (optional)
* <code>tooltip</code>: Tooltip to display on mouseover (optional)
* <code>accesskey</code>: Shortcut key press (optional)
* <code>nextnode</code>: Existing portlet link to place the new portlet link before (optional)
 
The optional fields must be included in the above order. To skip a field without changing it, use the value <var>null</var>.
* portletID = ID of the menu you want to add the menu item to
* href =
* text = the name of the menu item as it is to appear in the menu
* ID = element ID
* tooltip = the tip that shows up when you hover the mouse cursor over the menu item
* accesskey = the name of the hot key (without the Shift-alt)
* nextnode =
 
''For the documentation on this function, see https://www.mediawiki.org/wiki/ResourceLoader/Modules#addPortletLink'' and [[Help:Customizing toolbars]].
 
'''Important:''' It won't do anything until you bind it to a click handler (see below).