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
|
@ -14,12 +14,12 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.4.399",
|
"version": "1.4.400",
|
||||||
"_release": "1.4.399",
|
"_release": "1.4.400",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.4.399",
|
"tag": "1.4.400",
|
||||||
"commit": "b926b582df014a7b2b54e93dca167db73d59bbcb"
|
"commit": "8b3fe5c5f8044cccac68ca4535c2c818d160899e"
|
||||||
},
|
},
|
||||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||||
"_target": "^1.2.1",
|
"_target": "^1.2.1",
|
||||||
|
|
|
@ -71,6 +71,13 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.CanDownload && appHost.supports('filedownload')) {
|
||||||
|
commands.push({
|
||||||
|
name: globalize.translate('sharedcomponents#Download'),
|
||||||
|
id: 'download'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (itemHelper.canEdit(user, item)) {
|
if (itemHelper.canEdit(user, item)) {
|
||||||
|
|
||||||
if (options.edit !== false && item.Type !== 'SeriesTimer') {
|
if (options.edit !== false && item.Type !== 'SeriesTimer') {
|
||||||
|
@ -106,13 +113,6 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.CanDownload && appHost.supports('filedownload')) {
|
|
||||||
commands.push({
|
|
||||||
name: globalize.translate('sharedcomponents#Download'),
|
|
||||||
id: 'download'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.identify !== false) {
|
if (options.identify !== false) {
|
||||||
if (itemHelper.canIdentify(user, item.Type)) {
|
if (itemHelper.canIdentify(user, item.Type)) {
|
||||||
commands.push({
|
commands.push({
|
||||||
|
|
|
@ -765,11 +765,11 @@
|
||||||
showElement('#fldParentIndexNumber');
|
showElement('#fldParentIndexNumber');
|
||||||
|
|
||||||
if (item.Type === "Episode") {
|
if (item.Type === "Episode") {
|
||||||
context.querySelector('#txtParentIndexNumber').label(globalize.translate('LabelSeasonNumber'));
|
context.querySelector('#txtParentIndexNumber').label(globalize.translate('sharedcomponents#LabelSeasonNumber'));
|
||||||
} else if (item.Type === "Audio") {
|
} else if (item.Type === "Audio") {
|
||||||
context.querySelector('#txtParentIndexNumber').label(globalize.translate('LabelDiscNumber'));
|
context.querySelector('#txtParentIndexNumber').label(globalize.translate('sharedcomponents#LabelDiscNumber'));
|
||||||
} else {
|
} else {
|
||||||
context.querySelector('#txtParentIndexNumber').label(globalize.translate('LabelParentNumber'));
|
context.querySelector('#txtParentIndexNumber').label(globalize.translate('sharedcomponents#LabelParentNumber'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hideElement('#fldParentIndexNumber', context);
|
hideElement('#fldParentIndexNumber', context);
|
||||||
|
|
|
@ -49,6 +49,8 @@
|
||||||
"CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.",
|
"CloudSyncFeatureDescription": "Sync your media to the cloud for easy backup, archiving, and converting.",
|
||||||
"CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.",
|
"CoverArtFeatureDescription": "Cover Art creates fun covers and other treatments to help you personalize your media images.",
|
||||||
"CoverArt": "Cover Art",
|
"CoverArt": "Cover Art",
|
||||||
|
"ButtonCancelSyncJob": "Cancel sync",
|
||||||
|
"CancelSyncJobConfirmation": "Cancelling the sync job will remove synced media from the device during the next sync process. Are you sure you wish to proceed?",
|
||||||
"CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.",
|
"CinemaModeFeatureDescription": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the feature.",
|
||||||
"HeaderFreeApps": "Free Emby Apps",
|
"HeaderFreeApps": "Free Emby Apps",
|
||||||
"FreeAppsFeatureDescription": "Enjoy free access to Emby apps for your devices.",
|
"FreeAppsFeatureDescription": "Enjoy free access to Emby apps for your devices.",
|
||||||
|
@ -206,8 +208,8 @@
|
||||||
"LabelEpisodeNumber": "Episode number:",
|
"LabelEpisodeNumber": "Episode number:",
|
||||||
"LabelTrackNumber": "Track number:",
|
"LabelTrackNumber": "Track number:",
|
||||||
"LabelNumber": "Number:",
|
"LabelNumber": "Number:",
|
||||||
"LabelDiscNumber": "Disc number",
|
"LabelDiscNumber": "Disc number:",
|
||||||
"LabelParentNumber": "Parent number",
|
"LabelParentNumber": "Parent number:",
|
||||||
"SortName": "Sort name",
|
"SortName": "Sort name",
|
||||||
"ReleaseDate": "Release date",
|
"ReleaseDate": "Release date",
|
||||||
"Continuing": "Continuing",
|
"Continuing": "Continuing",
|
||||||
|
@ -232,11 +234,14 @@
|
||||||
"GuestStar": "Guest star",
|
"GuestStar": "Guest star",
|
||||||
"Producer": "Producer",
|
"Producer": "Producer",
|
||||||
"Writer": "Writer",
|
"Writer": "Writer",
|
||||||
|
"MessageNoSyncJobsFound": "No sync jobs found. Create sync jobs using the Sync buttons found throughout the app.",
|
||||||
|
"MessageNoDownloadsFound": "No offline downloads. Make your media available offline by clicking Make Available Offline throughout the app.",
|
||||||
"InstallingPackage": "Installing {0}",
|
"InstallingPackage": "Installing {0}",
|
||||||
"PackageInstallCompleted": "{0} installation completed.",
|
"PackageInstallCompleted": "{0} installation completed.",
|
||||||
"PackageInstallFailed": "{0} installation failed.",
|
"PackageInstallFailed": "{0} installation failed.",
|
||||||
"PackageInstallCancelled": "{0} installation cancelled.",
|
"PackageInstallCancelled": "{0} installation cancelled.",
|
||||||
"SeriesYearToPresent": "{0} - Present",
|
"SeriesYearToPresent": "{0} - Present",
|
||||||
|
"ValueOneItem": "1 item",
|
||||||
"ValueOneSong": "1 song",
|
"ValueOneSong": "1 song",
|
||||||
"ValueSongCount": "{0} songs",
|
"ValueSongCount": "{0} songs",
|
||||||
"ValueOneMovie": "1 movie",
|
"ValueOneMovie": "1 movie",
|
||||||
|
@ -269,6 +274,7 @@
|
||||||
"LabelQuality": "Quality:",
|
"LabelQuality": "Quality:",
|
||||||
"LabelSyncNoTargetsHelp": "It looks like you don't currently have any apps that support sync.",
|
"LabelSyncNoTargetsHelp": "It looks like you don't currently have any apps that support sync.",
|
||||||
"DownloadScheduled": "Download scheduled",
|
"DownloadScheduled": "Download scheduled",
|
||||||
|
"HeaderSyncRequiresSub": "Sync requires an active Emby Premiere subscription.",
|
||||||
"LearnMore": "Learn more",
|
"LearnMore": "Learn more",
|
||||||
"LabelProfile": "Profile:",
|
"LabelProfile": "Profile:",
|
||||||
"LabelBitrateMbps": "Bitrate (Mbps):",
|
"LabelBitrateMbps": "Bitrate (Mbps):",
|
||||||
|
@ -352,7 +358,23 @@
|
||||||
"MessageDidYouKnowCinemaMode2": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the main feature.",
|
"MessageDidYouKnowCinemaMode2": "Cinema Mode gives you the true cinema experience with trailers and custom intros before the main feature.",
|
||||||
"HeaderPlayMyMedia": "Play my Media",
|
"HeaderPlayMyMedia": "Play my Media",
|
||||||
"HeaderDiscoverEmbyPremiere": "Discover Emby Premiere",
|
"HeaderDiscoverEmbyPremiere": "Discover Emby Premiere",
|
||||||
|
"Items": "Items",
|
||||||
"OneChannel": "One channel",
|
"OneChannel": "One channel",
|
||||||
"ConfirmRemoveDownload": "Remove download?",
|
"ConfirmRemoveDownload": "Remove download?",
|
||||||
"AddedOnValue": "Added {0}"
|
"RemoveDownload": "Remove download",
|
||||||
|
"AddedOnValue": "Added {0}",
|
||||||
|
"RemovingFromDevice": "Removing from device",
|
||||||
|
"RemoveFromDevice": "Remove from device",
|
||||||
|
"KeepOnDevice": "Keep on device",
|
||||||
|
"CancelDownload": "Cancel download",
|
||||||
|
"SyncJobItemStatusReadyToTransfer": "Ready to Transfer",
|
||||||
|
"SyncJobItemStatusSyncedMarkForRemoval": "Removing from device",
|
||||||
|
"SyncJobItemStatusQueued": "Queued",
|
||||||
|
"SyncJobItemStatusConverting": "Converting",
|
||||||
|
"SyncJobItemStatusTransferring": "Transferring",
|
||||||
|
"SyncJobItemStatusSynced": "Downloaded",
|
||||||
|
"SyncJobItemStatusFailed": "Failed",
|
||||||
|
"SyncJobItemStatusRemovedFromDevice": "Removed from device",
|
||||||
|
"SyncJobItemStatusCancelled": "Cancelled",
|
||||||
|
"Retry": "Retry"
|
||||||
}
|
}
|
|
@ -62,10 +62,10 @@
|
||||||
} else {
|
} else {
|
||||||
html += '<div class="secondary">';
|
html += '<div class="secondary">';
|
||||||
}
|
}
|
||||||
html += globalize.translate('SyncJobItemStatus' + jobItem.Status);
|
html += globalize.translate('sharedcomponents#SyncJobItemStatus' + jobItem.Status);
|
||||||
if (jobItem.Status == 'Synced' && jobItem.IsMarkedForRemoval) {
|
if (jobItem.Status == 'Synced' && jobItem.IsMarkedForRemoval) {
|
||||||
html += '<br/>';
|
html += '<br/>';
|
||||||
html += globalize.translate('SyncJobItemStatusSyncedMarkForRemoval');
|
html += globalize.translate('sharedcomponents#RemovingFromDevice');
|
||||||
}
|
}
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
html += '<h1>' + globalize.translate('HeaderItems') + '</h1>';
|
html += '<h1>' + globalize.translate('sharedcomponents#Items') + '</h1>';
|
||||||
|
|
||||||
html += '<div class="paperList">';
|
html += '<div class="paperList">';
|
||||||
|
|
||||||
|
@ -133,33 +133,27 @@
|
||||||
|
|
||||||
var menuItems = [];
|
var menuItems = [];
|
||||||
|
|
||||||
if (status == 'Failed') {
|
if (status == 'Failed' || status == 'Cancelled') {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
name: globalize.translate('ButtonQueueForRetry'),
|
name: globalize.translate('sharedcomponents#Retry'),
|
||||||
id: 'retry'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else if (status == 'Cancelled') {
|
|
||||||
menuItems.push({
|
|
||||||
name: globalize.translate('ButtonReenable'),
|
|
||||||
id: 'retry'
|
id: 'retry'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (status == 'Queued' || status == 'Transferring' || status == 'Converting' || status == 'ReadyToTransfer') {
|
else if (status == 'Queued' || status == 'Transferring' || status == 'Converting' || status == 'ReadyToTransfer') {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
name: globalize.translate('ButtonCancelItem'),
|
name: globalize.translate('sharedcomponents#CancelDownload'),
|
||||||
id: 'cancel'
|
id: 'cancel'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (status == 'Synced' && remove) {
|
else if (status == 'Synced' && remove) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
name: globalize.translate('ButtonUnmarkForRemoval'),
|
name: globalize.translate('sharedcomponents#KeepOnDevice'),
|
||||||
id: 'unmarkforremoval'
|
id: 'unmarkforremoval'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (status == 'Synced') {
|
else if (status == 'Synced') {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
name: globalize.translate('ButtonMarkForRemoval'),
|
name: globalize.translate('sharedcomponents#RemoveFromDevice'),
|
||||||
id: 'markforremoval'
|
id: 'markforremoval'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['serverNotifications', 'events', 'loading', 'connectionManager', 'imageLoader', 'dom', 'globalize', 'listViewStyle'], function (serverNotifications, events, loading, connectionManager, imageLoader, dom, globalize) {
|
define(['serverNotifications', 'events', 'loading', 'connectionManager', 'imageLoader', 'dom', 'globalize', 'registrationServices', 'listViewStyle'], function (serverNotifications, events, loading, connectionManager, imageLoader, dom, globalize, registrationServices) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function onSyncJobsUpdated(e, apiClient, data) {
|
function onSyncJobsUpdated(e, apiClient, data) {
|
||||||
|
@ -20,10 +20,15 @@
|
||||||
require(['confirm'], function (confirm) {
|
require(['confirm'], function (confirm) {
|
||||||
|
|
||||||
var msg = listInstance.options.isLocalSync ?
|
var msg = listInstance.options.isLocalSync ?
|
||||||
globalize.translate('ConfirmRemoveDownload') :
|
globalize.translate('sharedcomponents#ConfirmRemoveDownload') :
|
||||||
globalize.translate('CancelSyncJobConfirmation');
|
globalize.translate('sharedcomponents#CancelSyncJobConfirmation');
|
||||||
|
|
||||||
confirm(msg).then(function () {
|
confirm({
|
||||||
|
|
||||||
|
text: msg,
|
||||||
|
primary: 'cancel'
|
||||||
|
|
||||||
|
}).then(function () {
|
||||||
|
|
||||||
loading.show();
|
loading.show();
|
||||||
var apiClient = getApiClient(listInstance);
|
var apiClient = getApiClient(listInstance);
|
||||||
|
@ -94,10 +99,10 @@ globalize.translate('CancelSyncJobConfirmation');
|
||||||
|
|
||||||
textLines.push(job.Name);
|
textLines.push(job.Name);
|
||||||
|
|
||||||
if (job.ItemCount == 1) {
|
if (job.ItemCount === 1) {
|
||||||
textLines.push(globalize.translate('ValueItemCount', job.ItemCount));
|
textLines.push(globalize.translate('sharedcomponents#ValueOneItem'));
|
||||||
} else {
|
} else {
|
||||||
textLines.push(globalize.translate('ValueItemCountPlural', job.ItemCount));
|
textLines.push(globalize.translate('sharedcomponents#ItemCount', job.ItemCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (textLines >= 3) {
|
if (textLines >= 3) {
|
||||||
|
@ -165,10 +170,10 @@ globalize.translate('CancelSyncJobConfirmation');
|
||||||
|
|
||||||
html += '<div class="detailSectionHeader">';
|
html += '<div class="detailSectionHeader">';
|
||||||
|
|
||||||
html += '<div>' + targetName + '</div>';
|
html += '<h1>' + targetName + '</h1>';
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '<div class="itemsContainer vertical-list">';
|
html += '<div class="itemsContainer vertical-list paperList">';
|
||||||
hasOpenSection = true;
|
hasOpenSection = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,13 +185,13 @@ globalize.translate('CancelSyncJobConfirmation');
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
var elem = listInstance.options.element;
|
var elem = listInstance.options.element.querySelector('.syncJobListContent');
|
||||||
|
|
||||||
if (!html) {
|
if (!html) {
|
||||||
if (isLocalSync) {
|
if (isLocalSync) {
|
||||||
html = '<div style="padding:1em .25em;">' + globalize.translate('MessageDownloadsFound') + '</div>';
|
html = '<div style="padding:1em .25em;">' + globalize.translate('sharedcomponents#MessageNoDownloadsFound') + '</div>';
|
||||||
} else {
|
} else {
|
||||||
html = '<div style="padding:1em .25em;">' + globalize.translate('MessageNoSyncJobsFound') + '</div>';
|
html = '<div style="padding:1em .25em;">' + globalize.translate('sharedcomponents#MessageNoSyncJobsFound') + '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,16 +265,16 @@ globalize.translate('CancelSyncJobConfirmation');
|
||||||
|
|
||||||
if (status == 'Cancelled') {
|
if (status == 'Cancelled') {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
name: globalize.translate('ButtonDelete'),
|
name: globalize.translate('sharedcomponents#Delete'),
|
||||||
id: 'delete'
|
id: 'delete'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var txt = listInstance.options.isLocalSync ?
|
var txt = listInstance.options.isLocalSync ?
|
||||||
globalize.translate('RemoveDownload') :
|
globalize.translate('sharedcomponents#RemoveDownload') :
|
||||||
globalize.translate('ButtonCancelSyncJob');
|
globalize.translate('sharedcomponents#ButtonCancelSyncJob');
|
||||||
|
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
name: globalize.translate(txt),
|
name: txt,
|
||||||
id: 'cancel'
|
id: 'cancel'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -312,7 +317,14 @@ globalize.translate('ButtonCancelSyncJob');
|
||||||
if (listItem) {
|
if (listItem) {
|
||||||
var jobId = listItem.getAttribute('data-id');
|
var jobId = listItem.getAttribute('data-id');
|
||||||
// edit job
|
// edit job
|
||||||
events.trigger(listInstance, 'jobedit', [jobId, listInstance.options.serverId]);
|
require(['syncJobEditor'], function (syncJobEditor) {
|
||||||
|
syncJobEditor.show({
|
||||||
|
serverId: listInstance.options.serverId,
|
||||||
|
jobId: jobId
|
||||||
|
}).then(function () {
|
||||||
|
fetchData(listInstance);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,8 +339,47 @@ globalize.translate('ButtonCancelSyncJob');
|
||||||
options.element.addEventListener('click', onClickHandler);
|
options.element.addEventListener('click', onClickHandler);
|
||||||
this.onClickHandler = onClickHandler;
|
this.onClickHandler = onClickHandler;
|
||||||
|
|
||||||
|
options.element.innerHTML = '<div class="syncJobListContent"></div>';
|
||||||
|
|
||||||
fetchData(this);
|
fetchData(this);
|
||||||
startListening(this);
|
startListening(this);
|
||||||
|
|
||||||
|
initSupporterInfo(options.element, getApiClient(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
function showSupporterInfo(context) {
|
||||||
|
|
||||||
|
var html = '<button is="emby-button" class="raised button-accent block btnSyncSupporter" style="margin:1em 0;">';
|
||||||
|
|
||||||
|
html += '<div>';
|
||||||
|
html += globalize.translate('sharedcomponents#HeaderSyncRequiresSub');
|
||||||
|
html += '</div>';
|
||||||
|
html += '<div style="margin-top:.5em;">';
|
||||||
|
html += globalize.translate('sharedcomponents#LearnMore');
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
html += '</button';
|
||||||
|
|
||||||
|
context.insertAdjacentHTML('afterbegin', html);
|
||||||
|
|
||||||
|
context.querySelector('.btnSyncSupporter').addEventListener('click', function () {
|
||||||
|
|
||||||
|
registrationServices.validateFeature('sync');
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function initSupporterInfo(context, apiClient) {
|
||||||
|
|
||||||
|
apiClient.getPluginSecurityInfo().then(function (regInfo) {
|
||||||
|
|
||||||
|
if (!regInfo.IsMBSupporter) {
|
||||||
|
showSupporterInfo(context, apiClient);
|
||||||
|
}
|
||||||
|
|
||||||
|
}, function () {
|
||||||
|
showSupporterInfo(context, apiClient);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
syncJobList.prototype.destroy = function () {
|
syncJobList.prototype.destroy = function () {
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
self.options = options;
|
self.options = options;
|
||||||
|
|
||||||
function resetSyncStatus() {
|
function resetSyncStatus() {
|
||||||
|
@ -67,12 +68,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
syncToggle.prototype.refresh = function(item) {
|
syncToggle.prototype.refresh = function (item) {
|
||||||
|
|
||||||
if (this.options) {
|
|
||||||
this.options.item = item;
|
this.options.item = item;
|
||||||
updateSyncStatus(this.options.container, item);
|
updateSyncStatus(this.options.container, item);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
syncToggle.prototype.destroy = function () {
|
syncToggle.prototype.destroy = function () {
|
||||||
|
|
|
@ -508,7 +508,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
|
||||||
|
|
||||||
@media all and (min-width: 800px) {
|
@media all and (min-width: 800px) {
|
||||||
|
|
||||||
.mainDetailButtons, .recordingFields button {
|
.mainDetailButtons, .itemDetailPage .recordingFields button {
|
||||||
font-size: 110%;
|
font-size: 110%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,17 +16,6 @@
|
||||||
</style>
|
</style>
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
|
|
||||||
<div class="supporterPromotionContainer hide" style="text-align: right; position: static;">
|
|
||||||
<div class="customSupporterPromotion supporterPromotion inlineSupporterPromotion">
|
|
||||||
<button is="emby-button" type="button" class="raised button-accent block btnSyncSupporter">
|
|
||||||
<div class="mainText">
|
|
||||||
</div>
|
|
||||||
<div class="btnLearnMore" style="font-weight: normal; margin-top: .25em;">
|
|
||||||
${ButtonLearnMore}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="ehsContent" style="clear:both;">
|
<div class="ehsContent" style="clear:both;">
|
||||||
<br />
|
<br />
|
||||||
<div class="localSyncStatus hide" style="text-align:right;margin:0 0 1em;">
|
<div class="localSyncStatus hide" style="text-align:right;margin:0 0 1em;">
|
||||||
|
|
|
@ -1,32 +1,6 @@
|
||||||
define(['apphost', 'globalize', 'syncJobList', 'events', 'localsync', 'emby-button', 'paper-icon-button-light'], function (appHost, globalize, syncJobList, events, localSync) {
|
define(['apphost', 'globalize', 'syncJobList', 'events', 'localsync', 'emby-button', 'paper-icon-button-light'], function (appHost, globalize, syncJobList, events, localSync) {
|
||||||
'use strict';
|
'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) {
|
return function (view, params) {
|
||||||
|
|
||||||
var interval;
|
var interval;
|
||||||
|
@ -71,22 +45,12 @@
|
||||||
view.querySelector('.localSyncStatus').classList.add('hide');
|
view.querySelector('.localSyncStatus').classList.add('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
initSupporterInfo(view, params);
|
|
||||||
var mySyncJobList = new syncJobList({
|
var mySyncJobList = new syncJobList({
|
||||||
isLocalSync: params.mode === 'offline',
|
isLocalSync: params.mode === 'offline',
|
||||||
serverId: ApiClient.serverId(),
|
serverId: ApiClient.serverId(),
|
||||||
userId: params.mode === 'offline' ? null : ApiClient.getCurrentUserId(),
|
userId: params.mode === 'offline' ? null : ApiClient.getCurrentUserId(),
|
||||||
element: view.querySelector('.syncActivity')
|
element: view.querySelector('.syncActivity'),
|
||||||
});
|
mode: params.mode
|
||||||
|
|
||||||
events.on(mySyncJobList, 'jobedit', function (e, jobId, serverId) {
|
|
||||||
|
|
||||||
require(['syncJobEditor'], function (syncJobEditor) {
|
|
||||||
syncJobEditor.show({
|
|
||||||
serverId: ApiClient.serverId(),
|
|
||||||
jobId: jobId
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
view.addEventListener('viewbeforeshow', function () {
|
view.addEventListener('viewbeforeshow', function () {
|
||||||
|
|
|
@ -21,43 +21,14 @@
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
function initSupporterInfo(view, params) {
|
|
||||||
|
|
||||||
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) {
|
return function (view, params) {
|
||||||
|
|
||||||
initSupporterInfo(view, params);
|
|
||||||
var mySyncJobList = new syncJobList({
|
var mySyncJobList = new syncJobList({
|
||||||
isLocalSync: params.mode === 'offline',
|
isLocalSync: params.mode === 'offline',
|
||||||
serverId: ApiClient.serverId(),
|
serverId: ApiClient.serverId(),
|
||||||
userId: params.mode === 'offline' ? null : ApiClient.getCurrentUserId(),
|
userId: params.mode === 'offline' ? null : ApiClient.getCurrentUserId(),
|
||||||
element: view.querySelector('.syncActivity')
|
element: view.querySelector('.syncActivity'),
|
||||||
});
|
mode: params.mode
|
||||||
|
|
||||||
events.on(mySyncJobList, 'jobedit', function (e, jobId, serverId) {
|
|
||||||
|
|
||||||
require(['syncJobEditor'], function (syncJobEditor) {
|
|
||||||
syncJobEditor.show({
|
|
||||||
serverId: ApiClient.serverId(),
|
|
||||||
jobId: jobId
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
view.addEventListener('viewshow', function () {
|
view.addEventListener('viewshow', function () {
|
||||||
|
|
|
@ -17,19 +17,6 @@
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
|
|
||||||
<div class="supporterPromotionContainer" style="display:none;">
|
|
||||||
<div class="customSupporterPromotion supporterPromotion">
|
|
||||||
<a class="clearLink" href="http://emby.media/premiere" target="_blank">
|
|
||||||
<button is="emby-button" type="button" class="raised block" style="text-transform:none;background-color:#52B54B;color:#fff;">
|
|
||||||
<div class="mainText">
|
|
||||||
</div>
|
|
||||||
<div class="btnLearnMore" style="font-weight: normal; margin-top: 5px;">
|
|
||||||
${ButtonLearnMore}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="text-align:right;">
|
<div style="text-align:right;">
|
||||||
<button is="emby-button" type="button" class="raised btnSync subdued">
|
<button is="emby-button" type="button" class="raised btnSync subdued">
|
||||||
<i class="md-icon">sync</i>
|
<i class="md-icon">sync</i>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue