User:Thundercraft5/ModuleIDE.js

var style = $(mw.util.addCSS(` body { overflow-y: hidden !important; }

.main-container { position: relative; }

.wikiEditor-ui, .ui-resizable, .page__main, .page-is-edit { position: static !important; }

position: absolute; bottom: 0; left: 0; width: 100%; height: var(--codeEditor-console-height); z-index: 10; overflow: hidden; max-height: var(--codeEditor-console-height); top: 100vh; border-top: 1px solid gray !important; transition: 0.3s transform ease; transform: translateY(0%); }
 * 1) mw-scribunto-console {

transform: translateY(-100%); }
 * 1) codeeditor-consoletoggle:checked + #mw-scribunto-console {

.codeeditor-console-open .codeEditor-status { transform: translateY(calc((-1 * (var(--codeEditor-console-height))%))); }

.codeEditor-status { position: absolute; bottom: 0; left: 0; top: var(--codeEditor-height); height: 3.5vh; display: flex; align-items: center; transition: 0.3s transform ease; z-index: 10; box-shadow: 0 0px 3px black; }

.codeeditor-consoletoggle-label { width: 3vh; height: 3vh; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230f0f0f'%3E%3Cpath d='M 8.90625 2 L 7.71875 3.59375 L 9.25 4.75 C 9.0839167 5.1277969 9 5.5491469 9 6 L 15 6 C 15 5.564911 14.936469 5.148849 14.78125 4.78125 L 16.34375 3.625 L 15.15625 2 L 13.375 3.34375 C 12.962316 3.1354159 12.508234 3 12 3 C 11.50753 3 11.059705 3.116189 10.65625 3.3125 L 8.90625 2 z M 8 7 C 7.4455939 7 6.9569277 7.6783929 6.59375 8.78125 L 4.15625 7.375 L 3.15625 9.09375 L 6.125 10.8125 C 6.0365185 11.488416 6 12.232851 6 13 L 3 13 L 3 15 L 6.125 15 C 6.2422017 15.797279 6.4390457 16.481344 6.6875 17.0625 L 4.09375 19.03125 L 5.3125 20.625 L 7.78125 18.75 C 8.6724703 19.679039 9.8221552 20.186034 11 20.59375 L 11 13 L 13 13 L 13 20.6875 C 14.44375 20.25 15.583374 19.776807 16.40625 18.90625 L 18.71875 20.65625 L 19.9375 19.09375 L 17.4375 17.15625 C 17.656442 16.552483 17.783977 15.84839 17.875 15 L 21 15 L 21 13 L 18 13 C 18 12.208956 17.937538 11.443166 17.84375 10.75 L 20.75 9.0625 L 19.75 7.3125 L 17.375 8.6875 C 17.014656 7.6428208 16.537602 7 16 7 L 8 7 z'/%3E%3C/svg%3E") center no-repeat; }

.codeEditor-status-worker { display: flex; align-items: center; flex-direction: row; }

.codeEditor-status-message { display: flex; align-items: center; align-content: center; justify-content: flex-end; }

.fandom-sticky-header, #WikiaBar, .editOptions, .codeeditor-fullscreen { display: none !important; } `).ownerNode).remove;

mw.util.addCSS(`:root {	--codeEditor-height: 97vh;	--codeEditor-console-height: 30vh; }`); var oldX, oldY;

mw.hook('dev.cgnb.change').add(function(collapsed) {	var interval = setInterval(function { ace.editor.resize; }, 0);	ace.editor.interval = interval; });

$('.global-navigation').on('trasitionend', function {	clearInterval(ace.editor.interval);	delete ace.editor.interval; });

var bodyStyles = getComputedStyle(document.documentElement); var height = bodyStyles.getPropertyValue("--codeEditor-height").trim;

$('.page-side-tools').append($(' ', { html: $(' ', {		class: "wds-icon",		html: $(" ", { "xlink:href": "#wds-icons-zoom-in", html: ' ', }),	}),	click: function { oldX = window.scrollX; oldY = window.scrollY;

window.scrollTo(0, 0); $([ace.editor.container, $('.ui-resizable')[0]]).css({			position: "absolute",			height: height,		});

style.appendTo('head'); ace.editor.resize; },	title: "Enter Code Editor fullscreen", class: "page-side-tool codeeditor-fullscreen", "data-wds-tooltip": "Collapse", "data-wds-tooltip-position": "right", "data-tooltip-attached": 1, }));

$('.codeEditor-status-message').append($(' ', { for: "codeeditor-consoletoggle", class: "codeeditor-consoletoggle-label", title: "Toggle Debug Console", }));

$('#mw-scribunto-console').before($(' ', { id: "codeeditor-consoletoggle", name: "codeeditor-consoletoggle", type: "checkbox", class: "wds-is-hidden", change { $('.mw-editform').toggleClass('codeeditor-console-open'); }, }));

$(window).on('keyup', function(e) {	if (e.key.toLowerCase === "escape") {		window.scrollTo(oldX, oldY);		style.remove;		$([ace.editor.container, $('.ui-resizable')[0]]).css({ position: "relative", height: height, });		ace.editor.resize;	} });