mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update sync dialogs
This commit is contained in:
parent
db403c3cd4
commit
f5ad0dbc21
12 changed files with 124 additions and 147 deletions
|
@ -1,32 +1,6 @@
|
|||
define(['apphost', 'globalize', 'syncJobList', 'events', 'localsync', 'emby-button', 'paper-icon-button-light'], function (appHost, globalize, syncJobList, events, localSync) {
|
||||
'use strict';
|
||||
|
||||
function initSupporterInfo(view, params) {
|
||||
|
||||
view.querySelector('.btnSyncSupporter').addEventListener('click', function () {
|
||||
|
||||
requirejs(["registrationServices"], function (registrationServices) {
|
||||
registrationServices.validateFeature('sync');
|
||||
});
|
||||
});
|
||||
|
||||
view.querySelector('.supporterPromotion .mainText').innerHTML = globalize.translate('HeaderSyncRequiresSupporterMembership');
|
||||
|
||||
var apiClient = ApiClient;
|
||||
apiClient.getPluginSecurityInfo().then(function (regInfo) {
|
||||
|
||||
if (regInfo.IsMBSupporter) {
|
||||
view.querySelector('.supporterPromotionContainer').classList.add('hide');
|
||||
} else {
|
||||
view.querySelector('.supporterPromotionContainer').classList.remove('hide');
|
||||
}
|
||||
|
||||
}, function () {
|
||||
|
||||
view.querySelector('.supporterPromotionContainer').classList.remove('hide');
|
||||
});
|
||||
}
|
||||
|
||||
return function (view, params) {
|
||||
|
||||
var interval;
|
||||
|
@ -71,22 +45,12 @@
|
|||
view.querySelector('.localSyncStatus').classList.add('hide');
|
||||
}
|
||||
|
||||
initSupporterInfo(view, params);
|
||||
var mySyncJobList = new syncJobList({
|
||||
isLocalSync: params.mode === 'offline',
|
||||
serverId: ApiClient.serverId(),
|
||||
userId: params.mode === 'offline' ? null : ApiClient.getCurrentUserId(),
|
||||
element: view.querySelector('.syncActivity')
|
||||
});
|
||||
|
||||
events.on(mySyncJobList, 'jobedit', function (e, jobId, serverId) {
|
||||
|
||||
require(['syncJobEditor'], function (syncJobEditor) {
|
||||
syncJobEditor.show({
|
||||
serverId: ApiClient.serverId(),
|
||||
jobId: jobId
|
||||
});
|
||||
});
|
||||
element: view.querySelector('.syncActivity'),
|
||||
mode: params.mode
|
||||
});
|
||||
|
||||
view.addEventListener('viewbeforeshow', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue