Difference between revisions of "MediaWiki talk:Common.js"
Jump to navigation
Jump to search
Percephene (talk | contribs) |
|||
Line 41: | Line 41: | ||
:::Sorry to be a pain! :( {{User:Percephene/sig}} <span style="color:#FF3399"><small>08:26, 28 May 2008</small></span> | :::Sorry to be a pain! :( {{User:Percephene/sig}} <span style="color:#FF3399"><small>08:26, 28 May 2008</small></span> | ||
+ | |||
+ | :::Done d-done done! --[[User:Agent Lex|Lex]] <small>([[User talk:Agent Lex|talk]] - [[Special:Contributions/Agent Lex|contribs]])</small> 14:34, 29 May 2008 (EDT) |
Revision as of 14:34, 29 May 2008
A request for comment has been made for this page. Please add your thoughts!
I would like to have the following code added please, I don't have access:
function userNameReplace() { if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return; for(var i=0; userName = document.getElementsByTagName("span")[i]; i++) { if ((document.getElementById('pt-userpage'))&&(UserName.getAttribute('class') == "insertusername")) { userName.innerHTML = wgUserName; } } } addOnloadHook(userNameReplace);
It allows the Template:Title to work which can then be used to change the title which displays on a page. ~ Percephene ~ talk contribs 02:02, 27 May 2008
- I'll trust you on this. Not that I know what need we'd have to replace a page's title, but... --Lex (talk - contribs) 15:10, 27 May 2008 (EDT)
- Cheers! Bry asked me the same question and I gave a couple examples off the top of my head, but really its not a crucial template, its more a nice to have way of jazzing up a page when used properly ;) If we don't find we use it much, we can always remove it. ~ Percephene ~ talk contribs 07:02, 28 May 2008
- Sorry, I pasted the wrong code, when you get a chance, could you please replace it with this:
function rewriteTitle() { if(typeof(SKIP_TITLE_REWRITE) != 'undefined' && SKIP_TITLE_REWRITE) return; var titleDiv = document.getElementById('title-meta'); if(titleDiv == null || titleDiv == undefined) return; var cloneNode = titleDiv.cloneNode(true); var firstHeading = YAHOO.util.Dom.getElementsByClassName('firstHeading', 'h1', document.getElementById('content') )[0]; var node = firstHeading.childNodes[0]; firstHeading.replaceChild(cloneNode, node); cloneNode.style.display = "inline"; var titleAlign = document.getElementById('title-align'); firstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue; } addOnloadHook(rewriteTitle, false);
- Sorry to be a pain! :( ~ Percephene ~ talk contribs 08:26, 28 May 2008