Forum:Javascripts not working in Oasis theme

Hi there! I'm an admin on Holopedia, the Bulgarian version of Wookieepedia, the Star Wars Wiki.

I'm having problems with w:c:bg.starwars:MediaWiki:Common.js, it's not working on the modern Oasis theme, but works perfectly fine on the MonoBook theme. For example there's a simple show/hide script to manipulate the "display" css property of an element - it works on MonoBook - check it out on the top of the Sandbox page. And I've written one script that adds a subtitle just below the title of any article that has an interwiki link for Wookieepedia - the subtitle is the english title of the corresponding article in Wookieepedia and it links to it. This script also works on MonoBook, but doesn't on Oasis - see any page that has an english interwiki link, for example Anakin Skywalker.

I think the whole Common.js was taken (a long time ago mind you) from Wookieepedia's Common.js. Aside from the subtitle function, I haven't written any of it.

I believe the file does load on Oasis (I ca see its code in Firebug, in the Script tab), however the functions just don't work.

So any idea why Common.js won't work in the Oasis theme?

Thanks! adenry 20:50, January 24, 2012 (UTC)


 * Make sure the ids and classes your JS expects are actually on the page when rendered as Oasis skin. The CSS ids and classes will change between skins, so expecting Javascript to work the same on Monobook vs. Oasis isn't really realistic. Oasis specific JS should be put in MediaWiki:Wikia.js.
 * That said, Wikia's implementation of Oasis was definitely strange, since it does load MediaWiki:Common.js, but not MediaWiki:Common.css. -- Fandyllic (talk &middot; contr) 24 Jan 2012 2:30 PM Pacific