diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 3bcaf3d510..87bf172158 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -16,12 +16,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.3.30", - "_release": "1.3.30", + "version": "1.3.37", + "_release": "1.3.37", "_resolution": { "type": "version", - "tag": "1.3.30", - "commit": "0cce51a6d5a1ab91c305ba22a211ee87fdf1bea0" + "tag": "1.3.37", + "commit": "43c74d495f1fbdae6d86ac6608e934d396069806" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/formdialog.css b/dashboard-ui/bower_components/emby-webcomponents/formdialog.css index e87ed7f43e..e78a4c73dd 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/formdialog.css +++ b/dashboard-ui/bower_components/emby-webcomponents/formdialog.css @@ -15,7 +15,7 @@ margin-left: .75em; } - .formDialog form { + .formDialog .centeredContent { margin: 0 auto; } @@ -25,16 +25,19 @@ .formDialog .dialogContentInner { padding-bottom: 10vh; - padding-top: 1em; } .layout-tv .formDialog .dialogContentInner { padding-bottom: 50vh; } +.formDialog .centeredContent { + max-width: 700px; +} + @media all and (min-width: 1000px) { - .formDialog form { + .layout-tv .formDialog .centeredContent { max-width: 70vw; } } diff --git a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js index 19a2c103ac..2e1cac7070 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js +++ b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js @@ -1,4 +1,4 @@ -define(['require', 'globalize', 'connectionManager', 'loading', 'scrollHelper', 'datetime', 'focusManager', 'imageLoader', 'events', 'layoutManager', 'itemShortcuts', 'registrationservices', 'clearButtonStyle', 'css!./guide.css', 'html!./../icons/mediainfo.html', 'html!./../icons/nav.html', 'scrollStyles'], function (require, globalize, connectionManager, loading, scrollHelper, datetime, focusManager, imageLoader, events, layoutManager, itemShortcuts, registrationServices) { +define(['require', 'browser', 'globalize', 'connectionManager', 'loading', 'scrollHelper', 'datetime', 'focusManager', 'imageLoader', 'events', 'layoutManager', 'itemShortcuts', 'registrationservices', 'clearButtonStyle', 'css!./guide.css', 'html!./../icons/mediainfo.html', 'html!./../icons/nav.html', 'scrollStyles'], function (require, browser, globalize, connectionManager, loading, scrollHelper, datetime, focusManager, imageLoader, events, layoutManager, itemShortcuts, registrationServices) { function Guide(options) { @@ -59,7 +59,7 @@ return registrationServices.validateFeature('livetv').then(function () { - var limit = 400; + var limit = browser.mobile ? 100 : 400; context.querySelector('.guideRequiresUnlock').classList.add('hide'); diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css index 842bfe0ffe..036c0f1d8c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css @@ -1,3 +1,7 @@ .recordingDialog .btnSubmit { background-color: #cc3333; -} \ No newline at end of file +} + +.layout-tv .btnHeaderSave { + display: none; +} diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html index 855a356131..c2d1680643 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html @@ -5,7 +5,7 @@
-
+

@@ -52,11 +52,11 @@
- +

- +

diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingeditor.js b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingeditor.js new file mode 100644 index 0000000000..34b469c09d --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingeditor.js @@ -0,0 +1,175 @@ +define(['dialogHelper', 'globalize', 'layoutManager', 'mediaInfo', 'apphost', 'connectionManager', 'require', 'loading', 'scrollHelper', 'scrollStyles', 'paper-checkbox', 'emby-collapsible', 'paper-input', 'paper-icon-button-light', 'css!./../formdialog', 'css!./recordingcreator', 'html!./../icons/mediainfo.html', 'html!./../icons/nav.html'], function (dialogHelper, globalize, layoutManager, mediaInfo, appHost, connectionManager, require, loading, scrollHelper) { + + var currentDialog; + var recordingUpdated = false; + var currentItemId; + var currentServerId; + + function renderTimer(context, item) { + + var programInfo = item.ProgramInfo || {}; + + context.querySelector('.itemName').innerHTML = item.Name; + context.querySelector('.itemEpisodeName').innerHTML = programInfo.EpisodeTitle || ''; + + context.querySelector('.itemGenres').innerHTML = (programInfo.Genres || []).join(' / '); + context.querySelector('.itemOverview').innerHTML = programInfo.Overview || ''; + + var timerPageImageContainer = context.querySelector('.timerPageImageContainer'); + + context.querySelector('.itemMiscInfoPrimary').innerHTML = mediaInfo.getPrimaryMediaInfoHtml(programInfo); + context.querySelector('.itemMiscInfoSecondary').innerHTML = mediaInfo.getSecondaryMediaInfoHtml(programInfo); + + context.querySelector('#txtPrePaddingMinutes').value = item.PrePaddingSeconds / 60; + context.querySelector('#txtPostPaddingMinutes').value = item.PostPaddingSeconds / 60; + + var timerStausElem = context.querySelector('.timerStatus'); + + if (item.Status == 'New') { + timerStausElem.classList.add('hide'); + } else { + timerStausElem.classList.remove('hide'); + timerStausElem.innerHTML = 'Status:   ' + item.Status; + } + + loading.hide(); + } + + function closeDialog(isSubmitted) { + + recordingUpdated = isSubmitted; + dialogHelper.close(currentDialog); + } + + function onSubmit(e) { + + loading.show(); + + var form = this; + + var apiClient = connectionManager.getApiClient(currentServerId); + + apiClient.getLiveTvTimer(currentItemId).then(function (item) { + + item.PrePaddingSeconds = form.querySelector('#txtPrePaddingMinutes').value * 60; + item.PostPaddingSeconds = form.querySelector('#txtPostPaddingMinutes').value * 60; + apiClient.updateLiveTvTimer(item).then(function () { + loading.hide(); + require(['toast'], function (toast) { + toast(Globalize.translate('MessageRecordingSaved')); + closeDialog(true); + }); + }); + }); + + e.preventDefault(); + + // Disable default form submission + return false; + } + + function init(context) { + + context.querySelector('.btnCancel').addEventListener('click', function () { + + closeDialog(false); + }); + + context.querySelector('form').addEventListener('submit', onSubmit); + + context.querySelector('.btnHeaderSave').addEventListener('click', function (e) { + + context.querySelector('.btnSubmit').click(); + }); + + context.querySelector('.btnSubmit').addEventListener('click', function () { + + // Do a fake form submit this the button isn't a real submit button + var fakeSubmit = document.createElement('input'); + fakeSubmit.setAttribute('type', 'submit'); + fakeSubmit.style.display = 'none'; + var form = context.querySelector('form'); + form.appendChild(fakeSubmit); + fakeSubmit.click(); + + // Seeing issues in smart tv browsers where the form does not get submitted if the button is removed prior to the submission actually happening + setTimeout(function () { + form.removeChild(fakeSubmit); + }, 500); + }); + } + + function reload(context, id) { + + loading.show(); + currentItemId = id; + + var apiClient = connectionManager.getApiClient(currentServerId); + apiClient.getLiveTvTimer(id).then(function (result) { + + renderTimer(context, result); + loading.hide(); + }); + } + + function showEditor(itemId, serverId) { + + return new Promise(function (resolve, reject) { + + recordingUpdated = false; + currentServerId = serverId; + loading.show(); + + require(['text!./recordingeditor.template.html'], function (template) { + + var dialogOptions = { + removeOnClose: true, + scrollY: false + }; + + if (layoutManager.tv) { + dialogOptions.size = 'fullscreen'; + } else { + dialogOptions.size = 'small'; + } + + var dlg = dialogHelper.createDialog(dialogOptions); + + dlg.classList.add('formDialog'); + dlg.classList.add('recordingDialog'); + + var html = ''; + + html += globalize.translateDocument(template, 'sharedcomponents'); + + dlg.innerHTML = html; + document.body.appendChild(dlg); + + currentDialog = dlg; + + dlg.addEventListener('close', function () { + + if (recordingUpdated) { + resolve(); + } else { + reject(); + } + }); + + if (layoutManager.tv) { + scrollHelper.centerFocus.on(dlg.querySelector('.dialogContent'), false); + } + + init(dlg); + + reload(dlg, itemId); + + dialogHelper.open(dlg); + }); + }); + } + + return { + show: showEditor + }; +}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingeditor.template.html b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingeditor.template.html new file mode 100644 index 0000000000..0ef855f607 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingeditor.template.html @@ -0,0 +1,43 @@ +
+ +
+ ${Edit} +
+
+ + + ${Save} + +
+
+ +
+
+

+

+

+

+

+

+ +

+

+ + +
+
+ +
+
+
+ +
+
+
+ ${Save} +
+
+
+ +
+
\ No newline at end of file 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 e21da03819..3b2082f16a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json @@ -34,8 +34,8 @@ "Saturday": "Saturday", "Days": "Days", "RecordSeries": "Record series", - "PrePaddingMinutes": "Pre-padding minutes:", - "PostPaddingMinutes": "Post-padding minutes:", + "LabelPrePaddingMinutes": "Pre-padding minutes:", + "LabelPostPaddingMinutes": "Post-padding minutes:", "RecordOnAllChannels": "Record on all channels", "RecordAnytime": "Record at any time", "RecordOnlyNewEpisodes": "Record only new episodes", @@ -46,6 +46,8 @@ "OptionConvertRecordingsToStreamingFormatHelp": "Recordings will be converted on the fly to MP4 for easy playback on your devices.", "FeatureRequiresEmbyPremiere": "This feature requires an active Emby Premiere subscription.", "Record": "Record", + "Save": "Save", + "Edit": "Edit", "Download": "Download", "Advanced": "Advanced", "Refresh": "Refresh", diff --git a/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewcontainer-lite.js b/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewcontainer-lite.js index eddac1d54f..40a97b1e97 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewcontainer-lite.js +++ b/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewcontainer-lite.js @@ -1,6 +1,7 @@ define(['browser'], function (browser) { var allPages = document.querySelectorAll('.mainAnimatedPage'); + var currentUrls = []; var pageContainerCount = allPages.length; var animationDuration = 500; var allowAnimation = true; @@ -39,7 +40,6 @@ define(['browser'], function (browser) { if (options.type) { view.setAttribute('data-type', options.type); } - view.setAttribute('data-url', options.url); view.innerHTML = options.view; var animatable = allPages[pageIndex]; @@ -63,6 +63,7 @@ define(['browser'], function (browser) { return animate(animatable, previousAnimatable, options.transition, options.isBack).then(function () { selectedPageIndex = pageIndex; + currentUrls[pageIndex] = options.url; if (!options.cancel && previousAnimatable) { afterAnimate(allPages, pageIndex); } @@ -225,22 +226,15 @@ define(['browser'], function (browser) { } function tryRestoreView(options) { + var url = options.url; - var view = document.querySelector(".page-view[data-url='" + url + "']"); - var page = parentWithClass(view, 'mainAnimatedPage'); + var index = currentUrls.indexOf(url); - if (view) { + if (index != -1) { + var page = allPages[index]; + var view = page.querySelector(".page-view"); - var index = -1; - var pages = allPages; - for (var i = 0, length = pages.length; i < length; i++) { - if (pages[i] == page) { - index = i; - break; - } - } - - if (index != -1) { + if (view) { if (options.cancel) { return; @@ -278,14 +272,7 @@ define(['browser'], function (browser) { function reset() { - var views = document.querySelectorAll(".mainAnimatedPage.hide .page-view"); - - for (var i = 0, length = views.length; i < length; i++) { - - var view = views[i]; - triggerDestroy(view); - view.parentNode.removeChild(view); - } + currentUrls = []; } function parentWithClass(elem, className) { diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json index 9604c48b0b..f920799d20 100644 --- a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json @@ -30,14 +30,14 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "ignore": [], - "homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior", + "homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior", "_release": "1.1.2", "_resolution": { "type": "version", "tag": "v1.1.2", "commit": "0c2330c229a6fd3d200e2b84147ec6f94f17c22d" }, - "_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git", + "_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/iron-a11y-keys-behavior" + "_originalSource": "polymerelements/iron-a11y-keys-behavior" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/polymer/.bower.json b/dashboard-ui/bower_components/polymer/.bower.json index 539707958b..3e8a4009a3 100644 --- a/dashboard-ui/bower_components/polymer/.bower.json +++ b/dashboard-ui/bower_components/polymer/.bower.json @@ -34,6 +34,6 @@ "commit": "11c987b2eb3c73b388a79fc8aaea8ca01624f514" }, "_source": "git://github.com/Polymer/polymer.git", - "_target": "^1.2.0", + "_target": "^1.0.0", "_originalSource": "Polymer/polymer" } \ No newline at end of file diff --git a/dashboard-ui/components/recordingeditor/recordingeditor.js b/dashboard-ui/components/recordingeditor/recordingeditor.js deleted file mode 100644 index 11eccea955..0000000000 --- a/dashboard-ui/components/recordingeditor/recordingeditor.js +++ /dev/null @@ -1,163 +0,0 @@ -define(['dialogHelper', 'loading', 'jQuery', 'mediaInfo', 'paper-checkbox', 'paper-input', 'emby-collapsible', 'paper-button', 'paper-icon-button-light'], function (dialogHelper, loading, $, mediaInfo) { - - var currentDialog; - var recordingUpdated = false; - var currentItemId; - - function renderTimer(context, item) { - - var programInfo = item.ProgramInfo || {}; - - $('.itemName', context).html(item.Name); - - $('.itemEpisodeName', context).html(programInfo.EpisodeTitle || ''); - - LibraryBrowser.renderGenres($('.itemGenres', context), programInfo); - LibraryBrowser.renderOverview(context.querySelectorAll('.itemOverview'), programInfo); - - if (programInfo.ImageTags && programInfo.ImageTags.Primary) { - - var imgUrl = ApiClient.getScaledImageUrl(programInfo.Id, { - maxWidth: 200, - maxHeight: 200, - tag: programInfo.ImageTags.Primary, - type: "Primary" - }); - - $('.timerPageImageContainer', context).css("display", "inline-block") - .html(''); - - } else { - $('.timerPageImageContainer', context).hide(); - } - - $('.itemMiscInfoPrimary', context).html(mediaInfo.getPrimaryMediaInfoHtml(programInfo)); - $('.itemMiscInfoSecondary', context).html(mediaInfo.getSecondaryMediaInfoHtml(programInfo)); - - $('#txtPrePaddingMinutes', context).val(item.PrePaddingSeconds / 60); - $('#txtPostPaddingMinutes', context).val(item.PostPaddingSeconds / 60); - - if (item.Status == 'New') { - $('.timerStatus', context).hide(); - } else { - $('.timerStatus', context).show().html('Status:   ' + item.Status); - } - - loading.hide(); - } - - function closeDialog(isSubmitted) { - - recordingUpdated = isSubmitted; - dialogHelper.close(currentDialog); - } - - function onSubmit(e) { - - loading.show(); - - var form = this; - - ApiClient.getLiveTvTimer(currentItemId).then(function (item) { - - item.PrePaddingSeconds = $('#txtPrePaddingMinutes', form).val() * 60; - item.PostPaddingSeconds = $('#txtPostPaddingMinutes', form).val() * 60; - ApiClient.updateLiveTvTimer(item).then(function () { - loading.hide(); - require(['toast'], function (toast) { - toast(Globalize.translate('MessageRecordingSaved')); - closeDialog(true); - }); - }); - }); - - e.preventDefault(); - - // Disable default form submission - return false; - } - - function init(context) { - - context.querySelector('.btnCancel').addEventListener('click', function () { - - closeDialog(false); - }); - - context.querySelector('form').addEventListener('submit', onSubmit); - - context.querySelector('.btnHeaderSave').addEventListener('click', function (e) { - - context.querySelector('.btnSave').click(); - }); - } - - function reload(context, id) { - - loading.show(); - currentItemId = id; - - ApiClient.getLiveTvTimer(id).then(function (result) { - - renderTimer(context, result); - loading.hide(); - }); - } - - function showEditor(itemId) { - - return new Promise(function (resolve, reject) { - - recordingUpdated = false; - loading.show(); - - var xhr = new XMLHttpRequest(); - xhr.open('GET', 'components/recordingeditor/recordingeditor.template.html', true); - - xhr.onload = function (e) { - - var template = this.response; - var dlg = dialogHelper.createDialog({ - removeOnClose: true, - size: 'small', - autoFocus: false - }); - - dlg.classList.add('ui-body-b'); - dlg.classList.add('background-theme-b'); - - dlg.classList.add('formDialog'); - - var html = ''; - - html += Globalize.translateDocument(template); - - dlg.innerHTML = html; - document.body.appendChild(dlg); - - dialogHelper.open(dlg); - - currentDialog = dlg; - - dlg.addEventListener('close', function () { - - if (recordingUpdated) { - resolve(); - } else { - reject(); - } - }); - - init(dlg); - - reload(dlg, itemId); - } - - xhr.send(); - }); - } - - return { - show: showEditor - }; -}); \ No newline at end of file diff --git a/dashboard-ui/components/recordingeditor/recordingeditor.template.html b/dashboard-ui/components/recordingeditor/recordingeditor.template.html deleted file mode 100644 index 87a55ce207..0000000000 --- a/dashboard-ui/components/recordingeditor/recordingeditor.template.html +++ /dev/null @@ -1,48 +0,0 @@ -
- -
- ${ButtonEdit} -
-
- - - ${ButtonSave} - -
-
- -
-
- -
-

-

-

-

-

-
-
-

- -

-

-
-
-
-
- -
-
-
- -
-
-
- -
-
-
-
\ No newline at end of file diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 0a4ee9d5e0..18db76b4ee 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -473,7 +473,9 @@ }); }); - LibraryBrowser.renderGenres($('.itemGenres', page), item, null, isStatic); + $('.itemGenres', page).each(function() { + LibraryBrowser.renderGenres(this, item, null, isStatic); + }); LibraryBrowser.renderStudios($('.itemStudios', page), item, isStatic); renderUserDataIcons(page, item); LibraryBrowser.renderLinks(page.querySelector('.itemExternalLinks'), item); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index ddac373b84..31a0453282 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -793,9 +793,10 @@ editTimer: function (id) { - require(['components/recordingeditor/recordingeditor'], function (recordingeditor) { + require(['recordingEditor'], function (recordingEditor) { - recordingeditor.show(id); + var serverId = ApiClient.serverInfo().Id; + recordingEditor.show(id, serverId); }); }, @@ -3343,7 +3344,7 @@ } } - elem.html(html).trigger('create'); + elem.innerHTML = html; }, renderPremiereDate: function (elem, item) { diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index fb4b3d0795..17bbe19a05 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1822,6 +1822,7 @@ var AppInfo = {}; define("libjass", [bowerPath + "/libjass/libjass", "css!" + bowerPath + "/libjass/libjass"], returnFirstDependency); define("recordingCreator", [embyWebComponentsBowerPath + "/recordingcreator/recordingcreator"], returnFirstDependency); + define("recordingEditor", [embyWebComponentsBowerPath + "/recordingcreator/recordingeditor"], returnFirstDependency); define("mediaInfo", [embyWebComponentsBowerPath + "/mediainfo/mediainfo"], returnFirstDependency); define("backdrop", [embyWebComponentsBowerPath + "/backdrop/backdrop"], returnFirstDependency); define("fetchHelper", [embyWebComponentsBowerPath + "/fetchhelper"], returnFirstDependency); @@ -3102,7 +3103,7 @@ var AppInfo = {}; loadTheme(); if (browserInfo.safari && browserInfo.mobile) { - initFastClick(); + //initFastClick(); } if (Dashboard.isRunningInCordova()) { diff --git a/dashboard-ui/thirdparty/paper-button-style.css b/dashboard-ui/thirdparty/paper-button-style.css index 9558613098..5c4609ba06 100644 --- a/dashboard-ui/thirdparty/paper-button-style.css +++ b/dashboard-ui/thirdparty/paper-button-style.css @@ -36,11 +36,11 @@ } paper-button.submit { - color: #4285f4; + color: #52B54B; } paper-button[raised].submit { - background: #4285f4; + background: #52B54B; color: #fff; } @@ -54,11 +54,11 @@ } paper-button.secondary { - color: #52B54B; + color: #4285f4; } paper-button[raised].secondary { - background: #52B54B; + background: #4285f4; color: #fff; }