diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 204259f41c..ab9c8a073d 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -15,12 +15,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.4.106", - "_release": "1.4.106", + "version": "1.4.107", + "_release": "1.4.107", "_resolution": { "type": "version", - "tag": "1.4.106", - "commit": "a24b7adf582019433bcd1cc93c7c38495e642d89" + "tag": "1.4.107", + "commit": "924bb12b6d7c3536ee00fc1a58ac4c492c36f559" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js b/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js index d10276e322..b58d427b0d 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js +++ b/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js @@ -217,16 +217,30 @@ }); + var timeout; + if (options.timeout) { + timeout = setTimeout(function () { + dialogHelper.close(dlg); + }, options.timeout); + } + return new Promise(function (resolve, reject) { dlg.addEventListener('close', function () { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + if (selectedId != null) { if (options.callback) { options.callback(selectedId); } resolve(selectedId); + } else { + reject(); } }); diff --git a/dashboard-ui/bower_components/emby-webcomponents/confirm/confirm.js b/dashboard-ui/bower_components/emby-webcomponents/confirm/confirm.js index fbce2372eb..5cd23133fe 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/confirm/confirm.js +++ b/dashboard-ui/bower_components/emby-webcomponents/confirm/confirm.js @@ -1,116 +1,4 @@ -define(['layoutManager', 'globalize'], function (layoutManager, globalize) { - - function showTvConfirm(options) { - return new Promise(function (resolve, reject) { - - require(['actionsheet'], function (actionSheet) { - - var items = []; - - items.push({ - name: globalize.translate('sharedcomponents#ButtonOk'), - id: 'ok' - }); - - items.push({ - name: globalize.translate('sharedcomponents#ButtonCancel'), - id: 'cancel' - }); - - actionSheet.show({ - - title: options.text, - items: items - - }).then(function (id) { - - switch (id) { - - case 'ok': - resolve(); - break; - default: - reject(); - break; - } - - }, reject); - }); - }); - } - - function showConfirmInternal(options, dialogHelper, resolve, reject) { - - var dialogOptions = { - removeOnClose: true - }; - - var backButton = false; - - if (layoutManager.tv) { - dialogOptions.size = 'fullscreen'; - backButton = true; - dialogOptions.autoFocus = true; - } else { - - dialogOptions.modal = false; - dialogOptions.entryAnimationDuration = 160; - dialogOptions.exitAnimationDuration = 160; - dialogOptions.autoFocus = false; - } - - var dlg = dialogHelper.createDialog(dialogOptions); - var html = ''; - - if (options.title) { - html += '

' + options.title + '

'; - } - - var text = options.html || options.text; - - if (text) { - html += '
' + text + '
'; - } - - html += '
'; - - html += ''; - - html += ''; - - html += '
'; - - dlg.innerHTML = html; - document.body.appendChild(dlg); - - var confirmed = false; - dlg.querySelector('.btnConfirm').addEventListener('click', function () { - confirmed = true; - dialogHelper.close(dlg); - }); - dlg.querySelector('.btnCancel').addEventListener('click', function () { - confirmed = false; - dialogHelper.close(dlg); - }); - - dialogHelper.open(dlg).then(function () { - - if (confirmed) { - resolve(); - } else { - reject(); - } - }); - } - - function showConfirm(options) { - return new Promise(function (resolve, reject) { - - require(['dialogHelper', 'emby-button'], function (dialogHelper) { - showConfirmInternal(options, dialogHelper, resolve, reject); - }); - }); - } +define(['dialog', 'globalize'], function (dialog, globalize) { return function (text, title) { @@ -124,10 +12,26 @@ define(['layoutManager', 'globalize'], function (layoutManager, globalize) { options = text; } - if (layoutManager.tv) { - return showTvConfirm(options); - } + var items = []; - return showConfirm(options); + items.push({ + name: globalize.translate('sharedcomponents#ButtonOk'), + id: 'ok' + }); + + items.push({ + name: globalize.translate('sharedcomponents#ButtonCancel'), + id: 'cancel' + }); + + options.buttons = items; + + return dialog(options).then(function (result) { + if (result == 'ok') { + return Promise.resolve(); + } + + return Promise.reject(); + }); }; }); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js b/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js new file mode 100644 index 0000000000..2727206950 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js @@ -0,0 +1,126 @@ +define(['layoutManager', 'globalize'], function (layoutManager, globalize) { + + function showTvDialog(options) { + return new Promise(function (resolve, reject) { + + require(['actionsheet'], function (actionSheet) { + + var items = []; + + items.push({ + name: globalize.translate('sharedcomponents#ButtonOk'), + id: 'ok' + }); + + items.push({ + name: globalize.translate('sharedcomponents#ButtonCancel'), + id: 'cancel' + }); + + actionSheet.show({ + + title: options.text, + items: options.buttons + + }).then(resolve, reject); + }); + }); + } + + function showDialogInternal(options, dialogHelper, resolve, reject) { + + var dialogOptions = { + removeOnClose: true + }; + + var backButton = false; + + if (layoutManager.tv) { + dialogOptions.size = 'fullscreen'; + backButton = true; + dialogOptions.autoFocus = true; + } else { + + dialogOptions.modal = false; + dialogOptions.entryAnimationDuration = 160; + dialogOptions.exitAnimationDuration = 160; + dialogOptions.autoFocus = true; + } + + var dlg = dialogHelper.createDialog(dialogOptions); + var html = ''; + + if (options.title) { + html += '

' + options.title + '

'; + } + + var text = options.html || options.text; + + if (text) { + html += '
' + text + '
'; + } + + html += '
'; + + var i, length; + for (i = 0, length = options.buttons.length; i < length; i++) { + + var item = options.buttons[i]; + var autoFocus = i == 0 ? ' autofocus' : ''; + html += ''; + } + + html += '
'; + + dlg.innerHTML = html; + document.body.appendChild(dlg); + + var dialogResult; + function onButtonClick() { + dialogResult = this.getAttribute('data-id'); + dialogHelper.close(dlg); + } + + var buttons = dlg.querySelectorAll('.btnOption'); + for (i = 0, length = options.buttons.length; i < length; i++) { + buttons[i].addEventListener('click', onButtonClick); + } + + dialogHelper.open(dlg).then(function () { + + if (dialogResult) { + resolve(dialogResult); + } else { + reject(); + } + }); + } + + function showDialog(options) { + return new Promise(function (resolve, reject) { + + require(['dialogHelper', 'emby-button'], function (dialogHelper) { + showDialogInternal(options, dialogHelper, resolve, reject); + }); + }); + } + + return function (text, title) { + + var options; + if (typeof text === 'string') { + options = { + title: title, + text: text + }; + } else { + options = text; + } + + if (layoutManager.tv) { + return showTvDialog(options); + } + + return showDialog(options); + }; +}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css index c2987411a0..17a59f638c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css +++ b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css @@ -1,7 +1,7 @@ button.listItem { background: transparent; - border: 0 !important; - border-bottom: 1px solid #2a2a2a !important; + border: 0; + border-bottom: 1px solid #2a2a2a; cursor: pointer; outline: none !important; color: inherit; @@ -138,7 +138,7 @@ div.listItem { transform: scale(1.025, 1.025); } - .listItem > .fab:first-child { + .listItem > .fab:first-child, .listItem > i:first-child { margin-left: .75em; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json index e0a07ffdb9..1f3bff351e 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json @@ -127,5 +127,6 @@ "TryMultiSelectMessage": "To edit multiple media items, just click and hold any poster and select the items you want to manage. Try it!", "HeaderConfirmRecordingCancellation": "Confirm Recording Cancellation", "MessageConfirmRecordingCancellation": "Are you sure you wish to cancel this recording?", - "Error": "Error" + "Error": "Error", + "VoiceInput": "Voice Input" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/voice/voicedialog.js b/dashboard-ui/bower_components/emby-webcomponents/voice/voicedialog.js index b394f82423..fe63ca6297 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/voice/voicedialog.js +++ b/dashboard-ui/bower_components/emby-webcomponents/voice/voicedialog.js @@ -114,7 +114,7 @@ define(['dialogHelper', './voicereceiver', './voiceprocessor', 'globalize', 'emb html += '
'; html += ''; html += '
'; - //html += title; + html += globalize.translate('sharedcomponents#VoiceInput'); html += '
'; html += '
'; diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index d28c94ab0f..0b92da967f 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -70,6 +70,7 @@ queue: false, playAllFromHere: false, queueAllFromHere: false, + sync: false, positionTo: button }; } diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 69f198f12e..24ee0a92e8 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -2175,6 +2175,8 @@ var AppInfo = {}; define("alert", [embyWebComponentsBowerPath + "/alert/alert"], returnFirstDependency); } + define("dialog", [embyWebComponentsBowerPath + "/dialog/dialog"], returnFirstDependency); + if (preferNativeAlerts && window.confirm) { define("confirm", [embyWebComponentsBowerPath + "/confirm/nativeconfirm"], returnFirstDependency); } else {