Show
Ignore:
Timestamp:
08/03/08 16:41:44 (4 months ago)
Author:
cho45
Message:

クラス名のマッチを $X 側でよしなにするように

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/userscripts/hatena.haiku.expandrepliestree.user.js

    r17017 r17020  
    9393                        return !a ? next() : es.length ? appendAndLoadNext(es[0]) : http.get(a.href).next(function (data) { 
    9494                                var t = h(data.responseText.replace(/<\/?(?:script|i?frame)[^>]*>/g, "")); 
    95                                 return parallel($X(".//div[@class='entries']/div[@class='entry']", t).map(appendAndLoadNext)); 
     95                                return parallel($X(".//div[@class='entries']/div[@class='entry' and not(@class='ad')]", t).map(appendAndLoadNext)); 
    9696                        }); 
    9797 
     
    296296}; 
    297297 
     298 
     299 
    298300// extend version of $X 
    299301// $X(exp); 
     
    302304// $X(exp, context, type); 
    303305function $X (exp, context, type /* want type */) { 
    304         // console.log(String(exp)); 
     306        exp = exp.replace(/@class\s*=\s*(?:"([^"]+)"|'([^']+)')/g, "contains(concat(' ', @class, ' '), ' $1$2 ')"); 
     307        log(String(exp)); 
    305308        if (typeof context == "function") { 
    306309                type    = context; 
     
    609612}// End of JSDeferred 
    610613 
     614// {{{ 
     615// }}} 
     616 
     617 
    611618})(this); 
    612619