From Test-Scratch-Wiki

< User:-iviedwall-

(Removed unused interwikis)
(Added link)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Remove lang attribute from editor so the font is more readable (not having syntax highlight is enough) */
+
var delayInMilliseconds = 500; //.5 seconds
document.getElementById("wpTextbox1").removeAttribute("lang");
+
setTimeout(function() {
/* Add semicolon */
+
    /* Remove lang attribute from editor so the font is more readable (not having syntax highlight is enough) */
const scDiv = document.createElement("div");
+
    if (['edit', 'submit'].includes(mw.config.get('wgAction'))) { //Only work if you are editing, otherwise the getElementById will return NULL and my code will break
const semicolon = document.createTextNode("  ;");
+
        document.getElementById("wpTextbox1").removeAttribute("lang")
scDiv.appendChild(semicolon);
+
    }
const notNav = document.getElementById("not-nav");
+
    console.log('Successfully changed editor appearance')
notNav.appendChild(scDiv);
+
 
/* Add status to left navbar */
+
    /* Add semicolon */
const statusLI = document.createElement("li");
+
    const scDiv = document.createElement("div")
statusLI.setAttribute("id", "n-Your-Status");
+
    const semicolon = document.createTextNode("  ;")
const statusLink = document.createElement("a");
+
    scDiv.appendChild(semicolon)
statusLink.setAttribute("href", "/wiki/Special:MyPage/status");
+
    const notNav = document.getElementById("not-nav")
statusLink.appendChild(document.createTextNode("Your Status"));
+
    notNav.appendChild(scDiv)
statusLI.appendChild(statusLink);
+
    console.log('Successfully added semicolons')
const nEdit = document.getElementById("n-Edit");
+
 
const parentBox = nEdit.parentNode;
+
    /* Add links to left navbar */
parentBox.insertBefore(statusLI, nEdit)
+
    const statusLI = document.createElement("li")
/* Removing some interwikis since I don't use them */
+
    statusLI.setAttribute("id", "n-Your-Status")
document.getElementById("n-.3D.3D.3D.3D.3D-TEST-.3D.3D.3D.3D.3D").remove();
+
    const statusLink = document.createElement("a")
document.getElementById("n-Italiano").remove();
+
    statusLink.setAttribute("href", "/wiki/Special:MyPage/status")
document.getElementById("n-Espa.C3.B1ol").remove();
+
    statusLink.appendChild(document.createTextNode("Your Status"))
document.getElementById("n-Portugu.C3.AAs").remove();
+
    statusLI.appendChild(statusLink)
document.getElementById("n-Polski").remove();
+
    const nEdit = document.getElementById("n-Edit")
document.getElementById("n-T.C3.BCrk.C3.A7e").remove();
+
    const parentBox1 = nEdit.parentNode
document.getElementById("n-.ED.95.9C.EA.B5.AD.EC.96.B4").remove();
+
    parentBox1.insertBefore(statusLI, nEdit)
document.getElementById("n-.E0.A4.B9.E0.A4.BF.E0.A4.A8.E0.A5.8D.E0.A4.A6.E0.A5.80").remove();
+
 
document.getElementById("n-.D7.A2.D7.91.D7.A8.D7.99.D7.AA").remove();
+
    const enwikiLI = document.createElement("li")
document.getElementById("n-Sloven.C5.A1.C4.8Dina").remove();
+
    enwikiLI.setAttribute("id", "n-English-Wiki")
document.getElementById("n-.D8.A7.D9.84.D8.B9.D8.B1.D8.A8.D9.8A.D8.A9").remove();
+
    const enwikiLink = document.createElement("a")
document.getElementById("n-Latina").remove();
+
    enwikiLink.setAttribute("href", "https://en.scratch-wiki.info")
document.getElementById("n-.D1.83.D0.BA.D1.80.D0.B0.D1.97.D0.BD.D1.81.D1.8C.D0.BA.D0.B0-.D0.BC.D0.BE.D0.B2.D0.B0").remove();
+
    enwikiLink.appendChild(document.createTextNode("English Wiki"))
document.getElementById("n-Shqip").remove();
+
    enwikiLI.appendChild(enwikiLink)
document.getElementById("n-.E0.A6.AC.E0.A6.BE.E0.A6.82.E0.A6.B2.E0.A6.BE").remove();
+
    const recentChanges = document.getElementById("n-recentchanges")
document.getElementById("n-.E0.AA.97.E0.AB.81.E0.AA.9C.E0.AA.B0.E0.AA.BE.E0.AA.A4.E0.AB.80").remove();
+
    const parentBox2 = recentChanges.parentNode
document.getElementById("n-Rom.C3.A2n.C4.83").remove();
+
    parentBox2.insertBefore(enwikiLI, recentChanges)
document.getElementById("n-.C4.8De.C5.A1tina").remove();
+
 
document.getElementById("n-Slov.C3.A1k").remove();
+
    const zhwikiLI = document.createElement("li")
document.getElementById("n-Malti").remove();
+
    zhwikiLI.setAttribute("id", "n-Chinese-Wiki")
document.getElementById("n-Suomi").remove();
+
    const zhwikiLink = document.createElement("a")
document.getElementById("n-.3D.3D.3D.3D.3D-DEMO-.3D.3D.3D.3D.3D").remove();
+
    zhwikiLink.setAttribute("href", "https://test.scratch-wiki.info/wiki/Zho:首页")
document.getElementById("n-.3D.3D.3D.3D.3D-REAL-.3D.3D.3D.3D.3D").remove();
+
    zhwikiLink.appendChild(document.createTextNode("中文维基"))
document.getElementById("n-Deutsch").remove();
+
    zhwikiLI.appendChild(zhwikiLink)
document.getElementById("n-Bahasa-Indonesia").remove();
+
    parentBox2.insertBefore(zhwikiLI, recentChanges)
document.getElementById("n-Magyar").remove();
+
 
document.getElementById("n-Nederlands").remove();
+
    /* Removing unnecessary tools on the left of the page */
document.getElementById("n-.D0.A0.D1.83.D1.81.D1.81.D0.BA.D0.B8.D0.B9").remove();
+
    document.getElementById("n-mainpage-description").remove()
document.getElementById("n-.E6.97.A5.E6.9C.AC.E8.AA.9E").remove();
+
    document.getElementById("n-FAQ").remove()
document.getElementById("n-Fran.C3.A7ais").remove();
+
    document.querySelector('[aria-label="For Authors"]').remove()
 +
    document.querySelector('[aria-label="Scratch Wikis"]').remove()
 +
    console.log('Successfully changed sidebar tools')
 +
}, delayInMilliseconds); //Delayed

Latest revision as of 02:14, 28 July 2022

var delayInMilliseconds = 500; //.5 seconds
setTimeout(function() {
    /* Remove lang attribute from editor so the font is more readable (not having syntax highlight is enough) */
    if (['edit', 'submit'].includes(mw.config.get('wgAction'))) { //Only work if you are editing, otherwise the getElementById will return NULL and my code will break
        document.getElementById("wpTextbox1").removeAttribute("lang")
    }
    console.log('Successfully changed editor appearance')

    /* Add semicolon */
    const scDiv = document.createElement("div")
    const semicolon = document.createTextNode("  ;")
    scDiv.appendChild(semicolon)
    const notNav = document.getElementById("not-nav")
    notNav.appendChild(scDiv)
    console.log('Successfully added semicolons')

    /* Add links to left navbar */
    const statusLI = document.createElement("li")
    statusLI.setAttribute("id", "n-Your-Status")
    const statusLink = document.createElement("a")
    statusLink.setAttribute("href", "/wiki/Special:MyPage/status")
    statusLink.appendChild(document.createTextNode("Your Status"))
    statusLI.appendChild(statusLink)
    const nEdit = document.getElementById("n-Edit")
    const parentBox1 = nEdit.parentNode
    parentBox1.insertBefore(statusLI, nEdit)

    const enwikiLI = document.createElement("li")
    enwikiLI.setAttribute("id", "n-English-Wiki")
    const enwikiLink = document.createElement("a")
    enwikiLink.setAttribute("href", "https://en.scratch-wiki.info")
    enwikiLink.appendChild(document.createTextNode("English Wiki"))
    enwikiLI.appendChild(enwikiLink)
    const recentChanges = document.getElementById("n-recentchanges")
    const parentBox2 = recentChanges.parentNode
    parentBox2.insertBefore(enwikiLI, recentChanges)

    const zhwikiLI = document.createElement("li")
    zhwikiLI.setAttribute("id", "n-Chinese-Wiki")
    const zhwikiLink = document.createElement("a")
    zhwikiLink.setAttribute("href", "https://test.scratch-wiki.info/wiki/Zho:首页")
    zhwikiLink.appendChild(document.createTextNode("中文维基"))
    zhwikiLI.appendChild(zhwikiLink)
    parentBox2.insertBefore(zhwikiLI, recentChanges)

    /* Removing unnecessary tools on the left of the page */
    document.getElementById("n-mainpage-description").remove()
    document.getElementById("n-FAQ").remove()
    document.querySelector('[aria-label="For Authors"]').remove()
    document.querySelector('[aria-label="Scratch Wikis"]').remove()
    console.log('Successfully changed sidebar tools')
}, delayInMilliseconds); //Delayed
Cookies help us deliver our services. By using our services, you agree to our use of cookies.