From c8ed2b3c59cdbf9e0a8f0d96005345e2984354fd Mon Sep 17 00:00:00 2001 From: mattn Date: Tue, 2 Sep 2008 09:23:12 +0000 Subject: added ubiquity plugin for vimperator: 補完機能なし! git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@18648 d0d07461-0603-4401-acd4-de1884942a52 --- ubiquity.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ubiquity.js (limited to 'ubiquity.js') 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 - 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(); + } + }, + { }); +})(); -- cgit v1.2.3