diff options
author | suVene | 2009-01-01 09:52:57 +0000 |
---|---|---|
committer | suVene | 2009-01-01 09:52:57 +0000 |
commit | d76a914c36ced77c6bcece7cc84a6d0e5910003b (patch) | |
tree | b8a74a2816f08b77104e7dc793a3b3321e5b535e /sbmcommentsviewer.js | |
parent | 5637f23370f234297d565fb9fb65f950ff259ee4 (diff) | |
download | vimperator-plugins-d76a914c36ced77c6bcece7cc84a6d0e5910003b.tar.bz2 |
* コメントのないブクマを非表示実装(sbm_comments_viewer_filter_nocomments).
* ついでに PLUGIN_INFO 対応。
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27729 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'sbmcommentsviewer.js')
-rw-r--r-- | sbmcommentsviewer.js | 98 |
1 files changed, 56 insertions, 42 deletions
diff --git a/sbmcommentsviewer.js b/sbmcommentsviewer.js index 2a891b0..ab3edf6 100644 --- a/sbmcommentsviewer.js +++ b/sbmcommentsviewer.js @@ -1,45 +1,53 @@ -/** - * ==VimperatorPlugin== - * @name SBM Comments Viewer - * @description List show Social Bookmark Comments - * @description-ja ソーシャル・ブックマーク・コメントを表示します - * @version 0.1c - * ==/VimperatorPlugin== - * - * Usage: - * - * viewSBMComments [url] [options] - * url : 省略時は現在のURL - * options: - * -f, -format : 出力時のフォーマット(`,'区切りのリスト) - * (default: id,timestamp,tags,comment) - * let g:def_sbm_format = ... で指定可能 - * -t, -type : 出力するSBMタイプ - * (default: hdl) - * let g:def_sbms = ... で指定可能 - * -c, -count : ブックマーク件数のみ出力 - * -b, -browser: バッファ・ウィンドウではなくブラウザに開く - * TODO:まだ出来てない - * - * 指定可能フォーマット: - * id, timpstamp, tags, comment, tagsAndComment - * - * SBMタイプ: - * h : hatena bookmark - * d : Delicious - * l : livedoor clip - * z : Buzzurl - * XXX:今後増やしていきたい - * - * 例: - * :viewSBMComments http://d.hatena.ne.jp/teramako/ -t hdl -f id,comment -c - * - * 備考: - * * 一度取得したものは(30分ほど)キャッシュに貯めてますので何度も見直すことが可能です。 - * * 粋なコマンド名募集中 - */ +var PLUGIN_INFO = +<VimperatorPlugin> + <name>SBM Comments Viewer</name> + <description>List show Social Bookmark Comments</description> + <description lang="ja">ソーシャル・ブックマーク・コメントを表示します</description> + <version>0.1c</version> + <minVersion>2.0pre</minVersion> + <maxVersion>2.0pre</maxVersion> + <updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/sbmcommentsviewer.js</updateURL> + <detail><![CDATA[ +== Usage == +>|| +viewSBMComments [url] [options] + url : 省略時は現在のURL + options: + -f, -format : 出力時のフォーマット(`,'区切りのリスト) + (default: id,timestamp,tags,comment) + let g:def_sbm_format = ... で指定可能 + -t, -type : 出力するSBMタイプ + (default: hdl) + let g:def_sbms = ... で指定可能 + -c, -count : ブックマーク件数のみ出力 + -b, -browser: バッファ・ウィンドウではなくブラウザに開く + TODO:まだ出来てない +||< + +== 指定可能フォーマット == + id, timpstamp, tags, comment, tagsAndComment +== SBMタイプ == +- h : hatena bookmark +- d : Delicious +- l : livedoor clip +- z : Buzzurl +- XXX:今後増やしていきたい + +>|| +e.g.) + :viewSBMComments http://d.hatena.ne.jp/teramako/ -t hdl -f id,comment -c +||< + +== 備考 == + 一度取得したものは(30分ほど)キャッシュに貯めてますので何度も見直すことが可能です。 + 粋なコマンド名募集中 + ]]></detail> +</VimperatorPlugin>; liberator.plugins.sbmCommentsViewer = (function(){ + +var isFilterNoComments = liberator.globalVariables.sbm_comments_viewer_filter_nocomments || false; + /** * SBMEntry Container {{{ * @param {String} type @@ -82,7 +90,10 @@ SBMContainer.prototype = { //{{{ var thead = <tr/>; format.forEach(function(colum){ thead.* += <th>{manager.format[colum] || '-'}</th>; }); var tbody = <></>; - self.entries.forEach(function(e){ tbody += e.toHTML(format); }); + self.entries.forEach(function(e){ + if (isFilterNoComments && !e.comment) return; + tbody += e.toHTML(format); + }); return thead + tbody; })(); return xml; @@ -327,7 +338,6 @@ var SBM = { //{{{ } //}}} }; //}}} - /** * jsonDecode {{{ * @param {String} str JSON String @@ -495,6 +505,9 @@ commands.addUserCommand(['viewSBMComments'], 'SBM Comments Viewer', //{{{ } ); //}}} +/** + * cacheManager {{{ + */ var cacheManager = (function(){ var cache = {}; // min sec millisec @@ -539,6 +552,7 @@ var cacheManager = (function(){ }; return c_manager; })(); +//}}} return manager; })(); |