// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
-// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
+// Copyright (c) 2008-2013 Kris Maglione <maglione.k@gmail.com>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
events: {
click: function onClick(event) {
- if (event.getPreventDefault())
+ if (event.defaultPrevented)
return;
const openLink = function openLink(where) {
for (let node in array.iterValues(menu.children)) {
let group = node.getAttributeNS(NS, "group");
- node.hidden = group && !group.split(/\s+/).every(function (g) enabled[g]);
+ node.hidden = group && !group.split(/\s+/).every(g => enabled[g]);
}
}
},
bind(["j", "<C-e>", "<Down>"], "Scroll down one line",
function ({ count }) { mow.scrollVertical("lines", 1 * (count || 1)); },
- function () mow.canScroll(1), BEEP);
+ () => mow.canScroll(1), BEEP);
bind(["k", "<C-y>", "<Up>"], "Scroll up one line",
function ({ count }) { mow.scrollVertical("lines", -1 * (count || 1)); },
- function () mow.canScroll(-1), BEEP);
+ () => mow.canScroll(-1), BEEP);
bind(["<C-j>", "<C-m>", "<Return>"], "Scroll down one line, exit on last line",
function ({ count }) { mow.scrollVertical("lines", 1 * (count || 1)); },
- function () mow.canScroll(1), DROP);
+ () => mow.canScroll(1), DROP);
// half page down
bind(["<C-d>"], "Scroll down half a page",
function ({ count }) { mow.scrollVertical("pages", .5 * (count || 1)); },
- function () mow.canScroll(1), BEEP);
+ () => mow.canScroll(1), BEEP);
bind(["<C-f>", "<PageDown>"], "Scroll down one page",
function ({ count }) { mow.scrollVertical("pages", 1 * (count || 1)); },
- function () mow.canScroll(1), BEEP);
+ () => mow.canScroll(1), BEEP);
bind(["<Space>"], "Scroll down one page",
function ({ count }) { mow.scrollVertical("pages", 1 * (count || 1)); },
- function () mow.canScroll(1), DROP);
+ () => mow.canScroll(1), DROP);
bind(["<C-u>"], "Scroll up half a page",
function ({ count }) { mow.scrollVertical("pages", -.5 * (count || 1)); },
- function () mow.canScroll(-1), BEEP);
+ () => mow.canScroll(-1), BEEP);
bind(["<C-b>", "<PageUp>"], "Scroll up half a page",
function ({ count }) { mow.scrollVertical("pages", -1 * (count || 1)); },
- function () mow.canScroll(-1), BEEP);
+ () => mow.canScroll(-1), BEEP);
bind(["gg"], "Scroll to the beginning of output",
function () { mow.scrollToPercent(null, 0); });
// close the window
bind(["q"], "Close the output window",
function () {},
- function () false, DROP);
+ () => false, DROP);
},
options: function initOptions() {
options.add(["more"],