MediaWiki:Common.js: Difference between revisions

Reverted to revision 29804 by K6ka (talk) (TW)
(stuff from Wikipedia)
(Reverted to revision 29804 by K6ka (talk) (TW))
 
(5 intermediate revisions by 3 users not shown)
Line 756:
 
/* END adds show/hide-button to navigation bars */
 
// *************************************************
// Pagetitle rewrite
//
// Rewrites the page's title, used by Template:Title
// *************************************************
$(function() {
if ($('#title-meta').length) {
var newTitle = mw.html.escape($("#title-meta").html());
// Allow italics
newTitle = newTitle.replace(/&lt;(\/?i)&gt;/g, '<$1>');
var edits = $("#user_masthead_since").text();
$(".firstHeading").html(newTitle);
$("#user_masthead_head h2").html(newTitle + "<small id='user_masthead_since'>" + edits + "</small>");
}
});
$(function changeTitle(){
if (!$('span.newPageTitle').html()) {
return;
}
$('h1.page-header__title').html($('span.newPageTitle').html());
});
 
/* END Pagetitle */