From 581d3bbfa2b3ce5b994e0f358aaf41c0a2c66fba Mon Sep 17 00:00:00 2001 From: arccosine Date: Wed, 26 Nov 2008 17:00:59 +0000 Subject: 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 --- direct_bookmark.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'direct_bookmark.js') 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 - 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); -- cgit v1.2.3