diff options
author | mattn | 2008-09-02 09:23:12 +0000 |
---|---|---|
committer | mattn | 2008-09-02 09:23:12 +0000 |
commit | c8ed2b3c59cdbf9e0a8f0d96005345e2984354fd (patch) | |
tree | f60c412902b5494887c5776a7c574f205cbc99f5 /ubiquity.js | |
parent | 999fe1b70f77a50e2e977dd56c60a54da86b5a9b (diff) | |
download | vimperator-plugins-c8ed2b3c59cdbf9e0a8f0d96005345e2984354fd.tar.bz2 |
added ubiquity plugin for vimperator: 補完機能なし!
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@18648 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'ubiquity.js')
-rw-r--r-- | ubiquity.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ubiquity.js b/ubiquity.js new file mode 100644 index 0000000..a302466 --- /dev/null +++ b/ubiquity.js @@ -0,0 +1,26 @@ +// Vimperator plugin: uaSwitch
+// Maintainer: mattn <mattn.jp@gmail.com> - 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, special){
+ 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("map osaka", context, previewBlock);
+ if (special) {
+ gUbiquity.__cmdManager.execute(context);
+ gUbiquity.closeWindow();
+ }
+ },
+ { });
+})();
|