Board Thread:Support Requests - Getting Technical/@comment-25793496-20140621163544/@comment-5454372-20140622091446

First off: this will only work the way you want if you are an admin on your wiki. If not, it's possible to make this work for yourself only -- no-one else looking at your blog will see the text changing to their username.

I'll refer to Fubuki's code, since Lynque's instructions involve editing certain bits of the one I provided (much appreciated, but guessing Coolboy87 may find it a little confusing at this point).

The first thing you need to do is to copy Fubuki's javascript sample (the colourful text with random $ signs and brackets all over the place). You need to paste that into your wiki's MediaWiki:Common.js file (if it's never been edited before, it'll say something along the lines of "This page needs to be created"). Doing this "installs" your desired function to your wiki.

Once you've done that, applying  to anything on a page should cause it to show the username of whoever's looking at the page. The easiest way to do that is to copy the following:

Clicking this text will show username

The thing above won't generate a button, but it WILL change the text if it's clicked on. If you want a button, change  to

That's probably about as simple as I can explain it. You can get a little fancier with it, but that may be better explored later when you can see how some of the code resembles HTML.

Many thanks for the crash course, Lynque and Fubuki -- I'm finding javascript a little harder to crack open compared to CSS ^^;