minibuffer: align baselines of prompt and input
[conkeror/arlinius.git] / modules / minibuffer-read-mime-type.js
blob47c699be5b616aa60fd0b5c0af386910f0038c03
1 /**
2  * (C) Copyright 2008 Jeremy Maitin-Shepard
3  *
4  * Use, modification, and distribution are subject to the terms specified in the
5  * COPYING file.
6 **/
8 in_module(null);
10 require("minibuffer-read.js");
12 let _viewable_mime_type_list = null;
14 __defineGetter__("viewable_mime_type_list",
15     function () {
16         if (_viewable_mime_type_list == null) {
17             let list = [];
18             var en = category_manager
19                 .enumerateCategory("Gecko-Content-Viewers");
20             while (en.hasMoreElements())
21                 list.push(en.getNext()
22                             .QueryInterface(Ci.nsISupportsCString)
23                             .toString());
24             _viewable_mime_type_list = list;
25         }
26         return _viewable_mime_type_list;
27     });
29 var category_manager = Cc["@mozilla.org/categorymanager;1"]
30     .getService(Ci.nsICategoryManager);
32 minibuffer.prototype.read_viewable_mime_type = function () {
33     var result = yield this.read(
34         forward_keywords(arguments),
35         $completer = prefix_completer(
36             $completions = viewable_mime_type_list),
37         $match_required,
38         $space_completes);
39     yield co_return(result);
42 provide("minibuffer-read-mime-type");