Talk:ShowHide/Archive 2

Italian
Please add the Italian messages:
 * Show: Mostra
 * Hide: Nascondi
 * Show all: Mostra tutti
 * Hide all: Nascondi tutti

I don't know if you prefer them capitalized or not, it's up to you. Question: is it possible to add a "generic" version, with "+" and "-"? Leviathan 89 19:01, October 8, 2011 (UTC)


 * Added. It is possible to do so for your wiki by including this after your import:


 * Replacing en for whatever language the wiki uses for its content. I hope that helps. Cheers, grunny  :&#126;$ 08:59, October 9, 2011 (UTC)

Nonlingual/symbolic
Can a nonlingual symbolic version be added?

A default non-lingual symbolic version would be good for people to select if they don't want to default to English. (maybe under language tag "mul" ? )

ForestMonthZero 06:32, October 12, 2011 (UTC)
 * There is an example and instructions how anyone can do it in their wiki if they want. The idea of internationalization its so other languages can benefit on if we use the simples then there is no point on internationalization --Cizagna (Discusión) • Helper • Central hispana 01:24, 12 November 2011 (UTC)

Font Famlily
I took the liberty to regroup the localizations request at the beginning, (I also added a request for Italian), undo it if I shouldn't. I saw a comment above that was talking about the class "collapseLink" of the links, is it still valid? So can I customize that class? If it's possible you should mention it in the documentation as well. I'd like to change the font family to a monospace family, since I like,  ... more than [show], [+]. Leviathan 89 19:31, October 8, 2011 (UTC)


 * The "collapseLink" class is still there, but it works on what is between the two square brackets, to affect both the square brackets and the + or show, use the class "collapseButton" instead. I hope that helps. Cheers, grunny  :&#126;$ 09:02, October 9, 2011 (UTC)

Thank you, you should add a little explanation of this in the page itself, other users can found this interesting. Leviathan 89 10:15, October 9, 2011 (UTC)

Animation
This is puzzled me for a while... is there a reason why the collapsible tables in wiki code haven't that sort of "animation" the collapsible tables in HTML have? An example:

[... Table in HTML ...] [... This content(1) is initially hidden ...]

I see the first table "instantly" show/hide while the second has a more "dynamic" effect. Can this be fixed/improved? Leviathan_89 23:37, October 11, 2011 (UTC)


 * Ah and shouldn't the "show link" in the HTML table be on the right instead of being under the title? Leviathan_89 23:39, October 11, 2011 (UTC)


 * divs aren't tables. This would be the HTML equivalent of your example table:


 * As you can see, it's quite different. Simply put, divs are used to mark sections of a page. ShowHide is basically two scripts rolled into one, one for collapsing tables and one for collapsing divs. The part for collapsing divs uses the animation while the part for collapsing tables does not (anymore). If I recall correctly, the animation was removed from the table part on purpose because it was causing the script not to work properly.
 * Regarding your second question, the "show" button appears on a new line in your div example because of the extra line breaks you have in there. Setting it up like this would make the button show up in the proper position:

 [... Table in HTML ...] [... This content(1) is initially hidden ...]
 * -- Porter21 (talk) 09:31, October 13, 2011 (UTC)


 * Thank you, too bad for the animation. Leviathan_89 22:07, October 13, 2011 (UTC)

Bulgarian language
Show: Покажи

Hide: Скрий

Show All: Покажи всички

Hide All: Скрий всички

That's all about it. Thanks!


 * Done. Cheers, grunny  :&#126;$ 14:21, October 17, 2011 (UTC)

margin-left
Hi,

Is margin-left on .collapseButton intented? It gives very strange display, pushing the text on the left of it to the right. Using languages other than English has the "show/hide" on top of the text... —Wyz 21:54, October 17, 2011 (UTC)

Columns
Is there a way to show/hide columns instead of rows? Rauleli 21:00, October 29, 2011 (UTC)
 * No. HTML builds the tables by rows and inside those rows are the "cells" that give the illusion of columns. --Cizagna (Discusión) • Helper • Central hispana 14:00, 12 November 2011 (UTC)

Navframe
Would it be possible to have the navframe button placed just like the table collapse buttons? Thanks, -- Kangaroopowah  - Talk  01:07, December 19, 2011 (UTC)

Show-Hide Appendage
Any way that we can get the Show-Hide text to show immediately after the Header text for the collapsible table? Currently it is aligned to the far right of the caption block. Goldbishop 03:29, January 15, 2012 (UTC)

Hungarian localization

 * Added. Thanks for posting them! grunny  :&#126;$ 12:38, March 2, 2012 (UTC)

Why double brackets?
Why do double brackes appear around show/hide links? This is both confusing and misleading. -- Fandyllic  (talk &middot; contr) 9 Mar 2012 12:52 PM Pacific
 * It might have been to show that it could be changed or just a personal preference (but this is just guessing), as Dantman set it here. I've removed it for now and added an example to the docs. :) Cheers, grunny  :&#126;$ 03:49, March 10, 2012 (UTC)

Change "hide" or "show"
Is it possible to customize the "hide" or "show" buttons to something like "Hide unofficially supported systems" or "Show unofficially supported systems"? Iggyvolz 01:34, March 18, 2012 (UTC)

Chinese
This is for Chinese:

Show: 显示

Hide: 隐藏

Show All: 全部显示

Hide All: 全部隐藏 &mdash;  S a m  Wang  09:55, April 11, 2012 (UTC)
 * Added, thanks for posting the translations :). Cheers, grunny  :&#126;$ 09:17, April 13, 2012 (UTC)

Portuguese (Portugal)
pt: { show: "Mostrar", hide: "Esconder", showAll: "Expandir Todos", hideAll: "Esconder Todos" } -- 02:36, April 14, 2012 (UTC)


 * Added. grunny  :&#126;$ 11:48, April 16, 2012 (UTC)

Portuguese (Brazil)
pt-br: { show: "Mostrar", hide: "Esconder", showAll: "Expandir Todos", hideAll: "Esconder Todos" }

P.S. You might have to change the coding to be like OasisToolbarButtons where they placed the language codes inside of single quotes " ' " because I was told that variables can not have the dash " - " in its name.

'pt-br': { show: "Mostrar", hide: "Esconder", showAll: "Expandir Todos", hideAll: "Esconder Todos" } -- 02:36, April 14, 2012 (UTC)


 * Added. And yep, that's right, see my explanation of why. Thanks for posting the translations. :) Cheers, grunny  :&#126;$ 11:49, April 16, 2012 (UTC)

Monobook bug
Not sure whether to post this here, but ShowHide seems to be malfunctioning in Monobook in a template on Star Wars Fanon; see the Oasis and [ Monobook] for comparison. I'm not sure what difference is causing this. TK-999 17:50, April 18, 2012 (UTC)


 * It looks like you have the actual script code on the wiki on the MediaWiki:common.js page, as a result of doing this, it is not updated when the code is updated here on the dev wiki.


 * Your or the wiki's admins need to replace

// BEGIN Dynamic Navigation Bars (experimantal) // This script is from Wikipedia:MediaWiki:Monobook.js/Wikipedia:MediaWiki:Common.js. // set up the words in your language var NavigationBarHide = '[hide]'; var NavigationBarShow = '[show]'; // set up max count of Navigation Bars on page, // if there are more, all will be hidden // NavigationBarShowDefault = 0; // all bars will be hidden // NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden var NavigationBarShowDefault = 1; // shows and hides content and picture (if available) of navigation bars // Parameters: //	 indexNavigationBar: the index of navigation bar to be toggled function toggleNavigationBar( indexNavigationBar ) { var NavToggle = document.getElementById( 'NavToggle' + indexNavigationBar ); var NavFrame = document.getElementById( 'NavFrame' + indexNavigationBar ); if ( !NavFrame || !NavToggle ) { return false; }	// if shown now if ( NavToggle.firstChild.data == NavigationBarHide ) { for ( var NavChild = NavFrame.firstChild; NavChild != null;			NavChild = NavChild.nextSibling		) {			if ( NavChild.className == 'NavPic' ) { NavChild.style.display = 'none'; }			if ( NavChild.className == 'NavContent' ) { NavChild.style.display = 'none'; }		}		NavToggle.firstChild.data = NavigationBarShow; // if hidden now } else if ( NavToggle.firstChild.data == NavigationBarShow ) { for ( var NavChild = NavFrame.firstChild; NavChild != null;			NavChild = NavChild.nextSibling		) {			if ( NavChild.className == 'NavPic' ) { NavChild.style.display = 'block'; }			if ( NavChild.className == 'NavContent' ) { NavChild.style.display = 'block'; }		}		NavToggle.firstChild.data = NavigationBarHide; } } // adds show/hide-button to navigation bars function createNavigationBarToggleButton { var indexNavigationBar = 0; // iterate over all -elements for( var i = 0; NavFrame = document.getElementsByTagName( 'div' )[i]; i++ ) { // if found a navigation bar if ( NavFrame.className == 'NavFrame' ) { indexNavigationBar++; var NavToggle = document.createElement( 'a' ); NavToggle.className = 'NavToggle'; NavToggle.setAttribute( 'id', 'NavToggle' + indexNavigationBar ); NavToggle.setAttribute( 'href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');' ); var NavToggleText = document.createTextNode( NavigationBarHide ); NavToggle.appendChild( NavToggleText ); // Find the NavHead and attach the toggle link // (Must be this complicated because Moz's firstChild handling is borked) for( var j = 0; j < NavFrame.childNodes.length; j++ ) { if ( NavFrame.childNodes[j].className == 'NavHead' ) { NavFrame.childNodes[j].appendChild( NavToggle ); }			}			NavFrame.setAttribute( 'id', 'NavFrame' + indexNavigationBar ); }	}	// if more Navigation Bars found than Default: hide all if ( NavigationBarShowDefault < indexNavigationBar ) { for( var i = 1; i <= indexNavigationBar; i++ ) { toggleNavigationBar( i ); }	} } hookEvent( 'load', createNavigationBarToggleButton ); // END Dynamic Navigation Bars with importScriptPage('ShowHide/code.js', 'dev');
 * or some portion of the code, since you have it intertwined with Navframe.
 * -- 18:49, April 18, 2012 (UTC)
 * Thanks for the help! Somehow failed to notice this in the old heap of code. Thanks again. TK-999 17:15, April 19, 2012 (UTC)

Korean
Thank you for adding korean translation. I'm not that sure I can write at the middle of page. Cafeinlove 15:14, April 24, 2012 (UTC)
 * Show: : 보이기
 * Hide: : 숨기기
 * Show all : 모두 보이기
 * Hide all : 모두 숨기기
 * Replaced. Cafeinlove 09:17, April 25, 2012 (UTC)


 * Added. Thanks for posting the translations! :) grunny  :&#126;$ 07:43, April 28, 2012 (UTC)

Can someone help me, please?
I am trying to show/hide div here, I added the code to the js file nothing is happening really. Except my div moved to the left! I find it strange that the js code goes "importScriptPage" but the way to invoke it is by using ? That doesn't look right?!

Ok so, this is a simple common template on the mainpage that's supposed to link to itself (been there for a long time but I want to give users ability to get it out of the way if they want) it sits here... where exactly in this page is the code to invoke it, that page doesn't look complete, emphasizing more in the language input that the code itself. Am I missing something, if so where do I find it? --Liliana (my talk). 00:36, April 28, 2012 (UTC)


 * Oh I see I found it, it has a link to this I didn't realize I also needed that. Thanks anyway. --Liliana (my talk). 06:22, April 28, 2012 (UTC)

Tagalog (Philippines)
// Tagalog tl: { show: "ipakita", hide: "itago", showAll: "ipakita lahat", hideAll: "itago lahat" }, ReignBough 04:26, April 29, 2012 (UTC)

Show/Hide to Right
Hi, this must be one of the most discussed and complex "simple" features on wikia!!!

I have such a headache from digesting so many dozens of discussion pages on this, including so many variations and contradictions - especially when several pages instruct you to specifically copy lots of content into your common.css and common.js page, and other pages tell you to simply only add one import line into your common.js page.

From so many discussions and requests for help I can see admins and wikia staff (people who actually understand the code) looking at peoples wiki sites and seeing and removing and fixing these duplicate codes. It's all so confusing.

I have both collapsible tables working (with both class=collapsible and class=mw-collapsbile - yet another confusing conflict and both look slightly different to each other!!!) and also div navhead working quite well (only since I removed all the css and js code and replaced it all with the one-line import line in js).

But no matter how much I search, I still can not find the illusive answer to:


 * How do you make the Show/Hide button appear at the right of the table / div instead of immediately to the right of the Header. I can make BOTH the header and the button appear on the left, center, or the right, but I can't make the Header appear on the Left or Center with the Button on the Right ...?!?! Like all the examples on Community and Dev seem to be but not on other wikias

I have seen this question asked many many times and yet no answer anywhere?!

(eg: Asked here but not answered: http://community.wikia.com/wiki/Forum%3ANeed_a_show/hide_table)

Here is my initial use of the code:

http://paradiseislandhd.wikia.com/wiki/User:DarkMoonRising

How can I make the headers align center/left and the button to the right like:

http://dev.wikia.com/wiki/ShowHide and

http://community.wikia.com/wiki/User:Original_Authority

I have looked at the source of all the examples in detail and looked at the source of common.css and common.js in detail and copied them exactly to test pages and live css and js pages, but my header and button are always hard-up adjacent to each other!

Please help! Thanks.


 * Hi, can you please do the following?


 * 1) Rather than writing a wall of text, give a short, succinct description (preferably without panic-inducing overtones)
 * 2) Attach a screenshot of what you're talking about (people see different things in different browsers)
 * 3) Say what internet browser you're using
 * 4) Link to a single page where you have a collapsible table/navframe.
 * 5) Link to your MediaWiki:Common.js page
 * Thanks. Especially on #1. I can't stress how important it is not to go into wall-of-text mode all the time :P — Mathmagician (message wall) 03:09, July 18, 2012 (UTC)


 * Try adding


 * Arkondi 06:20, July 18, 2012 (UTC)

Possible?
Is it possible to make it show and hide by clicking on the "navhead" class because I accidentally hid the show/hide button here using this code? Also, I want the cursor to turn into a pointer when it hovers over there, like a link --Sam Wang (talk) 22:45, July 17, 2012 (UTC)
 * I second those requests. Why don't you guys work with the SpoilerAlert guy - see my TalkPage comments. His buttons are so much more professional and with the pointer cursor, but ShowHide is much more flexible and customisable. I'd love to see his buttons on this script. 2. Also it would be good to be able to pass parameters to customise the labels on each page. On one page I might want to have Show="Reveal" and on another Show="More", and ShowAll="Appear!" or some such, but currently the labels are fixed across the whole site. Ta.


 * 1. Check the closing brackets in


 * I don't know if this makes the button reappear again. Perhaps there is a conflict with one of the other scripts?
 * 2. To get a pointer when hovering add


 * Arkondi 06:47, July 18, 2012 (UTC)


 * I've already fixed the closing and starting brackets, like the following:


 * However, it made no difference. Why does it do that? -- Sam Wang (talk) 12:25, July 18, 2012 (UTC)


 * I could reproduce the problem in 'my' wiki with the code in your Common.js. So the problem is located there.
 * Try the following: Comment out all javascript code except the import for ShowHide. The button should appear when you reload the page with Ctrl+F5. Then uncomment one import/block of code and reload the page with Ctrl+F5. Do this until the button disappear. Then you (hopefully) have found the import/block of code that causes the problem.
 * Arkondi 17:55, July 18, 2012 (UTC)


 * So you mean only this code:


 * Sam Wang (talk) 20:00, July 18, 2012 (UTC)


 * That's only the code for the local customization of ShowHide. You should start with only the following being active:


 * Arkondi 02:58, July 19, 2012 (UTC)

(reset indent) Thanks, but I want to remove the brackets, change the show button to "↓", and change the hide button to "↑" -- Sam Wang (talk) 12:36, July 19, 2012 (UTC)


 * For this purpose the code seems correct (except for one needless closing bracket) and I don't think it causes the problem. But if the button is not visible ... Arkondi (talk) 15:14, July 19, 2012 (UTC)


 * Which code? -- Sam Wang (talk) 20:34, July 19, 2012 (UTC)


 * If you remove the third closing bracket it should work. Arkondi (talk) 02:55, July 20, 2012 (UTC)


 * Thanks, but can I insert pictures in there? -- Sam Wang (talk) 13:40, July 20, 2012 (UTC)


 * The basic CSS code for this:


 * Instead of  you can use  . With the following code you should see, what's the difference:


 * Arkondi (talk) 16:36, July 20, 2012 (UTC)

(reset indent) I'm confused &mdash; for the hide button I want the image url of "http://images2.wikia.nocookie.net/isleoftune/images/b/ba/Arrow-up.png", and for the show button I want the image url of "http://images1.wikia.nocookie.net/isleoftune/images/f/fb/Arrow-down.png". For that, how is the CSS supposed to look like? -- Sam Wang (talk) 12:01, July 21, 2012 (UTC)


 * Arkondi 12:13, July 21, 2012 (UTC)


 * Thanks, but why does it repeat it, and only displays half of it? I tried adding, but it still remained the same -- Sam Wang ( 13:44, July 22, 2012 (UTC)


 * Your usage of  is not correct, because it combines all background-... properties in one. Instead of   you should use:


 * For more options see https://developer.mozilla.org/en/CSS/background Arkondi (talk) 14:00, July 22, 2012 (UTC)


 * The code:


 * Hid the arrow! You can see it here -- Sam Wang ( 22:51, July 22, 2012 (UTC)
 * You forgot the quotes around the URL of the image. Arkondi (talk) 06:34, July 23, 2012 (UTC)

(reset indent) I added quotes around it, but it still remained hidden -- Sam Wang 00:31, July 24, 2012 (UTC)


 * It seems that you can't use  or   in  . Try a fixed size or note   seperately. Arkondi (talk) 02:38, July 24, 2012 (UTC)


 * Sorry, but I do not quite understand what you are explaining. Can you do an example please? -- Sam Wang 01:00, July 25, 2012 (UTC)


 * Try to use the property  seperately


 * or a fixed size in the shorthand property


 * Arkondi (talk) 03:29, July 25, 2012 (UTC)


 * Thanks! I appreciate all of the time you've spent with helping me -- Sam Wang 20:17, July 25, 2012 (UTC)

Comments
Hello, I was wondering if it was possible to implement this button/system for comments on pages and blogs, so that you could Hide an entire comment thread (all the replies) to a single comment? Is this possible to be done and/or implemented? -MattShadow

Switch inside collapse
The ShowHide extension doesn't seem to work with the table navbox class when there is an switch code inside the collapse option. Anyone an idea how to fix this?Jens Ingels (talk) 12:29, July 27, 2012 (UTC)


 * Can you give example code or a link to a page where this problem occured? Arkondi (talk) 14:09, July 27, 2012 (UTC)


 * Here an example. I already test it with an space. That's not the problem. So I think it need an css or an js edit:

 {| class="navbox collapsible " style="width:100%; margin-top:1em; border:1px solid #999; font-size:90%; text-align:center;" ! style="background-color:#FF0000; color:#000000; padding:0.2em 0.5em;" nowrap="nowrap"| Heroes
 * style="padding:0.2em 0.5em;"| Melee: Miner · Knight · Dwarf · Golem · (Centaur) · (Tree Sprite) · Phoenix Mid range: Faun · (Rogue) · Unicorn · Fairy · Healer · Phoenix Long range: Elf · Wizard
 * }
 * Jens Ingels (talk) 18:34, July 27, 2012 (UTC)
 * Jens Ingels (talk) 18:34, July 27, 2012 (UTC)


 * I couldn't reproduce the problem with your code in this wiki (see User:Arkondi/sandbox). For me it seems to work as intended: If the pagename is one of the options, then the table is not collapsed, otherwise it is. Perhaps  is causing the problem? It doesn't seem to be part of ShowHide und maybe the CSS/JS code for it interferes with ShowHide? A link to your wiki would be useful to check this. Arkondi (talk) 19:43, July 27, 2012 (UTC)

I also added on the wikia help but I don't really got an aswer yet. There I post all codes:
 * Community/Forum:ParserFunctions support for ShowHide extension

I don't think the wiki would give an lot info since I removed the full common to start over. I currently do this tests on userstyle js and css. On the link above you can find all codes but here this wiki: --Jens Ingels (talk) 21:17, July 27, 2012 (UTC)