User:Chlod/Scripts/ReferenceDeselector.js

// ReferenceDeselector // Author: Chlod // Version: 1.0.0-REL

// Makes references unselectable for easy copy-pasting.

// By using this userscript, I am not liable for any plagiarism or copyright // charges that you may incur at work or school as a result of using this // userscript. Suffer the consequences on your own.

(function {	const linkB = mw.util.addPortletLink( "p-cactions", "#", "Make references unselectable", "pt-unselectablerefs" );	if(linkB) linkB.addEventListener( "click", function(e) { $( ".reference" ).css("user-select", "none"); e.preventDefault; return false; } );	const linkC = mw.util.addPortletLink( "p-cactions", "#", "Make references selectable", "pt-selectablerefs" );	if(linkC) linkC.addEventListener( "click", function(e) { $( ".reference" ).css("user-select", "inherit"); e.preventDefault; return false; } ); });