Changeset 16962 for lang/javascript/userscripts
- Timestamp:
- 08/02/08 00:19:28 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/hatena.haiku.expandrepliestree.user.js
r16959 r16962 56 56 var es = $X("//div[@class='entry' and .//span[@class='timestamp']/a[@href = '"+raw_href+"']]"); 57 57 if (es.length) return appendAndLoadNext(es[0]); 58 log(a.href);59 58 return xhttp.get(a.href).next(function (data) { 60 59 // remove unnecessary tags … … 66 65 a.style.opacity = "0.2"; 67 66 $X("./div[@class='list-body']/div/a[img[@src='/images/icon-replylink.gif']]", e)[0].style.opacity = "0.2"; 68 body.appendChild(applyJavaScript(e)); 67 68 // 時系列に並ぶ様に注意する 69 var time = $X("string(div/div/span[@class='timestamp']/a)", e); 70 var ref = $X("./div[@class='entry']", body).filter(function (i) { 71 return $X("string(div/div/span[@class='timestamp']/a)", i) < time; 72 })[0]; 73 74 body.insertBefore(applyJavaScript(e), ref); 69 75 return wait(WAIT).next(function () { 70 76 return call(expandChildReplies, e); … … 72 78 } 73 79 }) 74 );//.next(function () { 75 // // sort by timestamp 76 // $X("li[@class='entry']", body).map(function (i) { 77 // return { 78 // time: $X("string(div/div/span[@class='timestamp']/a/@href)", i).match(/\d+$/)[0], 79 // elem: i 80 // }; 81 // }).sort(function (a, b) { 82 // return b.time - a.time; 83 // }).forEach(function (i) { 84 // body.appendChild(i.elem); 85 // }); 86 // }); 80 ); 87 81 } 88 82 … … 171 165 172 166 function log (m) { 173 // var c = unsafeWindow.console; 174 // if (c) c.log.apply(c, arguments); 175 var o = Array.prototype.concat.apply([], arguments); 176 if (window.console) { 177 window.console.log(o.join(", ")); 178 } else 179 if (GM_log) { 180 GM_log(o); 181 } else { 182 location.href = "javascript:(function () { if (window.console) console.log.apply(console.log, "+o.toSource()+") })();"; 183 } 167 unsafeWindow.console.log(uneval(m)); 184 168 185 169 if (!arguments.callee.element) {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)