Jump to content

Topic on Talk:ResourceLoader/Legacy JavaScript

Summary by Krinkle

addPortletLink() was deprecated, but a replacement mw.util.addPortletLink() is also provided.

Krinkle (talkcontribs)

If addPortletLink() is going to be deprecated, I really hope that an equivalent function will be provided to replace it. Adding links to navigation menus is an extremely common task in user scripts, and I really don't want to see us going back to the bad old days when every script writer would roll their own, often half-assed implementation of it. --Ilmari Karonen 22:15, 10 October 2010 (UTC)

This post was posted by Krinkle, but signed as Ilmari Karonen.

Krinkle (talkcontribs)

+1. I don't really understand why we are deprecating the wiki-specific functions of wikibits. I could understand re-implementing things like addPortletLink, jsMsg in terms of jquery where appropriate, but the functions are useful and should stay. It doesn't make sense (imho) to just totally ditch all pre-existing wikibits js. Bawolff 01:25, 11 October 2010 (UTC)

This post was posted by Krinkle, but signed as Bawolff.

Krinkle (talkcontribs)

Its being deprecated apparently in favor of mw.util.addPortletLink() so an equivalent function will be provided. I wish a skin independent way to get at portlets and to delete portlet links were provided too though. A jsMsg replacement isn't needed at all because of the skin independent way to get at the content body that will make it as easy as mw.util.$content.prepend('<div>your message here</div>'); --Darklama 23:56, 3 December 2010 (UTC)

This post was posted by Krinkle, but signed as Darklama.

Krinkle (talkcontribs)

mw.util.addPortletLink() is not the same as mw.legacy.wikibits's addPortletLink(). The new one is in fact skin independant for all skins supported by core. It adds them to the known portlets when the skins supports it (such as in chick, modern, monobook, myskin, simple and vector), and otherwise it falls back to other locations that are used by the skin to place handy links. Such as #quickbar in the skin 'cologneblue' and 'standard'. And the area before #searchform in 'nostalgia' skin. See also mediaWiki.util.addPortletLink(); Krinkle 12:58, 11 December 2010 (UTC)

Krinkle (talkcontribs)

By skin independent I was thinking of something more along the lines of 'toolbox' or 'lang' being passed and it maps it to the correct id for the skin being used. Having looked at the js file, I see that addPortletLink ignores the passed id for some skins and checks if the passed id exists for all other skins. --Darklama 22:03, 11 December 2010 (UTC)

This post was posted by Krinkle, but signed as Darklama.

This post was hidden by Od1n (history)