FANDOM


//
/************************************/
/* PageMakerPro.                    */
/* Written by: Shining-Armor. */
/* License: GPL v2.                 */
/************************************/
 
(function ($, mw, window) {
 
    /***************************************************/
    /* i18n: Please contribute translations here only! */
    /***************************************************/
 
    var i18n = {
       "en": {
            formTitle: "Create a New Page",
            formStart: "Create",
            formCancel: "Close",
            formPage: "Special:New_Page",
            formMain: "Main",
            formBlog: "Blog",
            formCat: "Category",
            formMW: "MediaWiki",
            formTemp: "Template",
            formCont: "Page Content",
            formBlank: "Blank",
            formPop: "Populated"
        },
 
       "fr": {
            formTitle: "Créer une nouvelle page",
            formStart: "Créer",
            formCancel: "Fermer",
            formPage: "Spécial:Nouvelle_Page",
            formMain: "Principal",
            formBlog: "Blog",
            formCat: "Catégorie",
            formMW: "MediaWiki",
            formTemp: "Modèle",
            formCont: "Contenu de la page",
            formBlank: "Vide",
            formPop: "Complétée"
        },
 
        "es": {
            formTitle: "Crear una nueva página",
            formStart: "Crear",
            formCancel: "Cerrar",
            formPage: "Especial:Nueva_Página",
            formMain: "Portada",
            formBlog: "Blog",
            formCat: "Categoría",
            formMW: "MediaWiki",
            formTemp: "Plantilla",
            formCont: "Contenido",
            formBlank: "En blanco",
            formPop: "Completa"
        },
 
        "lt": {
            formTitle: "Sukurti naują puslapį",
            formStart: "Sukurti",
            formCancel: "Uždaryti",
            formPage: "Specialus:Naujas_puslapis",
            formMain: "Pagrindinis",
            formBlog: "Blog'as",
            formCat: "Kategorija",
            formMW: "MediaWiki",
            formTemp: "Šablonas",
            formCont: "Lapo turinys",
            formBlank: "Tusčias",
            formPop: "Populiarus"
        },
 
        "pl": {
            formTitle: "Utwórz nową stronę",
            formStart: "Utwórz",
            formCancel: "Zamknij",
            formPage: "Specjalna:Utwórz_stronę",
            formMain: "Główna",
            formBlog: "Blog",
            formCat: "Kategoria",
            formMW: "MediaWiki",
            formTemp: "Szablon",
            formCont: "Treść strony",
            formBlank: "Pusta",
            formPop: "Zapełniona"
        },
 
       "nl": {
            formTitle: "Maak een nieuwe pagina",
            formStart: "Maak",
            formCancel: "Sluit",
            formPage: "Special:New_Page",
            formMain: "Main",
            formBlog: "Blog",
            formCat: "Categorie",
            formMW: "MediaWiki",
            formTemp: "Sjabloon",
            formCont: "Paginainhoud",
            formBlank: "Leeg",
            formPop: "Vol"
        },
    };
 
    /****************************************************/
    /* End of i18n. Please don't change anything below. */
    /****************************************************/
 
    /* Variables for use in the script */
    var server = mw.config.get("wgServer");
    var skin = mw.config.get("skin");
    var lang = mw.config.get("wgUserLanguage");
    var page = mw.config.get("wgPageName");
    var formHTML = '<form class="wikiaform"><fieldset id="page-create-fieldset"><input type="radio" name="namespace" value="main" checked="checked">' + i18n[lang].formMain + '</input><input type="radio" name="namespace" value="blog">' + i18n[lang].formBlog + '</input><input type="radio" name="namespace" value="category">' + i18n[lang].formCat + '</input><input type="radio" name="namespace" value="mediawiki">' + i18n[lang].formMW + '</input><input type="radio" name="namespace" value="template">' + i18n[lang].formTemp + '</input><br/><br/><input type="text" id="NewPageTitle" style="width: 80%;" placeholder="Page title"/><br/><br/><span>' + i18n[lang].formCont + ': </span><input type="radio" name="pagecontent" value="blank" checked="checked">' + i18n[lang].formBlank + '</input><input type="radio" name="pagecontent" value="populated">' + i18n[lang].formPop + '</input><br /><br /></fieldset></form>';
    var monobookHTML = '<fieldset id="page-create-fieldset" style="width: 70%;"><legend>' + i18n[lang].formTitle + '</legend><input type="radio" name="namespace" value="main" checked="checked">' + i18n[lang].formMain + '</input><input type="radio" name="namespace" value="blog">' + i18n[lang].formBlog + '</input><input type="radio" name="namespace" value="category">' + i18n[lang].formCat + '</input><input type="radio" name="namespace" value="mediawiki">' + i18n[lang].formMW + '</input><input type="radio" name="namespace" value="template">' + i18n[lang].formTemp + '</input><br/><br/><input type="text" id="NewPageTitle" style="width: 80%;" placeholder="Page title"/><br/><br/><span>' + i18n[lang].formCont + ': </span><input type="radio" name="pagecontent" value="blank" checked="checked">' + i18n[lang].formBlank + '</input><input type="radio" name="pagecontent" value="populated">' + i18n[lang].formPop + '</input><br /><br /><button id="create-button" style="float: right;">' + i18n[lang].formStart + '</button></fieldset>';
 
    if (skin == "oasis" || skin == "wikia") {
        $("nav.contribute").find("ul").append('<li id="pagemakerpro"><a href="javascript:void(0)">Create Page<sup>(beta)</sup></a></li>');
        $("#pagemakerpro").click(function () {
            makeForm();
        });
    } else {
        if (page != i18n[lang].formPage) {
            $("#p-tb ul").append('<li><a href="' + server + '/wiki/' + i18n[lang].formPage + '">' + i18n[lang].formTitle + '</a></li>');
        } else {
            makePage();
        }
    }
 
    function makeForm() {
        $.showCustomModal(i18n[lang].formTitle, formHTML, {
            id: "page-create",
            width: 500,
            buttons: [{
                id: "page-create-close",
                message: i18n[lang].formCancel,
                handler: function () {
                    $("#page-create").closeModal();
                }
            }, {
                id: "page-create-go",
                defaultButton: true,
                message: i18n[lang].formStart,
                handler: function () {
                    redirectWindow();
                }
            }]
        });
    }
 
    function makePage() {
        $("title").text("Page Create");
        $("#bodyContent").html(monobookHTML);
        $("#create-button").click(function () {
            redirectWindow();
        });
    }
 
    function redirectWindow() {
        var namespace = $("input[name=namespace]:checked").val();
        var target = $("#NewPageTitle").val();
        var populated = $("input[name=pagecontent]:checked").val();
        var link = server + '/wiki/';
 
        switch (namespace) {
            case "main":
                link = target + '?action=edit';
 
                if (populated == "populated") {
                    link += '&useFormat=1';
                }
                break;
            case "blog":
                link += 'Special:CreateBlogPage';
                break;
            case "category":
                link += i18n[lang].formCat + ':' + target + '?action=edit';
                break;
            case "mediawiki":
                link += i18n[lang].formMW + ':' + target + '?action=edit';
                break;
            case "template":
                link += i18n[lang].formTemp + ':' + target + '?action=edit';
                break;
            default:
                break;
        }
        window.location = link;
    }
}(this.jQuery, this.mediaWiki, this));
//

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.