Toggle menu
2
16
17
151
The My Singing Monsters Modding Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Mobile.js

MediaWiki interface page
Revision as of 19:58, 4 November 2023 by Nextg (talk | contribs) (Created page with "// syntax highlighter var syntaxElements = document.querySelectorAll("pre"); // for each element do an action syntaxElements.forEach(checkSyntax); function checkSyntax(code) { // check if it has the specified keyword if (code.textContent.indexOf("game.") > -1) { // (technically) insert elements for specified keywords to color them code.innerHTML = code.textContent .replace(".", "<span style='color: #b1ac8b;'>.</span>") .replace("game", "<span styl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After publishing, 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: Press Ctrl-F5.
// syntax highlighter
var syntaxElements = document.querySelectorAll("pre");
// for each element do an action
syntaxElements.forEach(checkSyntax);
function checkSyntax(code) {
  // check if it has the specified keyword
  if (code.textContent.indexOf("game.") > -1) {
    // (technically) insert elements for specified keywords to color them
    code.innerHTML = code.textContent
      .replace(".", "<span style='color: #b1ac8b;'>.</span>")
      .replace("game", "<span style='color: #9cdcfe;'>game</span>");
  }
}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.