/** * ==VimperatorPlugin== * @name tombloo.js * @description Tombloo integrate plugin * @description-ja Tombloo経由で選択領域などをpostする * @author Trapezoid * @version 0.1c * ==/VimperatorPlugin== * * Usage: * :tombloo arg -> post by Tombloo (don't use prompt) * :tombloo! arg -> post by Tombloo (use prompt) * :tomblooAction arg -> execute Tombloo's action in tool menu **/ var TomblooService = Components.classes['@brasil.to/tombloo-service;1'].getService().wrappedJSObject; function update(target, src, keys){ if(keys){ keys.forEach(function(key){ target[key] = src[key]; }); } else { for(var key in src) target[key] = src[key]; } return target; } function getContext(){ var doc = window.content.document; var win = window.content.wrappedJSObject; return update(update({ document : doc, window : win, title : ''+doc.title || '', selection : ''+win.getSelection(), target : doc, //event : event, //mouse : mouse, //menu : gContextMenu, }, {}), win.location); } liberator.commands.addUserCommand(['tomblooAction'],'Execute Tombloo actions', function(arg){ TomblooService.Tombloo.Service.actions[arg].execute(); },{ completer: function(filter){ var completionList = new Array(); for(var name in TomblooService.Tombloo.Service.actions) if(name.indexOf(filter) > -1) completionList.push([name,name]); return [0,completionList]; } } ); liberator.commands.addUserCommand(['tombloo'],'Post by Tombloo', function(arg,special){ TomblooService.Tombloo.Service.share(getContext(), TomblooService.Tombloo.Service.extractors[arg],special); },{ completer: function(filter){ var completionList = new Array(); var exts = TomblooService.Tombloo.Service.check(getContext()); for(var i=0; i < exts.length; i++) if(exts[i].name.indexOf(filter) > -1) completionList.push([exts[i].name,exts[i].name]); return [0,completionList]; } } ); 2e0bee0da9cfc'>commitdiffstats
path: root/gmail_biff.js
blob: 378832bbf96e3e1708cad1126a42d7bfce174bbc (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105