This page is "edit" protected. The "autoconfirmed" right is required to "edit" this page.<ul class='mw-logevent-loglines'> <li data-mw-logid="60476" data-mw-logaction="protect/protect" class="mw-logline-protect"> <a href="/index.php?title=Special:Log&amp;logid=60476" title="Special:Log">18:54, 7 November 2024</a> <a href="/User:Coalson" class="mw-userlink" title="User:Coalson"><bdi>Coalson</bdi></a> <span class="mw-usertoollinks mw-changeslist-links"><span><a href="/User_talk:Coalson" class="mw-usertoollinks-talk" title="User talk:Coalson">talk</a></span> <span><a href="/Special:Contributions/Coalson" class="mw-usertoollinks-contribs" title="Special:Contributions/Coalson">contribs</a></span></span> protected <a href="/Template:USERNAME/USERNAME.js" title="Template:USERNAME/USERNAME.js">Template:USERNAME/USERNAME.js</a> [Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite) <span class="mw-logevent-actionlink">(<a href="/index.php?title=Template:USERNAME/USERNAME.js&amp;action=history&amp;offset=20241107185422" title="Template:USERNAME/USERNAME.js">hist</a>)</span> </li> </ul></ul>
This page is "move" protected. The "autoconfirmed" right is required to "move" this page.<ul class='mw-logevent-loglines'> <li data-mw-logid="60476" data-mw-logaction="protect/protect" class="mw-logline-protect"> <a href="/index.php?title=Special:Log&amp;logid=60476" title="Special:Log">18:54, 7 November 2024</a> <a href="/User:Coalson" class="mw-userlink" title="User:Coalson"><bdi>Coalson</bdi></a> <span class="mw-usertoollinks mw-changeslist-links"><span><a href="/User_talk:Coalson" class="mw-usertoollinks-talk" title="User talk:Coalson">talk</a></span> <span><a href="/Special:Contributions/Coalson" class="mw-usertoollinks-contribs" title="Special:Contributions/Coalson">contribs</a></span></span> protected <a href="/Template:USERNAME/USERNAME.js" title="Template:USERNAME/USERNAME.js">Template:USERNAME/USERNAME.js</a> [Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite) <span class="mw-logevent-actionlink">(<a href="/index.php?title=Template:USERNAME/USERNAME.js&amp;action=history&amp;offset=20241107185422" title="Template:USERNAME/USERNAME.js">hist</a>)</span> </li> </ul></ul>

Template:USERNAME/USERNAME.js

From Soyjak Wiki, the free ensoyclopedia
Jump to navigationJump to search
/* 
 * Script Name: InputUsername
 * Author: Ihojose
 *
 * Adds the username of the user viewing the page.
 * Only works for logged in users.
 *
 * Added by Spottra 5-Apr-2015:
 * Individual users can define "window.disableUsernameReplace = true;" in their
 * global.js or local common.js file to disable the replacement for themselves if
 * they so desire.
 */

;(function ($, mw) {
    'use strict';
    var username = mw.config.get('wgUserName');
    if (
        window.disableUsernameReplace ||
        !username
    ) {
        return;
    }
    window.disableUsernameReplace = true;
    var $rail = $('#WikiaRail'),
        customSelector = window.UsernameReplaceSelector
            ? ', ' + window.UsernameReplaceSelector
            : '';
    function inputUsername($content) {
        $content.find('.InputUsername, .insertusername' + customSelector).text(username);
    }
    mw.hook('wikipage.content').add(inputUsername);
    if ($rail.hasClass('loaded')) {
        inputUsername($rail);
    } else if ($rail.length) {
        $rail.on('afterLoad.rail',
            inputUsername.bind(null, $rail)
        );
    }
}