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

update subtitle editor

This commit is contained in:
Luke Pulverenti 2015-09-17 00:19:15 -04:00
parent ea83927812
commit 7ea4d0b4c9
3 changed files with 56 additions and 29 deletions

View file

@ -675,7 +675,12 @@
} }
if (user.Policy.IsAdministrator) { if (user.Policy.IsAdministrator) {
commands.push('edit'); commands.push('edit');
if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program') {
commands.push('managesubtitles');
}
} }
commands.push('refresh'); commands.push('refresh');
@ -692,10 +697,6 @@
commands.push('share'); commands.push('share');
} }
if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program') {
commands.push('managesubtitles');
}
return commands; return commands;
}, },
@ -736,7 +737,7 @@
editSubtitles: function (itemId) { editSubtitles: function (itemId) {
require(['subtitleeditor/edititemsubtitles'], function () { require(['subtitleeditor/subtitleeditor'], function () {
SubtitleEditor.show(itemId); SubtitleEditor.show(itemId);
}); });

View file

@ -107,12 +107,6 @@
itemHtml += '<paper-fab class="listAvatar blue" icon="closed-caption" item-icon></paper-fab>'; itemHtml += '<paper-fab class="listAvatar blue" icon="closed-caption" item-icon></paper-fab>';
itemHtml += '<paper-item-body three-line>';
itemHtml += '<div>';
itemHtml += (s.Language || Globalize.translate('LabelUnknownLanaguage'));
itemHtml += '</div>';
var atts = []; var atts = [];
atts.push(s.Codec); atts.push(s.Codec);
@ -125,7 +119,18 @@
atts.push('Forced'); atts.push('Forced');
} }
itemHtml += '<div secondary>' + atts.join(', ') + '</div>'; if (atts.length == 3) {
itemHtml += '<paper-item-body three-line>';
}
else {
itemHtml += '<paper-item-body two-line>';
}
itemHtml += '<div>';
itemHtml += (s.Language || Globalize.translate('LabelUnknownLanaguage'));
itemHtml += '</div>';
itemHtml += '<div secondary>' + atts.join(' - ') + '</div>';
if (s.Path) { if (s.Path) {
itemHtml += '<div secondary>' + (s.Path) + '</div>'; itemHtml += '<div secondary>' + (s.Path) + '</div>';
@ -202,8 +207,6 @@
$('.noSearchResults', page).hide(); $('.noSearchResults', page).hide();
html += '<ul data-role="listview">';
for (var i = 0, length = results.length; i < length; i++) { for (var i = 0, length = results.length; i < length; i++) {
var result = results[i]; var result = results[i];
@ -211,29 +214,50 @@
var provider = result.ProviderName; var provider = result.ProviderName;
if (provider != lastProvider) { if (provider != lastProvider) {
html += '<li data-role="list-divider">' + provider + '<span class="ui-li-count ui-body-inherit">' + Globalize.translate('HeaderRatingsDownloads') + '</span></li>';
if (i > 0) {
html += '</div>';
}
html += '<h1>' + provider + '</h1>';
html += '<div class="paperList">';
lastProvider = provider; lastProvider = provider;
} }
html += '<li><a class="btnViewSubtitle" href="#" data-subid="' + result.Id + '">'; html += '<paper-icon-item>';
html += '<h3>' + (result.Name) + '</h3>'; html += '<paper-fab class="listAvatar blue" icon="closed-caption" item-icon></paper-fab>';
html += '<p>' + (result.Format) + '</p>';
if (result.Comment) { if (result.Comment) {
html += '<p>' + (result.Comment) + '</p>'; html += '<paper-item-body three-line>';
}
else {
html += '<paper-item-body two-line>';
} }
html += '<div class="ui-li-count">' + (result.CommunityRating || 0) + ' / ' + (result.DownloadCount || 0) + '</div>'; //html += '<a class="btnViewSubtitle" href="#" data-subid="' + result.Id + '">';
html += '</a>'; html += '<div>' + (result.Name) + '</div>';
html += '<div secondary>' + (result.Format) + '</div>';
html += '<a href="#" class="btnDownload" data-icon="plus" data-subid="' + result.Id + '">' + Globalize.translate('ButtonDownload') + '</a>'; if (result.Comment) {
html += '<div secondary>' + (result.Comment) + '</div>';
}
html += '</li>'; //html += '</a>';
html += '</paper-item-body>';
html += '<div style="font-size:86%;opacity:.7;">' + /*(result.CommunityRating || 0) + ' / ' +*/ (result.DownloadCount || 0) + '</div>';
html += '<paper-icon-button icon="cloud-download" data-subid="' + result.Id + '" title="' + Globalize.translate('ButtonDownload') + '" class="btnDownload"></paper-icon-button>';
html += '</paper-icon-item>';
}
if (results.length) {
html += '</div>';
} }
html += '</ul>';
var elem = $('.subtitleResults', page).html(html).trigger('create'); var elem = $('.subtitleResults', page).html(html).trigger('create');
$('.btnViewSubtitle', elem).on('click', function () { $('.btnViewSubtitle', elem).on('click', function () {
@ -317,7 +341,7 @@
var html = ''; var html = '';
html += '<h2 class="dialogHeader">'; html += '<h2 class="dialogHeader">';
html += '<paper-fab icon="arrow-back" class="mini"></paper-fab>'; html += '<paper-fab icon="arrow-back" class="mini btnCloseDialog"></paper-fab>';
html += '<div style="display:inline-block;margin-left:.6em;vertical-align:middle;">' + item.Name + '</div>'; html += '<div style="display:inline-block;margin-left:.6em;vertical-align:middle;">' + item.Name + '</div>';
html += '</h2>'; html += '</h2>';
@ -333,7 +357,7 @@
// Has to be assigned a z-index after the call to .open() // Has to be assigned a z-index after the call to .open()
$(dlg).on('iron-overlay-closed', onDialogClosed); $(dlg).on('iron-overlay-closed', onDialogClosed);
//document.body.classList.add('bodyWithPopupOpen'); document.body.classList.add('bodyWithPopupOpen');
dlg.open(); dlg.open();
window.location.hash = getHash(itemId); window.location.hash = getHash(itemId);
@ -350,7 +374,7 @@
fillLanguages(editorContent, languages); fillLanguages(editorContent, languages);
}); });
$('paper-fab', dlg).on('click', closeDialog); $('.btnCloseDialog', dlg).on('click', closeDialog);
}); });
}); });
} }
@ -384,9 +408,9 @@
currentDialog = null; currentDialog = null;
window.removeEventListener('hashchange', onHashChange); window.removeEventListener('hashchange', onHashChange);
//document.body.classList.remove('bodyWithPopupOpen'); document.body.classList.remove('bodyWithPopupOpen');
$(this).remove(); $(this).remove();
Dashboard.hideLoadingMsg();
if ((window.location.hash || '').length > 1) { if ((window.location.hash || '').length > 1) {
history.back(); history.back();
} }

View file

@ -521,4 +521,6 @@ paper-dialog paper-radio-group paper-radio-button {
font-weight: inherit !important; font-weight: inherit !important;
line-height: 1 !important; line-height: 1 !important;
line-height: initial !important; line-height: initial !important;
padding: 0 1em;
margin-top: 1em;
} }