Last modified: 2012-09-27 01:10:57 UTC
The vector skin does not support the jsMsg javascript function (which is defined in wikibits.js). This causes the "This page has been watched" message, "this page has been flagged" message, etc not to appear (as well as breaking some custom user js). To fix, an empty div with the id "mw-js-message" should be added somewhere near where the sitenotice is. Thanks, [[n:user:Bawolff]]
That's how Modern does it. Some other skins like Monobook created the div dynamically, using the following code from wikiBits: if ( document.getElementById( 'column-content' ) && document.getElementById( 'content' ) ) { // MonoBook, presumably document.getElementById( 'content' ).insertBefore( messageDiv, document.getElementById( 'content' ).firstChild ); } else if ( document.getElementById('content') && document.getElementById( 'article' ) ) { // Non-Monobook but still recognizable (old-style) document.getElementById( 'article').insertBefore( messageDiv, document.getElementById( 'article' ).firstChild ); } That's of course ugly enough. I think the best way would be to change the "Monobook, presumably" way to always insert the message div right before the #top element. Or better yet, do that and change all skins so that they *have* a #top element (which would be useful in any case) and remove the skin branching from wikibits.js.
(In reply to comment #1) > That's how Modern does it. Some other skins like Monobook created the div > dynamically, using the following code from wikiBits: > > if ( document.getElementById( 'column-content' ) > && document.getElementById( 'content' ) ) { > // MonoBook, presumably > document.getElementById( 'content' ).insertBefore( > messageDiv, > document.getElementById( 'content' ).firstChild > ); > } else if ( document.getElementById('content') > && document.getElementById( 'article' ) ) { > // Non-Monobook but still recognizable (old-style) > document.getElementById( 'article').insertBefore( > messageDiv, > document.getElementById( 'article' ).firstChild > ); > } > > That's of course ugly enough. I think the best way would be to change the > "Monobook, presumably" way to always insert the message div right before the > #top element. Or better yet, do that and change all skins so that they *have* a > #top element (which would be useful in any case) and remove the skin branching > from wikibits.js. > Fixed this logic to do proper skin detection in r52821.
> Fixed this logic to do proper skin detection in r52821. Yes the original code was bad, but this is worse. >_< This presumably breaks it in chick, myskin, and simple, as well as any other user-defined monobook+template skins, which use the same HTML as Monobook (and are basically "Monobook" skins), but have a different name. You shouldn't rely on a js-based skin-name check, but fix the underlying problems with vector. Or do what the code suggests: // We special-case skin structures provided by the software. Skins that // choose to abandon or significantly modify our formatting can just define // an mw-js-message div to start with.
*** Bug 19486 has been marked as a duplicate of this bug. ***
Done better in r52849
(In reply to comment #5) > Done better in r52849 > Sweet!