]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/content/mow.js
Import r6976 from upstream hg supporting Firefox up to 25.*
[dactyl.git] / common / content / mow.js
index 6ef53f8fb54e278b3b3cbf652575102b63bedc45..7149f9cba230ad1a01c1c3ae8a1d91e193b985e0 100644 (file)
@@ -1,6 +1,6 @@
 // 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.
@@ -149,7 +149,7 @@ var MOW = Module("mow", {
 
     events: {
         click: function onClick(event) {
-            if (event.getPreventDefault())
+            if (event.defaultPrevented)
                 return;
 
             const openLink = function openLink(where) {
@@ -199,7 +199,7 @@ var MOW = Module("mow", {
 
             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]);
             }
         }
     },
@@ -346,36 +346,36 @@ var MOW = Module("mow", {
 
         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); });
@@ -390,7 +390,7 @@ var MOW = Module("mow", {
         // close the window
         bind(["q"], "Close the output window",
              function () {},
-             function () false, DROP);
+             () => false, DROP);
     },
     options: function initOptions() {
         options.add(["more"],