User:Mikevoir/sandbox.js

$(function {   // Load dependencies and cache	var config = mw.config.get(['wgDiffNewId', 'wgAction', 'wgPageName']);	var mapGenerator = {		init: function {			// Clean page			document.querySelectorAll('#mw-content-text.mw-body-content > p').forEach(function(p){ p.remove; });			document.querySelector('h1.page-header__title').innerHTML = 'Map Generator';			document.title = 'Map Generator';			var container = $('  ');			var markers = {				count: 0			};			$('#mw-content-text.mw-body-content').append(container);			container.draggable;			container.css('left', '-3740px'); // Default to Mond just cuz			container.css('top', '-842px'); // Default to Mond just cuz			container.css('height', (screen.height-100)+'px'); // Limit container so no scrolling is required			document.addEventListener('dblclick', function(event) { if (event.target && event.target.id == 'mapImage') { event.preventDefault; markers.count++; var newMarker = { x: event.layerX, y: event.layerY, elem: $('') };					markers['marker'+markers.count] = newMarker; container.append(newMarker.elem); } else if (event.target && /^marker\d+/.test(event.target.id)) { event.target.remove; markers.count--; }			});			document.addEventListener('contextmenu', function(event) { if (event.target && /^marker\d+/.test(event.target.id)) { event.preventDefault; var menu = $(						''+							''+								'32px'+								'53px'+								'75px'+								'96px'+								'&#x274C;'+							''+						' '					); container.append(menu); }			});		}	};	if (config.wgPageName == 'Special:Map') {		mapGenerator.init;	} });