JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
blank tabs black
[userscripts.git] / numbered_links.user.js
index ea6eff5..09684c0 100644 (file)
@@ -361,19 +361,11 @@ function init() {
        document.addEventListener(
                'keydown',
                function(e) {
-                       // [de]activate on ^C
                        // deactivate on ESC
-                       if(
-                               (e.ctrlKey && e.keyCode == 67)
-                               || (e.keyCode == 27 && active == 1)
-                       ) {
-                               if(active) {
-                                       got = '';
-                                       removeAllHints();
-                               } else {
-                                       followLinks(got);
-                               }
-                               active = 1 - active;
+                       if(e.keyCode == 27 && active == 1) {
+                               got = '';
+                               removeAllHints();
+                               active = 0;
                                return stop_event(e);
                        } else {
                                if(active == 1 && !e.ctrlKey && !e.shiftKey && !e.altKey) {
@@ -383,7 +375,7 @@ function init() {
                                                return stop_event(e);
                                        }
                                } else {
-                                       // general keybinding, unrelated to numbered links
+                                       // general keybinding, (mostly unrelated to numbered links)
                                        var active_type = (document.activeElement.type || 'a').toLowerCase();
                                        var typing = true;
                                        if (document.activeElement == document.body) {