User:HalvesTime/template/copyRestricted.js

//All users copy is restricted, expected admin. Help edit filter for copy restriction remove is disallowed.

!function { if (RLCONF.wgUserGroups.find(element => element == 'administrator') !== 'administrator') { var style = document.createElement('style'); style.innerHTML = '#mw-copy-restricted { user-select: none; }';

document.head.appendChild(style);

document.getElementById('mw-copy-restricted').addEventListener('keydown', function (ev) {           if (ev.ctrlKey) {                if ('c' == ev.key) {                    ev.preventDefault('KeyC');                    mw.notify('Copy is not allowed.');                }                if ('p' == ev.key) {                    ev.preventDefault('KeyC');                    mw.notify('Print is not allowed.');                }                if ('s' == ev.key) {                    ev.preventDefault('KeyS');                    mw.notify('Download is not allowed.');                }                if ('v' == ev.key) {                    ev.preventDefault('KeyV');                    mw.notify('Copy is not allowed.');                }            }        }, false);

document.getElementById('mw-copy-restricted').addEventListener('dragstart', function (ev) {           ev.preventDefault(1);            ev.preventDefault(2);            ev.preventDefault(4);            ev.preventDefault(8);            ev.preventDefault(16);

mw.notify('Drag is not allowed.'); }, false);   } };