diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index acbaa3cb4a..f96583457f 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.60", - "_release": "1.0.60", + "version": "1.0.65", + "_release": "1.0.65", "_resolution": { "type": "version", - "tag": "1.0.60", - "commit": "a55e4324dc88ec5cfa9640d1f5d59228a4c7c8c8" + "tag": "1.0.65", + "commit": "2117b3bb2d88bef07f2c150101683db8857021dd" }, "_source": "git://github.com/MediaBrowser/emby-webcomponents.git", "_target": "~1.0.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/prompt/icons.html b/dashboard-ui/bower_components/emby-webcomponents/prompt/icons.html new file mode 100644 index 0000000000..5b719d3869 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/prompt/icons.html @@ -0,0 +1,41 @@ + + + + + + + + + + + diff --git a/dashboard-ui/bower_components/emby-webcomponents/prompt/nativeprompt.js b/dashboard-ui/bower_components/emby-webcomponents/prompt/nativeprompt.js new file mode 100644 index 0000000000..11c4118fe2 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/prompt/nativeprompt.js @@ -0,0 +1,24 @@ +define([], function () { + + return function (options) { + + return new Promise(function (resolve, reject) { + + if (typeof options === 'string') { + options = { + title: '', + text: options + }; + } + + var result = prompt(options.title || '', options.text || ''); + + if (result) { + resolve(result); + } else { + 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 new file mode 100644 index 0000000000..35cf974cb4 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js @@ -0,0 +1,84 @@ +define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.css', 'paper-button', 'paper-input'], function (paperdialoghelper, layoutManager) { + + function show(options, resolve, reject) { + + var dialogOptions = { + removeOnClose: true + }; + + if (layoutManager.tv) { + dialogOptions.size = 'fullscreen'; + } + + var dlg = paperdialoghelper.createDialog(dialogOptions); + + dlg.classList.add('promptDialog'); + + var html = ''; + var submitValue = ''; + + html += '
'; + html += ''; + + if (options.title) { + html += '

'; + html += options.title; + html += '

'; + } + + html += ''; + + // TODO: An actual form element should probably be added + html += '
'; + html += '' + Globalize.translate('core#ButtonOk') + ''; + + html += '
'; + + dlg.innerHTML = html; + + if (options.text) { + dlg.querySelector('.txtPromptValue').value = options.text; + } + + document.body.appendChild(dlg); + + dlg.querySelector('.paperSubmit').addEventListener('click', function (e) { + + submitValue = dlg.querySelector('.txtPromptValue').value; + paperdialoghelper.close(dlg); + }); + + dlg.querySelector('.btnPromptExit').addEventListener('click', function (e) { + + paperdialoghelper.close(dlg); + }); + + dlg.addEventListener('iron-overlay-closed', function () { + + var value = submitValue; + if (value) { + resolve(value); + } else { + 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/bower_components/emby-webcomponents/prompt/style.css b/dashboard-ui/bower_components/emby-webcomponents/prompt/style.css new file mode 100644 index 0000000000..18eae47410 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/prompt/style.css @@ -0,0 +1,20 @@ +.promptDialog { + flex-direction: column; + display: flex; + align-items: center; + justify-content: center; + text-align: center; +} + +.btnPromptExit { + z-index: 1002; + position: absolute; + top: .5em; + left: .5em; + width: 5.2vh; + height: 5.2vh; +} + +.txtPromptValue label { + font-size: 200%; +} diff --git a/dashboard-ui/bower_components/emby-webcomponents/qualityoptions.js b/dashboard-ui/bower_components/emby-webcomponents/qualityoptions.js index 80ca8c05d3..696385c645 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/qualityoptions.js +++ b/dashboard-ui/bower_components/emby-webcomponents/qualityoptions.js @@ -10,8 +10,10 @@ // Some 1080- videos are reported as 1912? if (maxAllowedWidth >= 1900) { - options.push({ name: '1080p - 50Mbps', maxHeight: 1080, bitrate: 40000000 }); - options.push({ name: '1080p - 45Mbps', maxHeight: 1080, bitrate: 40000000 }); + options.push({ name: '1080p - 60Mbps', maxHeight: 1080, bitrate: 60000000 }); + options.push({ name: '1080p - 55Mbps', maxHeight: 1080, bitrate: 55000000 }); + options.push({ name: '1080p - 50Mbps', maxHeight: 1080, bitrate: 50000000 }); + options.push({ name: '1080p - 45Mbps', maxHeight: 1080, bitrate: 45000000 }); options.push({ name: '1080p - 40Mbps', maxHeight: 1080, bitrate: 40000000 }); options.push({ name: '1080p - 35Mbps', maxHeight: 1080, bitrate: 35000000 }); options.push({ name: '1080p - 30Mbps', maxHeight: 1080, bitrate: 30000000 }); diff --git a/dashboard-ui/bower_components/iron-behaviors/.bower.json b/dashboard-ui/bower_components/iron-behaviors/.bower.json index db08f2170c..17f68b3351 100644 --- a/dashboard-ui/bower_components/iron-behaviors/.bower.json +++ b/dashboard-ui/bower_components/iron-behaviors/.bower.json @@ -29,14 +29,14 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "ignore": [], - "homepage": "https://github.com/PolymerElements/iron-behaviors", + "homepage": "https://github.com/polymerelements/iron-behaviors", "_release": "1.0.12", "_resolution": { "type": "version", "tag": "v1.0.12", "commit": "657f526a2382a659cdf4e13be87ecc89261588a3" }, - "_source": "git://github.com/PolymerElements/iron-behaviors.git", + "_source": "git://github.com/polymerelements/iron-behaviors.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/iron-behaviors" + "_originalSource": "polymerelements/iron-behaviors" } \ No newline at end of file diff --git a/dashboard-ui/components/prompt.js b/dashboard-ui/components/prompt.js deleted file mode 100644 index 19ba0763c9..0000000000 --- a/dashboard-ui/components/prompt.js +++ /dev/null @@ -1,10 +0,0 @@ -define([], function () { - return function (options) { - - var result = prompt(options.text, options.defaultText || ''); - - if (options.callback) { - options.callback(result); - } - }; -}); \ No newline at end of file diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index b1996a39ed..1b6afc9df2 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1810,10 +1810,8 @@ var AppInfo = {}; return obj; } - function initRequire() { - - var urlArgs = "v=" + (window.dashboardVersion || new Date().getDate()); - + function getBowerPath() { + var bowerPath = "bower_components"; // Put the version into the bower path since we can't easily put a query string param on html imports @@ -1822,6 +1820,15 @@ var AppInfo = {}; bowerPath += window.dashboardVersion; } + return bowerPath; + } + + function initRequire() { + + var urlArgs = "v=" + (window.dashboardVersion || new Date().getDate()); + + var bowerPath = getBowerPath(); + var apiClientBowerPath = bowerPath + "/emby-apiclient"; var embyWebComponentsBowerPath = bowerPath + '/emby-webcomponents'; @@ -1870,14 +1877,12 @@ var AppInfo = {}; if (Dashboard.isRunningInCordova()) { paths.dialog = "cordova/dialog"; - paths.prompt = "cordova/prompt"; paths.sharingwidget = "cordova/sharingwidget"; paths.serverdiscovery = "cordova/serverdiscovery"; paths.wakeonlan = "cordova/wakeonlan"; paths.actionsheet = "cordova/actionsheet"; } else { paths.dialog = "components/dialog"; - paths.prompt = "components/prompt"; paths.sharingwidget = "components/sharingwidget"; paths.serverdiscovery = apiClientBowerPath + "/serverdiscovery"; paths.wakeonlan = apiClientBowerPath + "/wakeonlan"; @@ -2035,6 +2040,21 @@ var AppInfo = {}; }); } + function initRequireWithBrowser(browser) { + + var bowerPath = getBowerPath(); + + var embyWebComponentsBowerPath = bowerPath + '/emby-webcomponents'; + + if (Dashboard.isRunningInCordova()) { + define("prompt", ["cordova/prompt"], returnFirstDependency); + } else if (browser.mobile) { + define("prompt", [embyWebComponentsBowerPath + "/prompt/nativeprompt"], returnFirstDependency); + } else { + define("prompt", [embyWebComponentsBowerPath + "/prompt/prompt"], returnFirstDependency); + } + } + function init(hostingAppInfo) { if (Dashboard.isRunningInCordova() && browserInfo.android) { @@ -2448,6 +2468,8 @@ var AppInfo = {}; require(initialDependencies, function (browser, appStorage) { + initRequireWithBrowser(browser); + window.browserInfo = browser; window.appStorage = appStorage; diff --git a/dashboard-ui/scripts/userparentalcontrol.js b/dashboard-ui/scripts/userparentalcontrol.js index a7f8680622..3d8808d94f 100644 --- a/dashboard-ui/scripts/userparentalcontrol.js +++ b/dashboard-ui/scripts/userparentalcontrol.js @@ -343,18 +343,14 @@ require(['prompt'], function (prompt) { prompt({ - text: Globalize.translate('LabelTag'), - title: Globalize.translate('HeaderAddTag'), - callback: function(value) { - - if (value) { - var tags = getBlockedTagsFromPage(page); + title: Globalize.translate('LabelTag') - if (tags.indexOf(value) == -1) { - tags.push(value); - loadBlockedTags(page, tags); - } - } + }).then(function (value) { + var tags = getBlockedTagsFromPage(page); + + if (tags.indexOf(value) == -1) { + tags.push(value); + loadBlockedTags(page, tags); } });