Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Difference between revisions of "MediaWiki:Common.js"

From PCGamingWiki, the wiki about fixing PC games
Line 3: Line 3:
 
var $this = $(this);
 
var $this = $(this);
 
if ($this.attr('id') !== undefined) {
 
if ($this.attr('id') !== undefined) {
$('<span></span><a></a>').text('Link here').attr({title: 'Link here', href: '#'+$this.attr('id')}).wrap('<span class="mw-linkhere"></span>').appendTo(this);
+
$('<span>- </span><a></a>').text('Link here').attr({title: 'Link here', href: '#'+$this.attr('id')}).wrap('<span class="mw-linkhere"></span>').appendTo(this);
 
}
 
}
 
});
 
});

Revision as of 14:28, 11 September 2012

function addAnchorInHeaders() {
	$('span.mw-headline', '#mw-content-text').each(function() {
		var $this = $(this);
		if ($this.attr('id') !== undefined) {
			$('<span>- </span><a></a>').text('Link here').attr({title: 'Link here', href: '#'+$this.attr('id')}).wrap('<span class="mw-linkhere"></span>').appendTo(this);
		}
	});
}

$(addAnchorInHeaders);