Extension talk:TocTree/Archive

wikt:fr:MediaWiki:Gadget-SommaireDeveloppable.js edit

 
An image is worst any explanation

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 ? --GaAs19691 18:46, 16 July 2013 (UTC)Reply

No longer working on version 1.22 or 1.23 Monobook skin edit

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 edit

For wikis that have small and large pages, it can make sense to expand/collapse individual wiki pages only. I.e.:

<div class="noExpand">__TOC__</div>   -- always show collapsed TOC
<div class="noCollapse">__TOC__</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 = $( '<span />' ).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

Return to "TocTree/Archive" page.