Changeset 16979 for lang/javascript/userscripts
- Timestamp:
- 08/02/08 18:27:41 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/hatena.haiku.expandrepliestree.user.js
r16978 r16979 55 55 // 深すぎるので、さらに展開するためのリンクをつけたうえで終了する。 56 56 return next(function (i) { 57 if (!$X("boolean(.//a[.//img[@alt='Reply to'] and not(@style)])", entry)) return; 57 //var entries = $X("//div[@class='entries']/div[@class='entry'][.//img[@alt='Reply to'] or .//span[@class='replies']/a]"); 58 if (!$X("boolean( .//a[.//img[@alt='Reply to'] and not(@class = '__loaded')] | .//span[@class='replies']/a[not(@class = '__loaded')] )", entry)) return; 58 59 log("level too deep. Please click the link to expand more."); 59 60 addExpandLink(entry, function () { … … 88 89 if (e._expanded) return next(); 89 90 90 if (a) a.style.opacity = "0.2"; 91 if (a) { 92 a.style.opacity = "0.2"; 93 a.className = "__loaded"; 94 } 95 91 96 e = applyJavaScript(e); 92 97 var body = $X("./div[@class='list-body']", e)[0]; 93 98 entry.parentNode.insertBefore(e, entry); 94 99 body.appendChild(entry); 100 101 $X("./div[@class='list-body']/div[@class='info']/span[@class='replies']/a[@href]", e).forEach(function (a) { 102 log(a); 103 // 既にロードされているなら半透明にしとく 104 var raw_href = $X("string(@href)", a); 105 if ($X("boolean(.//span[@class='timestamp']/a[@href = '"+raw_href+"'])", e)) { 106 a.style.opacity = "0.2"; 107 a.className = "__loaded"; 108 } 109 }); 110 95 111 return wait(WAIT).next(function () { 96 112 return call(expandReplies, e, level - 1); … … 108 124 // don't show if this was showed entry 109 125 var raw_href = $X("string(@href)", a); 110 if ($X("boolean(.//span[@class='timestamp']/a[@href = '"+raw_href+"'])", entry)) { 111 a.style.opacity = "0.2"; 112 return next(); 113 } 126 if (a.className == "__loaded") return next(); 127 114 128 // don't load already showed entry 115 129 var es = $X("//div[@class='entry' and .//span[@class='timestamp']/a[@href = '"+raw_href+"']]"); … … 123 137 function appendAndLoadNext (e) { 124 138 a.style.opacity = "0.2"; 125 $X("./div[@class='list-body']/div/a[img[@alt='Reply to']]", e)[0].style.opacity = "0.2"; 139 a.className = "__loaded"; 140 141 var parentLink = $X("./div[@class='list-body']/div/a[img[@alt='Reply to']]", e)[0] 142 parentLink.style.opacity = "0.2"; 143 parentLink.className = "__loaded"; 126 144 127 145 // 時系列に並ぶ様に注意する
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)