diff options
author | anekos | 2009-02-04 10:08:58 +0000 |
---|---|---|
committer | anekos | 2009-02-04 10:08:58 +0000 |
commit | 856788febcc67f097e8000c779daad60f0734ecd (patch) | |
tree | 9fe8f9237fb4cda5c8264d7b28204de5dc6d9b9c | |
parent | 92c69ea625e531f99fdefdb8e150f510f7461799 (diff) | |
download | vimperator-plugins-856788febcc67f097e8000c779daad60f0734ecd.tar.bz2 |
コメント欄関連動画タイトルの文字列長の最大を設定する
コメントアウトされていたのを治す
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@29525 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | stella.js | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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*<a href="http:\\/\\/www\\.nicovideo\\.\\w+\\/watch\\/' + link + '" class="video">').exec(comment); if (r) - videos.push(new RelatedID(link, r[1])); + videos.push(new RelatedID(link, r[1].slice(-20))); }); } |