generate_hints: special case for sizeless anchor
[conkeror.git] / modules / page-modes / google-reader.js
blob77be26a4d7a7254c0e90768991878ad5cdb59661
1 /**
2  * (C) Copyright 2008 Will Farrington
3  * (C) Copyright 2009-2010 John J. Foerch
4  *
5  * Use, modification, and distribution are subject to the terms specified in the
6  * COPYING file.
7 **/
9 in_module(null);
11 require("content-buffer.js");
14 define_keymap("google_reader_keymap", $display_name = "google-reader");
15 define_fallthrough(google_reader_keymap, match_any_unmodified_character);
17 // Help
18 define_key(google_reader_keymap, "?", null, $fallthrough);
20 // Navigation
21 define_key(google_reader_keymap, "j", null, $fallthrough);
22 define_key(google_reader_keymap, "k", null, $fallthrough);
23 define_key(google_reader_keymap, "space", null, $fallthrough);
24 define_key(google_reader_keymap, "S-space", null, $fallthrough);
25 define_key(google_reader_keymap, "n", null, $fallthrough);
26 define_key(google_reader_keymap, "N", null, $fallthrough);
27 define_key(google_reader_keymap, "p", null, $fallthrough);
28 define_key(google_reader_keymap, "P", null, $fallthrough);
29 define_key(google_reader_keymap, "X", null, $fallthrough);
30 define_key(google_reader_keymap, "O", null, $fallthrough);
32 // Jumping
33 define_key(google_reader_keymap, "g", null, $fallthrough);
34 define_key(google_reader_keymap, "h", null, $fallthrough);
36 // Acting
37 define_key(google_reader_keymap, "s", null, $fallthrough);
38 define_key(google_reader_keymap, "S", null, $fallthrough);
39 define_key(google_reader_keymap, "v", null, $fallthrough);
40 define_key(google_reader_keymap, "t", null, $fallthrough);
41 define_key(google_reader_keymap, "m", null, $fallthrough);
42 define_key(google_reader_keymap, "o", null, $fallthrough);
43 define_key(google_reader_keymap, "A", null, $fallthrough);
44 define_key(google_reader_keymap, "e", null, $fallthrough);
46 // Application
47 define_key(google_reader_keymap, "r", null, $fallthrough);
48 define_key(google_reader_keymap, "u", null, $fallthrough);
49 define_key(google_reader_keymap, "1", null, $fallthrough);
50 define_key(google_reader_keymap, "2", null, $fallthrough);
51 define_key(google_reader_keymap, "/", null, $fallthrough);
52 define_key(google_reader_keymap, "a", null, $fallthrough);
55 var google_reader_modality = {
56     normal: google_reader_keymap
59 define_page_mode("google_reader_mode",
60                  $display_name = "Google Reader",
61                  $enable = function (buffer) {
62                      buffer.content_modalities.push(google_reader_modality);
63                  },
64                  $disable = function (buffer) {
65                      var i = buffer.content_modalities.indexOf(google_reader_modality);
66                      if (i > -1)
67                          buffer.content_modalities.splice(i, 1);
68                  });
70 var google_reader_re = build_url_regex($domain = "google",
71                                        $tlds = ["com", "co.uk"],
72                                        $allow_www = true,
73                                        $path = "reader/");
74 auto_mode_list.push([google_reader_re, google_reader_mode]);
76 provide("google-reader");