Forums: Index → |
|
→ Inventory Button |
To all those amazing people out there using Monobook, I was wondering what you thought of adding this code to the main Javascript page:
/* Code modified from http://dev.wikia.com/wiki/ShowAdsButton/code.js */ if( wgNamespaceNumber == 0 ) { addOnloadHook( inventoryButton ); } var inventoryLoad = true; // prevent duplication function inventoryButton () { switch( skin ) { case 'uncyclopedia': /* pass to monobook */ case 'monobook': $('<li id="ca-inv"><a href="http://lego.wikia.com/index.php?title=Inventory:'+encodeURIComponent(wgPageName)+'">Inventory</a></li>').appendTo('#p-cactions > .pBody > ul'); break; } } if( wgNamespaceNumber == 114 ) { addOnloadHook( articleButton ); } var articleLoad = true; // prevent duplication function articleButton () { switch( skin ) { case 'uncyclopedia': /* pass to monobook */ case 'monobook': $('<li id="ca-inv"><a href="http://lego.wikia.com/index.php?title='+encodeURIComponent(wgTitle)+'">article</a></li>').appendTo('#p-cactions > .pBody > ul'); break; } }
(you can add it to your monobook page here and test it)
Basically, what this does is puts in an inventory button to the right of "refresh", linking to the page's inventory, if you're on an article page. If you're on an inventory page, an "article" button linking to the appropriate article will come up. Anyway, let me know if you think it is of any use. To those using "the other skin", I believe there may be a way to do the same for the wikia skin as well, but I'm not really familiar with the skin (and I'm not sure if you've already got an inventory button?). If it is decided that it's a good idea and I sort out the bug, I'll be happy to work on a Wikia one as well. NightblazeSaber 07:06, September 10, 2011 (UTC)
Comments[]
Feel free to list any bugs/problems/concerns you have here
- Basically, the only problem I can see so far is that the link is blue, even if an inventory doesn't exist. I really do think that needs to be fixed if we do implement it. Also, I don't know if the position is a problem, being to the right of "refresh" and "follow". However I really don't think that can be fixed. NightblazeSaber 07:06, September 10, 2011 (UTC)
- Oh, and it would be present on things such as theme pages which it shouldn't appear on. Maybe it would be better as just a custom thing... NightblazeSaber 07:34, September 10, 2011 (UTC)
- There was one in the set and minifigure infoboxes, that only showed up if the page existed. I'm not sure if I put that in when I changed Set to the new template though. - nxt 16:51, September 12, 2011 (UTC)