Last modified: 2012-09-27 01:10:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21546, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19546 - Vector skin does not support jsMsg() javascript function
Vector skin does not support jsMsg() javascript function
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.13.x
All All
: Normal minor (vote)
: ---
Assigned To: Trevor Parscal
:
: 19486 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-06 06:42 UTC by Bawolff (Brian Wolff)
Modified: 2012-09-27 01:10 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bawolff (Brian Wolff) 2009-07-06 06:42:25 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]]
Comment 1 Amalthea 2009-07-06 11:48:40 UTC
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.
Comment 2 Roan Kattouw 2009-07-07 00:07:44 UTC
(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.
Comment 3 Splarka 2009-07-07 00:38:39 UTC
> 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.
Comment 4 Raimond Spekking 2009-07-07 07:57:59 UTC
*** Bug 19486 has been marked as a duplicate of this bug. ***
Comment 5 Roan Kattouw 2009-07-07 17:46:46 UTC
Done better in r52849
Comment 6 Splarka 2009-07-07 23:49:51 UTC
(In reply to comment #5)
> Done better in r52849
> 

Sweet!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links