Forum:I need CSS-JS for returning navigation menus to the admin-tools dashboard


 * See also: User blog:Meighan/Thoughts, Feedback & Fixes Around the Admin Dashboard Rollout.

I like some of the features of the new admin-tools dashboard, but I need my wiki's navigation menus back. I use the menus all the time from all pages on the wiki.

What CSS and/or JS do I need to return these menus to the admin-tools dashboard: http://cannabis.wikia.com/wiki/MediaWiki:Wiki-navigation

I will also make a suggestion to the Wikia staff to return the menus, but I need an immediate solution too. Thus the request here where most of the skilled CSS and JS people will see it quickly. --Timeshifter 19:44, August 7, 2011 (UTC)
 * RuneScape Wiki has developed the following CSS to hide the header:


 * The JS is:

Fill the first part (the one before the .insertAfter) with the HTMl header code&mdash;everything between  and. Please note, however, that you should only put it into your personal .css and .js files, as placing the coding into the MediaWiki namespace would be a ToU violation. TK 999  20:08, August 7, 2011 (UTC)


 * Thanks. I am not trying to hide the dashboard, or any part of it. I am trying to add back MediaWiki:Wiki-navigation at the top. Above the dashboard area. --Timeshifter 12:09, August 8, 2011 (UTC)
 * Then you'll only need the JS, but you'll also have to change  to   Hope it helps!  TK  999  12:49, August 8, 2011 (UTC)
 * You won't need anything after   TK  999  12:53, August 8, 2011 (UTC)
 * I tried out the revised JS, did Ctrl-F5 in Firefox, and I saw no change at
 * http://cannabis.wikia.com/index.php?title=Special:RecentChanges
 * There is still no MediaWiki:Wiki-navigation at the top above the admin tools. As you instructed I changed the JS from  to
 * See: http://cannabis.wikia.com/wiki/User:Timeshifter/wikia.js


 * I did not understand your other comment. Did I need to add, change, or do something else? --Timeshifter 13:27, August 8, 2011 (UTC)
 * You did not paste the HTML source code in, so this is what you need:

TK 999  14:14, August 8, 2011 (UTC)


 * Thanks. It works. Now I more fully understand what people mean by an ugly hack. ;)


 * Is there a way to have MediaWiki:Wiki-navigation imported more simply? --Timeshifter 15:04, August 8, 2011 (UTC)
 * I do not know of such methods. This is its HTMl source code, and the script would probably freak out from simplified MediaWiki. TK  999  16:11, August 8, 2011 (UTC)
 * It's possible, but requires slightly more code:


 * Theoretically, barring some cookie string rules, this will save the HTML of the header for the wiki you're on every time you load a page containing the header. Then, when you go to the dashboard, it'll paste that saved HTML as the header.


 * Thanks again. I tried out the JS here:
 * http://cannabis.wikia.com/wiki/User:Timeshifter/wikia.js


 * I then did Ctrl-F5 there in my Firefox browser, and then went here and saw no navigation menus:
 * http://cannabis.wikia.com/wiki/Special:RecentChanges


 * I then went to another page to make sure there was a chance to pick up the navigation HTML, and then back to a refreshed recent changes page. No navigation menus.


 * I am going back to your previous solution since it works for me. --Timeshifter 14:25, August 9, 2011 (UTC)


 * Turns out the wikiheader is much longer than some arbitrary limit Wikia has set - browsers can have cookies up to 4000 bytes long, Wikia throws an error when they're over 500 bytes long. Testing has corrupted my cookies, so I'll have to get back to you on this one.
 * Trying again, my cookies may have been corrupted from the start. Wikia does seem to accept long cookies, so this should work:


 * And that should do it. If running this gives you page loads with nothing but "Too long cookie", clear your cookies and then leave a message here.


 * Same results as before. No navigation menus show up. No notice about cookies. --Timeshifter 17:00, August 9, 2011 (UTC)


 * I tried again after deleting the wikia cookies. Still no navigation menus, and no notice about cookies. --Timeshifter 17:12, August 9, 2011 (UTC)


 * Whoops, logic fail. The cookie got deleted when the header wasn't present, including on special pages. Fixed above, works for me now.

(unindent). Still not working for me, even after deleting the cookie. Is this the change you made: Diff for Timeshifter/wikia.js page. --Timeshifter 17:31, August 9, 2011 (UTC)


 * Yep, that's the right code - Further testing shows that Minify trashes the whole script on special pages. Loading up RC with  shows that it works, but Minify can't deal with code, apparently. It'd be nice if Wikia would use a script for shrinking JS that can actually parse the whole language, rather than one that throws out perfectly good code. I changed the above to make it more consistent, I don't know if Minify will like it or not.


 * Still no luck. Are you an admin on a wiki using the dashboard admin tools? Whether you are or not, I can make you an admin on the Cannabis Wiki so you can try out ideas on a wiki with more navigation menus than most wikis. --Timeshifter 18:44, August 9, 2011 (UTC)


 * The number is irrelevant, the JS allocates as many cookies as are needed to store the entire header. The problem is that minify throws away the function on special pages, which is difficult to troubleshoot, let alone fix.


 * OK. You said higher up, "works for me now." What were you referring to? And what page exactly? --Timeshifter 19:20, August 9, 2011 (UTC)
 * When run from console, it works. Since putting in a code page subjects it to minify, it doesn't work in a code page. Unfortunately, that's minify's fault, not mine - I don't know why minify doesn't like the code, and I don't have any way of finding out. What I've written is valid, it's minify's poor handling of it that breaks it. Alternatively, were you to import the code instead, it should work just fine as minify doesn't affect.