1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

switch to subtitle filter

This commit is contained in:
Luke Pulverenti 2014-06-10 13:36:06 -04:00
parent c98448df25
commit c55d6e3511
4 changed files with 46 additions and 51 deletions

View file

@ -91,55 +91,64 @@
function fillSubtitleList(page, item) {
var html = '<ul data-role="listview" data-split-icon="delete"><li data-role="list-divider">Current Subtitles</li>';
var streams = item.MediaStreams || [];
html += streams.filter(function (s) {
var subs = streams.filter(function (s) {
return s.Type == 'Subtitle';
});
}).map(function (s) {
var html = '';
var itemHtml = '<li><a class="btnViewSubtitles" href="#" data-index="' + s.Index + '">';
if (subs.length) {
itemHtml += '<p>' + (s.Language || 'Unknown language') + '</p>';
html += '<br/>';
html += '<ul data-role="listview" data-split-icon="delete"><li data-role="list-divider">Current Subtitles</li>';
if (s.IsDefault || s.IsForced) {
html += subs.map(function (s) {
var atts = [];
var cssClass = s.Path ? 'btnViewSubtitles' : '';
if (s.IsDefault) {
var itemHtml = '<li><a class="' + cssClass + '" href="#" data-index="' + s.Index + '">';
atts.push('Default');
}
if (s.IsForced) {
itemHtml += '<p>' + (s.Language || 'Unknown language') + '</p>';
atts.push('Forced');
if (s.IsDefault || s.IsForced) {
var atts = [];
if (s.IsDefault) {
atts.push('Default');
}
if (s.IsForced) {
atts.push('Forced');
}
itemHtml += '<p>' + atts.join(', ') + '</p>';
}
itemHtml += '<p>' + atts.join(', ') + '</p>';
}
if (s.Path) {
itemHtml += '<p>' + (s.Path) + '</p>';
}
if (s.Path) {
itemHtml += '<p>' + (s.Path) + '</p>';
}
itemHtml += '</a>';
itemHtml += '</a>';
if (s.Path) {
itemHtml += '<a href="#" data-icon="delete" class="btnDelete" data-index="' + s.Index + '">' + Globalize.translate('Delete') + '</a>';
} else {
itemHtml += '<a href="#" data-icon="delete" style="display:none;" class="btnDelete" data-index="' + s.Index + '">' + Globalize.translate('Delete') + '</a>';
}
if (s.Path) {
itemHtml += '<a href="#" data-icon="delete" class="btnDelete" data-index="' + s.Index + '">' + Globalize.translate('Delete') + '</a>';
} else {
itemHtml += '<a href="#" data-icon="delete" style="display:none;" class="btnDelete" data-index="' + s.Index + '">' + Globalize.translate('Delete') + '</a>';
}
itemHtml += '</li>';
itemHtml += '</li>';
return itemHtml;
return itemHtml;
}).join('');
}).join('');
html += '</ul>';
html += '</ul>';
}
var elem = $('.subtitleList', page).html(html).trigger('create');