summaryrefslogtreecommitdiff
path: root/extensions/Vector/modules/ext.vector.footerCleanup.js
blob: 7c4b689848ee0f470632c539463d0aa7fa1fc6b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
 * Footer cleanup for Vector
 */
( function ( $ ) {
	// Wait for onload to remove edit help and "|" after cancel link.
	window.onload = function () {
		// Only if advanced editor is found.
		if ( 'wikiEditor' in $ ) {
			$( '.editButtons' ).find( '.editHelp' ).remove();
			// Remove the "|" from after the cancelLink.
			var $cancelLink = $( '#mw-editform-cancel' );
			$cancelLink.parent().empty().append( $cancelLink );
			// Adjustment for proper right side alignment with WikiEditor.
			$( '.editOptions, #editpage-specialchars' ).css( 'margin-right', '-2px' );
		}
	};
	// Waiting until dom ready as the module is loaded in the head.
	$( document ).ready( function () {
		// Make "Templates used" a collapsible list.
		$( '.templatesUsed ul' ).footerCollapsibleList( {
			name: 'templates-used-list',
			title: mw.msg( 'vector-footercleanup-templates' )
		} );

		// Make "Hidden categories" a collapsible list.
		$( '.hiddencats ul' ).footerCollapsibleList( {
			name: 'hidden-categories-list',
			title: mw.msg( 'vector-footercleanup-categories' )
		} );
	} );
} ( jQuery ) );