diff --git a/dashboard-ui/components/collectioneditor/collectioneditor.js b/dashboard-ui/components/collectioneditor/collectioneditor.js index 186fb1dd1f..6fe88da392 100644 --- a/dashboard-ui/components/collectioneditor/collectioneditor.js +++ b/dashboard-ui/components/collectioneditor/collectioneditor.js @@ -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); }); }; } diff --git a/dashboard-ui/components/directorybrowser/directorybrowser.js b/dashboard-ui/components/directorybrowser/directorybrowser.js index 40c57de704..d4f88f4468 100644 --- a/dashboard-ui/components/directorybrowser/directorybrowser.js +++ b/dashboard-ui/components/directorybrowser/directorybrowser.js @@ -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); } }; diff --git a/dashboard-ui/components/imagedownloader/imagedownloader.js b/dashboard-ui/components/imagedownloader/imagedownloader.js index f9afdd10d1..7af2ebf684 100644 --- a/dashboard-ui/components/imagedownloader/imagedownloader.js +++ b/dashboard-ui/components/imagedownloader/imagedownloader.js @@ -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 += '

'; @@ -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); diff --git a/dashboard-ui/components/imageeditor/imageeditor.js b/dashboard-ui/components/imageeditor/imageeditor.js index f0029ed6ef..127f455a0e 100644 --- a/dashboard-ui/components/imageeditor/imageeditor.js +++ b/dashboard-ui/components/imageeditor/imageeditor.js @@ -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); }); }); } diff --git a/dashboard-ui/components/imageuploader/imageuploader.js b/dashboard-ui/components/imageuploader/imageuploader.js index 29336ff284..0c95817eca 100644 --- a/dashboard-ui/components/imageuploader/imageuploader.js +++ b/dashboard-ui/components/imageuploader/imageuploader.js @@ -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); \ No newline at end of file +}); \ No newline at end of file diff --git a/dashboard-ui/components/itemidentifier/itemidentifier.js b/dashboard-ui/components/itemidentifier/itemidentifier.js index e4a0c0824f..ccbdf36c6e 100644 --- a/dashboard-ui/components/itemidentifier/itemidentifier.js +++ b/dashboard-ui/components/itemidentifier/itemidentifier.js @@ -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 += '

'; @@ -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); \ No newline at end of file +}); \ No newline at end of file diff --git a/dashboard-ui/components/medialibrarycreator/medialibrarycreator.js b/dashboard-ui/components/medialibrarycreator/medialibrarycreator.js index 78d32eea20..f0baa5c272 100644 --- a/dashboard-ui/components/medialibrarycreator/medialibrarycreator.js +++ b/dashboard-ui/components/medialibrarycreator/medialibrarycreator.js @@ -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 = []; diff --git a/dashboard-ui/components/medialibraryeditor/medialibraryeditor.js b/dashboard-ui/components/medialibraryeditor/medialibraryeditor.js index c21a0f4512..0eb22ce395 100644 --- a/dashboard-ui/components/medialibraryeditor/medialibraryeditor.js +++ b/dashboard-ui/components/medialibraryeditor/medialibraryeditor.js @@ -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); diff --git a/dashboard-ui/components/paperdialoghelper.js b/dashboard-ui/components/paperdialoghelper.js index 9d13e0b031..06d16d9fd8 100644 --- a/dashboard-ui/components/paperdialoghelper.js +++ b/dashboard-ui/components/paperdialoghelper.js @@ -165,7 +165,7 @@ } window.PaperDialogHelper = { - openWithHash: openWithHash, + open: openWithHash, close: close, createDialog: createDialog, positionTo: positionTo diff --git a/dashboard-ui/components/playlisteditor/playlisteditor.js b/dashboard-ui/components/playlisteditor/playlisteditor.js index bec4230eff..5513991913 100644 --- a/dashboard-ui/components/playlisteditor/playlisteditor.js +++ b/dashboard-ui/components/playlisteditor/playlisteditor.js @@ -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); }); }; } diff --git a/dashboard-ui/components/subtitleeditor/subtitleeditor.js b/dashboard-ui/components/subtitleeditor/subtitleeditor.js index 5fff1d30f8..cba613738e 100644 --- a/dashboard-ui/components/subtitleeditor/subtitleeditor.js +++ b/dashboard-ui/components/subtitleeditor/subtitleeditor.js @@ -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 += '

'; @@ -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); }); }); } diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index fca5b1d62b..3c72d2378c 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -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 () { diff --git a/dashboard-ui/scripts/registrationservices.js b/dashboard-ui/scripts/registrationservices.js index a2e6cdd22e..9ac91f255b 100644 --- a/dashboard-ui/scripts/registrationservices.js +++ b/dashboard-ui/scripts/registrationservices.js @@ -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 += '

'; @@ -138,10 +138,10 @@ deferred.resolve(); }); - PaperDialogHelper.openWithHash(dlg, 'premiere'); + paperDialogHelper.open(dlg); $('.btnCancelSupporterInfo').on('click', function () { - PaperDialogHelper.close(dlg); + paperDialogHelper.close(dlg); }); }); } diff --git a/dashboard-ui/scripts/sync.js b/dashboard-ui/scripts/sync.js index 9b86fad42e..997c083f85 100644 --- a/dashboard-ui/scripts/sync.js +++ b/dashboard-ui/scripts/sync.js @@ -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({