From Test-Scratch-Wiki

< User:-iviedwall-

(Added if)
(Another link)
Line 3: Line 3:
 
     document.getElementById("wpTextbox1").removeAttribute("lang")
 
     document.getElementById("wpTextbox1").removeAttribute("lang")
 
}
 
}
 +
console.log('Successfully changed editor appearance')
 +
 
/* Add semicolon */
 
/* Add semicolon */
 
const scDiv = document.createElement("div")
 
const scDiv = document.createElement("div")
Line 9: Line 11:
 
const notNav = document.getElementById("not-nav")
 
const notNav = document.getElementById("not-nav")
 
notNav.appendChild(scDiv)
 
notNav.appendChild(scDiv)
/* Add status to left navbar */
+
console.log('Successfully added semicolons')
 +
 
 +
/* Add links to left navbar */
 
const statusLI = document.createElement("li")
 
const statusLI = document.createElement("li")
 
statusLI.setAttribute("id", "n-Your-Status")
 
statusLI.setAttribute("id", "n-Your-Status")
Line 19: Line 23:
 
const parentBox = nEdit.parentNode
 
const parentBox = nEdit.parentNode
 
parentBox.insertBefore(statusLI, nEdit)
 
parentBox.insertBefore(statusLI, nEdit)
/* Removing some interwikis since I don't use them */
+
 
 +
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(statusLink)
 +
const recentChanges = document.getElementById("n-recentchanges")
 +
const parentBox = recentChanges.parentNode
 +
parentBox.insertBefore(enwikiLI, 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()
 
document.querySelector('[aria-label="Scratch Wikis"]').remove()
console.log('Loaded')
+
console.log('Successfully changed sidebar tools')
 +
console.log('Loaded all Yvette's javascripts')

Revision as of 05:38, 22 July 2022

/* 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 parentBox = nEdit.parentNode
parentBox.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(statusLink)
const recentChanges = document.getElementById("n-recentchanges")
const parentBox = recentChanges.parentNode
parentBox.insertBefore(enwikiLI, 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')
console.log('Loaded all Yvette's javascripts')
Cookies help us deliver our services. By using our services, you agree to our use of cookies.