-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathubiquityNeta.js
26 lines (25 loc) · 1004 Bytes
/
ubiquityNeta.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Vimperator plugin: Ubiquity
// Maintainer: mattn <[email protected]> - http://mattn.kaoriya.net
// Require: Ubiquity - https://wiki.mozilla.org/Labs/Ubiquity
// Usage:
// :ubiquity command... - show Ubiquity's command dialog.
// :ubiquity! command... - run Ubiquity's command.
(function() {
if (typeof gUbiquity === 'undefined') return;
liberator.commands.addUserCommand(["ubiquity"], "Ubiquity",
function(arg){
var anchor = document.getElementById("content");
if (window.location == "chrome://browser/content/browser.xul")
anchor = anchor.selectedBrowser;
gUbiquity.openWindow(anchor);
gUbiquity.__textBox.value = arg||'';
var context = gUbiquity.__makeContext();
var previewBlock = document.getElementById("cmd-preview").contentDocument.getElementById("preview");
gUbiquity.__cmdManager.updateInput(arg||'', context, previewBlock);
if (arg.special) {
gUbiquity.__cmdManager.execute(context);
gUbiquity.closeWindow();
}
},
{ });
})();