User:KurwaAntics/common.js

$.get( '/wiki/User:KurwaAntics/shift-context-menu?action=render', function( data ) {   $(document).on('contextmenu',function(e){ var x = e.clientX; var y = e.clientY; if(!e.shiftKey) { e.preventDefault; $( ".context-menu" ).remove; $('body').prepend(' '); $( "#shift-context-menu" ).html( data ); }   }); }); $(document).on('click',function(e){    $( ".context-menu" ).remove; });

mw.util.addCSS('.context-menu { position:fixed; background:white; padding: 4px 0; font-size:14px; z-index:9999999; line-height:150%; box-shadow: 2px 4px 8px rgba(0,0,0,0.25); border: 1px solid #567} .context-menu a { color: black; text-decoration: none; display: block; padding: 0 1em; } .context-menu li:hover { color:white; background: #567} .context-menu li:hover a {color:white;} .context-menu hr {-webkit-margin-before: 4px; -webkit-margin-after: 4px; border:1px solid #567; }');