mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add more sync buttons
This commit is contained in:
parent
0770149de2
commit
d84df77553
42 changed files with 2405 additions and 66 deletions
|
@ -365,7 +365,10 @@
|
|||
|
||||
html += '<div>';
|
||||
|
||||
if (session.PlayState.PlayMethod == 'Transcode') {
|
||||
if (session.TranscodingInfo && session.TranscodingInfo.IsAudioDirect && session.TranscodingInfo.IsVideoDirect) {
|
||||
html += Globalize.translate('LabelPlayMethodDirectStream');
|
||||
}
|
||||
else if (session.PlayState.PlayMethod == 'Transcode') {
|
||||
html += Globalize.translate('LabelPlayMethodTranscoding');
|
||||
}
|
||||
else if (session.PlayState.PlayMethod == 'DirectStream') {
|
||||
|
|
|
@ -19,7 +19,12 @@
|
|||
|
||||
var context = 'home-latest';
|
||||
|
||||
Sections.loadRecentlyAdded($('.section0', page), userId, context);
|
||||
var latestMediElem = $('.section0', page);
|
||||
|
||||
Sections.loadRecentlyAdded(latestMediElem, userId, context).done(function () {
|
||||
|
||||
$('h1', latestMediElem).addClass('firstListHeader');
|
||||
});
|
||||
Sections.loadLatestLiveTvRecordings($(".section1", page), userId);
|
||||
Sections.loadLatestChannelItems($(".section2", page), userId);
|
||||
}
|
||||
|
|
|
@ -130,14 +130,14 @@
|
|||
IsPlayed: false
|
||||
};
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
||||
return ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
||||
|
||||
var html = '';
|
||||
|
||||
if (items.length) {
|
||||
html += '<div>';
|
||||
html += '<h1 style="display:inline-block; vertical-align:middle;" class="listHeader">' + Globalize.translate('HeaderLatestMedia') + '</h1>';
|
||||
html += '<a href="mypreferencesdisplay.html" data-role="button" data-icon="edit" data-mini="true" data-inline="true" data-iconpos="notext" class="sectionHeaderButton">d</a>';
|
||||
html += '<a href="mypreferencesdisplay.html" class="accentButton"><i class="fa fa-pencil"></i>' + Globalize.translate('ButtonEdit') + '</a>';
|
||||
html += '</div>';
|
||||
html += '<div>';
|
||||
html += LibraryBrowser.getPosterViewHtml({
|
||||
|
@ -208,7 +208,7 @@
|
|||
|
||||
html += '<div>';
|
||||
html += '<h1 style="display:inline-block; vertical-align:middle;" class="' + cssClass + '">' + Globalize.translate('HeaderMyViews') + '</h1>';
|
||||
html += '<a href="mypreferencesdisplay.html" data-role="button" data-icon="edit" data-mini="true" data-inline="true" data-iconpos="notext" class="sectionHeaderButton">d</a>';
|
||||
html += '<a href="mypreferencesdisplay.html" class="accentButton"><i class="fa fa-pencil"></i>' + Globalize.translate('ButtonEdit') + '</a>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div>';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var LibraryBrowser = (function (window, document, $, screen, store) {
|
||||
|
||||
var pageSizeKey = 'pagesize_v3';
|
||||
var pageSizeKey = 'pagesize_v4';
|
||||
|
||||
$(function () {
|
||||
$("body").on("create", function () {
|
||||
|
|
|
@ -426,7 +426,7 @@
|
|||
}
|
||||
|
||||
if (commands.indexOf('sync') != -1) {
|
||||
html += '<li data-icon="refresh"><a href="#" class="btnSync" data-itemId="' + itemId + '">' + Globalize.translate('ButtonSync') + '</a></li>';
|
||||
html += '<li data-icon="cloud"><a href="#" class="btnSync" data-itemId="' + itemId + '">' + Globalize.translate('ButtonSync') + '</a></li>';
|
||||
}
|
||||
|
||||
if (commands.indexOf('delete') != -1) {
|
||||
|
|
|
@ -103,8 +103,9 @@
|
|||
return '.m3u8';
|
||||
}
|
||||
|
||||
// Chrome or IE with plugin installed
|
||||
// Chrome, Firefox or IE with plugin installed
|
||||
if (self.canPlayWebm()) {
|
||||
|
||||
return '.webm';
|
||||
}
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@
|
|||
return i.getAttribute('data-viewid');
|
||||
});
|
||||
|
||||
ApiClient.updateUser(user).done(function () {
|
||||
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
|
||||
Dashboard.alert(Globalize.translate('SettingsSaved'));
|
||||
|
||||
loadForm(page, user, false);
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
user.Configuration.PlayDefaultAudioTrack = $('#chkPlayDefaultAudioTrack', page).checked();
|
||||
user.Configuration.EnableCinemaMode = $('#chkEnableCinemaMode', page).checked();
|
||||
|
||||
ApiClient.updateUser(user).done(function () {
|
||||
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
|
||||
Dashboard.alert(Globalize.translate('SettingsSaved'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@
|
|||
|
||||
user.Configuration.EnableLocalPassword = $('#chkEnableLocalAccessWithoutPassword', page).checked();
|
||||
|
||||
ApiClient.updateUser(user).done(function () {
|
||||
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@
|
|||
|
||||
supportsPlaylists: function (item) {
|
||||
|
||||
return item.SupportsPlaylists;
|
||||
return item.RunTimeTicks || item.IsFolder || item.Type == "Genre" || item.Type == "MusicGenre" || item.Type == "MusicArtist";
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -760,10 +760,10 @@ var Dashboard = {
|
|||
name: Globalize.translate('TabPlayback'),
|
||||
href: "playbackconfiguration.html",
|
||||
selected: page.hasClass('playbackConfigurationPage')
|
||||
//}, {
|
||||
// name: Globalize.translate('TabSync'),
|
||||
// href: "syncactivity.html",
|
||||
// selected: page.hasClass('syncConfigurationPage')
|
||||
}, {
|
||||
name: Globalize.translate('TabSync'),
|
||||
href: "syncactivity.html",
|
||||
selected: page.hasClass('syncConfigurationPage')
|
||||
}, {
|
||||
divider: true,
|
||||
name: Globalize.translate('TabAutoOrganize'),
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
userId: userId,
|
||||
TargetId: target,
|
||||
|
||||
ItemIds: syncOptions.items.map(function (i) {
|
||||
ItemIds: (syncOptions.items || []).map(function (i) {
|
||||
return i.Id || i;
|
||||
}).join(','),
|
||||
|
||||
|
@ -41,7 +41,10 @@
|
|||
|
||||
SyncNewContent: $('#chkSyncNewContent', form).checked(),
|
||||
UnwatchedOnly: $('#chkUnwatchedOnly', form).checked(),
|
||||
ItemLimit: $('#txtItemLimit').val() || null
|
||||
ItemLimit: $('#txtItemLimit').val() || null,
|
||||
|
||||
ParentId: syncOptions.ParentId,
|
||||
Category: syncOptions.Category
|
||||
};
|
||||
|
||||
ApiClient.ajax({
|
||||
|
@ -66,9 +69,12 @@
|
|||
ApiClient.getJSON(ApiClient.getUrl('Sync/Options', {
|
||||
|
||||
UserId: userId,
|
||||
ItemIds: options.items.map(function (i) {
|
||||
ItemIds: (options.items || []).map(function (i) {
|
||||
return i.Id || i;
|
||||
}).join(',')
|
||||
}).join(','),
|
||||
|
||||
ParentId: options.ParentId,
|
||||
Category: options.Category
|
||||
|
||||
})).done(function (result) {
|
||||
|
||||
|
@ -157,7 +163,7 @@
|
|||
|
||||
html += '<br/>';
|
||||
html += '<p>';
|
||||
html += '<button type="submit" data-icon="refresh" data-theme="b">' + Globalize.translate('ButtonSync') + '</button>';
|
||||
html += '<button type="submit" data-icon="cloud" data-theme="b">' + Globalize.translate('ButtonSync') + '</button>';
|
||||
html += '</p>';
|
||||
|
||||
html += '</form>';
|
||||
|
@ -207,7 +213,7 @@
|
|||
|
||||
function isAvailable(item, user) {
|
||||
|
||||
return false;
|
||||
//return false;
|
||||
return item.SupportsSync;
|
||||
}
|
||||
|
||||
|
@ -219,4 +225,46 @@
|
|||
|
||||
};
|
||||
|
||||
function showSyncButtonsPerUser(page) {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
if (user.Policy.EnableSync) {
|
||||
$('.categorySyncButton', page).show();
|
||||
} else {
|
||||
$('.categorySyncButton', page).hide();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function onCategorySyncButtonClick(page, button) {
|
||||
|
||||
var category = button.getAttribute('data-category');
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
|
||||
SyncManager.showMenu({
|
||||
ParentId: parentId,
|
||||
Category: category
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pageinit', ".libraryPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.categorySyncButton', page).on('click', function () {
|
||||
|
||||
onCategorySyncButtonClick(page, this);
|
||||
});
|
||||
|
||||
}).on('pagebeforeshow', ".libraryPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
showSyncButtonsPerUser(page);
|
||||
|
||||
});
|
||||
|
||||
|
||||
})(window, jQuery);
|
|
@ -19,17 +19,17 @@
|
|||
|
||||
$('.scopedLibraryViewNav', page).show();
|
||||
$('.globalNav', page).hide();
|
||||
$('.ehsContent', page).css('text-align', 'left');
|
||||
$('.scopedContent', page).show();
|
||||
context = 'tv';
|
||||
$('.nextUpHeader', page).removeClass('firstListHeader');
|
||||
|
||||
loadResume(page);
|
||||
|
||||
} else {
|
||||
$('.scopedLibraryViewNav', page).hide();
|
||||
$('.globalNav', page).show();
|
||||
$('.ehsContent', page).css('text-align', 'center');
|
||||
$('.scopedContent', page).hide();
|
||||
$('.nextUpHeader', page).addClass('firstListHeader');
|
||||
}
|
||||
|
||||
loadNextUp(page, context || 'home-nextup');
|
||||
|
@ -49,20 +49,6 @@
|
|||
|
||||
query.ParentId = LibraryMenu.getTopParentId();
|
||||
|
||||
if (query.ParentId) {
|
||||
|
||||
$('.scopedLibraryViewNav', page).show();
|
||||
$('.globalNav', page).hide();
|
||||
$('.ehsContent', page).css('text-align', 'left');
|
||||
$('.scopedContent', page).show();
|
||||
|
||||
} else {
|
||||
$('.scopedLibraryViewNav', page).hide();
|
||||
$('.globalNav', page).show();
|
||||
$('.ehsContent', page).css('text-align', 'center');
|
||||
$('.scopedContent', page).hide();
|
||||
}
|
||||
|
||||
ApiClient.getNextUpEpisodes(query).done(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
|
@ -110,7 +96,6 @@
|
|||
|
||||
if (result.Items.length) {
|
||||
$('#resumableSection', page).show();
|
||||
$('.nextUpHeader', page).removeClass('firstListHeader');
|
||||
} else {
|
||||
$('#resumableSection', page).hide();
|
||||
$('.nextUpHeader', page).addClass('firstListHeader');
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
var query = {
|
||||
|
||||
Limit: 40,
|
||||
Fields: "SeriesInfo,UserData,SeriesStudio,SyncInfo",
|
||||
Fields: "AirTime,UserData,SeriesStudio,SyncInfo",
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
|
||||
$('#chkDisableUserPreferences', page).checked((!user.Configuration.EnableUserPreferenceAccess) || false).checkboxradio("refresh");
|
||||
|
||||
$('#chkEnableSync', page).checked(user.Policy.EnableSync).checkboxradio("refresh");
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
|
@ -75,8 +77,14 @@
|
|||
user.Configuration.EnableUserPreferenceAccess = !$('#chkDisableUserPreferences', page).checked();
|
||||
user.Configuration.EnableSharedDeviceControl = $('#chkRemoteControlSharedDevices', page).checked();
|
||||
|
||||
user.Policy.EnableSync = $('#chkEnableSync', page).checked();
|
||||
|
||||
ApiClient.updateUser(user).done(function () {
|
||||
onSaveComplete(page, user);
|
||||
|
||||
ApiClient.updateUserPolicy(user.Id, user.Policy).done(function () {
|
||||
|
||||
onSaveComplete(page, user);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
|
||||
}).get();
|
||||
|
||||
ApiClient.updateUser(user).done(function () {
|
||||
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
|
||||
onSaveComplete(page);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
|
||||
}).get();
|
||||
|
||||
ApiClient.updateUser(user).done(function () {
|
||||
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
|
||||
Dashboard.navigate("useredit.html?userId=" + user.Id);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -211,7 +211,7 @@
|
|||
|
||||
user.Configuration.BlockedTags = getTagsFromPage(page);
|
||||
|
||||
ApiClient.updateUser(user).done(function () {
|
||||
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
|
||||
onSaveComplete(page);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue