Page MenuHomePhabricator

mw.util.$content changed for Vector
Closed, ResolvedPublic

Description

According to [[mw:ResourceLoader/Default modules#$content]], and up until 13 September 2012, the mw.util.$content should mean the #bodyContent for the Vector skin on huwiki. Now is the #content, causing unwanted behavior.


Version: 1.20.x
Severity: normal

Details

Reference
bz40325

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:58 AM
bzimport set Reference to bz40325.

I prefer the idea that this should be a documentation bug. IMHO it should be the element who directly holds parser output HTML from wikitext of a page.

No it shouldn't. $content has only ever been used by core and the extensions I could find to refer to the overall content area (including ui, etc...).

If you want the actual content text use $( '#mw-content-text ').

Updated the documentation.

Indeed. #bodyContent is never the right selection, it never was.

  • The raw page output is #mw-content-text. This ID is fixed by the MediaWiki output handler and not overwritten by skins.
  • The full page output is a few levels up, and depends on the skin. In Vector it is #content. Because this is variable, mw.util.$content helps.
  • #bodyContent is somewhere in between.