mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
animate now playing bar
This commit is contained in:
parent
4a80f8d99b
commit
7dd1eedf26
21 changed files with 3722 additions and 6204 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
var currentDialogOptions;
|
||||
|
||||
function submitJob(panel, userId, syncOptions, form) {
|
||||
function submitJob(dlg, userId, syncOptions, form) {
|
||||
|
||||
if (!userId) {
|
||||
throw new Error('userId cannot be null');
|
||||
|
@ -51,7 +51,7 @@
|
|||
|
||||
}).then(function () {
|
||||
|
||||
panel.panel('close');
|
||||
PaperDialogHelper.close(dlg);
|
||||
$(window.SyncManager).trigger('jobsubmit');
|
||||
Dashboard.alert(Globalize.translate('MessageSyncJobCreated'));
|
||||
});
|
||||
|
@ -196,7 +196,7 @@
|
|||
|
||||
function showSyncMenu(options) {
|
||||
|
||||
requirejs(["scripts/registrationservices", "jqmcollapsible", "jqmpanel"], function () {
|
||||
requirejs(["scripts/registrationservices"], function () {
|
||||
RegistrationServices.validateFeature('sync').then(function () {
|
||||
showSyncMenuInternal(options);
|
||||
});
|
||||
|
@ -205,64 +205,81 @@
|
|||
|
||||
function showSyncMenuInternal(options) {
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
require(['components/paperdialoghelper'], function () {
|
||||
|
||||
var dialogOptionsQuery = {
|
||||
UserId: userId,
|
||||
ItemIds: (options.items || []).map(function (i) {
|
||||
return i.Id || i;
|
||||
}).join(','),
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ParentId: options.ParentId,
|
||||
Category: options.Category
|
||||
};
|
||||
var dialogOptionsQuery = {
|
||||
UserId: userId,
|
||||
ItemIds: (options.items || []).map(function (i) {
|
||||
return i.Id || i;
|
||||
}).join(','),
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Options', dialogOptionsQuery)).then(function (dialogOptions) {
|
||||
ParentId: options.ParentId,
|
||||
Category: options.Category
|
||||
};
|
||||
|
||||
currentDialogOptions = dialogOptions;
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Options', dialogOptionsQuery)).then(function (dialogOptions) {
|
||||
|
||||
var html = '<div data-role="panel" data-position="right" data-display="overlay" class="syncPanel" data-position-fixed="true" data-theme="a">';
|
||||
currentDialogOptions = dialogOptions;
|
||||
|
||||
html += '<div>';
|
||||
var dlg = PaperDialogHelper.createDialog({
|
||||
size: 'small',
|
||||
theme: 'a'
|
||||
});
|
||||
|
||||
html += '<form class="formSubmitSyncRequest">';
|
||||
var html = '';
|
||||
html += '<h2 class="dialogHeader">';
|
||||
html += '<paper-fab icon="arrow-back" mini class="btnCancel"></paper-fab>';
|
||||
html += '</h2>';
|
||||
|
||||
html += '<div style="margin:1em 0 1.5em;">';
|
||||
html += '<h1 style="margin: 0;display:inline-block;vertical-align:middle;">' + Globalize.translate('SyncMedia') + '</h1>';
|
||||
html += '<div>';
|
||||
|
||||
html += '<a href="https://github.com/MediaBrowser/Wiki/wiki/Sync" target="_blank" class="clearLink" style="margin-top:0;display:inline-block;vertical-align:middle;margin-left:1em;"><paper-button raised class="secondary mini"><iron-icon icon="info"></iron-icon><span>' + Globalize.translate('ButtonHelp') + '</span></paper-button></a>';
|
||||
html += '</div>';
|
||||
html += '<form class="formSubmitSyncRequest" style="margin: auto;">';
|
||||
|
||||
html += '<div class="formFields"></div>';
|
||||
html += '<div style="margin:1em 0 1.5em;">';
|
||||
html += '<h1 style="margin: 0;display:inline-block;vertical-align:middle;">' + Globalize.translate('SyncMedia') + '</h1>';
|
||||
|
||||
html += '<p>';
|
||||
html += '<button type="submit" data-role="none" class="clearButton"><paper-button raised class="submit block"><iron-icon icon="sync"></iron-icon><span>' + Globalize.translate('ButtonSync') + '</span></paper-button></button>';
|
||||
html += '</p>';
|
||||
html += '<a href="https://github.com/MediaBrowser/Wiki/wiki/Sync" target="_blank" class="clearLink" style="margin-top:0;display:inline-block;vertical-align:middle;margin-left:1em;"><paper-button raised class="secondary mini"><iron-icon icon="info"></iron-icon><span>' + Globalize.translate('ButtonHelp') + '</span></paper-button></a>';
|
||||
html += '</div>';
|
||||
|
||||
html += '</form>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<div class="formFields"></div>';
|
||||
|
||||
$(document.body).append(html);
|
||||
html += '<p>';
|
||||
html += '<button type="submit" data-role="none" class="clearButton"><paper-button raised class="submit block"><iron-icon icon="sync"></iron-icon><span>' + Globalize.translate('ButtonSync') + '</span></paper-button></button>';
|
||||
html += '</p>';
|
||||
|
||||
var elem = $('.syncPanel').panel({}).trigger('create').panel("open").on("panelclose", function () {
|
||||
$(this).off("panelclose").remove();
|
||||
html += '</form>';
|
||||
html += '</div>';
|
||||
|
||||
dlg.innerHTML = html;
|
||||
document.body.appendChild(dlg);
|
||||
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
dlg.addEventListener('iron-overlay-closed', function (e) {
|
||||
dlg.parentNode.removeChild(dlg);
|
||||
});
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'syncjob');
|
||||
|
||||
$('form', dlg).on('submit', function () {
|
||||
|
||||
submitJob(dlg, userId, options, this);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.btnCancel').on('click', function () {
|
||||
PaperDialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
renderForm({
|
||||
elem: $('.formFields', dlg),
|
||||
dialogOptions: dialogOptions,
|
||||
dialogOptionsFn: getTargetDialogOptionsFn(dialogOptionsQuery)
|
||||
});
|
||||
});
|
||||
|
||||
$('form', elem).on('submit', function () {
|
||||
|
||||
submitJob(elem, userId, options, this);
|
||||
return false;
|
||||
});
|
||||
|
||||
renderForm({
|
||||
elem: $('.formFields', elem),
|
||||
dialogOptions: dialogOptions,
|
||||
dialogOptionsFn: getTargetDialogOptionsFn(dialogOptionsQuery)
|
||||
});
|
||||
});
|
||||
|
||||
require(['jqmicons']);
|
||||
}
|
||||
|
||||
function getTargetDialogOptionsFn(query) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue