Extension talk:TocTree/Archive

wikt:fr:MediaWiki:Gadget-SommaireDeveloppable.js
Hi ! Are you aware that ?

People on French Wiktionary developped that (in javascript) because the standard TOC of Mediawiki is not suitable when there is a lot of sections.

The result is quite good, I think. :)) The question is : would it be possible to include that in Mediawiki, or in this extension ? --GaAs 19691 18:46, 16 July 2013 (UTC)

No longer working on version 1.22 or 1.23 Monobook skin
I installed this extension on version 1.22 and 1.23 and tried it on the Monobook skin. It doesn't work, however with the Vector skin it does work.

Allow expansion per wiki page
For wikis that have small and large pages, it can make sense to expand/collapse individual wiki pages only. I.e.: &lt;div class="noExpand">__ TOC __&lt;/div>  -- always show collapsed TOC &lt;div class="noCollapse">__ TOC __&lt;/div> -- always show expanded TOC

The following patch enables this behavior: diff ext.toctree.orig ext.toctree.js --- ext.toctree.orig +++ ext.toctree.js @@ -51,7 +51,13 @@ mw.tocTree = { var $toggleLink = $( ' ' ).addClass( 'toggleSymbol' ); -						if ( mw.user.options.get( 'toc-expand' ) ) { +						var $tocexpand = mw.user.options.get( 'toc-expand' ); +						if ($(this).parents ('.noExpand').length) +						 $tocexpand = false; +						if ($(this).parents ('.noCollapse').length) +						 $tocexpand = true; + +						if ( $tocexpand ) { $toggleLink .text( '-' ) .attr( 'title', mw.msg( 'hidetoc' ) ); 13:23, 26 April 2016 (UTC) timj