From Test-Scratch-Wiki

< User:-iviedwall-

Revision as of 05:45, 22 July 2022 by -iviedwall- (talk | contribs) (FIxed variable bug)

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* 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
console.log('Successfully changed editor appearance')

/* Add semicolon */
const scDiv = document.createElement("div")
const semicolon = document.createTextNode("  ;")
const notNav = document.getElementById("not-nav")
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"))
const nEdit = document.getElementById("n-Edit")
var 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", "")
enwikiLink.appendChild(document.createTextNode("English Wiki"))
const recentChanges = document.getElementById("n-recentchanges")
parentBox = recentChanges.parentNode
parentBox.insertBefore(enwikiLI, recentChanges)

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