MediaWiki:Gadget-titleparenthesis.js

$(function {    var conf = mw.config.get([ 'wgNamespaceNumber', 'wgTitle', 'wgAction' ]);

if (conf.wgNamespaceNumber !== 0 || conf.wgTitle.lastIndexOf('(') < 0 || conf.wgAction !== 'view' || $('.no-parenthesis-style').length) {		return;	} 	// use the title in the DOM so this respects DISPLAYTITLE	var title = mw.html.escape($('h1#firstHeading').text),		start = title.lastIndexOf('('), end = title.substring(start, title.length).lastIndexOf(')');

// add offset here end += start + 1; $('h1#firstHeading') .empty .append(			title.substring(0, start),			$(' ')				.addClass('title-parenthesis')				.html(title.substring(start, end)),			title.substring(end, title.length)		); });