MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

// Ace Editor if ((mw.config.get("wgAction") == "edit") && ((mw.config.get("wgNamespaceNumber") == 8) || (mw.config.get("wgNamespaceNumber") == 828))) { var observer = new MutationObserver(function(mutations) {   mutations.forEach(function(mutation) { var newNodes = mutation.addedNodes if (newNodes !== null) { $(newNodes).each(function {         if ($(this).hasClass("ace_content")) {            observer.disconnect            $(".ui-resizable").height(660)            var editor = ace.edit(document.getElementsByClassName("ace_editor")[0])            editor.setOptions({ theme: "ace/theme/solarized_dark", useSoftTabs: true, printMargin: false })           if (editor.session.$modeId != "ace/mode/css") {              editor.setOptions({ tabSize: 2, wrap: true })           }          }        })      }    })  })  observer.observe(document.getElementsByClassName("mw-body")[0], { childList: true, subtree: true }) }