Last modified: 2012-08-24 16:08:22 UTC
Created attachment 10996 [details] Broken JavaScript See the attached image. On all normal wiki pages, we have a sidebar which uses JavaScript to expand into multiple menus. On some pages such as Special:Preferences and Special:UserLogin, the extended menus do not work. Examples are below: Works - http://www.khwiki.net/Main_Page Works - http://www.khwiki.net/Special:RecentChanges Does not work - http://www.khwiki.net/Special:UserLogin Does not work - http://www.khwiki.net/Special:Preferences So there is something different about these pages which breaks the JavaScript menu.
Where is that javascript defined? UserLogin and Preferences page explicitely disable some javascript, so that a malicious javascript can't steal your password or copy/change your email address.
It's defined in MediaWiki:Monobook.js.
Quick answer: 1) Don't use javascript as the only means to access a menu bar. It should fall back to a simple html/css nested list and using javascript/css to trigger the dynamic menus only when javascript is ran. Had you done that, then at least it wouldn't be broken, just not interactive. 2) Don't use site scripts for layout. Site and user scripts are not allowed to run on SpecialLogin and other sensitive pages. If you want that, it means you're either doing something you shouldn't or doing it in the wrong place. If you are the site administrator and have access to the server, please implement this as a skin (e.g. make your own skin in /mediawiki/skins/<yourskin> next to "monobook" and "nostalgia" etc.). Do not hack stuff into Monobook, and certainly not in MediaWiki:Monobook.js. Closing as "invalid" since it isn't a bug, this is the expected behavior. It is perfectly possible to have a interactive sidebar that is enabled on all pages, but it has to be ran from the server-side not from within the wiki through MediaWiki:Monobook.js because that script is only allowed to run on non-sensitive pages and shouldn't do anything with components that are visible everywhere (because that would make it inconsistent as it would only be visible on some pages).