diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 7093e7552d..1e7aad08d3 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.0.90", - "_release": "1.0.90", + "version": "1.0.92", + "_release": "1.0.92", "_resolution": { "type": "version", - "tag": "1.0.90", - "commit": "2722d205b177e50517bb46b4d416b8ea2e8e2e3b" + "tag": "1.0.92", + "commit": "31046563fca4f28a30c1ae6f6d124a2714649398" }, "_source": "git://github.com/MediaBrowser/emby-webcomponents.git", "_target": "~1.0.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js b/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js index 4395a05650..3f20af90c2 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js +++ b/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js @@ -1,4 +1,4 @@ -define(['paperdialoghelper', 'layoutManager', 'paper-button', 'css!./actionsheet'], function (paperdialoghelper, layoutManager) { +define(['paperdialoghelper', 'layoutManager', 'dialogText', 'paper-button', 'css!./actionsheet'], function (paperdialoghelper, layoutManager, dialogText) { function parentWithClass(elem, className) { @@ -103,7 +103,7 @@ // If any items have an icon, give them all an icon just to make sure they're all lined up evenly var renderIcon = itemsWithIcons.length; - var center = options.title && (!itemsWithIcons.length); + var center = options.title && (!itemsWithIcons.length || itemsWithIcons.length != options.items.length); if (center) { dlg.classList.add('centered'); @@ -141,7 +141,7 @@ if (options.showCancel) { html += '
'; - html += '' + Globalize.translate('core#ButtonCancel') + ''; + html += '' + dialogText.get('Cancel') + ''; html += '
'; } html += ''; diff --git a/dashboard-ui/bower_components/emby-webcomponents/confirm/confirm.js b/dashboard-ui/bower_components/emby-webcomponents/confirm/confirm.js new file mode 100644 index 0000000000..68d020c7be --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/confirm/confirm.js @@ -0,0 +1,61 @@ +define(['layoutManager', 'dialogText'], function (layoutManager, dialogText) { + + function showTvConfirm(options) { + return new Promise(function (resolve, reject) { + + require(['actionsheet'], function (actionSheet) { + + var items = []; + + items.push({ + name: dialogText.get('Ok'), + id: 'ok' + }); + + items.push({ + name: dialogText.get('Cancel'), + id: 'cancel' + }); + + actionsheet.show({ + + title: options.title, + items: items + + }).then(function (id) { + + switch (id) { + + case 'ok': + resolve(); + break; + default: + reject(); + break; + } + + }, reject); + }); + }); + } + + function showConfirm(options) { + + } + + return function (options) { + + if (typeof options === 'string') { + options = { + title: '', + text: options + }; + } + + if (layoutManager.tv) { + return showTvConfirm(options); + } + + return showConfirm(options); + }; +}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js b/dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js new file mode 100644 index 0000000000..7cabb3d002 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js @@ -0,0 +1,20 @@ +define([], function () { + + return function (options) { + + if (typeof options === 'string') { + options = { + title: '', + text: options + }; + } + + var result = confirm(options.text); + + if (result) { + return Promise.resolve(); + } else { + return Promise.reject(); + } + }; +}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/prompt/nativeprompt.js b/dashboard-ui/bower_components/emby-webcomponents/prompt/nativeprompt.js index 81fe63ebe5..8517428e75 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/prompt/nativeprompt.js +++ b/dashboard-ui/bower_components/emby-webcomponents/prompt/nativeprompt.js @@ -2,23 +2,19 @@ define([], function () { return function (options) { - return new Promise(function (resolve, reject) { + if (typeof options === 'string') { + options = { + label: '', + text: options + }; + } - if (typeof options === 'string') { - options = { - label: '', - text: options - }; - } - - var result = prompt(options.label || '', options.text || ''); - - if (result) { - resolve(result); - } else { - reject(result); - } - }); + var result = prompt(options.label || '', options.text || ''); + if (result) { + return Promise.resolve(result); + } else { + return Promise.reject(result); + } }; }); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js b/dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js index 872ed0c3c3..14cc747b09 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js +++ b/dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js @@ -1,6 +1,13 @@ -define(['paperdialoghelper', 'layoutManager', 'globalize', 'dialogText', 'html!./icons.html', 'css!./style.css', 'paper-button', 'paper-input'], function (paperdialoghelper, layoutManager, globalize, dialogText) { +define(['paperdialoghelper', 'layoutManager', 'dialogText', 'html!./icons.html', 'css!./style.css', 'paper-button', 'paper-input'], function (paperdialoghelper, layoutManager, dialogText) { - function show(options, resolve, reject) { + return function (options) { + + if (typeof options === 'string') { + options = { + title: '', + text: options + }; + } var dialogOptions = { removeOnClose: true @@ -50,11 +57,11 @@ define(['paperdialoghelper', 'layoutManager', 'globalize', 'dialogText', 'html!. html += '
'; if (raisedButtons) { - html += '' + globalize.translate(dialogText.buttonOk) + ''; + html += '' + dialogText.get('Ok') + ''; } else { html += '
'; - html += '' + globalize.translate(dialogText.buttonOk) + ''; - html += '' + globalize.translate(dialogText.buttonCancel) + ''; + html += '' + dialogText.get('Ok') + ''; + html += '' + dialogText.get('Cancel') + ''; html += '
'; } html += ''; @@ -90,32 +97,13 @@ define(['paperdialoghelper', 'layoutManager', 'globalize', 'dialogText', 'html!. paperdialoghelper.close(dlg); }); - dlg.addEventListener('iron-overlay-closed', function () { - + return paperdialoghelper.open(dlg).then(function () { var value = submitValue; if (value) { - resolve(value); + return value; } else { - reject(); + return Promise.reject(); } }); - - paperdialoghelper.open(dlg); - } - - return function (options) { - - return new Promise(function (resolve, reject) { - - if (typeof options === 'string') { - options = { - title: '', - text: options - }; - } - - show(options, resolve, reject); - }); - }; }); \ No newline at end of file diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 98fce9ed95..8cd0d2306c 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -713,18 +713,12 @@ var Dashboard = { if (!apiClient) { - return new Promise(function (resolve, reject) { - - reject(); - }); + return Promise.reject(); } var cachedInfo = Dashboard.pluginSecurityInfo; if (cachedInfo) { - return new Promise(function (resolve, reject) { - - resolve(cachedInfo); - }); + return Promise.resolve(cachedInfo); } return apiClient.ajax({ @@ -2002,14 +1996,15 @@ var AppInfo = {}; return Globalize; }); - define('dialogText', [], getDialogText()); + define('dialogText', ['globalize'], getDialogText()); } function getDialogText() { - return function () { + return function (globalize) { return { - buttonOk: 'ButtonOk', - buttonCancel: 'ButtonCancel' + get: function (text) { + return globalize.translate('Button' + text); + } }; }; }