MediaWiki:PowerPageMaker.js

//Original code by User:Deadcoder //Script made by User:Prince(ss) Platinum var PowerPageMakerLangPacks = new Object; $(function { PowerPageMakerLangPacks.en = {    New_Page: "New_Page",    NewPage: "New Page",    CreateANewPage: "Create A New Page",    main: "Main",    blog: "Blog",    category: "Category:",    MediaWiki: "MediaWiki:",    Template: "Template:",    Forum: "Forum",    PageTitle: "Page Title",    PageContent: "Page Content",    Blank: "Blank",    Populated: "Populated",    Create: "Create",    NeedName: "Please give the name of a page to create.",    BlogURL: "Special:CreateBlogPage",    forumDomain: "Topic:",    genericError: "Error" }; PowerPageMakerLangPacks.es = {    New_Page: "Nueva_página",    NewPage: "Nueva página",    CreateANewPage: "Crear una nueva página",    main: "Principal",    blog: "Blog",    category: "Categoría:",    MediaWiki: "MediaWiki:",    Template: "Plantilla:",    Forum: "Foro",    PageTitle: "Título de la página",    PageContent: "Contenido de la página:",    Blank: "Vacío", Populated: "Lleno", Create: "Crear", NeedName: "Por favor, indica el nombre de la página para crear.", BlogURL: "Especial:PublicarEnBlog", forumDomain: "Foro:", genericError: "Hay problema(s)." }; PowerPageMakerLangPacks.fr = { New_Page: "Nouvelle_page", NewPage: "Nouvelle page", CreateANewPage: "Créer une nouvelle page", main: "Principal", blog: "Blog", category: "Catégorie:", MediaWiki: "MediaWiki:", Template: "Modèle:", Forum: "Forum", PageTitle: "Titre de la page", PageContent: "Contenu de la page:", Blank: "Vide", Populated: "Complétée", Create: "Créer", NeedName: "Veuillez écrire le titre de la page à créer.", BlogURL: "Spécial:CreateBlogPage", forumDomain: "Sujet:", genericError: "ERREUR" }; PowerPageMakerLangPacks.lt = { New_Page: "Naujas_puslapis", NewPage: "Naujas puslapis", CreateANewPage: "Sukurti naują puslapį", main: "Pagrindinis", blog: "Blog\'as", category: "Kategorija:", MediaWiki: "MediaWiki:", Template: "Šablonas:", Forum: "Forum", PageTitle: "straipsnio antraštė", PageContent: "Lapo turinys:", Blank: "Tusčias", Populated: "Populiarus", Create: "Sukurti", NeedName: "Prašome įrašyti puslapio pavadinimą prieš sukuriant jį", BlogURL: "Specialus:CreateBlogPage", forumDomain: "FAULT", genericError: "klaida" }; PowerPageMakerLangPacks.pl = { New_Page: "Nowa_Strona", NewPage: "Nowa Strona", CreateANewPage: "Utwórz nową stronę", main: "Główna", blog: "Blog", category: "Kategoria:", MediaWiki: "MediaWiki:", Template: "Szablon:", Forum: "Forum", PageTitle: "Tytuł strony", PageContent: "Zawartość strony:", Blank: "Pusta", Populated: "Popularna", Create: "Utwórz", NeedName: "Proszę podać nazwę strony do utworzenia.", BlogURL: "Specjalna:Utwórz_wpis_na_blogu", forumDomain: "Temat:", genericError: "BŁĄD" }; PowerPageMakerLangPacks.ca = { New_Page: "Nova_pàgina", NewPage: "Nova pàgina", CreateANewPage: "Crea una nova pàgina", main: "Principal", blog: "Blog", category: "Categoria:", MediaWiki: "MediaWiki:", Template: "Plantilla:", Forum: "Fòrum", PageTitle: "Títol de la pàgina", PageContent: "Contingut de la pàgina:", Blank: "Buit", Populated: "Ple", Create: "Crea", NeedName: "Si us plau, indica el nom de la pàgina per crear.", BlogURL: "Especial:CreateBlogPage", forumDomain: "FAULT", genericError: "Hi ha problemes." }; PowerPageMakerLangPacks.pt = { New_Page: "Nova_página", NewPage: "Nova página", CreateANewPage: "Criar uma nova página", main: "Principal", blog: "Blogue", category: "Categoria:", MediaWiki: "MediaWiki:", Template: "Predefinição:", Forum: "Fórum", PageTitle: "Título da página", PageContent: "Conteúdo da página:", Blank: "Vazio", Populated: "Cheio", Create: "Criar", NeedName: "Faz favor, indica o nome da página para criar.", BlogURL: "Especial:CreateBlogPage", forumDomain: "FAULT", genericError: "Há problema(s)." }; PowerPageMakerLangPacks.it = { New_Page: "Nuovo_articolo", NewPage: "Nuovo articolo", CreateANewPage: "Crea una pagina", main: "Principale", blog: "Blog", category: "Categoria:", MediaWiki: "MediaWiki:", Template: "Template:", Forum: "Forum", PageTitle: "Titolo", PageContent: "Contenuto della pagina:", Blank: "Bianco", Populated: "Popolata", Create: "Crea", NeedName: "È necessario un nome.", BlogURL: "Speciale:CreaNuovoPost", forumDomain: "Argomento:", genericError: "ERRORE" }; PowerPageMakerLangPacks.nl = { New_Page: "Pagina_toevoegen", NewPage: "Pagina toevoegen", CreateANewPage: "Maak een nieuwe pagina", main: "Primair", blog: "Blog", category: "Categorie:", MediaWiki: "MediaWiki:", Template: "Sjabloon:", Forum: "Forum", PageTitle: "Titel", PageContent: "Pagina Inhoud:", Blank: "Wit", Populated: "Bevolkte", Create: "Maken", NeedName: "Noodzaak van een naam.", BlogURL: "Speciaal:CreateBlogPage", forumDomain: "FAULT", genericError: "ERRORE" };   var lang = wgPageContentLanguage; var langpacks = PowerPageMakerLangPacks; $(function {        for (var j = 0; j < document.getElementsByClassName("createpage").length; j++) {            document.getElementsByClassName("createpage")[j].addEventListener("click", function  { setTimeout(function {                    window.location.replace("http://" + location.hostname + "/wiki/" + langpacks[lang].New_Page);                }, 314); });       }        $("#p-search").ready(function{ $("#p-search").append('' + langpacks[lang].NewPage + ' '); });      $("#quickbar").ready(function{ $("#quickbar").append('' + langpacks[lang].NewPage + ' '); });   });    if (mw.config.get("wgPageName") == langpacks[lang].New_Page) { var html = '  ' + langpacks[lang].CreateANewPage + ' ' + langpacks[lang].main + ' ' + langpacks[lang].blog + ' ' + langpacks[lang].category + ' ' + langpacks[lang].MediaWiki + ' ' + langpacks[lang].Template + ' ' + langpacks[lang].Forum + '     ' + langpacks[lang].PageContent + ': ' + langpacks[lang].Blank + ' <input type="radio" name="pagecontent" value="populated">' + langpacks[lang].Populated + ' <button id="createpage" type="button" style="float: right; height:2.5em; width:10em; font-weight:700;" type="button" onclick="PowerPageMakerMakeNewPage;">' + langpacks[lang].Create + '  '; $("#WikiaArticle").ready(function{      $("#WikiaArticle").html(html);    }); $("#bodyContent").ready(function{      $("#bodyContent").html(html);    }); $("#article").ready(function{      $("#article").html(html);    }); } }); function PowerPageMakerMakeNewPage {    var lang = wgPageContentLanguage;    var langpacks = PowerPageMakerLangPacks;    var namespace,        pagetosend = document.getElementById("NewPageTitle").value || "NULL",        content;    if (pagetosend === "NULL") {        alert(langpacks[lang].NeedName);        return;    }    var radioname = document.getElementsByName("namespace"),        radiocont = document.getElementsByName("pagecontent");    for (var i = 0; i < radioname.length; i++) {        if (radioname[i].checked) {            namespace = radioname[i].value;            break;        }    }    for (i = 0; i < radiocont.length; i++) {        if (radiocont[i].checked) {            content = radiocont[i].value;            break;        }    }    var wgServer = mw.config.get("wgServer") + '/wiki/';    var link;    switch (namespace) {        case "main":            link = wgServer + pagetosend + '?action=edit'; break; case "blog": link = wgServer + langpacks[lang].BlogURL; if (langpacks[lang].BlogURL === "FAULT") { alert(langpacks[lang].genericError); return; }           break; case "category": link = wgServer + langpacks[lang].category + pagetosend + '?action=edit'; break; case "mediawiki": link = wgServer + langpacks[lang].MediaWiki + pagetosend + '?action=edit'; break; case "template": link = wgServer + langpacks[lang].Template + pagetosend + '?action=edit'; break; case "forum": link = wgServer + langpacks[lang].forumDomain + pagetosend + '?openEditor=1'; if (langpacks[lang].forumDomain === "FAULT") { alert(langpacks[lang].genericError); return; }           break; default: alert(langpacks[lang].genericError); return; }   if ((content === 'populated') && (namespace !== 'forum') && (namespace !== 'mediawiki') && (namespace !== 'blog')) { link += "&useFormat=1"; }   window.location = link; } //