FANDOM


//
;(function (mw, $, window) {
    'use strict';
 
    var seconds = 5, start = true, redirectUrl, title, interval;
 
    function removeInterval() {
        mw.util.jsMessage();
        window.clearInterval(interval);
        start = false;
    }
 
    function showCountdown () {
        if (!start) {
            removeInterval();
            return;
        }
        mw.util.jsMessage(
            '<div style="color: black; text-align: center; font-size: 15px; font-weight: bold;">' +
                'redirecting to ' + title + ' in ' + seconds + ' seconds ' +
                '<input id="cancel" type="button" value="cancel" style="vertical-align: middle; margin-left: 10px;" />' +
            '</div>'
        );
        $('#cancel').click(removeInterval);
    }
 
    function showMessage () {
        if (seconds) {
            showCountdown();
        } else {
            removeInterval();
            $(document.body).startThrobbing();
            location.href = redirectUrl;
        }
        seconds--;
    }
 
    function redirect () {
        showMessage();
        interval = window.setInterval(showMessage, 1000);
    }
 
    if (mw.config.get('wgUserName')) {
        $(function () {
            var isMissingArticle = Boolean(window.document.querySelector('.noarticletext')),
                isMissingFile    = Boolean(window.document.getElementById('mw-imagepage-nofile'));
            if (!isMissingArticle && !isMissingFile) {
                return;
            }
            title = isMissingFile ? 'Special:Upload' : 'Special:CreatePage';
            redirectUrl = mw.config.get('wgServer') +
                          mw.config.get('wgArticlePath').replace(/\$1/, title) +
                          (isMissingFile ? '?wpDestFile=' : '?wpTitle=') +
                          mw.config.get('wgTitle');
            if (window.document.hasFocus && window.document.hasFocus()) {
                redirect();
            } else {
                $(window).one('focus', redirect);
            }
        });
    }
}(mediaWiki, jQuery, window));
//

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.