From: Daniel Carl Date: Sun, 5 Jan 2014 18:56:22 +0000 (+0100) Subject: Merge branch 'hinting-g-mode' X-Git-Url: https://git.owens.tech/assets/static/git-favicon.png/assets/static/git-favicon.png/git?a=commitdiff_plain;h=a40d7646956a37e90a9de03f50959e334a8d4b05;p=vimb.git Merge branch 'hinting-g-mode' Conflicts: src/hints.js --- a40d7646956a37e90a9de03f50959e334a8d4b05 diff --cc src/hints.js index 95315af,97e8700..357a93d --- a/src/hints.js +++ b/src/hints.js @@@ -326,25 -383,18 +386,20 @@@ var VbHint = (function() } } - /* retrieves the hint for given hint number */ - function getHint(i) { - return hints[i] || null; - } - - function click(e) { - /* for sites that are interested in mouseover before click */ - mouseEvent(e, "mouseover"); - /* this is the w3.org definition for DOM-Level 2 events */ - mouseEvent(e, "mousedown"); - mouseEvent(e, "mouseup"); - mouseEvent(e, "click"); + function click(e, ctrl) { + mouseEvent(e, "mouseover", ctrl); + mouseEvent(e, "mousedown", ctrl); + mouseEvent(e, "mouseup", ctrl); + mouseEvent(e, "click", ctrl); } - function mouseEvent(e, name) { + function mouseEvent(e, name, ctrl) { var evObj = e.ownerDocument.createEvent("MouseEvents"); - evObj.initMouseEvent(name, true, true, e.contentWindow, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + evObj.initMouseEvent( + name, true, true, e.contentWindow, + 0, 0, 0, 0, 0, + ctrl !== undefined ? ctrl : false, false, false, false, 0, null + ); e.dispatchEvent(evObj); }