From 2660ccb89af4b3a1bc01ddff82540e62b3ab71c0 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 10 Mar 2013 23:35:48 +0100 Subject: [PATCH] rm array building --- 4chan_x.user.js | 12 ++++-------- src/features.coffee | 2 ++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index f1d010f0e..69e88f7ec 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1570,11 +1570,10 @@ } }, keybinds: function(section) { - var arr, input, key, tbody, tr, _ref, _results; + var arr, input, key, tbody, tr, _ref; section.innerHTML = "
Keybinds are disabled.
\n
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
\n
Press Return to disable a keybind.
\n\n \n
ActionsKeybinds
"; tbody = $('tbody', section); _ref = Config.hotkeys; - _results = []; for (key in _ref) { arr = _ref[key]; tr = $.el('tr', { @@ -1584,9 +1583,8 @@ input.name = key; input.value = $.get(key, Conf[key]); $.on(input, 'keydown', Settings.keybind); - _results.push($.add(tbody, tr)); + $.add(tbody, tr); } - return _results; }, keybind: function(e) { var key; @@ -2834,14 +2832,12 @@ } $.on(d, 'keydown', Keybinds.keydown); return $.on(d, '4chanXInitFinished', function() { - var node, _i, _len, _ref, _results; + var node, _i, _len, _ref; _ref = $$('[accesskey]'); - _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { node = _ref[_i]; - _results.push(node.removeAttribute('accesskey')); + node.removeAttribute('accesskey'); } - return _results; }); }, keydown: function(e) { diff --git a/src/features.coffee b/src/features.coffee index 23f48792c..da68b5881 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -569,6 +569,7 @@ Settings = input.value = $.get key, Conf[key] $.on input, 'keydown', Settings.keybind $.add tbody, tr + return keybind: (e) -> return if e.keyCode is 9 # tab e.preventDefault() @@ -1558,6 +1559,7 @@ Keybinds = $.on d, '4chanXInitFinished', -> for node in $$ '[accesskey]' node.removeAttribute 'accesskey' + return keydown: (e) -> return unless key = Keybinds.keyCode e