Page MenuHomePhabricator

Username as Magic Word
Closed, DuplicatePublic

Description

Author: electrawn

Description:
I would like to be able to import the username into a mediawiki page. I
understand the cache problem and may have a workaround. Seems the username is
already exposed under javascript, we can rely on javascript to write the
username in as needed.

So for {{username}} the cacheable text would be

<script type="text/javascript">document.write(wgUserName)</script>

Thoughts?


Version: unspecified
Severity: enhancement

Details

Reference
bz7397

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:27 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz7397.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

Relying on JavaScript for display is very bad for accessibility. Not all
clients support it, in particular mobile devices. Therefore, most people would
see their name but some would not, and I can't see any satisfactory *general*
fallback here (unlike for all the other JavaScript we currently package).

Of course, should someone want this, they could add it themselves to
Monobook.js: you don't need a magic word, just a reserved class that you hunt
down and fill in. But please don't, at least not on Wikimedia projects, unless
there's a good fallback for each and every use. (For instance, a "Welcome to
Wikipedia, username!" box could have display: none; by default, and then that
would be changed by the same JavaScript that adds the name, so people without
JavaScript just don't see the box.)

electrawn wrote:

Sure, we could add it to Monobook, if we want to make our editors jump through a
flaming hoop.

This situation is what I would like to solve:

http://en.wikipedia.org/wiki/Wikipedia:AMA_Requests_for_Assistance

Currently, the two step process is overly complex. Wouldn't it be easier to just do:

[[Wikipedia:AMA Requests for Assistance/Requests/{{CURRENTMONTH}}
{{CURRENTYEAR}}/{{USERNAME}}|Click Here to file a RfA Blah Blah]]

and have the user click the red link?

No, User has to Copy and Paste and further hoop jumping using an inputbox to
even get to the RFA page, which is then another problem for a different bug.

Solution? Magic Word or javascript/skin specific Clientside Magic Words.

robchur wrote:

*** This bug has been marked as a duplicate of 4196 ***