From 856788febcc67f097e8000c779daad60f0734ecd Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 4 Feb 2009 10:08:58 +0000 Subject: コメント欄関連動画タイトルの文字列長の最大を設定する コメントアウトされていたのを治す git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@29525 d0d07461-0603-4401-acd4-de1884942a52 --- stella.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'stella.js') diff --git a/stella.js b/stella.js index 991791a..1b41f27 100644 --- a/stella.js +++ b/stella.js @@ -924,9 +924,9 @@ Thanks: get playerContainer () U.getElementByIdEx('flvplayer_container'), get relatedIDs () { - // if (this.__rid_last_url == U.currentURL()) - // return this.__rid_cache || []; - // this.__rid_last_url = U.currentURL(); + if (this.__rid_last_url == U.currentURL()) + return this.__rid_cache || []; + this.__rid_last_url = U.currentURL(); let videos = []; @@ -947,7 +947,9 @@ Thanks: } } - // コメント欄からそれっぽいのを取得 + // コメント欄からそれっぽいのを取得する + // コメント欄のリンクの前のテキストをタイトルと見なす + // textContent を使うと改行が理解できなくなるので、innerHTML で頑張ったけれど頑張りたくない { let xpath = '//*[@id="des_2"]/table/tbody/tr/td/div[2]'; let comment = U.xpathGet(xpath).innerHTML; @@ -958,7 +960,7 @@ Thanks: links.forEach(function (link) { let r = RegExp('(?:^|[\u3000\\s\\>])([^\u3000\\s\\>]+)\\s*').exec(comment); if (r) - videos.push(new RelatedID(link, r[1])); + videos.push(new RelatedID(link, r[1].slice(-20))); }); } -- cgit v1.2.3