[q.hatena]回答へのコメントをリストで表示

    
      
  • /*
     * @title [q.hatena]回答へのコメントをリストで表示
     * @description 新着順に並べたリスト (リンク) を作ります。仕様変更前の返信は含まれません。
     * @include http://q.hatena.ne.jp/*
     * @license MIT License
     */
    
    (function() {
    
    var l = [], u = $('<ul>').appendTo('#breadcrumbs');
    
    $("div[id^='ac']").each(function() {
    
    	l.push(
    	 $('<li>').attr('id', 'l' + this.id).append(
    	  $('<a>').attr('href', '#' + this.id).text(
    	   $('div.section', this).text().replace(/^\s+/m, '').substr(0, 16) + '... : ' + $('span.timestamp', this).text()
    	  ).click(function() {
    	   $('div.answer-comment-more:visible', $($(this).attr('href')).parent()).click();
    	  })
    	 )
    	);
    
    });
    
    l.sort(function(a, b) { return((a.attr('id').substr(3) - 0 < b.attr('id').substr(3) - 0) ? 1 : -1); });
    $(l).each(function() { u.append(this) });
    
    
    })();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2011/10/25 21:18:36 - 2011-10-25
  2. 2011/10/24 16:18:13 - 2011-10-24
  3. 2011/10/23 17:34:09 - 2011-10-23