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
19 interactive("formfill-next",
20 "Select next item in the formfill popup.",
22 var p = I.window.document.getElementById("popup_autocomplete");
23 var reverse = false, page = false;
24 p.selectBy(reverse, page);
27 interactive("formfill-previous",
28 "Select previous item in the formfill popup.",
30 var p = I.window.document.getElementById("popup_autocomplete");
31 var reverse = true, page = false;
32 p.selectBy(reverse, page);
35 function formfill_modality (buffer) {
36 buffer.keymaps.push(formfill_keymap);
39 function formfill_mode (arg, panel) {
40 var buffer = panel.buffer;
42 var i = buffer.modalities.indexOf(formfill_modality);
44 buffer.modalities.splice(i, 1);
48 buffer = panel.ownerDocument.defaultView.buffers.current;
49 buffer.modalities.push(formfill_modality);
50 panel.buffer = buffer;
52 buffer.set_input_mode();