Changeset 14433

Show
Ignore:
Timestamp:
06/22/08 23:19:57 (5 years ago)
Author:
kga
Message:

fixed bug when # is encoded.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/userscripts/ldr_show_sbm_comments/ldr_show_sbm_comments.user.js

    r14336 r14433  
    2222        var item_link = item.link; 
    2323        var item_id   = item.id; 
    24         var url       = encodeURIComponent(item_link); 
     24        var url       = encodeURIComponent(item_link.replace(/%23/g, '#')); 
    2525        var elem      = w.$('sbm_' + item_id); 
    2626 
     
    2929            parseResponse : function (req) { 
    3030                var o = new Function('return ' + req.responseText)(); 
    31                 if (!o || o.count < 1) return []; 
    32                 return o.bookmarks.map(hatena.makeComment); 
     31                return (o && o.count > 0) ? o.bookmarks.map(hatena.makeComment) : []; 
    3332            }, 
    3433            makeTag : function (tags, id) { 
     
    6362            parseResponse: function (req) { 
    6463                var o = new Function('return ' + req.responseText)(); 
    65                 if (!o.isSuccess) return []; 
    66                 return o.Comments.map(livedoor.makeComment); 
     64                return (o.isSuccess) ? o.Comments.map(livedoor.makeComment) : []; 
    6765            }, 
    6866            makeTag : function (tags, id) {