redesign buffer-modes and page-modes
[conkeror.git] / modules / page-modes / google-calendar.js
blob195dcdc2e9f560cf645c0473550fdd7cdec8b7a7
1 /**
2  * (C) Copyright 2008 Nelson Elhage
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");
13 define_keymap("google_calendar_keymap", $display_name = "google-calendar");
15 define_key(google_calendar_keymap, "c", null, $fallthrough);
17 define_key(google_calendar_keymap, "/", null, $fallthrough);
18 define_key(google_calendar_keymap, "p", null, $fallthrough);
19 define_key(google_calendar_keymap, "j", null, $fallthrough);
20 define_key(google_calendar_keymap, "n", null, $fallthrough);
21 define_key(google_calendar_keymap, "k", null, $fallthrough);
22 define_key(google_calendar_keymap, "t", null, $fallthrough);
24 define_key(google_calendar_keymap, "d", null, $fallthrough);
25 define_key(google_calendar_keymap, "x", null, $fallthrough);
26 define_key(google_calendar_keymap, "w", null, $fallthrough);
27 define_key(google_calendar_keymap, "m", null, $fallthrough);
28 define_key(google_calendar_keymap, "a", null, $fallthrough);
29 define_key(google_calendar_keymap, "q", null, $fallthrough);
30 define_key(google_calendar_keymap, "s", null, $fallthrough);
31 define_key(google_calendar_keymap, "u", null, $fallthrough);
32 define_key(google_calendar_keymap, "return", null, $fallthrough);
33 define_key(google_calendar_keymap, "tab", null, $fallthrough);//PROBABLY BAD
34 define_key(google_calendar_keymap, "M-s", null, $fallthrough);
35 define_key(google_calendar_keymap, "escape", null, $fallthrough);
37 var google_calendar_modality = {
38     normal: google_calendar_keymap
41 define_page_mode("google-calendar-mode",
42     build_url_regex($domain = "google",
43                     $path   = "calendar/",
44                     $allow_www = true),
45     function enable (buffer) {
46         buffer.content_modalities.push(google_calendar_modality);
47     },
48     function disable (buffer) {
49         var i = buffer.content_modalities.indexOf(google_calendar_modality);
50         if (i > -1)
51             buffer.content_modalities.splice(i, 1);
52     },
53     $display_name = "Google Calendar");
55 page_mode_activate(google_calendar_mode);
57 provide("google-calendar");