2 * (C) Copyright 2012 Scott Jaderholm
4 * Use, modification, and distribution are subject to the terms specified in the
8 require("content-buffer.js");
10 define_keymap("grooveshark_keymap", $display_name = "grooveshark");
12 function grooveshark_click_command (selector, error_message) {
15 var elem = buf.document.querySelector(selector);
17 dom_node_click(elem, 1, 1);
19 I.minibuffer.message(error_message);
23 interactive("grooveshark-play-or-pause",
24 "Click the Groovshark play/pause button.",
25 grooveshark_click_command("#play-pause",
26 "No play or pause button found"));
28 interactive("grooveshark-mute",
29 "Click the Grooveshark mute button.",
30 grooveshark_click_command("#volume",
31 "No mute button found"));
33 interactive("grooveshark-previous",
34 "Click the Grooveshark previous-video button.",
35 grooveshark_click_command("#play-prev",
36 "No previous button found"));
38 interactive("grooveshark-next",
39 "Click the Grooveshark next-video button.",
40 grooveshark_click_command("#play-next",
41 "No next button found"));
43 define_key(grooveshark_keymap, "C-c return", "grooveshark-play-or-pause");
44 define_key(grooveshark_keymap, "C-c C-m", "grooveshark-mute");
45 define_key(grooveshark_keymap, "C-c C-n", "grooveshark-next");
46 define_key(grooveshark_keymap, "C-c C-p", "grooveshark-previous");
48 define_keymaps_page_mode("grooveshark-mode",
49 build_url_regexp($domain = "grooveshark", $allow_www = true),
50 { normal: grooveshark_keymap },
51 $display_name = "Grooveshark");
53 page_mode_activate(grooveshark_mode);
55 provide("grooveshark");