Improved describe-bindings display
[conkeror.git] / modules / page-modes / gmail.js
blobb7ae132b80bcd80c4f3518d9ba47b9d10b58c115
1 require("content-buffer.js");
2 require("bindings/default/content-buffer/normal.js");
4 define_keymap("gmail_keymap", $parent = content_buffer_normal_keymap);
6 function gmail_label_go(buffer, label)
8     buffer.window.content.location.hash = "#label/" + encodeURIComponent(label);
10 interactive("gmail-label-go",
11             "Go to a GMail label.",
12             function(I) {
13               gmail_label_go(I.buffer, (yield I.minibuffer.read($prompt = "Go to label: ")));
14             });
16 define_key(gmail_keymap, "C-c g", "gmail-label-go");
17 define_key(gmail_keymap, "j", null, $fallthrough);
18 define_key(gmail_keymap, "k", null, $fallthrough);
19 define_key(gmail_keymap, "u", null, $fallthrough);
20 define_key(gmail_keymap, "n", null, $fallthrough);
21 define_key(gmail_keymap, "p", null, $fallthrough);
22 define_key(gmail_keymap, "r", null, $fallthrough);
23 define_key(gmail_keymap, "C-c r", "reload");
24 define_key(gmail_keymap, "a", null, $fallthrough);
26 define_page_mode("gmail_mode", "GMail", $enable = function (buffer) {
27     buffer.local_variables.content_buffer_normal_keymap = gmail_keymap;
28 });
30 auto_mode_list.push([/^https?:\/\/mail\.google\.com\//, gmail_mode]);