MediaWiki:Vector.js

/* Any JavaScript here will be loaded for users using the Vector skin */

/** * Hide prefix in category * * @source https://www.mediawiki.org/wiki/Snippets/Hide_prefix_in_category * @rev 5 */

var prefix = $.trim( $( '#mw-cat-hideprefix' ).text ) || ( mw.config.get( 'wgTitle' ) + '/' ); $( '#mw-pages' ).find( 'a' ).text( function ( i, val ) {   return val.slice( 0, prefix.length ) === prefix ? val.slice( prefix.length ) : val; } );

/** * Hide firstheading * @author mwjames */ mw.loader.using( 'jquery.mwExtension', function {  var hidefirstheading = $( '#smw-hide-firstheading' );  if ( hidefirstheading.length ) {        // Hide firstHeading        $( '#content' ).find( '#firstHeading' ).hide;  } } );

/** * Tab/Panel right slide * @author mwjames */

$("#panel-tab").click( function (event) {	event.stopPropagation;	showIfNotVisible( "#panel-content" ); } );

function showIfNotVisible( element ) { var width = $( '#panel' ).find( 'table').width + 8; if ( $(element).css( "width" ) == width + 'px' ) $(element).animate( { width: 4 }, 1500); else $(element).animate( { width: width }, 1500); };

$( function {	var element = $("#panel-content"),	status = element.attr( 'class' ),	width = element.find( 'table').width + 8;

if ( status === 'close' ){ element .width( width ) .animate( { width: 4 }, 1200); } else { element .width( width ); } } );

/** * Modified bootstrap class for tables * * Causes a "ReferenceError: importStylesheet is not defined" * importStylesheet('MediaWiki:Bootstrap.css'); */

/** * Additional linked icon for the searchlabel of result format "feed" * * @since 1.9.0 * * @rev 1 * @author mwjames */ $( '.smw-feed-furtherresults > a' ).addClass( 'feedlink' );

/** * Prepend w3c validation url * * @since 1.9.0 * * @rev 1 * @author mwjames */ $( '.feed-validation' ).find( 'a' ) .attr( 'href','https://validator.w3.org/check?uri=https://www.semantic-mediawiki.org' +	$( '.feed-validation' ).find( 'a' ).attr( 'href' ) ) .removeClass( 'feedlink' );