diff options
author | drry | 2008-11-07 23:34:36 +0000 |
---|---|---|
committer | drry | 2008-11-07 23:34:36 +0000 |
commit | 3e8d354c1199cb42298c69eff977a4b068246827 (patch) | |
tree | 8d43425adf01f704ddb60c3a5cc892df4f74aef3 /bitly.js | |
parent | 26e7a3b656e1f9853cde1f7010afa3c21ffeaae5 (diff) | |
download | vimperator-plugins-3e8d354c1199cb42298c69eff977a4b068246827.tar.bz2 |
* cosmetic changes.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22978 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'bitly.js')
-rw-r--r-- | bitly.js | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -12,15 +12,15 @@ function bitly (uri, callback) { let req = new XMLHttpRequest(); - req.onreadystatechange = function(){ + req.onreadystatechange = function () { if (req.readyState != 4) return; if (req.status == 200) return callback && callback(req.responseText, req); - else - throw new Error(req.statusText) + else + throw new Error(req.statusText); }; - req.open("GET", 'http://bit.ly/api?url=' + uri, callback); + req.open('GET', 'http://bit.ly/api?url=' + uri, callback); req.send(null); return !callback && req.responseText; } @@ -37,12 +37,10 @@ }); } ); - + // 外から使えるように liberator.plugins.bitly = { - get: bitly, + get: bitly }; })(); - - |