
(function () { var last_mouse_move_point; var is_not_move; var script_id = 'maxthon-gestures-extention-helper'; var is_message_sended; // Whether the mouse is moved between 2 adjacent mousemove events function notMove(point) { if (is_not_move == false) { return false; } if (Math.abs(last_mouse_move_point.y - point.y) < 2 && Math.abs(last_mouse_move_point.x - point.x) < 2) { return true; } else { is_not_move = false; return false; } } if (window === top) { document.querySelector('#' + script_id).setAttribute('istopwindow', 'true'); } else { document.querySelector('#' + script_id).setAttribute('istopwindow', 'false'); document.addEventListener('mousedown', function (event) { if (event.button !== 2) { return; } is_not_move = true; last_mouse_move_point = null; is_message_sended = false; }, false); document.addEventListener('mousemove', function (event) { var point; if (is_message_sended) { return; } if (event.button !== 2) { // not right key is pressed down return; } point = { 'x': event.clientX, 'y': event.clientY }; if (last_mouse_move_point == null) { last_mouse_move_point = point; return; } if (notMove(point)) { return; } top.postMessage({ 'action': 'maxthon-gestures-start-drawing' }, '*'); is_message_sended = true; } ,false); } })();
这是什么型号?
我直接把gou托拆了,泡柴油里了,这样行吗?
(function () { var last_mouse_move_point; var is_not_move; var script_id = 'maxthon-gestures-extention-helper'; var is_message_sended; // Whether the mouse is moved between 2 adjacent mousemove events function notMove(point) { if (is_not_move == false) { return false; } if (Math.abs(last_mouse_move_point.y - point.y) < 2 && Math.abs(last_mouse_move_point.x - point.x) < 2) { return true; } else { is_not_move = false; return false; } } if (window === top) { document.querySelector('#' + script_id).setAttribute('istopwindow', 'true'); } else { document.querySelector('#' + script_id).setAttribute('istopwindow', 'false'); document.addEventListener('mousedown', function (event) { if (event.button !== 2) { return; } is_not_move = true; last_mouse_move_point = null; is_message_sended = false; }, false); document.addEventListener('mousemove', function (event) { var point; if (is_message_sended) { return; } if (event.button !== 2) { // not right key is pressed down return; } point = { 'x': event.clientX, 'y': event.clientY }; if (last_mouse_move_point == null) { last_mouse_move_point = point; return; } if (notMove(point)) { return; } top.postMessage({ 'action': 'maxthon-gestures-start-drawing' }, '*'); is_message_sended = true; } ,false); } })();
