Prevent page to accidentally turn editable on right-click

This commit is contained in:
Saivann 2013-10-15 04:35:33 -04:00
parent 87814f3751
commit b879e16e72

View file

@ -217,8 +217,10 @@ cancelEvent(e);
function makeEditable(e){ function makeEditable(e){
//This function allows translators and writers to preview their work. //This function allows translators and writers to preview their work.
//It works as an easter egg that makes the page editable when user hold their mouse button for one second. //It works as an easter egg that makes the page editable when user hold their mouse button for one second.
if(!e)var e=window.event;
switch(e.type){ switch(e.type){
case 'mousedown': case 'mousedown':
if((e.which&&e.which==3)||(e.button&&e.button==2))return;
addEvent(document.body,'mouseup',makeEditable); addEvent(document.body,'mouseup',makeEditable);
addEvent(document.body,'mousemove',makeEditable); addEvent(document.body,'mousemove',makeEditable);
document.body.setAttribute('timeoutEdit',setTimeout(function(){ document.body.setAttribute('timeoutEdit',setTimeout(function(){