-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathuuid.js
39 lines (35 loc) · 1.08 KB
/
uuid.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
27
28
29
30
31
32
33
34
35
36
37
38
39
// PLUGIN_INFO//{{{
var PLUGIN_INFO = xml`
<VimperatorPlugin>
<name>{NAME}</name>
<description>UUID generator</description>
<author mail="[email protected]" homepage="http://d.hatena.ne.jp/hogelog/">hogelog</author>
<version>0.1</version>
<minVersion>2.0pre</minVersion>
<maxVersion>2.0pre</maxVersion>
<updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/uuid.js</updateURL>
<detail><![CDATA[
== COMMANDS ==
uuid:
generate and copy UUID
== THANKS ==
http://moz-addon.g.hatena.ne.jp/ZIGOROu/20080417/1208413079
]]></detail>
</VimperatorPlugin>`;
//}}}
(function() {
const Ci = Components.interfaces;
services.add("uuid", "@mozilla.org/uuid-generator;1", Ci.nsIUUIDGenerator);
const UUID = services.get("uuid");
commands.add(['uuid'], 'generate and copy UUID',
function(args)
{
let uuid = UUID.generateUUID().number;
util.copyToClipboard(uuid);
liberator.echo("generate "+uuid);
},
{
argCount: '0',
});
})();
// vim: fdm=marker sw=4 ts=4 et: