index
:
vimperator-plugins
1.2
2.0
2.2
2.3
3.6
asdfghjkl--fix-block-syntax-errors
google-plus-commando/poster
google-results/support-completion
master
pixiv/desynchronization
stella/nico-fullscreen
unlettter
for Vimperator plugins
about
summary
refs
log
tree
commit
diff
stats
log msg
author
committer
range
path:
root
/
alias.js
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
author
anekos
2010-05-04 10:24:21 +0000
committer
anekos
2010-05-04 10:24:21 +0000
commit
08c8d6c04cf9694bd754bded362049583d905f8f
(
// PLUGIN_INFO//{{{
var
PLUGIN_INFO
=
<
VimperatorPlugin
>
<
name
>
{
NAME
}
<
/name>
<
description
>
TinyURL
from
Vimperator
<
/description>
<
author
mail
=
"konbu.komuro@gmail.com"
homepage
=
"http://d.hatena.ne.jp/hogelog/"
>
hogelog
<
/author>
<
version
>
0.1
<
/version>
<
minVersion
>
2.0
pre
<
/minVersion>
<
maxVersion
>
2.0
pre
<
/maxVersion>
<
updateURL
>
http
:
//svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/tinyurl.js</updateURL>
<
detail
><!
[
CDATA
[
==
COMMANDS
==
tinyurl
[
URL
]
:
echo
and
copy
URL
expandurl
URL
:
expand
URL
==
LIBRARY
==
plugins
.
tinyurl
.
getTiny
(
url
)
:
return
TinyURL
plugins
.
tinyurl
.
getExpand
(
url
)
:
return
ExpandURL
]]
><
/detail>
<
/VimperatorPlugin>;
//}}}
(
function
()
{
const
TinyAPI
=
'http://tinyurl.com/api-create.php?url='
;
commands
.
add
([
'tinyurl'
],
'echo and copy TinyURL'
,
function
(
args
)
util
.
copyToClipboard
(
tiny
.
getTiny
(
args
.
length
==
0
?
buffer
.
URL
:
args
.
string
),
true
),
{
argCount
:
'?'
,
});
commands
.
add
([
'expandurl'
],
'expand TinyURL'
,
function
(
args
)
util
.
copyToClipboard
(
tiny
.
getExpand
(
args
.
string
),
true
),
{
argCount
:
'1'
,
});
var
tiny
=
plugins
.
tinyurl
=
{
getTiny
:
function
(
url
)
util
.
httpGet
(
TinyAPI
+
encodeURIComponent
(
url
)).
responseText
,
getExpand
:
function
(
url
)
util
.
httpGet
(
url
).
channel
.
name
};
})();
// vim: fdm=marker sw=4 ts=4 et: