From 0209b950a1ebc6d8c5e5dcc186d603891fa3c842 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 4 May 2016 16:50:47 -0400 Subject: [PATCH 01/11] update recording saving --- dashboard-ui/livetvsettings.html | 23 +++++++++--- dashboard-ui/scripts/livetvsettings.js | 51 ++++++++++++++++++++++++-- dashboard-ui/scripts/sections.js | 23 +++++++++--- dashboard-ui/strings/en-US.json | 13 +++---- 4 files changed, 88 insertions(+), 22 deletions(-) diff --git a/dashboard-ui/livetvsettings.html b/dashboard-ui/livetvsettings.html index 22cd639db..e60ac6485 100644 --- a/dashboard-ui/livetvsettings.html +++ b/dashboard-ui/livetvsettings.html @@ -39,6 +39,23 @@
${LabelRecordingPathHelp}

+
+ ${OptionEnableRecordingSubfolders} +
+
+
+ + +
+
+ + +
+
+
+ ${OptionSendRecordingsToAutoOrganize} +
+

${OptionConvertRecordingsToStreamingFormat} @@ -52,12 +69,6 @@


-
- ${OptionSendRecordingsToAutoOrganize} -
${OptionSendRecordingsToAutoOrganizeHelp}
-
-
-

${HeaderDefaultPadding}

diff --git a/dashboard-ui/scripts/livetvsettings.js b/dashboard-ui/scripts/livetvsettings.js index 43be4ad7b..a15ddc03e 100644 --- a/dashboard-ui/scripts/livetvsettings.js +++ b/dashboard-ui/scripts/livetvsettings.js @@ -12,11 +12,15 @@ $('#chkConvertRecordings', page).checked(config.EnableRecordingEncoding); $('#chkPreserveAudio', page).checked(config.EnableOriginalAudioWithEncodedRecordings || false); - $('#txtRecordingPath', page).val(config.RecordingPath || ''); - $('#txtPrePaddingMinutes', page).val(config.PrePaddingSeconds / 60); $('#txtPostPaddingMinutes', page).val(config.PostPaddingSeconds / 60); + page.querySelector('#txtRecordingPath').value = config.RecordingPath || ''; + page.querySelector('#txtMovieRecordingPath').value = config.MovieRecordingPath || ''; + page.querySelector('#txtSeriesRecordingPath').value = config.SeriesRecordingPath || ''; + + page.querySelector('#chkEnableRecordingSubfolders').checked = config.EnableRecordingSubfolders || false; + Dashboard.hideLoadingMsg(); } @@ -33,10 +37,13 @@ config.EnableAutoOrganize = $('#chkOrganize', form).checked(); config.EnableRecordingEncoding = $('#chkConvertRecordings', form).checked(); config.EnableOriginalAudioWithEncodedRecordings = $('#chkPreserveAudio', form).checked(); - config.RecordingPath = $('#txtRecordingPath', form).val() || null; + config.RecordingPath = form.querySelector('#txtRecordingPath').value || null; + config.MovieRecordingPath = form.querySelector('#txtMovieRecordingPath').value || null; + config.SeriesRecordingPath = form.querySelector('#txtSeriesRecordingPath').value || null; config.PrePaddingSeconds = $('#txtPrePaddingMinutes', form).val() * 60; config.PostPaddingSeconds = $('#txtPostPaddingMinutes', form).val() * 60; + config.EnableRecordingSubfolders = form.querySelector('#chkEnableRecordingSubfolders').checked; ApiClient.updateNamedConfiguration("livetv", config).then(Dashboard.processServerConfigurationUpdateResult); }); @@ -86,6 +93,44 @@ }); }); + $('#btnSelectMovieRecordingPath', page).on("click.selectDirectory", function () { + + require(['directorybrowser'], function (directoryBrowser) { + + var picker = new directoryBrowser(); + + picker.show({ + + callback: function (path) { + + if (path) { + $('#txtMovieRecordingPath', page).val(path); + } + picker.close(); + } + }); + }); + }); + + $('#btnSelectSeriesRecordingPath', page).on("click.selectDirectory", function () { + + require(['directorybrowser'], function (directoryBrowser) { + + var picker = new directoryBrowser(); + + picker.show({ + + callback: function (path) { + + if (path) { + $('#txtSeriesRecordingPath', page).val(path); + } + picker.close(); + } + }); + }); + }); + }).on('pageshow', "#liveTvSettingsPage", function () { LibraryMenu.setTabs('livetvadmin', 1, getTabs); diff --git a/dashboard-ui/scripts/sections.js b/dashboard-ui/scripts/sections.js index 68654e64d..d828a65c9 100644 --- a/dashboard-ui/scripts/sections.js +++ b/dashboard-ui/scripts/sections.js @@ -163,12 +163,14 @@ function getAppInfo() { - if (AppInfo.nativeApp) { - return Promise.resolve(''); + var frequency = 86400000; + + if (AppInfo.isNativeApp) { + frequency = 604800000; } var cacheKey = 'lastappinfopresent5'; - if ((new Date().getTime() - parseInt(appSettings.get(cacheKey) || '0')) < 86400000) { + if ((new Date().getTime() - parseInt(appSettings.get(cacheKey) || '0')) < frequency) { return Promise.resolve(''); } @@ -180,7 +182,11 @@ return ''; } - var infos = [getTheaterInfo, getPremiereInfo]; + var infos = [getPremiereInfo]; + + if (!browserInfo.safari || !AppInfo.isNativeApp) { + infos.push(getTheaterInfo); + } appSettings.set(cacheKey, new Date().getTime()); @@ -198,7 +204,9 @@ var html = ''; html += '
'; html += '

Try Emby Theater

'; - html += '

A beautiful app for your TV and large screen tablet. Emby Theater runs on Windows, Xbox One, Google Chrome, FireFox, Microsoft Edge and Opera.

'; + + var nameText = AppInfo.isNativeApp ? 'Emby Theater' : 'Emby Theater'; + html += '

A beautiful app for your TV and large screen tablet. ' + nameText + ' runs on Windows, Xbox One, Google Chrome, FireFox, Microsoft Edge and Opera.

'; html += '
'; html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png', 'https://emby.media/download'); html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png', 'https://emby.media/download'); @@ -214,7 +222,10 @@ var html = ''; html += '
'; html += '

Try Emby Premiere

'; - html += '

Design beautiful Cover Art, enjoy free access to Emby apps, and more. Learn more

'; + + var learnMoreText = AppInfo.isNativeApp ? '' : 'Learn more'; + + html += '

Design beautiful Cover Art, enjoy free access to Emby apps, and more. ' + learnMoreText + '

'; html += '
'; html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png', 'https://emby.media/premiere'); html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png', 'https://emby.media/premiere'); diff --git a/dashboard-ui/strings/en-US.json b/dashboard-ui/strings/en-US.json index 85e3101f7..0cdfc90eb 100644 --- a/dashboard-ui/strings/en-US.json +++ b/dashboard-ui/strings/en-US.json @@ -347,8 +347,10 @@ "LabelCustomPaths": "Specify custom paths where desired. Leave fields empty to use the defaults.", "LabelCachePath": "Cache path:", "LabelCachePathHelp": "Specify a custom location for server cache files, such as images. Leave blank to use the server default.", - "LabelRecordingPath": "Recording path:", - "LabelRecordingPathHelp": "Specify a custom location to save recordings. Leave blank to use the server default.", + "LabelRecordingPath": "Default recording path:", + "LabelMovieRecordingPath": "Movie recording path (optional):", + "LabelSeriesRecordingPath": "Series recording path (optional):", + "LabelRecordingPathHelp": "Specify the default location to save recordings. If left empty, the server's program data folder will be used.", "LabelImagesByNamePath": "Images by name path:", "LabelImagesByNamePathHelp": "Specify a custom location for downloaded actor, genre and studio images.", "LabelMetadataPath": "Metadata path:", @@ -1486,14 +1488,11 @@ "MessageActiveSubscriptionRequiredSeriesRecordings": "An active Emby Premiere subscription is required in order to create automated series recordings.", "HeaderSetupTVGuide": "Setup TV Guide", "LabelDataProvider": "Data provider:", - "OptionSendRecordingsToAutoOrganize": "Enable Auto-Organize for new recordings", - "OptionSendRecordingsToAutoOrganizeHelp": "New recordings will be sent to the Auto-Organize feature and imported into your media library.", + "OptionSendRecordingsToAutoOrganize": "Automatically organize recordings into existing series folders in other libraries", "HeaderDefaultPadding": "Default Padding", + "OptionEnableRecordingSubfolders": "Create sub-folders for categories such as Sports, Kids, etc.", "HeaderSubtitles": "Subtitles", "HeaderVideos": "Videos", - "OptionEnableVideoFrameAnalysis": "Enable frame by frame video analysis", - "OptionEnableVideoFrameAnalysisHelp": "Extract detailed information about videos that can be used to make transcoding as efficient as possible. This will cause library scans to take longer.", - "LabelVideoFrameAnalysisLimit": "Limit frame by frame analysis to videos less than:", "LabelHardwareAccelerationType": "Hardware acceleration:", "LabelHardwareAccelerationTypeHelp": "Available on supported systems only.", "ButtonServerDashboard": "Server Dashboard", From 25b5198fa7b57314f2715a1aa62992cb14d69e6c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 5 May 2016 00:18:35 -0400 Subject: [PATCH 02/11] update components --- .../emby-webcomponents/guide/guide.js | 26 +++++++++++++-- .../emby-webcomponents/images/imagehelper.js | 33 +++++++++++++++++-- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js index 039c0418b..9e929a9b6 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js +++ b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js @@ -600,6 +600,24 @@ var xhr = new XMLHttpRequest(); xhr.open('GET', baseUrl + '/tvguide.template.html', true); + var supportsCaptureOption = false; + try { + var opts = Object.defineProperty({}, 'capture', { + get: function () { + supportsCaptureOption = true; + } + }); + window.addEventListener("test", null, opts); + } catch (e) { } + + function addEventListenerWithOptions(target, type, handler, options) { + var optionsOrCapture = options; + if (!supportsCaptureOption) { + optionsOrCapture = options.capture; + } + target.addEventListener(type, handler, optionsOrCapture); + } + xhr.onload = function (e) { var template = this.response; @@ -610,13 +628,17 @@ var timeslotHeaders = context.querySelector('.timeslotHeaders'); programGrid.addEventListener('focus', onProgramGridFocus, true); - programGrid.addEventListener('scroll', function () { + addEventListenerWithOptions(programGrid, 'scroll', function () { onProgramGridScroll(context, this, timeslotHeaders); + }, { + passive: true }); - timeslotHeaders.addEventListener('scroll', function () { + addEventListenerWithOptions(timeslotHeaders, 'scroll', function () { onTimeslotHeadersScroll(context, this, programGrid); + }, { + passive: true }); context.querySelector('.btnSelectDate').addEventListener('click', function () { diff --git a/dashboard-ui/bower_components/emby-webcomponents/images/imagehelper.js b/dashboard-ui/bower_components/emby-webcomponents/images/imagehelper.js index 3acfa9cbd..0247b0f3c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/images/imagehelper.js +++ b/dashboard-ui/bower_components/emby-webcomponents/images/imagehelper.js @@ -43,6 +43,24 @@ define(['visibleinviewport', 'imageFetcher'], function (visibleinviewport, image } } + var supportsCaptureOption = false; + try { + var opts = Object.defineProperty({}, 'capture', { + get: function () { + supportsCaptureOption = true; + } + }); + window.addEventListener("test", null, opts); + } catch (e) { } + + function addEventListenerWithOptions(target, type, handler, options) { + var optionsOrCapture = options; + if (!supportsCaptureOption) { + optionsOrCapture = options.capture; + } + target.addEventListener(type, handler, optionsOrCapture); + } + function unveilElements(images) { if (!images.length) { @@ -103,10 +121,19 @@ define(['visibleinviewport', 'imageFetcher'], function (visibleinviewport, image }, 1); } - document.addEventListener('scroll', unveil, true); + addEventListenerWithOptions(document, 'scroll', unveil, { + capture: true, + passive: true + }); document.addEventListener('focus', unveil, true); - document.addEventListener(wheelEvent, unveil, true); - window.addEventListener('resize', unveil, true); + addEventListenerWithOptions(document, wheelEvent, unveil, { + capture: true, + passive: true + }); + addEventListenerWithOptions(window, 'resize', unveil, { + capture: true, + passive: true + }); unveil(); } From e5a4b3813f2f297d37dc860ad0b444bed48e3c45 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 5 May 2016 14:29:30 -0400 Subject: [PATCH 03/11] update components --- .../emby-webcomponents/.bower.json | 8 +- .../iron-behaviors/.bower.json | 8 +- .../iron-behaviors/bower.json | 2 +- .../iron-behaviors/iron-control-state.html | 3 +- .../iron-behaviors/test/focused-state.html | 19 +++- .../iron-fit-behavior/.bower.json | 8 +- .../iron-fit-behavior/bower.json | 2 +- .../iron-fit-behavior/iron-fit-behavior.html | 107 ++++++++++-------- .../test/iron-fit-behavior.html | 60 ++++++++++ .../iron-overlay-behavior/.bower.json | 8 +- .../iron-overlay-behavior/bower.json | 2 +- .../iron-overlay-backdrop.html | 8 +- .../iron-selector/.bower.json | 4 +- .../paper-icon-button/.bower.json | 13 ++- .../.github/ISSUE_TEMPLATE.md | 33 ++++++ .../paper-icon-button/.travis.yml | 6 +- .../paper-icon-button/bower.json | 7 +- .../demo/paper-icon-button-light.html | 57 ++++++++++ .../paper-icon-button-light.html | 82 ++++++++++++++ .../bower_components/paper-input/.bower.json | 6 +- .../paper-material/.bower.json | 4 +- 21 files changed, 360 insertions(+), 87 deletions(-) create mode 100644 dashboard-ui/bower_components/paper-icon-button/.github/ISSUE_TEMPLATE.md create mode 100644 dashboard-ui/bower_components/paper-icon-button/demo/paper-icon-button-light.html create mode 100644 dashboard-ui/bower_components/paper-icon-button/paper-icon-button-light.html diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 53eace5a3..7dcce3fce 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.2.58", - "_release": "1.2.58", + "version": "1.2.59", + "_release": "1.2.59", "_resolution": { "type": "version", - "tag": "1.2.58", - "commit": "523cb074208c7350bb68554c6fcde613142117f4" + "tag": "1.2.59", + "commit": "2089ec993031b303b5c2163fbc5aff5b37056d1f" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/iron-behaviors/.bower.json b/dashboard-ui/bower_components/iron-behaviors/.bower.json index 26a892a0b..fe0c6d195 100644 --- a/dashboard-ui/bower_components/iron-behaviors/.bower.json +++ b/dashboard-ui/bower_components/iron-behaviors/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-behaviors", - "version": "1.0.14", + "version": "1.0.15", "description": "Provides a set of behaviors for the iron elements", "private": true, "authors": [ @@ -30,11 +30,11 @@ }, "ignore": [], "homepage": "https://github.com/PolymerElements/iron-behaviors", - "_release": "1.0.14", + "_release": "1.0.15", "_resolution": { "type": "version", - "tag": "v1.0.14", - "commit": "c1d38a26219cf2e83b31a71a2bd8ae35ebee7ed7" + "tag": "v1.0.15", + "commit": "f91583bfae24235401a21a1d67bde8cacce13030" }, "_source": "git://github.com/PolymerElements/iron-behaviors.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-behaviors/bower.json b/dashboard-ui/bower_components/iron-behaviors/bower.json index 460ccc800..ba405d65d 100644 --- a/dashboard-ui/bower_components/iron-behaviors/bower.json +++ b/dashboard-ui/bower_components/iron-behaviors/bower.json @@ -1,6 +1,6 @@ { "name": "iron-behaviors", - "version": "1.0.14", + "version": "1.0.15", "description": "Provides a set of behaviors for the iron elements", "private": true, "authors": [ diff --git a/dashboard-ui/bower_components/iron-behaviors/iron-control-state.html b/dashboard-ui/bower_components/iron-behaviors/iron-control-state.html index 4b7c615c8..ab5b432b3 100644 --- a/dashboard-ui/bower_components/iron-behaviors/iron-control-state.html +++ b/dashboard-ui/bower_components/iron-behaviors/iron-control-state.html @@ -73,7 +73,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN if (event.target === this) { this._setFocused(event.type === 'focus'); - } else if (!this.shadowRoot && !this.isLightDescendant(event.target)) { + } else if (!this.shadowRoot && + !this.isLightDescendant(Polymer.dom(event).localTarget)) { this.fire(event.type, {sourceEvent: event}, { node: this, bubbles: event.bubbles, diff --git a/dashboard-ui/bower_components/iron-behaviors/test/focused-state.html b/dashboard-ui/bower_components/iron-behaviors/test/focused-state.html index e34a55c12..3b75c704e 100644 --- a/dashboard-ui/bower_components/iron-behaviors/test/focused-state.html +++ b/dashboard-ui/bower_components/iron-behaviors/test/focused-state.html @@ -31,10 +31,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - + @@ -119,11 +120,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN suite('elements in the light dom', function() { - var lightDOM, input; + var lightDOM, input, lightDescendantShadowInput; setup(function() { lightDOM = fixture('LightDOM'); input = document.querySelector('#input'); + lightDescendantShadowInput = Polymer.dom(lightDOM) + .querySelector('nested-focusable').$.input; }); test('should not fire the focus event', function() { @@ -138,6 +141,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN expect(nFocusEvents).to.be.equal(0); }); + test('should not fire the focus event from shadow descendants', function() { + var nFocusEvents = 0; + + lightDOM.addEventListener('focus', function() { + nFocusEvents += 1; + }); + + MockInteractions.focus(lightDescendantShadowInput); + + expect(nFocusEvents).to.be.equal(0); + }); + }); diff --git a/dashboard-ui/bower_components/iron-fit-behavior/.bower.json b/dashboard-ui/bower_components/iron-fit-behavior/.bower.json index 0b62f4dbf..885d2d5a7 100644 --- a/dashboard-ui/bower_components/iron-fit-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-fit-behavior/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-fit-behavior", - "version": "1.1.0", + "version": "1.1.1", "license": "http://polymer.github.io/LICENSE.txt", "description": "Fits an element inside another element", "private": true, @@ -29,11 +29,11 @@ }, "ignore": [], "homepage": "https://github.com/PolymerElements/iron-fit-behavior", - "_release": "1.1.0", + "_release": "1.1.1", "_resolution": { "type": "version", - "tag": "v1.1.0", - "commit": "6602a102f425f5ccc9e05e9cc15139a3ad259081" + "tag": "v1.1.1", + "commit": "c87fd44553b9ce2c60f695146d667932a7be2f8f" }, "_source": "git://github.com/PolymerElements/iron-fit-behavior.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-fit-behavior/bower.json b/dashboard-ui/bower_components/iron-fit-behavior/bower.json index c4eb1fe91..531d810ed 100644 --- a/dashboard-ui/bower_components/iron-fit-behavior/bower.json +++ b/dashboard-ui/bower_components/iron-fit-behavior/bower.json @@ -1,6 +1,6 @@ { "name": "iron-fit-behavior", - "version": "1.1.0", + "version": "1.1.1", "license": "http://polymer.github.io/LICENSE.txt", "description": "Fits an element inside another element", "private": true, diff --git a/dashboard-ui/bower_components/iron-fit-behavior/iron-fit-behavior.html b/dashboard-ui/bower_components/iron-fit-behavior/iron-fit-behavior.html index c5387fc05..8e7b26a07 100644 --- a/dashboard-ui/bower_components/iron-fit-behavior/iron-fit-behavior.html +++ b/dashboard-ui/bower_components/iron-fit-behavior/iron-fit-behavior.html @@ -105,18 +105,8 @@ Use `noOverlap` to position the element around another element without overlappi }, /** - * A pixel value that will be added to the position calculated for the - * given `horizontalAlign`, in the direction of alignment. You can think - * of it as increasing or decreasing the distance to the side of the - * screen given by `horizontalAlign`. - * - * If `horizontalAlign` is "left", this offset will increase or decrease - * the distance to the left side of the screen: a negative offset will - * move the element to the left; a positive one, to the right. - * - * Conversely if `horizontalAlign` is "right", this offset will increase - * or decrease the distance to the right side of the screen: a negative - * offset will move the element to the right; a positive one, to the left. + * The same as setting margin-left and margin-right css properties. + * @deprecated */ horizontalOffset: { type: Number, @@ -125,18 +115,8 @@ Use `noOverlap` to position the element around another element without overlappi }, /** - * A pixel value that will be added to the position calculated for the - * given `verticalAlign`, in the direction of alignment. You can think - * of it as increasing or decreasing the distance to the side of the - * screen given by `verticalAlign`. - * - * If `verticalAlign` is "top", this offset will increase or decrease - * the distance to the top side of the screen: a negative offset will - * move the element upwards; a positive one, downwards. - * - * Conversely if `verticalAlign` is "bottom", this offset will increase - * or decrease the distance to the bottom side of the screen: a negative - * offset will move the element downwards; a positive one, upwards. + * The same as setting margin-top and margin-bottom css properties. + * @deprecated */ verticalOffset: { type: Number, @@ -205,7 +185,7 @@ Use `noOverlap` to position the element around another element without overlappi get _defaultPositionTarget() { var parent = Polymer.dom(this).parentNode; - if (parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { + if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { parent = parent.host; } @@ -262,6 +242,7 @@ Use `noOverlap` to position the element around another element without overlappi } var target = window.getComputedStyle(this); var sizer = window.getComputedStyle(this.sizingTarget); + this._fitInfo = { inlineStyle: { top: this.style.top || '', @@ -292,6 +273,20 @@ Use `noOverlap` to position the element around another element without overlappi left: parseInt(target.marginLeft, 10) || 0 } }; + + // Support these properties until they are removed. + if (this.verticalOffset) { + this._fitInfo.margin.top = this._fitInfo.margin.bottom = this.verticalOffset; + this._fitInfo.inlineStyle.marginTop = this.style.marginTop || ''; + this._fitInfo.inlineStyle.marginBottom = this.style.marginBottom || ''; + this.style.marginTop = this.style.marginBottom = this.verticalOffset + 'px'; + } + if (this.horizontalOffset) { + this._fitInfo.margin.left = this._fitInfo.margin.right = this.horizontalOffset; + this._fitInfo.inlineStyle.marginLeft = this.style.marginLeft || ''; + this._fitInfo.inlineStyle.marginRight = this.style.marginRight || ''; + this.style.marginLeft = this.style.marginRight = this.horizontalOffset + 'px'; + } }, /** @@ -340,11 +335,15 @@ Use `noOverlap` to position the element around another element without overlappi var positionRect = this.__getNormalizedRect(this.positionTarget); var fitRect = this.__getNormalizedRect(this.fitInto); - var alignRight = this.__isAlignRight(this._localeHorizontalAlign, rect, positionRect, fitRect); - var alignBottom = this.__isAlignBottom(this.verticalAlign, rect, positionRect, fitRect); + // Consider the margin as part of the size for position calculations. + var width = rect.width + this._fitInfo.margin.left + this._fitInfo.margin.right; + var height = rect.height + this._fitInfo.margin.top + this._fitInfo.margin.bottom; - var top = alignBottom ? positionRect.bottom - rect.height - this.verticalOffset : positionRect.top + this.verticalOffset; - var left = alignRight ? positionRect.right - rect.width - this.horizontalOffset : positionRect.left + this.horizontalOffset; + var alignRight = this.__isAlignRight(this._localeHorizontalAlign, width, positionRect, fitRect); + var alignBottom = this.__isAlignBottom(this.verticalAlign, height, positionRect, fitRect); + + var top = alignBottom ? positionRect.bottom - height : positionRect.top; + var left = alignRight ? positionRect.right - width : positionRect.left; if (this.noOverlap) { // We can overlap one of the dimensions, choose the one that minimizes the cropped area. @@ -353,30 +352,34 @@ Use `noOverlap` to position the element around another element without overlappi var areaOverlapLeft = this.__getCroppedArea({ top: noOverlapTop, left: left, - width: rect.width, - height: rect.height + width: width, + height: height }, fitRect); var areaOverlapTop = this.__getCroppedArea({ top: top, left: noOverlapLeft, - width: rect.width, - height: rect.height + width: width, + height: height }, fitRect); - if (areaOverlapLeft < areaOverlapTop) { + if (areaOverlapLeft >= areaOverlapTop) { left = noOverlapLeft; } else { top = noOverlapTop; } } + left += this._fitInfo.margin.left; + top += this._fitInfo.margin.top; + + // Use original size (without margin) var right = left + rect.width; var bottom = top + rect.height; - left = Math.max(left, 0); - top = Math.max(top, 0); + left = Math.max(left, this._fitInfo.margin.left); + top = Math.max(top, this._fitInfo.margin.top); - var maxWidth = Math.min(fitRect.right, right) - left; - var maxHeight = Math.min(fitRect.bottom, bottom) - top; + var maxWidth = Math.min(fitRect.right - this._fitInfo.margin.right, right) - left; + var maxHeight = Math.min(fitRect.bottom - this._fitInfo.margin.bottom, bottom) - top; var minWidth = this._fitInfo.sizedBy.minWidth; var minHeight = this._fitInfo.sizedBy.minHeight; @@ -503,24 +506,38 @@ Use `noOverlap` to position the element around another element without overlappi return target.getBoundingClientRect(); }, - __isAlignRight: function(hAlign, rect, positionRect, fitRect) { + __isAlignRight: function(hAlign, size, positionRect, fitRect) { if (hAlign === 'right') { return true; } if (hAlign === 'auto') { - return positionRect.left + positionRect.width/2 > fitRect.left + fitRect.width/2 || - (!this.noOverlap && positionRect.left < 0 && positionRect.right - rect.width > positionRect.left); + // We should align on the right if positionTarget is on the right of fitInto, + // or if we can overlap and aligning on the left would cause more cropping + // than aligning on the right. + var positionTargetCenter = positionRect.left + positionRect.width/2; + var fitIntoCenter = fitRect.left + fitRect.width/2; + var croppedLeft = Math.abs(Math.min(0, positionRect.left)); + var croppedRight = Math.abs(Math.min(0, positionRect.right - size)); + return positionTargetCenter > fitIntoCenter || + (!this.noOverlap && croppedLeft > croppedRight); } return false; }, - __isAlignBottom: function(vAlign, rect, positionRect, fitRect) { + __isAlignBottom: function(vAlign, size, positionRect, fitRect) { if (vAlign === 'bottom') { return true; } if (vAlign === 'auto') { - return positionRect.top + positionRect.height/2 > fitRect.top + fitRect.height/2 || - (!this.noOverlap && positionRect.top < 0 && positionRect.bottom - rect.height > positionRect.top); + // We should align on the bottom if positionTarget is on the bottom of fitInto, + // or if we can overlap and aligning on the top would cause more cropping + // than aligning on the bottom. + var positionTargetCenter = positionRect.top + positionRect.height/2; + var fitIntoCenter = fitRect.top + fitRect.height/2; + var croppedTop = Math.abs(Math.min(0, positionRect.top)); + var croppedBottom = Math.abs(Math.min(0, positionRect.bottom - size)); + return positionTargetCenter > fitIntoCenter || + (!this.noOverlap && croppedTop > croppedBottom); } return false; }, @@ -528,7 +545,7 @@ Use `noOverlap` to position the element around another element without overlappi __getCroppedArea: function(rect, fitRect) { var verticalCrop = Math.min(0, rect.top) + Math.min(0, fitRect.bottom - (rect.top + rect.height)); var horizontalCrop = Math.min(0, rect.left) + Math.min(0, fitRect.right - (rect.left + rect.width)); - return verticalCrop * rect.width + horizontalCrop * rect.height; + return Math.abs(verticalCrop) * rect.width + Math.abs(horizontalCrop) * rect.height; } }; diff --git a/dashboard-ui/bower_components/iron-fit-behavior/test/iron-fit-behavior.html b/dashboard-ui/bower_components/iron-fit-behavior/test/iron-fit-behavior.html index b03fefdbe..f249fb3fa 100644 --- a/dashboard-ui/bower_components/iron-fit-behavior/test/iron-fit-behavior.html +++ b/dashboard-ui/bower_components/iron-fit-behavior/test/iron-fit-behavior.html @@ -453,6 +453,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN assert.equal(rect.height, elRect.height, 'no cropping'); }); + test('element margin is considered as offset', function() { + el.verticalAlign = 'top'; + el.style.marginTop = '10px'; + el.refit(); + var rect = el.getBoundingClientRect(); + assert.equal(rect.top, parentRect.top + 10, 'top ok'); + assert.equal(rect.height, elRect.height, 'no cropping'); + + el.style.marginTop = '-10px'; + el.refit(); + rect = el.getBoundingClientRect(); + assert.equal(rect.top, parentRect.top - 10, 'top ok'); + assert.equal(rect.height, elRect.height, 'no cropping'); + }); + test('verticalOffset is applied', function() { el.verticalAlign = 'top'; el.verticalOffset = 10; @@ -499,6 +514,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN assert.equal(rect.height, elRect.height, 'no cropping'); }); + test('element margin is considered as offset', function() { + el.verticalAlign = 'bottom'; + el.style.marginBottom = '10px'; + el.refit(); + var rect = el.getBoundingClientRect(); + assert.equal(rect.bottom, parentRect.bottom - 10, 'bottom ok'); + assert.equal(rect.height, elRect.height, 'no cropping'); + + el.style.marginBottom = '-10px'; + el.refit(); + rect = el.getBoundingClientRect(); + assert.equal(rect.bottom, parentRect.bottom + 10, 'bottom ok'); + assert.equal(rect.height, elRect.height, 'no cropping'); + }); + test('verticalOffset is applied', function() { el.verticalAlign = 'bottom'; el.verticalOffset = 10; @@ -596,6 +626,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN assert.equal(rect.width, elRect.width, 'no cropping'); }); + test('element margin is considered as offset', function() { + el.horizontalAlign = 'left'; + el.style.marginLeft = '10px'; + el.refit(); + var rect = el.getBoundingClientRect(); + assert.equal(rect.left, parentRect.left + 10, 'left ok'); + assert.equal(rect.width, elRect.width, 'no cropping'); + + el.style.marginLeft = '-10px'; + el.refit(); + rect = el.getBoundingClientRect(); + assert.equal(rect.left, parentRect.left - 10, 'left ok'); + assert.equal(rect.width, elRect.width, 'no cropping'); + }); + test('horizontalOffset is applied', function() { el.horizontalAlign = 'left'; el.horizontalOffset = 10; @@ -645,6 +690,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN assert.equal(rect.width, elRect.width, 'no cropping'); }); + test('element margin is considered as offset', function() { + el.horizontalAlign = 'right'; + el.style.marginRight = '10px'; + el.refit(); + var rect = el.getBoundingClientRect(); + assert.equal(rect.right, parentRect.right - 10, 'right ok'); + assert.equal(rect.width, elRect.width, 'no cropping'); + + el.style.marginRight = '-10px'; + el.refit(); + rect = el.getBoundingClientRect(); + assert.equal(rect.right, parentRect.right + 10, 'right ok'); + assert.equal(rect.width, elRect.width, 'no cropping'); + }); + test('horizontalOffset is applied', function() { el.horizontalAlign = 'right'; el.horizontalOffset = 10; diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json index 4536dd6f6..d9e785fdb 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-overlay-behavior", - "version": "1.7.0", + "version": "1.7.1", "license": "http://polymer.github.io/LICENSE.txt", "description": "Provides a behavior for making an element an overlay", "private": true, @@ -35,11 +35,11 @@ }, "ignore": [], "homepage": "https://github.com/polymerelements/iron-overlay-behavior", - "_release": "1.7.0", + "_release": "1.7.1", "_resolution": { "type": "version", - "tag": "v1.7.0", - "commit": "d61575162a40904914fa3528ba20bb531d098001" + "tag": "v1.7.1", + "commit": "4655445cb91e19ef3cdae247ded2ffc9f50b46a8" }, "_source": "git://github.com/polymerelements/iron-overlay-behavior.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json index 2765daa8c..5f6ed2179 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/bower.json +++ b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json @@ -1,6 +1,6 @@ { "name": "iron-overlay-behavior", - "version": "1.7.0", + "version": "1.7.1", "license": "http://polymer.github.io/LICENSE.txt", "description": "Provides a behavior for making an element an overlay", "private": true, diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html index afa5c638f..d2c85396e 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html @@ -128,8 +128,12 @@ Custom property | Description | Default } }, - _openedChanged: function() { - if (this.opened) { + /** + * @param {boolean} opened + * @private + */ + _openedChanged: function(opened) { + if (opened) { // Auto-attach. this.prepare(); } else { diff --git a/dashboard-ui/bower_components/iron-selector/.bower.json b/dashboard-ui/bower_components/iron-selector/.bower.json index adb996b83..bda2eca14 100644 --- a/dashboard-ui/bower_components/iron-selector/.bower.json +++ b/dashboard-ui/bower_components/iron-selector/.bower.json @@ -36,7 +36,7 @@ "tag": "v1.5.0", "commit": "c7402274efa2e3b2a905ffa25d70c2ff3309dc59" }, - "_source": "git://github.com/PolymerElements/iron-selector.git", + "_source": "git://github.com/polymerelements/iron-selector.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/iron-selector" + "_originalSource": "polymerelements/iron-selector" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/paper-icon-button/.bower.json b/dashboard-ui/bower_components/paper-icon-button/.bower.json index 5962b4669..bdd597d40 100644 --- a/dashboard-ui/bower_components/paper-icon-button/.bower.json +++ b/dashboard-ui/bower_components/paper-icon-button/.bower.json @@ -1,10 +1,13 @@ { "name": "paper-icon-button", "private": true, - "version": "1.0.7", + "version": "1.1.0", "license": "http://polymer.github.io/LICENSE.txt", "description": "A material design icon button", - "main": "paper-icon-button.html", + "main": [ + "paper-icon-button.html", + "paper-icon-button-light.html" + ], "author": [ "The Polymer Authors" ], @@ -35,11 +38,11 @@ }, "ignore": [], "homepage": "https://github.com/PolymerElements/paper-icon-button", - "_release": "1.0.7", + "_release": "1.1.0", "_resolution": { "type": "version", - "tag": "v1.0.7", - "commit": "7623d73efeb6e2e88e2abdb5e4d00641d39e400f" + "tag": "v1.1.0", + "commit": "1d57e0d3a76d001674cb0b86ed14244551577e7a" }, "_source": "git://github.com/PolymerElements/paper-icon-button.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/paper-icon-button/.github/ISSUE_TEMPLATE.md b/dashboard-ui/bower_components/paper-icon-button/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..c80193d9f --- /dev/null +++ b/dashboard-ui/bower_components/paper-icon-button/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,33 @@ + +### Description + + +### Expected outcome + + + +### Actual outcome + + + +### Live Demo + + +### Steps to reproduce + + + +### Browsers Affected + +- [ ] Chrome +- [ ] Firefox +- [ ] Safari 9 +- [ ] Safari 8 +- [ ] Safari 7 +- [ ] Edge +- [ ] IE 11 +- [ ] IE 10 diff --git a/dashboard-ui/bower_components/paper-icon-button/.travis.yml b/dashboard-ui/bower_components/paper-icon-button/.travis.yml index 7b433ea5d..302779e70 100644 --- a/dashboard-ui/bower_components/paper-icon-button/.travis.yml +++ b/dashboard-ui/bower_components/paper-icon-button/.travis.yml @@ -1,5 +1,5 @@ language: node_js -sudo: false +sudo: required before_script: - npm install -g bower polylint web-component-tester - bower install @@ -8,18 +8,16 @@ env: global: - secure: A+iEL5FUMQWkkaOduE26bo0jW49LYKxDwWGZOty9H9fCDpBNQSADOhIvLzScGtjE7Rr3jVmowVsDN0XfVSRpJneEIvj7+tHAXUFoVey8vDVklOmhlR25IH2OczEmCkOS+sAKRiSF54aptdPeJhmpbMH0FyZfuX+jJfhdonJ+YQg= - secure: Ps1Hy0fzmYRYF/ur2Myg7ol43HpzpooCoDvqzpMbIBWkXjXcN0KlPoNc6lEFlhjSpjddMFavdajKYIO0j9adAjZA7HYlf+BglhxV45lz13o04+QlNbDSADNyAlKJLrIvFacn9DE3VXlvBwBu83m+ndHUN/uMyHyZo0VE1/ad9Iw= - - CXX=g++-4.8 node_js: stable addons: firefox: latest apt: sources: - google-chrome - - ubuntu-toolchain-r-test packages: - google-chrome-stable - - g++-4.8 sauce_connect: true script: - xvfb-run wct - "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi" +dist: trusty diff --git a/dashboard-ui/bower_components/paper-icon-button/bower.json b/dashboard-ui/bower_components/paper-icon-button/bower.json index aed79fc9b..3bc283268 100644 --- a/dashboard-ui/bower_components/paper-icon-button/bower.json +++ b/dashboard-ui/bower_components/paper-icon-button/bower.json @@ -1,10 +1,13 @@ { "name": "paper-icon-button", "private": true, - "version": "1.0.7", + "version": "1.1.0", "license": "http://polymer.github.io/LICENSE.txt", "description": "A material design icon button", - "main": "paper-icon-button.html", + "main": [ + "paper-icon-button.html", + "paper-icon-button-light.html" + ], "author": [ "The Polymer Authors" ], diff --git a/dashboard-ui/bower_components/paper-icon-button/demo/paper-icon-button-light.html b/dashboard-ui/bower_components/paper-icon-button/demo/paper-icon-button-light.html new file mode 100644 index 000000000..6bae8e372 --- /dev/null +++ b/dashboard-ui/bower_components/paper-icon-button/demo/paper-icon-button-light.html @@ -0,0 +1,57 @@ + + + + + paper-icon-button-light demo + + + + + + + + + + + + +
+

paper-icon-button-light can contain iron-icons or external images and can be disabled

+ + + +
+ + diff --git a/dashboard-ui/bower_components/paper-icon-button/paper-icon-button-light.html b/dashboard-ui/bower_components/paper-icon-button/paper-icon-button-light.html new file mode 100644 index 000000000..d45a69d3b --- /dev/null +++ b/dashboard-ui/bower_components/paper-icon-button/paper-icon-button-light.html @@ -0,0 +1,82 @@ + + + + + + + + + + diff --git a/dashboard-ui/bower_components/paper-input/.bower.json b/dashboard-ui/bower_components/paper-input/.bower.json index d0d6e203a..dc6a378a1 100644 --- a/dashboard-ui/bower_components/paper-input/.bower.json +++ b/dashboard-ui/bower_components/paper-input/.bower.json @@ -54,7 +54,7 @@ "tag": "v1.1.11", "commit": "8cfe5c5bf8c2e40d243443d046a94b6fe371983c" }, - "_source": "git://github.com/PolymerElements/paper-input.git", - "_target": "^1.0.0", - "_originalSource": "PolymerElements/paper-input" + "_source": "git://github.com/polymerelements/paper-input.git", + "_target": "^1.0.9", + "_originalSource": "polymerelements/paper-input" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/paper-material/.bower.json b/dashboard-ui/bower_components/paper-material/.bower.json index 76995ae72..d08896777 100644 --- a/dashboard-ui/bower_components/paper-material/.bower.json +++ b/dashboard-ui/bower_components/paper-material/.bower.json @@ -38,7 +38,7 @@ "tag": "v1.0.6", "commit": "6aef0896fcbc25f9f5bd1dd55f7679e6ab7f92ad" }, - "_source": "git://github.com/PolymerElements/paper-material.git", + "_source": "git://github.com/polymerelements/paper-material.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/paper-material" + "_originalSource": "polymerelements/paper-material" } \ No newline at end of file From e65b47e772162a9b7c9a972decbf087b1c1734fc Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 5 May 2016 21:02:24 -0400 Subject: [PATCH 04/11] update components --- .../emby-webcomponents/.bower.json | 8 +- .../emby-webcomponents/datetime.js | 10 ++ .../emby-webcomponents/guide/guide.js | 2 +- .../iron-dropdown/.bower.json | 8 +- .../bower_components/iron-dropdown/bower.json | 2 +- .../iron-dropdown/iron-dropdown.html | 157 +----------------- .../bower_components/iron-meta/.bower.json | 6 +- .../iron-selector/.bower.json | 8 +- .../bower_components/iron-selector/bower.json | 2 +- .../iron-selector/iron-selector.html | 3 +- .../iron-validatable-behavior/.bower.json | 8 +- .../iron-validatable-behavior/bower.json | 2 +- .../iron-validatable-behavior.html | 1 + .../paper-behaviors/.bower.json | 4 +- .../paper-icon-button/.bower.json | 8 +- .../paper-icon-button/bower.json | 2 +- .../paper-icon-button-light.html | 12 +- .../bower_components/paper-ripple/.bower.json | 6 +- .../bower_components/polymer/.bower.json | 2 +- 19 files changed, 58 insertions(+), 193 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 7dcce3fce..e82737fc4 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.2.59", - "_release": "1.2.59", + "version": "1.2.61", + "_release": "1.2.61", "_resolution": { "type": "version", - "tag": "1.2.59", - "commit": "2089ec993031b303b5c2163fbc5aff5b37056d1f" + "tag": "1.2.61", + "commit": "d28f24510d524454f235f9f83979639e8b0913d6" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/datetime.js b/dashboard-ui/bower_components/emby-webcomponents/datetime.js index 0e6f9540d..92c7afa59 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/datetime.js +++ b/dashboard-ui/bower_components/emby-webcomponents/datetime.js @@ -103,6 +103,15 @@ return false; }(); + function toLocaleDateString(date) { + + var currentLocale = globalize.getCurrentLocale(); + + return currentLocale && toLocaleTimeStringSupportsLocales ? + date.toLocaleDateString(currentLocale) : + date.toLocaleDateString(); + } + function getDisplayTime(date) { var currentLocale = globalize.getCurrentLocale(); @@ -144,6 +153,7 @@ return { parseISO8601Date: parseISO8601Date, getDisplayRunningTime: getDisplayRunningTime, + toLocaleDateString: toLocaleDateString, getDisplayTime: getDisplayTime }; }); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js index 9e929a9b6..19c376425 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js +++ b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js @@ -449,7 +449,7 @@ weekday[6] = globalize.translate('core#OptionSaturdayShort'); var day = weekday[date.getDay()]; - date = date.toLocaleDateString(); + date = datetime.toLocaleDateString(date); if (date.toLowerCase().indexOf(day.toLowerCase()) == -1) { return day + " " + date; diff --git a/dashboard-ui/bower_components/iron-dropdown/.bower.json b/dashboard-ui/bower_components/iron-dropdown/.bower.json index ae9e1fd2f..34b55af4e 100644 --- a/dashboard-ui/bower_components/iron-dropdown/.bower.json +++ b/dashboard-ui/bower_components/iron-dropdown/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-dropdown", - "version": "1.3.1", + "version": "1.4.0", "description": "An unstyled element that works similarly to a native browser select", "authors": [ "The Polymer Authors" @@ -36,11 +36,11 @@ "iron-image": "polymerelements/iron-image#^1.0.0" }, "ignore": [], - "_release": "1.3.1", + "_release": "1.4.0", "_resolution": { "type": "version", - "tag": "v1.3.1", - "commit": "f7a47d4cd6c6cb87adba08703ec1588c1b649f4d" + "tag": "v1.4.0", + "commit": "8e14da0aaeb791983ee4b254890c7263644f7851" }, "_source": "git://github.com/PolymerElements/iron-dropdown.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-dropdown/bower.json b/dashboard-ui/bower_components/iron-dropdown/bower.json index 9572a26ff..1318a2a46 100644 --- a/dashboard-ui/bower_components/iron-dropdown/bower.json +++ b/dashboard-ui/bower_components/iron-dropdown/bower.json @@ -1,6 +1,6 @@ { "name": "iron-dropdown", - "version": "1.3.1", + "version": "1.4.0", "description": "An unstyled element that works similarly to a native browser select", "authors": [ "The Polymer Authors" diff --git a/dashboard-ui/bower_components/iron-dropdown/iron-dropdown.html b/dashboard-ui/bower_components/iron-dropdown/iron-dropdown.html index 263f1cb1b..c98a856b6 100644 --- a/dashboard-ui/bower_components/iron-dropdown/iron-dropdown.html +++ b/dashboard-ui/bower_components/iron-dropdown/iron-dropdown.html @@ -81,6 +81,7 @@ method is called on the element. /** * The orientation against which to align the dropdown content * horizontally relative to the dropdown trigger. + * Overridden from `Polymer.IronFitBehavior`. */ horizontalAlign: { type: String, @@ -91,6 +92,7 @@ method is called on the element. /** * The orientation against which to align the dropdown content * vertically relative to the dropdown trigger. + * Overridden from `Polymer.IronFitBehavior`. */ verticalAlign: { type: String, @@ -98,54 +100,6 @@ method is called on the element. reflectToAttribute: true }, - /** - * A pixel value that will be added to the position calculated for the - * given `horizontalAlign`, in the direction of alignment. You can think - * of it as increasing or decreasing the distance to the side of the - * screen given by `horizontalAlign`. - * - * If `horizontalAlign` is "left", this offset will increase or decrease - * the distance to the left side of the screen: a negative offset will - * move the dropdown to the left; a positive one, to the right. - * - * Conversely if `horizontalAlign` is "right", this offset will increase - * or decrease the distance to the right side of the screen: a negative - * offset will move the dropdown to the right; a positive one, to the left. - */ - horizontalOffset: { - type: Number, - value: 0, - notify: true - }, - - /** - * A pixel value that will be added to the position calculated for the - * given `verticalAlign`, in the direction of alignment. You can think - * of it as increasing or decreasing the distance to the side of the - * screen given by `verticalAlign`. - * - * If `verticalAlign` is "top", this offset will increase or decrease - * the distance to the top side of the screen: a negative offset will - * move the dropdown upwards; a positive one, downwards. - * - * Conversely if `verticalAlign` is "bottom", this offset will increase - * or decrease the distance to the bottom side of the screen: a negative - * offset will move the dropdown downwards; a positive one, upwards. - */ - verticalOffset: { - type: Number, - value: 0, - notify: true - }, - - /** - * The element that should be used to position the dropdown when - * it is opened. - */ - positionTarget: { - type: Object - }, - /** * An animation config. If provided, this will be used to animate the * opening of the dropdown. @@ -199,12 +153,6 @@ method is called on the element. '_updateOverlayPosition(positionTarget, verticalAlign, horizontalAlign, verticalOffset, horizontalOffset)' ], - attached: function() { - // Memoize this to avoid expensive calculations & relayouts. - this._isRTL = window.getComputedStyle(this).direction == 'rtl'; - this.positionTarget = this.positionTarget || this._defaultPositionTarget; - }, - /** * The element that is contained by the dropdown, if any. */ @@ -220,72 +168,6 @@ method is called on the element. return this.focusTarget || this.containedElement; }, - /** - * The element that should be used to position the dropdown when - * it opens, if no position target is configured. - */ - get _defaultPositionTarget() { - var parent = Polymer.dom(this).parentNode; - - if (parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { - parent = parent.host; - } - - return parent; - }, - - /** - * The horizontal align value, accounting for the RTL/LTR text direction. - */ - get _localeHorizontalAlign() { - // In RTL, "left" becomes "right". - if (this._isRTL) { - return this.horizontalAlign === 'right' ? 'left' : 'right'; - } else { - return this.horizontalAlign; - } - }, - - /** - * The horizontal offset value used to position the dropdown. - * @param {ClientRect} dropdownRect - * @param {ClientRect} positionRect - * @param {boolean=} fromRight - * @return {number} pixels - * @private - */ - _horizontalAlignTargetValue: function(dropdownRect, positionRect, fromRight) { - var target; - if (fromRight) { - target = document.documentElement.clientWidth - positionRect.right - (this._fitWidth - dropdownRect.right); - } else { - target = positionRect.left - dropdownRect.left; - } - target += this.horizontalOffset; - - return Math.max(target, 0); - }, - - /** - * The vertical offset value used to position the dropdown. - * @param {ClientRect} dropdownRect - * @param {ClientRect} positionRect - * @param {boolean=} fromBottom - * @return {number} pixels - * @private - */ - _verticalAlignTargetValue: function(dropdownRect, positionRect, fromBottom) { - var target; - if (fromBottom) { - target = document.documentElement.clientHeight - positionRect.bottom - (this._fitHeight - dropdownRect.bottom); - } else { - target = positionRect.top - dropdownRect.top; - } - target += this.verticalOffset; - - return Math.max(target, 0); - }, - /** * Called when the value of `opened` changes. * Overridden from `IronOverlayBehavior` @@ -417,41 +299,6 @@ method is called on the element. } }, - /** - * Resets the target element's position and size constraints, and clear - * the memoized data. - */ - resetFit: function() { - Polymer.IronFitBehavior.resetFit.apply(this, arguments); - - var hAlign = this._localeHorizontalAlign; - var vAlign = this.verticalAlign; - // Set to 0, 0 in order to discover any offset caused by parent stacking contexts. - this.style[hAlign] = this.style[vAlign] = '0px'; - - var dropdownRect = this.getBoundingClientRect(); - var positionRect = this.positionTarget.getBoundingClientRect(); - var horizontalValue = this._horizontalAlignTargetValue(dropdownRect, positionRect, hAlign === 'right'); - var verticalValue = this._verticalAlignTargetValue(dropdownRect, positionRect, vAlign === 'bottom'); - - this.style[hAlign] = horizontalValue + 'px'; - this.style[vAlign] = verticalValue + 'px'; - }, - - /** - * Overridden from `IronFitBehavior`. - * Ensure positionedBy has correct values for horizontally & vertically. - */ - _discoverInfo: function() { - Polymer.IronFitBehavior._discoverInfo.apply(this, arguments); - // Note(valdrin): in Firefox, an element with style `position: fixed; bottom: 90vh; height: 20vh` - // would have `getComputedStyle(element).top < 0` (instead of being `auto`) http://jsbin.com/cofired/3/edit?html,output - // This would cause IronFitBehavior's `constrain` to wrongly calculate sizes - // (it would use `top` instead of `bottom`), so we ensure we give the correct values. - this._fitInfo.positionedBy.horizontally = this._localeHorizontalAlign; - this._fitInfo.positionedBy.vertically = this.verticalAlign; - }, - /** * Apply focus to focusTarget or containedElement */ diff --git a/dashboard-ui/bower_components/iron-meta/.bower.json b/dashboard-ui/bower_components/iron-meta/.bower.json index f4bfef4a7..e1304d174 100644 --- a/dashboard-ui/bower_components/iron-meta/.bower.json +++ b/dashboard-ui/bower_components/iron-meta/.bower.json @@ -26,14 +26,14 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "main": "iron-meta.html", - "homepage": "https://github.com/polymerelements/iron-meta", + "homepage": "https://github.com/PolymerElements/iron-meta", "_release": "1.1.1", "_resolution": { "type": "version", "tag": "v1.1.1", "commit": "e171ee234b482219c9514e6f9551df48ef48bd9f" }, - "_source": "git://github.com/polymerelements/iron-meta.git", + "_source": "git://github.com/PolymerElements/iron-meta.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-meta" + "_originalSource": "PolymerElements/iron-meta" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-selector/.bower.json b/dashboard-ui/bower_components/iron-selector/.bower.json index bda2eca14..1da99816d 100644 --- a/dashboard-ui/bower_components/iron-selector/.bower.json +++ b/dashboard-ui/bower_components/iron-selector/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-selector", - "version": "1.5.0", + "version": "1.5.1", "description": "Manages a set of elements that can be selected", "private": true, "license": "http://polymer.github.io/LICENSE.txt", @@ -30,11 +30,11 @@ "web-component-tester": "^4.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "_release": "1.5.0", + "_release": "1.5.1", "_resolution": { "type": "version", - "tag": "v1.5.0", - "commit": "c7402274efa2e3b2a905ffa25d70c2ff3309dc59" + "tag": "v1.5.1", + "commit": "e3e34408fad8f7cde59c4255cf3fe90f7dcf91d8" }, "_source": "git://github.com/polymerelements/iron-selector.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-selector/bower.json b/dashboard-ui/bower_components/iron-selector/bower.json index 1aa811336..ea97938c3 100644 --- a/dashboard-ui/bower_components/iron-selector/bower.json +++ b/dashboard-ui/bower_components/iron-selector/bower.json @@ -1,6 +1,6 @@ { "name": "iron-selector", - "version": "1.5.0", + "version": "1.5.1", "description": "Manages a set of elements that can be selected", "private": true, "license": "http://polymer.github.io/LICENSE.txt", diff --git a/dashboard-ui/bower_components/iron-selector/iron-selector.html b/dashboard-ui/bower_components/iron-selector/iron-selector.html index bcf12093b..0ecc9fbcd 100644 --- a/dashboard-ui/bower_components/iron-selector/iron-selector.html +++ b/dashboard-ui/bower_components/iron-selector/iron-selector.html @@ -38,7 +38,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
Zot
- If no matching element is found using `attForSelected`, use `fallbackSelection` as fallback. + You can specify a default fallback with `fallbackSelection` in case the `selected` attribute does + not match the `attrForSelected` attribute of any elements. Example: diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/.bower.json b/dashboard-ui/bower_components/iron-validatable-behavior/.bower.json index 6450b86c2..9b49957bf 100644 --- a/dashboard-ui/bower_components/iron-validatable-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-validatable-behavior/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-validatable-behavior", - "version": "1.1.0", + "version": "1.1.1", "description": "Provides a behavior for an element that validates user input", "authors": "The Polymer Authors", "keywords": [ @@ -30,11 +30,11 @@ "web-component-tester": "^4.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "_release": "1.1.0", + "_release": "1.1.1", "_resolution": { "type": "version", - "tag": "v1.1.0", - "commit": "01ed585b28d8ab41367518f9aebd8442b9166bfe" + "tag": "v1.1.1", + "commit": "2ecd3f411e298733b29f1660f75cb9b03ea31d77" }, "_source": "git://github.com/PolymerElements/iron-validatable-behavior.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/bower.json b/dashboard-ui/bower_components/iron-validatable-behavior/bower.json index f71147bcf..2ebf2bcb7 100644 --- a/dashboard-ui/bower_components/iron-validatable-behavior/bower.json +++ b/dashboard-ui/bower_components/iron-validatable-behavior/bower.json @@ -1,6 +1,6 @@ { "name": "iron-validatable-behavior", - "version": "1.1.0", + "version": "1.1.1", "description": "Provides a behavior for an element that validates user input", "authors": "The Polymer Authors", "keywords": [ diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/iron-validatable-behavior.html b/dashboard-ui/bower_components/iron-validatable-behavior/iron-validatable-behavior.html index 1b9beba95..803731be9 100644 --- a/dashboard-ui/bower_components/iron-validatable-behavior/iron-validatable-behavior.html +++ b/dashboard-ui/bower_components/iron-validatable-behavior/iron-validatable-behavior.html @@ -81,6 +81,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }, _validator: { + type: Object, computed: '__computeValidator(validator)' } }, diff --git a/dashboard-ui/bower_components/paper-behaviors/.bower.json b/dashboard-ui/bower_components/paper-behaviors/.bower.json index 2b04bf9f8..a6b333d33 100644 --- a/dashboard-ui/bower_components/paper-behaviors/.bower.json +++ b/dashboard-ui/bower_components/paper-behaviors/.bower.json @@ -45,7 +45,7 @@ "tag": "v1.0.11", "commit": "e3c1ab0c72905b58fb4d9adc2921ea73b5c085a5" }, - "_source": "git://github.com/PolymerElements/paper-behaviors.git", + "_source": "git://github.com/polymerelements/paper-behaviors.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/paper-behaviors" + "_originalSource": "polymerelements/paper-behaviors" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/paper-icon-button/.bower.json b/dashboard-ui/bower_components/paper-icon-button/.bower.json index bdd597d40..7852adc7e 100644 --- a/dashboard-ui/bower_components/paper-icon-button/.bower.json +++ b/dashboard-ui/bower_components/paper-icon-button/.bower.json @@ -1,7 +1,7 @@ { "name": "paper-icon-button", "private": true, - "version": "1.1.0", + "version": "1.1.1", "license": "http://polymer.github.io/LICENSE.txt", "description": "A material design icon button", "main": [ @@ -38,11 +38,11 @@ }, "ignore": [], "homepage": "https://github.com/PolymerElements/paper-icon-button", - "_release": "1.1.0", + "_release": "1.1.1", "_resolution": { "type": "version", - "tag": "v1.1.0", - "commit": "1d57e0d3a76d001674cb0b86ed14244551577e7a" + "tag": "v1.1.1", + "commit": "f4a8a7a0666aa5a6e2049aa3672ee686bb60b5f3" }, "_source": "git://github.com/PolymerElements/paper-icon-button.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/paper-icon-button/bower.json b/dashboard-ui/bower_components/paper-icon-button/bower.json index 3bc283268..177044a38 100644 --- a/dashboard-ui/bower_components/paper-icon-button/bower.json +++ b/dashboard-ui/bower_components/paper-icon-button/bower.json @@ -1,7 +1,7 @@ { "name": "paper-icon-button", "private": true, - "version": "1.1.0", + "version": "1.1.1", "license": "http://polymer.github.io/LICENSE.txt", "description": "A material design icon button", "main": [ diff --git a/dashboard-ui/bower_components/paper-icon-button/paper-icon-button-light.html b/dashboard-ui/bower_components/paper-icon-button/paper-icon-button-light.html index d45a69d3b..65ec95d74 100644 --- a/dashboard-ui/bower_components/paper-icon-button/paper-icon-button-light.html +++ b/dashboard-ui/bower_components/paper-icon-button/paper-icon-button-light.html @@ -72,10 +72,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN this.getRipple().upAction(); }, - ensureRipple: function() { + /** + * @param {...*} var_args + */ + ensureRipple: function(var_args) { + var lastRipple = this._ripple; Polymer.PaperRippleBehavior.ensureRipple.apply(this, arguments); - this._ripple.center = true; - this._ripple.classList.add('circle'); + if (this._ripple && this._ripple !== lastRipple) { + this._ripple.center = true; + this._ripple.classList.add('circle'); + } } }); diff --git a/dashboard-ui/bower_components/paper-ripple/.bower.json b/dashboard-ui/bower_components/paper-ripple/.bower.json index 157225ee7..2f654d71c 100644 --- a/dashboard-ui/bower_components/paper-ripple/.bower.json +++ b/dashboard-ui/bower_components/paper-ripple/.bower.json @@ -32,14 +32,14 @@ "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0" }, "ignore": [], - "homepage": "https://github.com/PolymerElements/paper-ripple", + "homepage": "https://github.com/polymerelements/paper-ripple", "_release": "1.0.5", "_resolution": { "type": "version", "tag": "v1.0.5", "commit": "d72e7a9a8ab518b901ed18dde492df3b87a93be5" }, - "_source": "git://github.com/PolymerElements/paper-ripple.git", + "_source": "git://github.com/polymerelements/paper-ripple.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/paper-ripple" + "_originalSource": "polymerelements/paper-ripple" } \ 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 3e8a4009a..bbad7fe7b 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.0.0", + "_target": "^1.1.0", "_originalSource": "Polymer/polymer" } \ No newline at end of file From 6fb76e74815b8bf83e55d836a7c8897963532232 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 5 May 2016 22:18:14 -0400 Subject: [PATCH 05/11] update package creator --- .../components/servertestermessage.js | 106 +++++++++--------- dashboard-ui/css/notifications.css | 2 +- dashboard-ui/scripts/librarybrowser.js | 13 +-- dashboard-ui/scripts/librarymenu.js | 4 +- 4 files changed, 59 insertions(+), 66 deletions(-) diff --git a/dashboard-ui/components/servertestermessage.js b/dashboard-ui/components/servertestermessage.js index bb3ad5fb1..b719b1a7b 100644 --- a/dashboard-ui/components/servertestermessage.js +++ b/dashboard-ui/components/servertestermessage.js @@ -26,9 +26,13 @@ if (!result.dev && release.target_commitish == 'dev') { result.dev = release; } + } else { + if (!result.stable && release.target_commitish == 'master') { + result.stable = release; + } } - if (result.beta && result.dev) { + if (result.beta && result.dev && result.stable) { break; } } @@ -43,62 +47,59 @@ return str.split(find).join(replace); } - function showInternal() { + function showInternal(releases) { - getReleases().then(function (releases) { + require(['dialogHelper'], function (dialogHelper) { + var dlg = dialogHelper.createDialog({ + size: 'small', + removeOnClose: true, + autoFocus: false + }); - require(['dialogHelper'], function (dialogHelper) { - var dlg = dialogHelper.createDialog({ - size: 'small', - removeOnClose: true, - autoFocus: false - }); + dlg.classList.add('ui-body-b'); + dlg.classList.add('background-theme-b'); - dlg.classList.add('ui-body-b'); - dlg.classList.add('background-theme-b'); + var html = ''; - var html = ''; + html += '
'; + html += ''; + html += '
'; + html += 'Emby'; + html += '
'; + html += '
'; - html += '
'; - html += ''; - html += '
'; - html += 'Emby'; + html += '

Welcome Emby Tester!

'; + + html += '

If you\'re seeing this message, it\s because you\'re running a pre-release version of Emby Server. Thank you for being a part of the Emby pre-release testing process.

'; + + html += '

Please take a moment to leave your testing feedback about this version in the Emby Community.

'; + + html += 'Visit Emby Community'; + + if (releases.beta) { + html += '

Beta Release Notes

'; + + html += '
'; + html += replaceAll((releases.beta.body || ''), '*', '
'); html += '
'; + } + + if (releases.dev) { + html += '

Dev Release Notes

'; + + html += '
'; + html += replaceAll((releases.dev.body || ''), '*', '
'); html += '
'; + } - html += '

Welcome Emby Tester!

'; + dlg.innerHTML = html; + document.body.appendChild(dlg); - html += '

If you\'re seeing this message, it\s because you\'re running a pre-release version of Emby Server. Thank you for being a part of the Emby pre-release testing process.

'; + dialogHelper.open(dlg); - html += '

Please take a moment to leave your testing feedback about this version in the Emby Community.

'; + dlg.querySelector('.btnCancel', dlg).addEventListener('click', function () { - html += 'Visit Emby Community'; - - if (releases.beta) { - html += '

Beta Release Notes

'; - - html += '
'; - html += replaceAll((releases.beta.body || ''), '*', '
'); - html += '
'; - } - - if (releases.dev) { - html += '

Dev Release Notes

'; - - html += '
'; - html += replaceAll((releases.dev.body || ''), '*', '
'); - html += '
'; - } - - dlg.innerHTML = html; - document.body.appendChild(dlg); - - dialogHelper.open(dlg); - - dlg.querySelector('.btnCancel', dlg).addEventListener('click', function () { - - dialogHelper.close(dlg); - }); + dialogHelper.close(dlg); }); }); } @@ -132,7 +133,7 @@ var key = 'servertestermessagetime'; var lastShown = parseInt(appSettings.get(key) || '0'); - if ((new Date().getTime() - lastShown) < 259200000) { + if ((new Date().getTime() - lastShown) < 345600000) { return; } @@ -143,11 +144,12 @@ return; } - apiClient.getPublicSystemInfo().then(function (info) { - - if (compareVersions(info.Version, '3.0.5934') == 1) { - showInternal(); - } + getReleases().then(function (releases) { + apiClient.getPublicSystemInfo().then(function (info) { + if (releases.stable && compareVersions(info.Version, releases.stable.tag_name) == 1) { + showInternal(releases); + } + }); }); } diff --git a/dashboard-ui/css/notifications.css b/dashboard-ui/css/notifications.css index 69ec12eec..72736892a 100644 --- a/dashboard-ui/css/notifications.css +++ b/dashboard-ui/css/notifications.css @@ -3,7 +3,7 @@ outline: 0 !important; vertical-align: middle; width: auto; - margin: 0 .7em; + margin: 0; } .btnNotificationsInner { diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 2522e0caf..53d93cfad 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1380,19 +1380,10 @@ } if (imgUrl) { - var minLazyIndex = 16; if (options.smallIcon) { - if (index < minLazyIndex) { - html += '
'; - } else { - html += '
'; - } + html += '
'; } else { - if (index < minLazyIndex) { - html += '
'; - } else { - html += '
'; - } + html += '
'; } } else { if (options.smallIcon) { diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index d31f5250c..4550c28e2 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -34,7 +34,7 @@ html += ''; - html += ''; + html += '
0
'; html += ''; @@ -1119,7 +1119,7 @@ var headerCreated; var userRequiresUpdateAfterHeader; - require(['paper-icon-button', 'emby-icons'], function () { + require(['paper-icon-button', 'emby-icons', 'paper-button'], function () { renderHeader(); headerCreated = true; From 579a4fb8da0bc040f6d8c0aa37e9e6dc12821b72 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 5 May 2016 22:30:15 -0400 Subject: [PATCH 06/11] fix letter filters --- dashboard-ui/scripts/channelitems.js | 2 +- dashboard-ui/scripts/musicalbums.js | 2 +- dashboard-ui/scripts/tvshows.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard-ui/scripts/channelitems.js b/dashboard-ui/scripts/channelitems.js index 5bf7091f2..286f72b77 100644 --- a/dashboard-ui/scripts/channelitems.js +++ b/dashboard-ui/scripts/channelitems.js @@ -248,7 +248,7 @@ function updateFilterControls(page) { var query = getQuery(page); - $('.alphabetPicker', page).alphaValue(query.NameStartsWith); + $('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater); } pageIdOn('pageinit', "channelItemsPage", function () { diff --git a/dashboard-ui/scripts/musicalbums.js b/dashboard-ui/scripts/musicalbums.js index fcc7912cd..bc702c916 100644 --- a/dashboard-ui/scripts/musicalbums.js +++ b/dashboard-ui/scripts/musicalbums.js @@ -206,7 +206,7 @@ var query = getQuery(page); - $('.alphabetPicker', page).alphaValue(query.NameStartsWith); + $('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater); } function initPage(tabContent) { diff --git a/dashboard-ui/scripts/tvshows.js b/dashboard-ui/scripts/tvshows.js index 8c5d89cb1..0694e7b0f 100644 --- a/dashboard-ui/scripts/tvshows.js +++ b/dashboard-ui/scripts/tvshows.js @@ -183,7 +183,7 @@ function updateFilterControls(tabContent) { var query = getQuery(tabContent); - $('.alphabetPicker', tabContent).alphaValue(query.NameStartsWith); + $('.alphabetPicker', tabContent).alphaValue(query.NameStartsWithOrGreater); } function initPage(tabContent) { From 69ae494554ef9597b42a570d5f7074f13d25ce76 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 5 May 2016 22:30:33 -0400 Subject: [PATCH 07/11] add paper-icon-button-light --- dashboard-ui/scripts/site.js | 1 + 1 file changed, 1 insertion(+) diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index f26927998..b35b010be 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1730,6 +1730,7 @@ var AppInfo = {}; define("paper-dialog-scrollable", ["html!" + bowerPath + "/paper-dialog-scrollable/paper-dialog-scrollable.html"]); define("paper-button", ["html!" + bowerPath + "/paper-button/paper-button.html"]); define("paper-icon-button", ["html!" + bowerPath + "/paper-icon-button/paper-icon-button.html"]); + define("paper-icon-button-light", ["html!" + bowerPath + "/paper-icon-button/paper-icon-button-light.html"]); define("paper-drawer-panel", ["html!" + bowerPath + "/paper-drawer-panel/paper-drawer-panel.html"]); define("paper-radio-group", ["html!" + bowerPath + "/paper-radio-group/paper-radio-group.html"]); define("paper-radio-button", ["html!" + bowerPath + "/paper-radio-button/paper-radio-button.html"]); From 8225003fd585200dee36929e7aafd31d7b37e13d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 5 May 2016 22:55:15 -0400 Subject: [PATCH 08/11] consolidate datetime methods --- .../emby-webcomponents/datetime.js | 11 +++- .../components/remotecontrolautoplay.js | 6 +-- dashboard-ui/scripts/librarybrowser.js | 54 +------------------ dashboard-ui/scripts/livetvchannel.js | 6 +-- dashboard-ui/scripts/livetvcomponents.js | 6 +-- dashboard-ui/scripts/livetvseriestimer.js | 4 +- dashboard-ui/scripts/livetvseriestimers.js | 4 +- dashboard-ui/scripts/logpage.js | 4 +- dashboard-ui/scripts/serversecurity.js | 4 +- 9 files changed, 29 insertions(+), 70 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/datetime.js b/dashboard-ui/bower_components/emby-webcomponents/datetime.js index 92c7afa59..dc9f11309 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/datetime.js +++ b/dashboard-ui/bower_components/emby-webcomponents/datetime.js @@ -114,6 +114,16 @@ function getDisplayTime(date) { + if ((typeof date).toString().toLowerCase() === 'string') { + try { + + date = parseISO8601Date(date, true); + + } catch (err) { + return date; + } + } + var currentLocale = globalize.getCurrentLocale(); var time = currentLocale && toLocaleTimeStringSupportsLocales ? @@ -124,7 +134,6 @@ if (timeLower.indexOf('am') != -1 || timeLower.indexOf('pm') != -1) { - time = timeLower; var hour = date.getHours() % 12; var suffix = date.getHours() > 11 ? 'pm' : 'am'; if (!hour) { diff --git a/dashboard-ui/components/remotecontrolautoplay.js b/dashboard-ui/components/remotecontrolautoplay.js index 6689ea300..adae74079 100644 --- a/dashboard-ui/components/remotecontrolautoplay.js +++ b/dashboard-ui/components/remotecontrolautoplay.js @@ -1,4 +1,4 @@ -(function () { +define(['events'], function (events) { function transferPlayback(oldPlayer) { @@ -25,7 +25,7 @@ }); } - Events.on(MediaController, 'playerchange', function (e, newPlayer, newTarget, oldPlayer) { + events.on(MediaController, 'playerchange', function (e, newPlayer, newTarget, oldPlayer) { if (!oldPlayer) { console.log('Skipping remote control autoplay because oldPlayer is null'); @@ -48,4 +48,4 @@ } }); -})(); \ No newline at end of file +}); \ No newline at end of file diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 53d93cfad..9d9cdefcd 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1,4 +1,4 @@ -define(['playlistManager', 'appSettings', 'appStorage', 'apphost', 'jQuery', 'scrollStyles'], function (playlistManager, appSettings, appStorage, appHost, $) { +define(['playlistManager', 'appSettings', 'appStorage', 'apphost', 'datetime', 'jQuery', 'scrollStyles'], function (playlistManager, appSettings, appStorage, appHost, datetime, $) { var libraryBrowser = (function (window, document, screen) { @@ -3413,56 +3413,6 @@ detailImageProgressContainer.innerHTML = progressHtml || ''; }, - getDisplayTime: function (date) { - - if ((typeof date).toString().toLowerCase() === 'string') { - try { - - date = parseISO8601Date(date, { toLocal: true }); - - } catch (err) { - return date; - } - } - - var lower = date.toLocaleTimeString().toLowerCase(); - - var hours = date.getHours(); - var minutes = date.getMinutes(); - - var text; - - if (lower.indexOf('am') != -1 || lower.indexOf('pm') != -1) { - - var suffix = hours > 11 ? 'pm' : 'am'; - - hours = (hours % 12) || 12; - - text = hours; - - if (minutes) { - - text += ':'; - if (minutes < 10) { - text += '0'; - } - text += minutes; - } - - text += suffix; - - } else { - text = hours + ':'; - - if (minutes < 10) { - text += '0'; - } - text += minutes; - } - - return text; - }, - getMiscInfoHtml: function (item) { var miscInfo = []; @@ -3512,7 +3462,7 @@ miscInfo.push(text); if (item.Type != "Recording") { - text = LibraryBrowser.getDisplayTime(date); + text = datetime.getDisplayTime(date); miscInfo.push(text); } } diff --git a/dashboard-ui/scripts/livetvchannel.js b/dashboard-ui/scripts/livetvchannel.js index 72a25b500..1e6800b1b 100644 --- a/dashboard-ui/scripts/livetvchannel.js +++ b/dashboard-ui/scripts/livetvchannel.js @@ -1,4 +1,4 @@ -define(['jQuery'], function ($) { +define(['datetime'], function (datetime) { function renderPrograms(page, result) { @@ -32,7 +32,7 @@ } html += '
'; - html += '
' + LibraryBrowser.getDisplayTime(startDate) + '
'; + html += '
' + datetime.getDisplayTime(startDate) + '
'; html += '
'; cssClass = "tvProgramInfo"; @@ -96,7 +96,7 @@ html += ''; } - $('#childrenContent', page).html(html); + page.querySelector('#childrenContent').innerHTML = html; } function loadPrograms(page, channelId) { diff --git a/dashboard-ui/scripts/livetvcomponents.js b/dashboard-ui/scripts/livetvcomponents.js index a0e81b1e4..51a39a975 100644 --- a/dashboard-ui/scripts/livetvcomponents.js +++ b/dashboard-ui/scripts/livetvcomponents.js @@ -1,4 +1,4 @@ -define([], function () { +define(['datetime'], function (datetime) { function getTimersHtml(timers) { @@ -69,8 +69,8 @@ html += '
'; html += '
'; - html += LibraryBrowser.getDisplayTime(timer.StartDate); - html += ' - ' + LibraryBrowser.getDisplayTime(timer.EndDate); + html += datetime.getDisplayTime(timer.StartDate); + html += ' - ' + datetime.getDisplayTime(timer.EndDate); html += '
'; html += ''; diff --git a/dashboard-ui/scripts/livetvseriestimer.js b/dashboard-ui/scripts/livetvseriestimer.js index 3d9ffbec8..ce841aad5 100644 --- a/dashboard-ui/scripts/livetvseriestimer.js +++ b/dashboard-ui/scripts/livetvseriestimer.js @@ -1,4 +1,4 @@ -define(['jQuery'], function ($) { +define(['datetime', 'jQuery'], function (datetime, $) { var currentItem; @@ -52,7 +52,7 @@ $('.time', page).html(Globalize.translate('LabelAnytime')).trigger('create'); } else if (item.ChannelId) { - $('.time', page).html(LibraryBrowser.getDisplayTime(item.StartDate)).trigger('create'); + $('.time', page).html(datetime.getDisplayTime(item.StartDate)).trigger('create'); } Dashboard.hideLoadingMsg(); diff --git a/dashboard-ui/scripts/livetvseriestimers.js b/dashboard-ui/scripts/livetvseriestimers.js index 88994f773..3035e4f00 100644 --- a/dashboard-ui/scripts/livetvseriestimers.js +++ b/dashboard-ui/scripts/livetvseriestimers.js @@ -1,4 +1,4 @@ -define(['jQuery'], function ($) { +define(['datetime', 'jQuery'], function (datetime, $) { var query = { @@ -63,7 +63,7 @@ html += ' - ' + Globalize.translate('LabelAnytime'); } else { - html += ' - ' + LibraryBrowser.getDisplayTime(timer.StartDate); + html += ' - ' + datetime.getDisplayTime(timer.StartDate); } html += '
'; diff --git a/dashboard-ui/scripts/logpage.js b/dashboard-ui/scripts/logpage.js index 46b3e5988..2e71e14ae 100644 --- a/dashboard-ui/scripts/logpage.js +++ b/dashboard-ui/scripts/logpage.js @@ -1,4 +1,4 @@ -define(['jQuery', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function ($) { +define(['datetime', 'jQuery', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function (datetime, $) { function getTabs() { return [ @@ -65,7 +65,7 @@ var text = date.toLocaleDateString(); - text += ' ' + LibraryBrowser.getDisplayTime(date); + text += ' ' + datetime.getDisplayTime(date); logHtml += '
' + text + '
'; diff --git a/dashboard-ui/scripts/serversecurity.js b/dashboard-ui/scripts/serversecurity.js index 0c966d6d5..3b39c2b59 100644 --- a/dashboard-ui/scripts/serversecurity.js +++ b/dashboard-ui/scripts/serversecurity.js @@ -1,4 +1,4 @@ -define(['jQuery'], function ($) { +define(['datetime', 'jQuery'], function (datetime, $) { function revoke(page, key) { @@ -61,7 +61,7 @@ var date = parseISO8601Date(item.DateCreated, { toLocal: true }); - html += date.toLocaleDateString() + ' ' + LibraryBrowser.getDisplayTime(date); + html += datetime.toLocaleDateString(date) + ' ' + datetime.getDisplayTime(date); html += ''; From 7b625ade868992240c49041f1f46dc0d0a3c9bec Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 5 May 2016 23:09:36 -0400 Subject: [PATCH 09/11] consolidate datetime methods --- dashboard-ui/components/remotecontrol.js | 8 +- dashboard-ui/scripts/dashboardpage.js | 6 +- dashboard-ui/scripts/externalplayer.js | 4 +- dashboard-ui/scripts/itemdetailpage.js | 8 +- dashboard-ui/scripts/librarybrowser.js | 4 +- dashboard-ui/scripts/mediaplayer-video.js | 6 +- dashboard-ui/scripts/mediaplayer.js | 220 +------------------ dashboard-ui/scripts/nowplayingbar.js | 8 +- dashboard-ui/scripts/site.js | 245 ++++++++++++++++++---- 9 files changed, 231 insertions(+), 278 deletions(-) diff --git a/dashboard-ui/components/remotecontrol.js b/dashboard-ui/components/remotecontrol.js index 0d54dd64d..d5049894c 100644 --- a/dashboard-ui/components/remotecontrol.js +++ b/dashboard-ui/components/remotecontrol.js @@ -1,4 +1,4 @@ -define(['browser', 'jQuery', 'paper-fab', 'paper-tabs', 'paper-slider', 'paper-icon-button'], function (browser, $) { +define(['browser', 'datetime', 'jQuery', 'paper-fab', 'paper-tabs', 'paper-slider', 'paper-icon-button'], function (browser, datetime, $) { function showSlideshowMenu(context) { require(['scripts/slideshow'], function () { @@ -343,11 +343,11 @@ if (playState.PositionTicks == null) { context.querySelector('.positionTime').innerHTML = '--:--'; } else { - context.querySelector('.positionTime').innerHTML = Dashboard.getDisplayTime(playState.PositionTicks); + context.querySelector('.positionTime').innerHTML = datetime.getDisplayRunningTime(playState.PositionTicks); } if (item && item.RunTimeTicks != null) { - context.querySelector('.runtime').innerHTML = Dashboard.getDisplayTime(item.RunTimeTicks); + context.querySelector('.runtime').innerHTML = datetime.getDisplayRunningTime(item.RunTimeTicks); } else { context.querySelector('.runtime').innerHTML = '--:--'; } @@ -733,7 +733,7 @@ ticks /= 100; ticks *= value; - this.pinValue = Dashboard.getDisplayTime(ticks); + this.pinValue = datetime.getDisplayRunningTime(ticks); }; context.addEventListener('click', onContextClick); diff --git a/dashboard-ui/scripts/dashboardpage.js b/dashboard-ui/scripts/dashboardpage.js index ec59e485c..04a79b096 100644 --- a/dashboard-ui/scripts/dashboardpage.js +++ b/dashboard-ui/scripts/dashboardpage.js @@ -411,7 +411,7 @@ if (session.TranscodingInfo && session.TranscodingInfo.Framerate) { - html += ' - '+session.TranscodingInfo.Framerate + ' fps'; + html += ' - ' + session.TranscodingInfo.Framerate + ' fps'; } } else if (session.PlayState.PlayMethod == 'DirectStream') { @@ -465,7 +465,7 @@ var html = ''; if (session.PlayState.PositionTicks) { - html += Dashboard.getDisplayTime(session.PlayState.PositionTicks); + html += datetime.getDisplayRunningTime(session.PlayState.PositionTicks); } else { html += '--:--:--'; } @@ -475,7 +475,7 @@ var nowPlayingItem = session.NowPlayingItem; if (nowPlayingItem && nowPlayingItem.RunTimeTicks) { - html += Dashboard.getDisplayTime(nowPlayingItem.RunTimeTicks); + html += datetime.getDisplayRunningTime(nowPlayingItem.RunTimeTicks); } else { html += '--:--:--'; } diff --git a/dashboard-ui/scripts/externalplayer.js b/dashboard-ui/scripts/externalplayer.js index 7f81c87ae..46b44339a 100644 --- a/dashboard-ui/scripts/externalplayer.js +++ b/dashboard-ui/scripts/externalplayer.js @@ -1,4 +1,4 @@ -define(['appSettings', 'jQuery', 'paper-slider', 'paper-button'], function (appSettings, $) { +define(['appSettings', 'datetime', 'jQuery', 'paper-slider', 'paper-button'], function (appSettings, datetime, $) { function getDeviceProfile(serverAddress, deviceId, item, startPositionTicks, maxBitrate, mediaSourceId, audioStreamIndex, subtitleStreamIndex) { @@ -322,7 +322,7 @@ var time = item.RunTimeTicks * (Number(pct) * .01); - var tooltext = Dashboard.getDisplayTime(time); + var tooltext = datetime.getDisplayRunningTime(time); $('.sliderValue', elem).html(tooltext); diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index b3da6ae94..67515e919 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -1,4 +1,4 @@ -define(['layoutManager', 'jQuery', 'scrollStyles'], function (layoutManager, $) { +define(['layoutManager', 'datetime', 'jQuery', 'scrollStyles'], function (layoutManager, datetime, $) { var currentItem; @@ -341,7 +341,7 @@ }); var itemsContainer = section.querySelector('.nextUpItems'); - + itemsContainer.innerHTML = html; ImageLoader.lazyChildren(itemsContainer); $(itemsContainer).createCardMenus(); @@ -1402,7 +1402,7 @@ html += '
'; html += '
' + chapterName + '
'; html += '
'; - html += Dashboard.getDisplayTime(chapter.StartPositionTicks); + html += datetime.getDisplayRunningTime(chapter.StartPositionTicks); html += '
'; //cardFooter @@ -1639,7 +1639,7 @@ html += '
' + item.Name + '
'; html += '
'; if (item.RunTimeTicks != "") { - html += Dashboard.getDisplayTime(item.RunTimeTicks); + html += datetime.getDisplayRunningTime(item.RunTimeTicks); } else { html += " "; diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 9d9cdefcd..a27edbf70 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -3525,7 +3525,7 @@ if (item.Type == "Audio") { - miscInfo.push(Dashboard.getDisplayTime(item.RunTimeTicks)); + miscInfo.push(datetime.getDisplayRunningTime(item.RunTimeTicks)); } else { minutes = item.RunTimeTicks / 600000000; @@ -3538,7 +3538,7 @@ if (item.CumulativeRunTimeTicks && item.Type != "Series" && item.Type != "Season") { - miscInfo.push(Dashboard.getDisplayTime(item.CumulativeRunTimeTicks)); + miscInfo.push(datetime.getDisplayRunningTime(item.CumulativeRunTimeTicks)); } if (item.OfficialRating && item.Type !== "Season" && item.Type !== "Episode") { diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index a5ae0477f..5dabfbcf3 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -1,4 +1,4 @@ -define(['appSettings', 'jQuery', 'scrollStyles'], function (appSettings, $) { +define(['appSettings', 'datetime', 'jQuery', 'scrollStyles'], function (appSettings, datetime, $) { function createVideoPlayer(self) { @@ -495,7 +495,7 @@ if (c.Name) { chapterHtml += '
' + c.Name + '
'; } - chapterHtml += '
' + Dashboard.getDisplayTime(c.StartPositionTicks) + '
'; + chapterHtml += '
' + datetime.getDisplayRunningTime(c.StartPositionTicks) + '
'; chapterHtml += '
'; chapterHtml += '
'; @@ -789,7 +789,7 @@ ticks /= 100; ticks *= value; - this.pinValue = Dashboard.getDisplayTime(ticks); + this.pinValue = datetime.getDisplayRunningTime(ticks); }; volumeSlider = $('.videoVolumeSlider', parent).on('change', function () { diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index b3efd6e21..6a5eee461 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -1,4 +1,4 @@ -define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, userSettings, appStorage) { +define(['appSettings', 'userSettings', 'appStorage', 'datetime'], function (appSettings, userSettings, appStorage, datetime) { function mediaPlayer() { @@ -44,216 +44,6 @@ define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, use return targets; }; - function updateDeviceProfileForAndroid(profile) { - - // Just here as an easy escape out, if ever needed - var enableVlcVideo = true; - var enableVlcAudio = window.VlcAudio; - - if (enableVlcVideo) { - - profile.DirectPlayProfiles.push({ - Container: "m4v,3gp,ts,mpegts,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,m2v,avi,mpg,mpeg,mp4,webm", - Type: 'Video', - AudioCodec: 'aac,aac_latm,mp3,ac3,wma,dca,pcm,PCM_S16LE,PCM_S24LE,opus,flac' - }); - - profile.CodecProfiles = profile.CodecProfiles.filter(function (i) { - return i.Type == 'Audio'; - }); - - profile.SubtitleProfiles = []; - profile.SubtitleProfiles.push({ - Format: 'srt', - Method: 'External' - }); - profile.SubtitleProfiles.push({ - Format: 'srt', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'subrip', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'ass', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'ssa', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'pgs', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'pgssub', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'dvdsub', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'vtt', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'sub', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'idx', - Method: 'Embed' - }); - profile.SubtitleProfiles.push({ - Format: 'smi', - Method: 'Embed' - }); - - // These don't play very well - profile.CodecProfiles.push({ - Type: 'VideoAudio', - Codec: 'dca', - Conditions: [ - { - Condition: 'LessThanEqual', - Property: 'AudioChannels', - Value: 6 - } - ] - }); - - profile.CodecProfiles.push({ - Type: 'VideoAudio', - Codec: 'aac,mp3', - Conditions: [ - { - Condition: 'LessThanEqual', - Property: 'AudioChannels', - Value: '6' - } - ] - }); - - profile.CodecProfiles.push({ - Type: 'Video', - Codec: 'h264', - Conditions: [ - { - Condition: 'EqualsAny', - Property: 'VideoProfile', - Value: 'high|main|baseline|constrained baseline' - }, - { - Condition: 'LessThanEqual', - Property: 'VideoLevel', - Value: '41' - }] - }); - - profile.TranscodingProfiles.filter(function (p) { - - return p.Type == 'Video' && p.CopyTimestamps == true; - - }).forEach(function (p) { - - // Vlc doesn't seem to handle this well - p.CopyTimestamps = false; - }); - - profile.TranscodingProfiles.filter(function (p) { - - return p.Type == 'Video' && p.VideoCodec == 'h264'; - - }).forEach(function (p) { - - p.AudioCodec += ',ac3'; - }); - } - - if (enableVlcAudio) { - - profile.DirectPlayProfiles.push({ - Container: "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus", - Type: 'Audio' - }); - - profile.CodecProfiles = profile.CodecProfiles.filter(function (i) { - return i.Type != 'Audio'; - }); - - profile.CodecProfiles.push({ - Type: 'Audio', - Conditions: [{ - Condition: 'LessThanEqual', - Property: 'AudioChannels', - Value: '2' - }] - }); - } - } - - function updateDeviceProfileForIOS(profile) { - - } - - self.getDeviceProfile = function (maxHeight) { - - return new Promise(function (resolve, reject) { - - require(['browserdeviceprofile', 'qualityoptions'], function (profileBuilder, qualityoptions) { - - var supportsCustomSeeking = false; - if (!browserInfo.mobile) { - supportsCustomSeeking = true; - } else if (AppInfo.isNativeApp && browserInfo.safari) { - if (navigator.userAgent.toLowerCase().indexOf('ipad') == -1) { - // Need to disable it in order to support picture in picture - supportsCustomSeeking = true; - } - } else if (AppInfo.isNativeApp) { - supportsCustomSeeking = true; - } - - var profile = profileBuilder({ - supportsCustomSeeking: supportsCustomSeeking - }); - - if (!(AppInfo.isNativeApp && browserInfo.android)) { - profile.SubtitleProfiles.push({ - Format: 'ass', - Method: 'External' - }); - profile.SubtitleProfiles.push({ - Format: 'ssa', - Method: 'External' - }); - } - - var bitrateSetting = appSettings.maxStreamingBitrate(); - - if (!maxHeight) { - maxHeight = qualityoptions.getVideoQualityOptions(bitrateSetting).filter(function (q) { - return q.selected; - })[0].maxHeight; - } - - if (AppInfo.isNativeApp && browserInfo.android) { - updateDeviceProfileForAndroid(profile); - } - else if (AppInfo.isNativeApp && browserInfo.safari) { - updateDeviceProfileForIOS(profile); - } - - profile.MaxStreamingBitrate = bitrateSetting; - - resolve(profile); - }); - }); - }; - var supportsTextTracks; self.supportsTextTracks = function () { @@ -378,7 +168,7 @@ define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, use var playSessionId = getParameterByName('PlaySessionId', currentSrc); var liveStreamId = getParameterByName('LiveStreamId', currentSrc); - self.getDeviceProfile().then(function (deviceProfile) { + Dashboard.getDeviceProfile().then(function (deviceProfile) { var audioStreamIndex = params.AudioStreamIndex == null ? (getParameterByName('AudioStreamIndex', currentSrc) || null) : params.AudioStreamIndex; if (typeof (audioStreamIndex) == 'string') { @@ -481,12 +271,12 @@ define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, use // Convert to ticks ticks = Math.floor(ticks); - var timeText = Dashboard.getDisplayTime(ticks); + var timeText = datetime.getDisplayRunningTime(ticks); var mediaRenderer = self.currentMediaRenderer; if (self.currentDurationTicks) { - timeText += " / " + Dashboard.getDisplayTime(self.currentDurationTicks); + timeText += " / " + datetime.getDisplayRunningTime(self.currentDurationTicks); if (positionSlider) { @@ -864,7 +654,7 @@ define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, use } var onBitrateDetected = function () { - self.getDeviceProfile().then(function (deviceProfile) { + Dashboard.getDeviceProfile().then(function (deviceProfile) { playOnDeviceProfileCreated(deviceProfile, item, startPosition, callback); }); }; diff --git a/dashboard-ui/scripts/nowplayingbar.js b/dashboard-ui/scripts/nowplayingbar.js index 9a05ed36e..9e4378398 100644 --- a/dashboard-ui/scripts/nowplayingbar.js +++ b/dashboard-ui/scripts/nowplayingbar.js @@ -1,4 +1,4 @@ -define(['jQuery'], function ($) { +define(['datetime', 'jQuery'], function (datetime, $) { var currentPlayer; @@ -247,7 +247,7 @@ ticks /= 100; ticks *= value; - this.pinValue = Dashboard.getDisplayTime(ticks); + this.pinValue = datetime.getDisplayRunningTime(ticks); }; }, 300); } @@ -375,11 +375,11 @@ } } - var timeText = Dashboard.getDisplayTime(playState.PositionTicks); + var timeText = datetime.getDisplayRunningTime(playState.PositionTicks); if (nowPlayingItem.RunTimeTicks) { - timeText += " / " + Dashboard.getDisplayTime(nowPlayingItem.RunTimeTicks); + timeText += " / " + datetime.getDisplayRunningTime(nowPlayingItem.RunTimeTicks); } diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index b35b010be..9caf15df8 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1101,44 +1101,6 @@ var Dashboard = { } }, - getDisplayTime: function (ticks) { - - var ticksPerHour = 36000000000; - var ticksPerMinute = 600000000; - var ticksPerSecond = 10000000; - - var parts = []; - - var hours = ticks / ticksPerHour; - hours = Math.floor(hours); - - if (hours) { - parts.push(hours); - } - - ticks -= (hours * ticksPerHour); - - var minutes = ticks / ticksPerMinute; - minutes = Math.floor(minutes); - - ticks -= (minutes * ticksPerMinute); - - if (minutes < 10 && hours) { - minutes = '0' + minutes; - } - parts.push(minutes); - - var seconds = ticks / ticksPerSecond; - seconds = Math.floor(seconds); - - if (seconds < 10) { - seconds = '0' + seconds; - } - parts.push(seconds); - - return parts.join(':'); - }, - getSupportedRemoteCommands: function () { // Full list @@ -1249,6 +1211,209 @@ var Dashboard = { exit: function () { Dashboard.logout(); + }, + + getDeviceProfile: function (maxHeight) { + + return new Promise(function (resolve, reject) { + + function updateDeviceProfileForAndroid(profile) { + + // Just here as an easy escape out, if ever needed + var enableVlcVideo = true; + var enableVlcAudio = window.VlcAudio; + + if (enableVlcVideo) { + + profile.DirectPlayProfiles.push({ + Container: "m4v,3gp,ts,mpegts,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,m2v,avi,mpg,mpeg,mp4,webm", + Type: 'Video', + AudioCodec: 'aac,aac_latm,mp3,ac3,wma,dca,pcm,PCM_S16LE,PCM_S24LE,opus,flac' + }); + + profile.CodecProfiles = profile.CodecProfiles.filter(function (i) { + return i.Type == 'Audio'; + }); + + profile.SubtitleProfiles = []; + profile.SubtitleProfiles.push({ + Format: 'srt', + Method: 'External' + }); + profile.SubtitleProfiles.push({ + Format: 'srt', + Method: 'Embed' + }); + profile.SubtitleProfiles.push({ + Format: 'subrip', + Method: 'Embed' + }); + profile.SubtitleProfiles.push({ + Format: 'ass', + Method: 'Embed' + }); + profile.SubtitleProfiles.push({ + Format: 'ssa', + Method: 'Embed' + }); + profile.SubtitleProfiles.push({ + Format: 'pgs', + Method: 'Embed' + }); + profile.SubtitleProfiles.push({ + Format: 'pgssub', + Method: 'Embed' + }); + profile.SubtitleProfiles.push({ + Format: 'dvdsub', + Method: 'Embed' + }); + profile.SubtitleProfiles.push({ + Format: 'vtt', + Method: 'Embed' + }); + profile.SubtitleProfiles.push({ + Format: 'sub', + Method: 'Embed' + }); + profile.SubtitleProfiles.push({ + Format: 'idx', + Method: 'Embed' + }); + profile.SubtitleProfiles.push({ + Format: 'smi', + Method: 'Embed' + }); + + // These don't play very well + profile.CodecProfiles.push({ + Type: 'VideoAudio', + Codec: 'dca', + Conditions: [ + { + Condition: 'LessThanEqual', + Property: 'AudioChannels', + Value: 6 + } + ] + }); + + profile.CodecProfiles.push({ + Type: 'VideoAudio', + Codec: 'aac,mp3', + Conditions: [ + { + Condition: 'LessThanEqual', + Property: 'AudioChannels', + Value: '6' + } + ] + }); + + profile.CodecProfiles.push({ + Type: 'Video', + Codec: 'h264', + Conditions: [ + { + Condition: 'EqualsAny', + Property: 'VideoProfile', + Value: 'high|main|baseline|constrained baseline' + }, + { + Condition: 'LessThanEqual', + Property: 'VideoLevel', + Value: '41' + }] + }); + + profile.TranscodingProfiles.filter(function (p) { + + return p.Type == 'Video' && p.CopyTimestamps == true; + + }).forEach(function (p) { + + // Vlc doesn't seem to handle this well + p.CopyTimestamps = false; + }); + + profile.TranscodingProfiles.filter(function (p) { + + return p.Type == 'Video' && p.VideoCodec == 'h264'; + + }).forEach(function (p) { + + p.AudioCodec += ',ac3'; + }); + } + + if (enableVlcAudio) { + + profile.DirectPlayProfiles.push({ + Container: "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus", + Type: 'Audio' + }); + + profile.CodecProfiles = profile.CodecProfiles.filter(function (i) { + return i.Type != 'Audio'; + }); + + profile.CodecProfiles.push({ + Type: 'Audio', + Conditions: [{ + Condition: 'LessThanEqual', + Property: 'AudioChannels', + Value: '2' + }] + }); + } + } + + require(['browserdeviceprofile', 'qualityoptions', 'appSettings'], function (profileBuilder, qualityoptions, appSettings) { + + var supportsCustomSeeking = false; + if (!browserInfo.mobile) { + supportsCustomSeeking = true; + } else if (AppInfo.isNativeApp && browserInfo.safari) { + if (navigator.userAgent.toLowerCase().indexOf('ipad') == -1) { + // Need to disable it in order to support picture in picture + supportsCustomSeeking = true; + } + } else if (AppInfo.isNativeApp) { + supportsCustomSeeking = true; + } + + var profile = profileBuilder({ + supportsCustomSeeking: supportsCustomSeeking + }); + + if (!(AppInfo.isNativeApp && browserInfo.android)) { + profile.SubtitleProfiles.push({ + Format: 'ass', + Method: 'External' + }); + profile.SubtitleProfiles.push({ + Format: 'ssa', + Method: 'External' + }); + } + + var bitrateSetting = appSettings.maxStreamingBitrate(); + + if (!maxHeight) { + maxHeight = qualityoptions.getVideoQualityOptions(bitrateSetting).filter(function (q) { + return q.selected; + })[0].maxHeight; + } + + if (AppInfo.isNativeApp && browserInfo.android) { + updateDeviceProfileForAndroid(profile); + } + + profile.MaxStreamingBitrate = bitrateSetting; + + resolve(profile); + }); + }); } }; @@ -1377,9 +1542,7 @@ var AppInfo = {}; function getSyncProfile() { - return getRequirePromise(['scripts/mediaplayer']).then(function () { - return MediaPlayer.getDeviceProfile(Math.max(screen.height, screen.width)); - }); + return Dashboard.getDeviceProfile(Math.max(screen.height, screen.width)); } function onApiClientCreated(e, newApiClient) { From 9fd023f7de7cbd19b56dfb33398927a0d733dc18 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 6 May 2016 00:50:06 -0400 Subject: [PATCH 10/11] consolidate datetime methods --- dashboard-ui/components/humanedate.js | 4 +- .../metadataeditor/metadataeditor.js | 12 ++-- dashboard-ui/scripts/autoorganizelog.js | 4 +- dashboard-ui/scripts/editorsidebar.js | 6 +- dashboard-ui/scripts/extensions.js | 59 ------------------- dashboard-ui/scripts/homeupcoming.js | 4 +- dashboard-ui/scripts/itemdetailpage.js | 10 ++-- dashboard-ui/scripts/librarybrowser.js | 18 +++--- dashboard-ui/scripts/livetvchannel.js | 6 +- dashboard-ui/scripts/livetvcomponents.js | 4 +- dashboard-ui/scripts/logpage.js | 2 +- dashboard-ui/scripts/serversecurity.js | 2 +- dashboard-ui/scripts/syncjob.js | 4 +- dashboard-ui/scripts/tvupcoming.js | 4 +- 14 files changed, 40 insertions(+), 99 deletions(-) diff --git a/dashboard-ui/components/humanedate.js b/dashboard-ui/components/humanedate.js index 67e77166e..52699c319 100644 --- a/dashboard-ui/components/humanedate.js +++ b/dashboard-ui/components/humanedate.js @@ -1,4 +1,4 @@ -define([], function () { +define(['datetime'], function (datetime) { /* * Javascript Humane Dates @@ -29,7 +29,7 @@ ]; var dt = new Date; - var date = parseISO8601Date(date_str, { toLocal: true }); + var date = datetime.parseISO8601Date(date_str, true); var seconds = ((dt - date) / 1000); var token = ' ago'; diff --git a/dashboard-ui/components/metadataeditor/metadataeditor.js b/dashboard-ui/components/metadataeditor/metadataeditor.js index d1a9ba344..aa8cc9d6b 100644 --- a/dashboard-ui/components/metadataeditor/metadataeditor.js +++ b/dashboard-ui/components/metadataeditor/metadataeditor.js @@ -1,4 +1,4 @@ -define(['dialogHelper', 'jQuery', 'paper-checkbox', 'paper-input', 'paper-item-body', 'paper-icon-item', 'paper-textarea', 'paper-fab'], function (dialogHelper, $) { +define(['dialogHelper', 'datetime', 'jQuery', 'paper-checkbox', 'paper-input', 'paper-item-body', 'paper-icon-item', 'paper-textarea', 'paper-fab'], function (dialogHelper, $, datetime) { var currentContext; var metadataEditorInfo; @@ -96,7 +96,7 @@ if (currentItem[property]) { - var date = parseISO8601Date(currentItem[property], { toLocal: true }); + var date = datetime.parseISO8601Date(currentItem[property], true); var parts = date.toISOString().split('T'); @@ -278,7 +278,7 @@ ReplaceAllMetadata: true }); - require(['toast'], function(toast) { + require(['toast'], function (toast) { toast(Globalize.translate('MessageRefreshQueued')); }); } @@ -873,7 +873,7 @@ if (item.DateCreated) { try { - date = parseISO8601Date(item.DateCreated, { toLocal: true }); + date = datetime.parseISO8601Date(item.DateCreated, true); $('#txtDateAdded', context).val(date.toISOString().slice(0, 10)); } catch (e) { @@ -885,7 +885,7 @@ if (item.PremiereDate) { try { - date = parseISO8601Date(item.PremiereDate, { toLocal: true }); + date = datetime.parseISO8601Date(item.PremiereDate, true); $('#txtPremiereDate', context).val(date.toISOString().slice(0, 10)); } catch (e) { @@ -897,7 +897,7 @@ if (item.EndDate) { try { - date = parseISO8601Date(item.EndDate, { toLocal: true }); + date = datetime.parseISO8601Date(item.EndDate, true); $('#txtEndDate', context).val(date.toISOString().slice(0, 10)); } catch (e) { diff --git a/dashboard-ui/scripts/autoorganizelog.js b/dashboard-ui/scripts/autoorganizelog.js index 4b076460e..82ff9990d 100644 --- a/dashboard-ui/scripts/autoorganizelog.js +++ b/dashboard-ui/scripts/autoorganizelog.js @@ -1,4 +1,4 @@ -define(['jQuery'], function ($) { +define(['jQuery', 'datetime'], function ($, datetime) { var query = { @@ -160,7 +160,7 @@ html += ''; - var date = parseISO8601Date(item.Date, { toLocal: true }); + var date = datetime.parseISO8601Date(item.Date, true); html += date.toLocaleDateString(); html += ''; diff --git a/dashboard-ui/scripts/editorsidebar.js b/dashboard-ui/scripts/editorsidebar.js index 239f25965..180cce89b 100644 --- a/dashboard-ui/scripts/editorsidebar.js +++ b/dashboard-ui/scripts/editorsidebar.js @@ -1,4 +1,4 @@ -define(['jQuery'], function ($) { +define(['datetime', 'jQuery'], function (datetime, $) { function getNode(item, folderState, selected) { @@ -84,7 +84,7 @@ if (item.Type == "Episode" && item.LocationType == "Virtual") { try { - if (item.PremiereDate && (new Date().getTime() >= parseISO8601Date(item.PremiereDate, { toLocal: true }).getTime())) { + if (item.PremiereDate && (new Date().getTime() >= datetime.parseISO8601Date(item.PremiereDate, true).getTime())) { htmlName += ''; } } catch (err) { @@ -446,7 +446,7 @@ } window.MetadataEditor = { - getItemPromise: function() { + getItemPromise: function () { var currentItemId = getCurrentItemId(); if (currentItemId) { diff --git a/dashboard-ui/scripts/extensions.js b/dashboard-ui/scripts/extensions.js index 7334b1779..7e906acec 100644 --- a/dashboard-ui/scripts/extensions.js +++ b/dashboard-ui/scripts/extensions.js @@ -39,63 +39,4 @@ function replaceQueryString(url, param, value) { } return url; -} - -function parseISO8601Date(s, options) { - - options = options || {}; - - // parenthese matches: - // year month day hours minutes seconds - // dotmilliseconds - // tzstring plusminus hours minutes - var re = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(Z|([+-])(\d{2}):(\d{2}))?/; - - var d = s.match(re); - - // "2010-12-07T11:00:00.000-09:00" parses to: - // ["2010-12-07T11:00:00.000-09:00", "2010", "12", "07", "11", - // "00", "00", ".000", "-09:00", "-", "09", "00"] - // "2010-12-07T11:00:00.000Z" parses to: - // ["2010-12-07T11:00:00.000Z", "2010", "12", "07", "11", - // "00", "00", ".000", "Z", undefined, undefined, undefined] - - if (!d) { - - throw "Couldn't parse ISO 8601 date string '" + s + "'"; - } - - // parse strings, leading zeros into proper ints - var a = [1, 2, 3, 4, 5, 6, 10, 11]; - for (var i in a) { - d[a[i]] = parseInt(d[a[i]], 10); - } - d[7] = parseFloat(d[7]); - - // Date.UTC(year, month[, date[, hrs[, min[, sec[, ms]]]]]) - // note that month is 0-11, not 1-12 - // see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/UTC - var ms = Date.UTC(d[1], d[2] - 1, d[3], d[4], d[5], d[6]); - - // if there are milliseconds, add them - if (d[7] > 0) { - ms += Math.round(d[7] * 1000); - } - - // if there's a timezone, calculate it - if (d[8] != "Z" && d[10]) { - var offset = d[10] * 60 * 60 * 1000; - if (d[11]) { - offset += d[11] * 60 * 1000; - } - if (d[9] == "-") { - ms -= offset; - } else { - ms += offset; - } - } else if (!options.toLocal) { - ms += new Date().getTimezoneOffset() * 60000; - } - - return new Date(ms); } \ No newline at end of file diff --git a/dashboard-ui/scripts/homeupcoming.js b/dashboard-ui/scripts/homeupcoming.js index b80f4b8f9..9dd12ac30 100644 --- a/dashboard-ui/scripts/homeupcoming.js +++ b/dashboard-ui/scripts/homeupcoming.js @@ -1,4 +1,4 @@ -define(['jQuery', 'scrollStyles'], function ($) { +define(['datetime', 'scrollStyles'], function (datetime) { function loadUpcoming(page) { Dashboard.showLoadingMsg(); @@ -59,7 +59,7 @@ if (item.PremiereDate) { try { - var premiereDate = parseISO8601Date(item.PremiereDate, { toLocal: true }); + var premiereDate = datetime.parseISO8601Date(item.PremiereDate, true); if (premiereDate.getDate() == new Date().getDate() - 1) { dateText = Globalize.translate('Yesterday'); diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 67515e919..437886ead 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -93,7 +93,7 @@ var now = new Date(); - if (now >= parseISO8601Date(item.StartDate, { toLocal: true }) && now < parseISO8601Date(item.EndDate, { toLocal: true })) { + if (now >= datetime.parseISO8601Date(item.StartDate, true) && now < datetime.parseISO8601Date(item.EndDate, true)) { $('.btnPlay', page).removeClass('hide'); canPlay = true; } else { @@ -176,7 +176,7 @@ if (item.Type == "Person" && item.PremiereDate) { try { - var birthday = parseISO8601Date(item.PremiereDate, { toLocal: true }).toDateString(); + var birthday = datetime.parseISO8601Date(item.PremiereDate, true).toDateString(); $('#itemBirthday', page).show().html(Globalize.translate('BirthDateValue').replace('{0}', birthday)); } @@ -190,7 +190,7 @@ if (item.Type == "Person" && item.EndDate) { try { - var deathday = parseISO8601Date(item.EndDate, { toLocal: true }).toDateString(); + var deathday = datetime.parseISO8601Date(item.EndDate, true).toDateString(); $('#itemDeathDate', page).show().html(Globalize.translate('DeathDateValue').replace('{0}', deathday)); } @@ -222,7 +222,7 @@ if (item.LocationType == "Virtual" && item.Type == "Episode") { try { - if (item.PremiereDate && (new Date().getTime() >= parseISO8601Date(item.PremiereDate, { toLocal: true }).getTime())) { + if (item.PremiereDate && (new Date().getTime() >= datetime.parseISO8601Date(item.PremiereDate, true).getTime())) { isMissingEpisode = true; } } catch (err) { @@ -1221,7 +1221,7 @@ try { - var date = parseISO8601Date(review.Date, { toLocal: true }).toLocaleDateString(); + var date = datetime.parseISO8601Date(review.Date, true).toLocaleDateString(); html += '' + date + ''; } diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index a27edbf70..ff9701e48 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1916,7 +1916,7 @@ if (item.StartDate) { try { - dateText = LibraryBrowser.getFutureDateText(parseISO8601Date(item.StartDate, { toLocal: true }), true); + dateText = LibraryBrowser.getFutureDateText(datetime.parseISO8601Date(item.StartDate, true), true); } catch (err) { } @@ -2426,7 +2426,7 @@ if (options.showProgramAirInfo) { - var date = parseISO8601Date(item.StartDate, { toLocal: true }); + var date = datetime.parseISO8601Date(item.StartDate, true); var text = item.StartDate ? date.toLocaleString() : @@ -2614,7 +2614,7 @@ if (item.Type == 'Episode') { try { - var date = parseISO8601Date(item.PremiereDate, { toLocal: true }); + var date = datetime.parseISO8601Date(item.PremiereDate, true); if (item.PremiereDate && (new Date().getTime() < date.getTime())) { return '
' + Globalize.translate('HeaderUnaired') + '
'; @@ -3442,7 +3442,7 @@ if (item.PremiereDate) { try { - date = parseISO8601Date(item.PremiereDate, { toLocal: true }); + date = datetime.parseISO8601Date(item.PremiereDate, true); text = date.toLocaleDateString(); miscInfo.push(text); @@ -3456,7 +3456,7 @@ if (item.StartDate) { try { - date = parseISO8601Date(item.StartDate, { toLocal: true }); + date = datetime.parseISO8601Date(item.StartDate, true); text = date.toLocaleDateString(); miscInfo.push(text); @@ -3485,10 +3485,10 @@ try { - var endYear = parseISO8601Date(item.EndDate, { toLocal: true }).getFullYear(); + var endYear = datetime.parseISO8601Date(item.EndDate, true).getFullYear(); if (endYear != item.ProductionYear) { - text += "-" + parseISO8601Date(item.EndDate, { toLocal: true }).getFullYear(); + text += "-" + datetime.parseISO8601Date(item.EndDate, true).getFullYear(); } } @@ -3510,7 +3510,7 @@ else if (item.PremiereDate) { try { - text = parseISO8601Date(item.PremiereDate, { toLocal: true }).getFullYear(); + text = datetime.parseISO8601Date(item.PremiereDate, true).getFullYear(); miscInfo.push(text); } catch (e) { @@ -3678,7 +3678,7 @@ if (item.PremiereDate) { try { - var date = parseISO8601Date(item.PremiereDate, { toLocal: true }); + var date = datetime.parseISO8601Date(item.PremiereDate, true); var translationKey = new Date().getTime() > date.getTime() ? "ValuePremiered" : "ValuePremieres"; diff --git a/dashboard-ui/scripts/livetvchannel.js b/dashboard-ui/scripts/livetvchannel.js index 1e6800b1b..c957798fb 100644 --- a/dashboard-ui/scripts/livetvchannel.js +++ b/dashboard-ui/scripts/livetvchannel.js @@ -1,4 +1,4 @@ -define(['datetime'], function (datetime) { +define(['datetime', 'tvguide'], function (datetime) { function renderPrograms(page, result) { @@ -12,10 +12,10 @@ var program = result.Items[i]; - var startDate = parseISO8601Date(program.StartDate, { toLocal: true }); + var startDate = datetime.parseISO8601Date(program.StartDate, true); var startDateText = LibraryBrowser.getFutureDateText(startDate); - var endDate = parseISO8601Date(program.EndDate, { toLocal: true }); + var endDate = datetime.parseISO8601Date(program.EndDate, true); if (startDateText != currentIndexValue) { diff --git a/dashboard-ui/scripts/livetvcomponents.js b/dashboard-ui/scripts/livetvcomponents.js index 51a39a975..7224c3f01 100644 --- a/dashboard-ui/scripts/livetvcomponents.js +++ b/dashboard-ui/scripts/livetvcomponents.js @@ -13,7 +13,7 @@ var timer = timers[i]; - var startDateText = LibraryBrowser.getFutureDateText(parseISO8601Date(timer.StartDate, { toLocal: true })); + var startDateText = LibraryBrowser.getFutureDateText(datetime.parseISO8601Date(timer.StartDate, true)); if (startDateText != index) { @@ -130,7 +130,7 @@ if (airDate && item.IsRepeat) { try { - airDate = parseISO8601Date(airDate, { toLocal: true }).toLocaleDateString(); + airDate = datetime.parseISO8601Date(airDate, true).toLocaleDateString(); } catch (e) { console.log("Error parsing date: " + airDate); diff --git a/dashboard-ui/scripts/logpage.js b/dashboard-ui/scripts/logpage.js index 2e71e14ae..014b2eb6a 100644 --- a/dashboard-ui/scripts/logpage.js +++ b/dashboard-ui/scripts/logpage.js @@ -61,7 +61,7 @@ logHtml += "
" + log.Name + "
"; - var date = parseISO8601Date(log.DateModified, { toLocal: true }); + var date = datetime.parseISO8601Date(log.DateModified, true); var text = date.toLocaleDateString(); diff --git a/dashboard-ui/scripts/serversecurity.js b/dashboard-ui/scripts/serversecurity.js index 3b39c2b59..0cf184ecc 100644 --- a/dashboard-ui/scripts/serversecurity.js +++ b/dashboard-ui/scripts/serversecurity.js @@ -59,7 +59,7 @@ html += ''; - var date = parseISO8601Date(item.DateCreated, { toLocal: true }); + var date = datetime.parseISO8601Date(item.DateCreated, true); html += datetime.toLocaleDateString(date) + ' ' + datetime.getDisplayTime(date); diff --git a/dashboard-ui/scripts/syncjob.js b/dashboard-ui/scripts/syncjob.js index 5f10d02ac..27deace63 100644 --- a/dashboard-ui/scripts/syncjob.js +++ b/dashboard-ui/scripts/syncjob.js @@ -1,11 +1,11 @@ -define(['jQuery', 'paper-progress', 'paper-fab', 'paper-item-body', 'paper-icon-item', 'paper-icon-button', 'paper-button'], function ($) { +define(['jQuery', 'datetime', 'paper-progress', 'paper-fab', 'paper-item-body', 'paper-icon-item', 'paper-icon-button', 'paper-button'], function ($, datetime) { function renderJob(page, job, dialogOptions) { var html = ''; html += '
'; - html += Globalize.translate('ValueDateCreated', parseISO8601Date(job.DateCreated, { toLocal: true }).toLocaleString()); + html += Globalize.translate('ValueDateCreated', datetime.parseISO8601Date(job.DateCreated, true).toLocaleString()); html += '
'; html += '
'; html += '
'; diff --git a/dashboard-ui/scripts/tvupcoming.js b/dashboard-ui/scripts/tvupcoming.js index 34dc8ea08..c6ce40c3d 100644 --- a/dashboard-ui/scripts/tvupcoming.js +++ b/dashboard-ui/scripts/tvupcoming.js @@ -1,4 +1,4 @@ -define(['scrollStyles'], function () { +define(['datetime', 'scrollStyles'], function (datetime) { function loadUpcoming(context, params) { @@ -62,7 +62,7 @@ if (item.PremiereDate) { try { - var premiereDate = parseISO8601Date(item.PremiereDate, { toLocal: true }); + var premiereDate = datetime.parseISO8601Date(item.PremiereDate, true); if (premiereDate.getDate() == new Date().getDate() - 1) { dateText = Globalize.translate('Yesterday'); From 9b355ec012f92216f2aa997e8cc81a79e3eecf14 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 6 May 2016 01:13:29 -0400 Subject: [PATCH 11/11] update channel styles --- dashboard-ui/css/card.css | 13 ++++--------- dashboard-ui/livetv.html | 2 +- dashboard-ui/scripts/librarybrowser.js | 9 +++++++++ dashboard-ui/scripts/livetvchannels.js | 8 ++++++-- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/dashboard-ui/css/card.css b/dashboard-ui/css/card.css index ef342a838..829d3a61f 100644 --- a/dashboard-ui/css/card.css +++ b/dashboard-ui/css/card.css @@ -58,14 +58,6 @@ iron-list .card { border-radius: 3px; } -.defaultBackground .cardImage { - background-color: #303030; -} - -.homeTopViews .defaultBackground .cardImage { - background-color: #181818; -} - .cardOverlayButtonContainer { position: absolute; bottom: 0; @@ -109,10 +101,13 @@ iron-list .card { } .ui-body-b .visualCardBox { - background: rgba(56,56,56,.85); border-radius: 3px; } +.defaultBackground .cardImage, .ui-body-b .visualCardBox { + background-color: #262626; +} + .cardScalable { position: relative; } diff --git a/dashboard-ui/livetv.html b/dashboard-ui/livetv.html index 9f463d264..982b40302 100644 --- a/dashboard-ui/livetv.html +++ b/dashboard-ui/livetv.html @@ -63,7 +63,7 @@
-
+
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index ff9701e48..a0da6e86e 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -2412,6 +2412,15 @@ lines.push(item.ProductionYear || ''); } + if (item.Type == 'TvChannel') { + + if (item.CurrentProgram) { + lines.push(LibraryBrowser.getPosterViewDisplayName(item.CurrentProgram)); + } else { + lines.push(''); + } + } + if (options.showSeriesYear) { if (item.Status == "Continuing") { diff --git a/dashboard-ui/scripts/livetvchannels.js b/dashboard-ui/scripts/livetvchannels.js index 3b759c75d..54dac8105 100644 --- a/dashboard-ui/scripts/livetvchannels.js +++ b/dashboard-ui/scripts/livetvchannels.js @@ -35,9 +35,13 @@ function getChannelsHtml(channels) { - return LibraryBrowser.getListViewHtml({ + return LibraryBrowser.getPosterViewHtml({ items: channels, - smallIcon: true + shape: "square", + showTitle: true, + lazy: true, + cardLayout: true, + showDetailsMenu: true }); }