script/bitlove-enclosures.js: cosmetics

This commit is contained in:
Astro 2014-10-11 02:34:17 +02:00
parent adf771da53
commit 388a051df3
2 changed files with 9 additions and 4 deletions

View File

@ -84,7 +84,7 @@ $(document).ready(function() {
/* For C3D2-Web */
$('a[rel="enclosure"]').each(function() {
var a = $(this);
var prevLi = a.parent();
var li = a.parent();
var url = a.attr('href');
if (/\.torrent$/.test(url))
@ -93,9 +93,10 @@ $(document).ready(function() {
resolve(url, function(info) {
var torrent = info && info.sources && info.sources[0] && info.sources[0].torrent;
if (info && torrent) {
var li = $('<li><a type="application/x-bittorrent" class="mime">Torrent</a>');
li.find('a').attr('href', torrent);
prevLi.after(li);
var a = $('<a type="application/x-bittorrent" class="torrent mime">Torrent</a>');
a.attr('href', torrent);
li.append(" ");
li.append(a);
}
});
});

View File

@ -781,6 +781,10 @@ li audio, li video, li .poster {
font-size: smaller;
color: #333;
}
.video-resource .torrent {
margin-left: 0.4em;
font-size: smaller;
}
.chapters {
margin: 0.5em auto;