/** * ==VimperatorPlugin== * @name bufferecho.js * @description Display results of JavaScript to a buffer(browser) instead of commandline-buffer * @description-ja JavaScript実行結果をコマンドライン・バッファではなくバッファ(ブラウザ)に表示 * @version 0.1 * ==/VimperatorPlugin== */ liberator.plugins.buffer_echo = (function(){ var title = "bufferecho results"; var prefix = 'data:text/html,'; function execute(str){ var result; try { result = (function(){ return window.eval("with(liberator) {" + str + "}") })(); } catch (e) { result = e.name + ":\n" + e.message; } return result; } commands.addUserCommand(['bufferecho','becho'],'Display results of JavaScript to a buffer(browser)', function(args){ liberator.plugins.buffer_echo.open(args.string, args.bang); },{ completer: function(context) completion.javascript(context) },true ); var manager = { append: function(htmlString){ var body = util.evaluateXPath('/html/body').snapshotItem(0); body.innerHTML += htmlString; }, open: function(str, forceNewTab) { var result = execute(str); if (typeof(result) == "object") result = util.objectToString(result,true); var data = '

' + util.escapeHTML(str) + '

' + result + '
'; if (buffer.title == title && !forceNewTab){ this.append(data); return; } var where = buffer.URL == "about:blank" ? liberator.CURRENT_TAB : liberator.NEW_TAB; liberator.open([prefix + ''+title+'' + data], where); } }; return manager; })(); // vim:sw=4 ts=4 et: imperator-plugins/about/'>aboutsummaryrefslogtreecommitdiffstats
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