2 * (C) Copyright 2010 John J. Foerch
4 * Use, modification, and distribution are subject to the terms specified in the
9 This module manages formfill_keymap, the keymap for interacting with the
10 popup_autocomplete panel.
12 notes for future development:
14 http://mxr.mozilla.org/mozilla-central/source/xpfe/components/autocomplete/resources/content/autocomplete.xml
17 interactive("formfill-next",
18 "Select next item in the formfill popup.",
20 var p = I.window.document.getElementById("popup_autocomplete");
21 var reverse = false, page = false;
22 p.selectBy(reverse, page);
25 interactive("formfill-previous",
26 "Select previous item in the formfill popup.",
28 var p = I.window.document.getElementById("popup_autocomplete");
29 var reverse = true, page = false;
30 p.selectBy(reverse, page);
33 function formfill_modality (buffer) {
34 buffer.keymaps.push(formfill_keymap);
37 function formfill_mode (arg, panel) {
38 var buffer = panel.buffer;
40 var i = buffer.modalities.indexOf(formfill_modality);
42 buffer.modalities.splice(i, 1);
46 buffer = panel.ownerDocument.defaultView.buffers.current;
47 buffer.modalities.push(formfill_modality);
48 panel.buffer = buffer;
50 buffer.set_input_mode();