From bbb9e890630ed7f6b2b1c36487342a0cf3e52910 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 16 Sep 2016 02:32:40 -0400 Subject: [PATCH] update datetime --- .../emby-webcomponents/.bower.json | 8 +-- .../browserdeviceprofile.js | 2 +- .../cardbuilder/cardbuilder.js | 29 ++-------- .../emby-webcomponents/datetime.js | 53 +++++-------------- .../emby-checkbox/emby-checkbox.css | 19 +++++-- .../emby-webcomponents/formdialog.css | 2 +- .../emby-webcomponents/guide/guide.js | 9 +--- .../emby-webcomponents/mediainfo/mediainfo.js | 2 +- .../recordingcreator/recordingcreator.js | 19 ++----- .../recordingcreator.template.html | 16 +++--- .../emby-webcomponents/strings/en-US.json | 7 +-- .../subtitleeditor.template.html | 4 +- 12 files changed, 57 insertions(+), 113 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index d35324c496..999858ca61 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -14,12 +14,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.4.248", - "_release": "1.4.248", + "version": "1.4.250", + "_release": "1.4.250", "_resolution": { "type": "version", - "tag": "1.4.248", - "commit": "099ebb1e4d7df48d6dbf182985a565b83b17cea7" + "tag": "1.4.250", + "commit": "64a7a8d4d23fff00807f047f1019e27886b2a928" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.1", diff --git a/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js b/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js index 770871b274..855dffddae 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js +++ b/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js @@ -199,7 +199,7 @@ define(['browser'], function (browser) { function getMaxBitrate() { if (browser.edgeUwp) { - return 20000000; + return 22000000; } // 10mbps diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js index 2bea7eb583..ac2e9edc10 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js @@ -233,7 +233,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (item.PremiereDate) { try { - newIndexValue = getDisplayDateText(datetime.parseISO8601Date(item.PremiereDate)); + newIndexValue = datetime.toLocaleDateString(datetime.parseISO8601Date(item.PremiereDate), { weekday: 'long', month: 'long', day: 'numeric' }); } catch (err) { } @@ -408,27 +408,6 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo return html; } - function getDisplayDateText(date) { - - var weekday = []; - weekday[0] = globalize.translate('sharedcomponents#Sunday'); - weekday[1] = globalize.translate('sharedcomponents#Monday'); - weekday[2] = globalize.translate('sharedcomponents#Tuesday'); - weekday[3] = globalize.translate('sharedcomponents#Wednesday'); - weekday[4] = globalize.translate('sharedcomponents#Thursday'); - weekday[5] = globalize.translate('sharedcomponents#Friday'); - weekday[6] = globalize.translate('sharedcomponents#Saturday'); - - var day = weekday[date.getDay()]; - date = date.toLocaleDateString(); - - if (date.toLowerCase().indexOf(day.toLowerCase()) == -1) { - return day + " " + date; - } - - return date; - } - function getDesiredAspect(shape) { if (shape) { @@ -818,9 +797,9 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo try { var date = datetime.parseISO8601Date(item.StartDate); - airTimeText = date.toLocaleDateString(); + airTimeText = datetime.toLocaleDateString(date, { weekday: 'short', month: 'short', day: 'numeric' }); - airTimeText += ', ' + datetime.getDisplayTime(date); + airTimeText += ' ' + datetime.getDisplayTime(date); if (item.EndDate) { date = datetime.parseISO8601Date(item.EndDate); @@ -861,7 +840,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var text; if (item.StartDate) { var startDate = datetime.parseISO8601Date(item.StartDate, true); - text = datetime.toLocaleDateString(startDate) + ', ' + datetime.getDisplayTime(startDate); + text = datetime.toLocaleDateString(startDate, { weekday: 'short', month: 'short', day: 'numeric' }) + ' ' + datetime.getDisplayTime(startDate); } else { text = ''; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/datetime.js b/dashboard-ui/bower_components/emby-webcomponents/datetime.js index 0a61ecfe34..52f9038e3a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/datetime.js +++ b/dashboard-ui/bower_components/emby-webcomponents/datetime.js @@ -109,59 +109,29 @@ return locale; } - function toLocaleString(date) { + function toLocaleString(date, options) { var currentLocale = getCurrentLocale(); return currentLocale && toLocaleTimeStringSupportsLocales ? - date.toLocaleString(currentLocale) : + date.toLocaleString(currentLocale, options || {}) : date.toLocaleString(); } - function getLocaleDateStringParts(date) { - - var day = getDayName(date); - date = toLocaleDateString(date); - - var parts = []; - - if (date.toLowerCase().indexOf(day.toLowerCase()) == -1) { - parts.push(day); - } - - parts.push(date); - - return parts; - } - - function getDayName(date) { - - var weekday = []; - weekday[0] = globalize.translate('sharedcomponents#Sunday'); - weekday[1] = globalize.translate('sharedcomponents#Monday'); - weekday[2] = globalize.translate('sharedcomponents#Tuesday'); - weekday[3] = globalize.translate('sharedcomponents#Wednesday'); - weekday[4] = globalize.translate('sharedcomponents#Thursday'); - weekday[5] = globalize.translate('sharedcomponents#Friday'); - weekday[6] = globalize.translate('sharedcomponents#Saturday'); - - return weekday[date.getDay()]; - } - - function toLocaleDateString(date) { + function toLocaleDateString(date, options) { var currentLocale = getCurrentLocale(); return currentLocale && toLocaleTimeStringSupportsLocales ? - date.toLocaleDateString(currentLocale) : + date.toLocaleDateString(currentLocale, options || {}) : date.toLocaleDateString(); } - function toLocaleTimeString(date) { + function toLocaleTimeString(date, options) { var currentLocale = getCurrentLocale(); return currentLocale && toLocaleTimeStringSupportsLocales ? - date.toLocaleTimeString(currentLocale) : + date.toLocaleTimeString(currentLocale, options || {}) : date.toLocaleTimeString(); } @@ -194,7 +164,13 @@ if (minutes < 10) { minutes = '0' + minutes; } - time = hour + ':' + minutes + suffix; + + if (minutes == '00') { + minutes = ''; + } else { + minutes = ':' + minutes; + } + time = hour + minutes + suffix; } else { var timeParts = time.split(':'); @@ -224,7 +200,6 @@ toLocaleDateString: toLocaleDateString, toLocaleString: toLocaleString, getDisplayTime: getDisplayTime, - isRelativeDay: isRelativeDay, - getLocaleDateStringParts: getLocaleDateStringParts + isRelativeDay: isRelativeDay }; }); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.css b/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.css index 5ec9a2be18..eeee0573a6 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.css +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-checkbox/emby-checkbox.css @@ -2,7 +2,7 @@ position: relative; z-index: 1; vertical-align: middle; - display: inline-flex; + display: inline-block; box-sizing: border-box; width: 100%; margin: 0; @@ -18,7 +18,18 @@ .checkboxContainer { margin-bottom: 1.8em; - display: flex; + display: block; +} + +@supports (display: flex) { + + .mdl-checkbox { + display: inline-flex; + } + + .checkboxContainer { + display: flex; + } } .checkboxContainer-withDescription { @@ -113,7 +124,7 @@ cursor: auto; } -.checkboxList .mdl-checkbox { +.checkboxList > .mdl-checkbox { display: flex; margin: .5em 0; } @@ -124,4 +135,4 @@ .checkboxListLabel { opacity: .7; -} \ No newline at end of file +} diff --git a/dashboard-ui/bower_components/emby-webcomponents/formdialog.css b/dashboard-ui/bower_components/emby-webcomponents/formdialog.css index ca95cd7e6b..cae3b85055 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/formdialog.css +++ b/dashboard-ui/bower_components/emby-webcomponents/formdialog.css @@ -49,7 +49,7 @@ left: 0; right: 0; display: flex; - padding: 1.25em; + padding: 1.25em 1em; /* Without this emby-checkbox is able to appear on top */ z-index: 1; align-items: center; diff --git a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js index 2969522208..b0bfd2b63e 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js +++ b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js @@ -639,13 +639,8 @@ reloadGuide(page, newStartDate); - var dateText = datetime.getLocaleDateStringParts(date); + var dateText = datetime.toLocaleDateString(date, { weekday: 'short', month: 'short', day: 'numeric' }); - if (dateText.length == 1) { - dateText = dateText[0]; - } else { - dateText = '
' + dateText[0] + '
' + dateText[1] + '
'; - } page.querySelector('.guideDateText').innerHTML = dateText; } @@ -673,7 +668,7 @@ while (start <= end) { dateOptions.push({ - name: datetime.getLocaleDateStringParts(start).join(' '), + name: datetime.toLocaleDateString(start, { weekday: 'long', month: 'long', day: 'numeric' }), id: start.getTime() }); diff --git a/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js b/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js index e2d80dbe58..af402f4112 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js +++ b/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js @@ -11,7 +11,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', ' try { date = datetime.parseISO8601Date(item.StartDate); - text = datetime.toLocaleDateString(date); + text = datetime.toLocaleDateString(date, { weekday: 'short', month: 'short', day: 'numeric' }); text += ' ' + datetime.getDisplayTime(date); diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.js b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.js index 62c048ecc1..b5f5d570c5 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.js +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.js @@ -27,13 +27,6 @@ var apiClient = connectionManager.getApiClient(currentServerId); - apiClient.getNamedConfiguration("livetv").then(function (config) { - - config.EnableRecordingEncoding = form.querySelector('#chkConvertRecordings').checked; - - apiClient.updateNamedConfiguration("livetv", config); - }); - apiClient.getNewLiveTvTimerDefaults({ programId: currentProgramId }).then(function (item) { item.RecordNewOnly = form.querySelector('#chkNewOnly').checked; @@ -218,11 +211,6 @@ supporterButtons[i].classList.add('hide'); } } - - apiClient.getNamedConfiguration("livetv").then(function (config) { - - context.querySelector('#chkConvertRecordings').checked = config.EnableRecordingEncoding; - }); } function getImageUrl(item, apiClient, imageHeight) { @@ -293,7 +281,6 @@ context.querySelector('#eligibleForSeriesFields').classList.add('hide'); } - context.querySelector('.convertRecordingsContainer').classList.remove('hide'); showConvertRecordingsUnlockMessage(context, apiClient); loading.hide(); @@ -304,14 +291,14 @@ apiClient.getPluginSecurityInfo().then(function (regInfo) { if (regInfo.IsMBSupporter) { - context.querySelector('.btnSupporterForConverting').classList.add('hide'); + context.querySelector('.convertRecordingsContainer').classList.add('hide'); } else { - context.querySelector('.btnSupporterForConverting').classList.remove('hide'); + context.querySelector('.convertRecordingsContainer').classList.remove('hide'); } }, function () { - context.querySelector('.btnSupporterForConverting').classList.remove('hide'); + context.querySelector('.convertRecordingsContainer').classList.remove('hide'); }); } diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html index df93007593..6dc41232b0 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.template.html @@ -43,15 +43,13 @@
-
- -
${OptionConvertRecordingsToStreamingFormatHelp}
- +
+

${HeaderConvertYourRecordings}

+
${PromoConvertRecordingsToStreamingFormat}
+
+

diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json index 098760ca22..4f05a0d237 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json @@ -46,9 +46,9 @@ "RecordOnlyNewEpisodes": "Record only new episodes", "HeaderBecomeProjectSupporter": "Get Emby Premiere", "MessageActiveSubscriptionRequiredSeriesRecordings": "An active Emby Premiere subscription is required in order to create automated series recordings.", - "OptionConvertRecordingsToStreamingFormat": "Automatically convert recordings to a streaming friendly format", - "OptionConvertRecordingsToStreamingFormatHelp": "Recordings will be converted on the fly to MP4 or MKV, based on Emby server settings.", + "PromoConvertRecordingsToStreamingFormat": "Automatically convert recordings to a streaming friendly format with Emby Premiere. Recordings will be converted on the fly to MP4 or MKV, based on Emby server settings.", "FeatureRequiresEmbyPremiere": "This feature requires an active Emby Premiere subscription.", + "HeaderConvertYourRecordings": "Convert Your Recordings", "Record": "Record", "Save": "Save", "Edit": "Edit", @@ -284,5 +284,6 @@ "Premieres": "Premieres", "RepeatEpisodes": "Repeat episodes", "DvrSubscriptionRequired": "Emby DVR requires an active Emby Premiere subscription.", - "HeaderCancelRecording": "Cancel Recording" + "HeaderCancelRecording": "Cancel Recording", + "HeaderLearnMore": "Learn More" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.template.html b/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.template.html index 76c93f9ea8..12a7eeaa0c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.template.html +++ b/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.template.html @@ -15,9 +15,7 @@
- +