mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
update paper dialog helper api
This commit is contained in:
parent
df4f347fb4
commit
eb59fad11f
@ -1,4 +1,4 @@
|
||||
define(['components/paperdialoghelper', 'paper-checkbox', 'paper-dialog', 'paper-input', 'paper-fab'], function () {
|
||||
define(['components/paperdialoghelper', 'paper-checkbox', 'paper-dialog', 'paper-input', 'paper-fab'], function (paperDialogHelper) {
|
||||
|
||||
function onSubmit() {
|
||||
Dashboard.showLoadingMsg();
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
var id = result.Id;
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
redirectToCollection(id);
|
||||
|
||||
});
|
||||
@ -71,7 +71,7 @@
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
|
||||
Dashboard.alert(Globalize.translate('MessageItemsAdded'));
|
||||
});
|
||||
@ -192,7 +192,7 @@
|
||||
|
||||
items = items || [];
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog({
|
||||
var dlg = paperDialogHelper.createDialog({
|
||||
size: 'small'
|
||||
});
|
||||
|
||||
@ -217,11 +217,11 @@
|
||||
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'collectioneditor');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
define(['components/paperdialoghelper', 'paper-item', 'paper-input', 'paper-fab', 'paper-item-body'], function () {
|
||||
define(['components/paperdialoghelper', 'paper-item', 'paper-input', 'paper-fab', 'paper-item-body'], function (paperDialogHelper) {
|
||||
|
||||
var systemInfo;
|
||||
function getSystemInfo() {
|
||||
@ -213,7 +213,7 @@
|
||||
|
||||
getSystemInfo().then(function (systemInfo) {
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog({
|
||||
var dlg = paperDialogHelper.createDialog({
|
||||
theme: 'a',
|
||||
size: 'medium'
|
||||
});
|
||||
@ -242,11 +242,11 @@
|
||||
});
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'directorybrowser');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
currentDialog = dlg;
|
||||
@ -264,7 +264,7 @@
|
||||
|
||||
self.close = function () {
|
||||
if (currentDialog) {
|
||||
PaperDialogHelper.close(currentDialog);
|
||||
paperDialogHelper.close(currentDialog);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
define(['components/paperdialoghelper', 'paper-checkbox', 'paper-dialog', 'paper-fab'], function () {
|
||||
define(['components/paperdialoghelper', 'paper-checkbox', 'paper-dialog', 'paper-fab'], function (paperDialogHelper) {
|
||||
|
||||
var currentItemId;
|
||||
var currentItemType;
|
||||
@ -131,7 +131,7 @@
|
||||
|
||||
hasChanges = true;
|
||||
var dlg = $(page).parents('paper-dialog')[0];
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@
|
||||
currentItemId = itemId;
|
||||
currentItemType = itemType;
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog();
|
||||
var dlg = paperDialogHelper.createDialog();
|
||||
|
||||
var html = '';
|
||||
html += '<h2 class="dialogHeader">';
|
||||
@ -289,14 +289,14 @@
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'imagedownloader');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
var editorContent = dlg.querySelector('.editorContent');
|
||||
initEditor(editorContent);
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
reloadBrowsableImages(editorContent);
|
||||
|
@ -1,4 +1,4 @@
|
||||
define(['components/paperdialoghelper', 'css!css/metadataeditor.css', 'paper-fab'], function () {
|
||||
define(['components/paperdialoghelper', 'css!css/metadataeditor.css', 'paper-fab'], function (paperDialogHelper) {
|
||||
|
||||
var currentItem;
|
||||
var currentDeferred;
|
||||
@ -206,9 +206,9 @@
|
||||
|
||||
$('.btnOpenUploadMenu', page).on('click', function () {
|
||||
|
||||
require(['components/imageuploader/imageuploader'], function () {
|
||||
require(['components/imageuploader/imageuploader'], function (imageUploader) {
|
||||
|
||||
ImageUploader.show(currentItem.Id, {
|
||||
imageUploader.show(currentItem.Id, {
|
||||
|
||||
theme: options.theme
|
||||
|
||||
@ -241,7 +241,7 @@
|
||||
var template = this.response;
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).then(function (item) {
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog({
|
||||
var dlg = paperDialogHelper.createDialog({
|
||||
theme: options.theme
|
||||
});
|
||||
|
||||
@ -263,14 +263,14 @@
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'imageeditor');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
var editorContent = dlg.querySelector('.editorContent');
|
||||
reload(editorContent, item);
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
(function ($, window, document) {
|
||||
define(['components/paperdialoghelper', 'paper-dialog', 'paper-fab'], function (paperDialogHelper) {
|
||||
|
||||
var currentItemId;
|
||||
var currentFile;
|
||||
@ -133,7 +133,7 @@
|
||||
var template = this.response;
|
||||
currentItemId = itemId;
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog({
|
||||
var dlg = paperDialogHelper.createDialog({
|
||||
theme: options.theme
|
||||
});
|
||||
|
||||
@ -153,14 +153,14 @@
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'imageuploader');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
var editorContent = dlg.querySelector('.editorContent');
|
||||
initEditor(editorContent);
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@
|
||||
currentDeferred.resolveWith(null, [hasChanges]);
|
||||
}
|
||||
|
||||
window.ImageUploader = {
|
||||
return {
|
||||
show: function (itemId, options) {
|
||||
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
@ -182,12 +182,8 @@
|
||||
currentDeferred = deferred;
|
||||
hasChanges = false;
|
||||
|
||||
require(['components/paperdialoghelper', 'paper-dialog'], function () {
|
||||
|
||||
showEditor(itemId, options);
|
||||
});
|
||||
showEditor(itemId, options);
|
||||
return deferred.promise();
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, window, document);
|
||||
});
|
@ -1,4 +1,4 @@
|
||||
(function ($, window, document) {
|
||||
define(['components/paperdialoghelper', 'paper-dialog', 'paper-fab', 'paper-input'], function (paperDialogHelper) {
|
||||
|
||||
var currentItem;
|
||||
var currentDeferred;
|
||||
@ -218,13 +218,13 @@
|
||||
hasChanges = true;
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
PaperDialogHelper.close(document.querySelector('.identifyDialog'));
|
||||
paperDialogHelper.close(document.querySelector('.identifyDialog'));
|
||||
|
||||
}, function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
PaperDialogHelper.close(document.querySelector('.identifyDialog'));
|
||||
paperDialogHelper.close(document.querySelector('.identifyDialog'));
|
||||
});
|
||||
}
|
||||
|
||||
@ -291,7 +291,7 @@
|
||||
|
||||
currentItem = item;
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog();
|
||||
var dlg = paperDialogHelper.createDialog();
|
||||
|
||||
var html = '';
|
||||
html += '<h2 class="dialogHeader">';
|
||||
@ -309,14 +309,14 @@
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'itemidentifier');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
var editorContent = dlg.querySelector('.editorContent');
|
||||
initEditor(editorContent);
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
dlg.classList.add('identifyDialog');
|
||||
@ -344,12 +344,8 @@
|
||||
currentDeferred = deferred;
|
||||
hasChanges = false;
|
||||
|
||||
require(['components/paperdialoghelper', 'paper-input'], function () {
|
||||
|
||||
showEditor(itemId);
|
||||
});
|
||||
showEditor(itemId);
|
||||
return deferred.promise();
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, window, document);
|
||||
});
|
@ -1,4 +1,4 @@
|
||||
define(['components/paperdialoghelper', 'paper-dialog', 'paper-input', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
|
||||
define(['components/paperdialoghelper', 'paper-dialog', 'paper-input', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function (paperDialogHelper) {
|
||||
|
||||
var currentDeferred;
|
||||
var hasChanges;
|
||||
@ -27,7 +27,7 @@
|
||||
ApiClient.addVirtualFolder(name, type, currentOptions.refresh, paths).then(function () {
|
||||
|
||||
hasChanges = true;
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
|
||||
}, function () {
|
||||
|
||||
@ -192,7 +192,7 @@
|
||||
xhr.onload = function (e) {
|
||||
|
||||
var template = this.response;
|
||||
var dlg = PaperDialogHelper.createDialog({
|
||||
var dlg = paperDialogHelper.createDialog({
|
||||
size: 'small',
|
||||
theme: 'a',
|
||||
|
||||
@ -221,11 +221,11 @@
|
||||
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'medialibrarycreator');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
paths = [];
|
||||
|
@ -1,4 +1,4 @@
|
||||
define(['components/paperdialoghelper', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
|
||||
define(['components/paperdialoghelper', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function (paperDialogHelper) {
|
||||
|
||||
var currentDeferred;
|
||||
var hasChanges;
|
||||
@ -146,7 +146,7 @@
|
||||
xhr.onload = function (e) {
|
||||
|
||||
var template = this.response;
|
||||
var dlg = PaperDialogHelper.createDialog({
|
||||
var dlg = paperDialogHelper.createDialog({
|
||||
size: 'small',
|
||||
theme: 'a',
|
||||
|
||||
@ -173,11 +173,11 @@
|
||||
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'medialibraryeditor');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
refreshLibraryFromServer(editorContent);
|
||||
|
@ -165,7 +165,7 @@
|
||||
}
|
||||
|
||||
window.PaperDialogHelper = {
|
||||
openWithHash: openWithHash,
|
||||
open: openWithHash,
|
||||
close: close,
|
||||
createDialog: createDialog,
|
||||
positionTo: positionTo
|
||||
|
@ -1,4 +1,4 @@
|
||||
define(['components/paperdialoghelper', 'paper-dialog', 'paper-input', 'paper-fab'], function () {
|
||||
define(['components/paperdialoghelper', 'paper-dialog', 'paper-input', 'paper-fab'], function (paperDialogHelper) {
|
||||
|
||||
var lastPlaylistId = '';
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
var id = result.Id;
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
redirectToPlaylist(id);
|
||||
});
|
||||
}
|
||||
@ -73,7 +73,7 @@
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
Dashboard.alert(Globalize.translate('MessageAddedToPlaylistSuccess'));
|
||||
|
||||
});
|
||||
@ -197,7 +197,7 @@
|
||||
|
||||
items = items || [];
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog({
|
||||
var dlg = paperDialogHelper.createDialog({
|
||||
size: 'small'
|
||||
});
|
||||
|
||||
@ -222,11 +222,11 @@
|
||||
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'playlisteditor');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
define(['components/paperdialoghelper', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
|
||||
define(['components/paperdialoghelper', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function (paperDialogHelper) {
|
||||
|
||||
var currentItem;
|
||||
|
||||
@ -339,7 +339,7 @@
|
||||
var template = this.response;
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).then(function (item) {
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog();
|
||||
var dlg = paperDialogHelper.createDialog();
|
||||
|
||||
var html = '';
|
||||
html += '<h2 class="dialogHeader">';
|
||||
@ -359,7 +359,7 @@
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
$(dlg).on('iron-overlay-closed', onDialogClosed);
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'subtitleeditor');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
var editorContent = dlg.querySelector('.editorContent');
|
||||
reload(editorContent, item);
|
||||
@ -371,7 +371,7 @@
|
||||
|
||||
$('.btnCloseDialog', dlg).on('click', function () {
|
||||
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -2829,7 +2829,7 @@
|
||||
|
||||
showSortMenu: function (options) {
|
||||
|
||||
require(['paper-dialog', 'components/paperdialoghelper', 'paper-radio-button', 'paper-radio-group', 'scale-up-animation', 'fade-in-animation', 'fade-out-animation'], function () {
|
||||
require(['components/paperdialoghelper', 'paper-dialog', 'paper-radio-button', 'paper-radio-group', 'scale-up-animation', 'fade-in-animation', 'fade-out-animation'], function (paperDialogHelper) {
|
||||
|
||||
var dlg = document.createElement('paper-dialog');
|
||||
|
||||
@ -2906,7 +2906,7 @@
|
||||
dlg.parentNode.removeChild(dlg);
|
||||
});
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'sortmenu');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
$('.groupSortBy', dlg).on('iron-select', function () {
|
||||
|
||||
|
@ -97,9 +97,9 @@
|
||||
|
||||
function showPlaybackOverlay(deferred) {
|
||||
|
||||
require(['components/paperdialoghelper', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
|
||||
require(['components/paperdialoghelper', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function (paperDialogHelper) {
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog({});
|
||||
var dlg = paperDialogHelper.createDialog({});
|
||||
|
||||
var html = '';
|
||||
html += '<h2 class="dialogHeader">';
|
||||
@ -138,10 +138,10 @@
|
||||
deferred.resolve();
|
||||
});
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'premiere');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
$('.btnCancelSupporterInfo').on('click', function () {
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -212,7 +212,7 @@
|
||||
|
||||
function showSyncMenuInternal(options) {
|
||||
|
||||
require(['components/paperdialoghelper', 'paper-fab'], function () {
|
||||
require(['components/paperdialoghelper', 'paper-fab'], function (paperDialogHelper) {
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
@ -230,7 +230,7 @@
|
||||
|
||||
currentDialogOptions = dialogOptions;
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog({
|
||||
var dlg = paperDialogHelper.createDialog({
|
||||
size: 'small',
|
||||
theme: 'a'
|
||||
});
|
||||
@ -267,7 +267,7 @@
|
||||
dlg.parentNode.removeChild(dlg);
|
||||
});
|
||||
|
||||
PaperDialogHelper.openWithHash(dlg, 'syncjob');
|
||||
paperDialogHelper.open(dlg);
|
||||
|
||||
$('form', dlg).on('submit', function () {
|
||||
|
||||
@ -276,7 +276,7 @@
|
||||
});
|
||||
|
||||
$('.btnCancel').on('click', function () {
|
||||
PaperDialogHelper.close(dlg);
|
||||
paperDialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
renderForm({
|
||||
|
Loading…
Reference in New Issue
Block a user