aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2010-05-04 10:05:55 +0000
committeranekos2010-05-04 10:05:55 +0000
commitb30cbaba7e3d96d99413d56cc3ef270a6cd196b3 (patch)
treefaaaab25a9ee7725dc0bc30cc79a88021b4c61e3
parent86dfd95415df4324c8405c9652c48b4802ae6bf9 (diff)
downloadvimperator-plugins-b30cbaba7e3d96d99413d56cc3ef270a6cd196b3.tar.bz2
YouTube もサムネ付き関連動画に対応
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37357 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r--stella.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/stella.js b/stella.js
index 6cd7f5e..53e9593 100644
--- a/stella.js
+++ b/stella.js
@@ -39,12 +39,12 @@ let PLUGIN_INFO =
<name lang="ja">すてら</name>
<description>For Niconico/YouTube/Vimeo, Add control commands and information display(on status line).</description>
<description lang="ja">ニコニコ動画/YouTube/Vimeo 用。操作コマンドと情報表示(ステータスライン上に)追加します。</description>
- <version>0.26.4</version>
+ <version>0.26.5</version>
<author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author>
<license>new BSD License (Please read the source code comments of this plugin)</license>
<license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license>
<minVersion>2.0</minVersion>
- <maxVersion>2.3</maxVersion>
+ <maxVersion>2.4</maxVersion>
<updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/stella.js</updateURL>
<detail><![CDATA[
== Commands ==
@@ -923,10 +923,14 @@ Thanks:
get relations () {
let result = [];
let doc = content.document;
- let r = doc.evaluate("//div[@class='video-mini-title']/a", doc, null, 7, null);
- for (let i = 0, l = r.snapshotLength; i < l; i++) {
- let e = r.snapshotItem(i);
- result.push(new RelatedID(YouTubePlayer.getIDfromURL(e.href), e.textContent));
+ for each (let item in Array.slice(doc.querySelectorAll('.video-list-item'))) {
+ result.push(
+ new RelatedID(
+ YouTubePlayer.getIDfromURL(item.querySelector('a').href),
+ item.querySelector('span.title').textContent,
+ item.querySelector('img').src
+ )
+ );
}
return result;
},