aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2009-02-04 10:08:58 +0000
committeranekos2009-02-04 10:08:58 +0000
commit856788febcc67f097e8000c779daad60f0734ecd (patch)
tree9fe8f9237fb4cda5c8264d7b28204de5dc6d9b9c
parent92c69ea625e531f99fdefdb8e150f510f7461799 (diff)
downloadvimperator-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.js12
1 files changed, 7 insertions, 5 deletions
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*<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)));
});
}