aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhogelog2009-06-28 12:49:48 +0000
committerhogelog2009-06-28 12:49:48 +0000
commit2df79473f91f1b795298205458fcc3bbbd8b6795 (patch)
tree79d4f5bc517ec1e7e530f6a5329857bcec816e4a
parent3b1117d4bab299634bb6a88500520af71c31af1e (diff)
downloadvimperator-plugins-2df79473f91f1b795298205458fcc3bbbd8b6795.tar.bz2
* firefox/thunderbird/songbird のGUIDなどのアプリケーション情報を調べるプラグイン appinfo.js
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@34181 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r--appinfo.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/appinfo.js b/appinfo.js
new file mode 100644
index 0000000..c746807
--- /dev/null
+++ b/appinfo.js
@@ -0,0 +1,40 @@
+// PLUGIN_INFO//{{{
+var PLUGIN_INFO =
+<VimperatorPlugin>
+ <name>{NAME}</name>
+ <description>show application information</description>
+ <author mail="konbu.komuro@gmail.com" homepage="http://d.hatena.ne.jp/hogelog/">hogelog</author>
+ <version>0.0.1</version>
+ <minVersion>2.0pre</minVersion>
+ <maxVersion>2.1</maxVersion>
+ <license>CC0</license>
+ <detail><![CDATA[
+
+== COMMANDS ==
+appinfo [information]:
+ echo and copy mozilla information
+
+ ]]></detail>
+</VimperatorPlugin>;
+//}}}
+
+(function() {
+ const appinfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo);
+ commands.add(['appinfo'], 'show application information',
+ function(args) {
+ if (args.length==1) {
+ util.copyToClipboard(appinfo[args.string], true);
+ } else {
+ let descs = [[i,appinfo[i]] for(i in appinfo) if(i!="QueryInterface")];
+ let list = template.genericTable(descs, { title: ["Application Information", "Value"] });
+ commandline.echo(list, commandline.HL_INFOMSG);
+ }
+ },{
+ argCount: '?',
+ completer: function(context, args) {
+ context.title = ["Application Information", "Value"];
+ context.completions = [[i,appinfo[i]] for(i in appinfo) if(i!="QueryInterface")];
+ },
+ });
+})();
+// vim: fdm=marker sw=4 ts=4 et: