MediaWiki:Button.js

(function($, mw) {   'use strict';    var nsNr = mw.config.get('wgNamespaceNumber');    if (nsNr < 0 || window.watchButtonsLoaded || document.getElementById('control_watch')) {        return;    }    window.watchButtonsLoaded = true; // prevent duplicate running (but not dupe buttons from outside this code)    $(addwatchButton);    function watchPage {        var page = encodeURIComponent(mw.config.get('wgPageName'));        $.get('/index.php?title=' + page + '&action=watch', function { location.reload(true); });       $('html,body').css({ display: 'block', overflow: 'hidden' });       $(' ').appendTo(document.body)            .css('height', $(window).height);    }    function addOasiswatchButton {        $('.WikiaPageHeader > .wikia-menu-button').after('watch');   }    function addwatchButton {        switch (mw.config.get('skin')) {            case 'monobook':                $('#p-cactions > .pBody > ul').append('' + 'watch');               break;            case 'oasis':            case 'wikia':                addOasiswatchButton;                $('#watch').css('margin', '3px 0 0 13px');                break;        }        $('#watch').click(watchPage);    } }(jQuery, mediaWiki));