diff options
author | arccosine | 2008-11-26 17:00:59 +0000 |
---|---|---|
committer | arccosine | 2008-11-26 17:00:59 +0000 |
commit | 581d3bbfa2b3ce5b994e0f358aaf41c0a2c66fba (patch) | |
tree | bc011ab94bed3d9908b8c5633c31a952877bf4d3 | |
parent | efe59e1a8949a14cd875600be3074de173a4a10f (diff) | |
download | vimperator-plugins-581d3bbfa2b3ce5b994e0f358aaf41c0a2c66fba.tar.bz2 |
1.id:suVeneがつけてくれたPost完了後のメッセージ表示の復活
2.id:guyonが作成した*によるLDCのレート表示機能の追記
どうみてもコピペです。本当に(ry
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@25004 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | direct_bookmark.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/direct_bookmark.js b/direct_bookmark.js index 88ee223..4516e4d 100644 --- a/direct_bookmark.js +++ b/direct_bookmark.js @@ -1,6 +1,6 @@ // Vimperator plugin: 'Direct Post to Social Bookmarks'
// Version: 0.12
-// Last Change: 25-Nov-2008. Jan 2008
+// Last Change: 27-Nov-2008. Jan 2008
// License: Creative Commons
// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid
// Parts:
@@ -420,8 +420,14 @@ loginPrompt:{ user:'', password:'apikey', description:'Enter username and apikey.\nyou can get "api-key" from\n\thttp://clip.livedoor.com/config/api' },
entryPage:'http://clip.livedoor.com/page/%URL%',
poster:function(user,password,url,title,comment,tags){
+ var rate=0;
+ var starFullRate=5;
+ if(comment.match(/\*+$/)){
+ comment = RegExp.leftContext;
+ rate = (RegExp.lastMatch.length > starFullRate)? starFullRate : RegExp.lastMatch.length;
+ }
var request_url = 'http://api.clip.livedoor.com/v1/posts/add?' + [
- ['url', url], ['description', title], ['extended', comment], ['tags', tags.join(' ')]
+ ['url', url], ['description', title], ['extended', comment], ['rate', rate], ['tags', tags.join(' ')]
].map(function(p) p[0] + '=' + encodeURIComponent(p[1])).join('&');
return Deferred.http({
method: "get",
@@ -627,7 +633,10 @@ user,password,
isNormalize ? getNormalizedPermalink(url) : url,title,
comment,tags
- ));
+ //));
+ )).next(function(){
+ liberator.echo("[" + services[service].description + "] post completed.");
+ });
});
d.error(function(e){liberator.echoerr("direct_bookmark.js: Exception throwed! " + e);liberator.log(e);});
setTimeout(function(){first.call();},0);
|