Merge pull request #1712 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-05-06 14:55:00 -04:00
commit 3123f57b28
30 changed files with 312 additions and 316 deletions

View file

@ -16,12 +16,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.1.54", "version": "1.1.55",
"_release": "1.1.54", "_release": "1.1.55",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.1.54", "tag": "1.1.55",
"commit": "80b29ca19f79c58f1b9e7f105c5b637761a9c5f9" "commit": "c985db6d4a2c6013dcb3bcb200532144a909732c"
}, },
"_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git", "_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
"_target": "^1.1.51", "_target": "^1.1.51",

View file

@ -215,7 +215,7 @@
return connectUser; return connectUser;
}; };
var minServerVersion = '3.0.5785'; var minServerVersion = '3.0.5818';
self.minServerVersion = function (val) { self.minServerVersion = function (val) {
if (val) { if (val) {

View file

@ -16,12 +16,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.2.61", "version": "1.2.65",
"_release": "1.2.61", "_release": "1.2.65",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.2.61", "tag": "1.2.65",
"commit": "d28f24510d524454f235f9f83979639e8b0913d6" "commit": "882a508b902015305d2058b236131c53f95f320a"
}, },
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.0", "_target": "^1.2.0",

View file

@ -61,8 +61,8 @@
} }
.layout-tv .actionSheetMenuItem { .layout-tv .actionSheetMenuItem {
padding-top: .6em; padding-top: .2em;
padding-bottom: .6em; padding-bottom: .2em;
} }
.actionSheetItemIcon { .actionSheetItemIcon {

View file

@ -1,4 +1,11 @@
define(['dialogHelper', 'layoutManager', 'dialogText', 'html!./../prompt/icons.html', 'css!./../prompt/style.css', 'paper-button', 'paper-input'], function (dialogHelper, layoutManager, dialogText) { define(['dialogHelper', 'layoutManager', 'dialogText', 'html!./../prompt/icons.html', 'css!./../prompt/style.css', 'paper-button', 'paper-icon-button-light', 'paper-input'], function (dialogHelper, layoutManager, dialogText) {
function getIcon(icon, cssClass, canFocus, autoFocus) {
var tabIndex = canFocus ? '' : ' tabindex="-1"';
autoFocus = autoFocus ? ' autofocus' : '';
return '<button is="paper-icon-button-light" class="' + cssClass + '"' + tabIndex + autoFocus + '><iron-icon icon="' + icon + '"></iron-icon></button>';
}
return function (options) { return function (options) {
@ -37,7 +44,7 @@ define(['dialogHelper', 'layoutManager', 'dialogText', 'html!./../prompt/icons.h
html += '<div class="promptDialogContent">'; html += '<div class="promptDialogContent">';
if (backButton) { if (backButton) {
html += '<paper-icon-button tabindex="-1" icon="dialog:arrow-back" class="btnPromptExit"></paper-icon-button>'; html += getIcon('dialog:arrow-back', 'btnPromptExit', false);
} }
if (options.title) { if (options.title) {

View file

@ -134,6 +134,7 @@
if (timeLower.indexOf('am') != -1 || timeLower.indexOf('pm') != -1) { if (timeLower.indexOf('am') != -1 || timeLower.indexOf('pm') != -1) {
time = timeLower;
var hour = date.getHours() % 12; var hour = date.getHours() % 12;
var suffix = date.getHours() > 11 ? 'pm' : 'am'; var suffix = date.getHours() > 11 ? 'pm' : 'am';
if (!hour) { if (!hour) {

View file

@ -1,4 +1,4 @@
define(['browser', 'appSettings'], function (browser, appSettings) { define(['browser', 'appSettings', 'events'], function (browser, appSettings, events) {
function setLayout(self, layout, selectedLayout) { function setLayout(self, layout, selectedLayout) {
@ -32,6 +32,8 @@ define(['browser', 'appSettings'], function (browser, appSettings) {
appSettings.set('layout', layout); appSettings.set('layout', layout);
} }
} }
events.trigger(self, 'modechange');
}; };
self.getSavedLayout = function (layout) { self.getSavedLayout = function (layout) {

View file

@ -1,4 +1,11 @@
define(['dialogHelper', 'layoutManager', 'dialogText', 'html!./icons.html', 'css!./style.css', 'paper-button', 'paper-input'], function (dialogHelper, layoutManager, dialogText) { define(['dialogHelper', 'layoutManager', 'dialogText', 'html!./icons.html', 'css!./style.css', 'paper-button', 'paper-icon-button-light', 'paper-input'], function (dialogHelper, layoutManager, dialogText) {
function getIcon(icon, cssClass, canFocus, autoFocus) {
var tabIndex = canFocus ? '' : ' tabindex="-1"';
autoFocus = autoFocus ? ' autofocus' : '';
return '<button is="paper-icon-button-light" class="' + cssClass + '"' + tabIndex + autoFocus + '><iron-icon icon="' + icon + '"></iron-icon></button>';
}
return function (options) { return function (options) {
@ -36,7 +43,7 @@ define(['dialogHelper', 'layoutManager', 'dialogText', 'html!./icons.html', 'css
html += '<div class="promptDialogContent">'; html += '<div class="promptDialogContent">';
if (backButton) { if (backButton) {
html += '<paper-icon-button tabindex="-1" icon="dialog:arrow-back" class="btnPromptExit"></paper-icon-button>'; html += getIcon('dialog:arrow-back', 'btnPromptExit', false);
} }
if (options.title) { if (options.title) {

View file

@ -1,4 +1,4 @@
define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'focusManager', 'apphost', 'css!./style', 'html!./icons', 'iron-icon-set', 'paper-icon-button', 'paper-spinner'], function (dialogHelper, inputmanager, connectionManager, layoutManager, focusManager, appHost) { define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'focusManager', 'apphost', 'css!./style', 'html!./icons', 'iron-icon-set', 'paper-icon-button-light', 'paper-spinner'], function (dialogHelper, inputmanager, connectionManager, layoutManager, focusManager, appHost) {
function getImageUrl(item, options, apiClient) { function getImageUrl(item, options, apiClient) {
@ -96,6 +96,13 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
} }
} }
function getIcon(icon, cssClass, canFocus, autoFocus) {
var tabIndex = canFocus ? '' : ' tabindex="-1"';
autoFocus = autoFocus ? ' autofocus' : '';
return '<button is="paper-icon-button-light" class="' + cssClass + '"' + tabIndex + autoFocus + '><iron-icon icon="' + icon + '"></iron-icon></button>';
}
return function (options) { return function (options) {
var self = this; var self = this;
@ -125,31 +132,30 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
html += '<div>'; html += '<div>';
html += '<div class="slideshowSwiperContainer"><div class="swiper-wrapper"></div></div>'; html += '<div class="slideshowSwiperContainer"><div class="swiper-wrapper"></div></div>';
html += '<paper-icon-button icon="slideshow:keyboard-arrow-left" class="btnSlideshowPrevious slideshowButton" tabindex="-1"></paper-icon-button>'; html += getIcon('slideshow:keyboard-arrow-left', 'btnSlideshowPrevious slideshowButton', false);
html += '<paper-icon-button icon="slideshow:keyboard-arrow-right" class="btnSlideshowNext slideshowButton" tabindex="-1"></paper-icon-button>'; html += getIcon('slideshow:keyboard-arrow-right', 'btnSlideshowNext slideshowButton', false);
html += '<div class="topActionButtons">'; html += '<div class="topActionButtons">';
if (actionButtonsOnTop) { if (actionButtonsOnTop) {
if (appHost.supports('filedownload')) { if (appHost.supports('filedownload')) {
html += '<paper-icon-button icon="slideshow:file-download" class="btnDownload slideshowButton"></paper-icon-button>'; html += getIcon('slideshow:file-download', 'btnDownload slideshowButton', true);
} }
if (appHost.supports('sharing')) { if (appHost.supports('sharing')) {
html += '<paper-icon-button icon="slideshow:share" class="btnShare slideshowButton"></paper-icon-button>'; html += getIcon('slideshow:share', 'btnShare slideshowButton', true);
} }
} }
html += '<paper-icon-button icon="slideshow:close" class="btnSlideshowExit" tabindex="-1"></paper-icon-button>'; html += getIcon('slideshow:close', 'slideshowButton btnSlideshowExit', false);
html += '</div>'; html += '</div>';
if (!actionButtonsOnTop) { if (!actionButtonsOnTop) {
html += '<div class="slideshowBottomBar hide">'; html += '<div class="slideshowBottomBar hide">';
//html += '<paper-icon-button icon="slideshow:share" class="btnShare slideshowButton"></paper-icon-button>'; html += getIcon('slideshow:pause', 'btnSlideshowPause slideshowButton', true, true);
html += '<paper-icon-button icon="slideshow:pause" class="btnSlideshowPause slideshowButton" autoFocus></paper-icon-button>';
if (appHost.supports('filedownload')) { if (appHost.supports('filedownload')) {
html += '<paper-icon-button icon="slideshow:file-download" class="btnDownload slideshowButton"></paper-icon-button>'; html += getIcon('slideshow:file-download', 'btnDownload slideshowButton', true);
} }
if (appHost.supports('sharing')) { if (appHost.supports('sharing')) {
html += '<paper-icon-button icon="slideshow:share" class="btnShare slideshowButton"></paper-icon-button>'; html += getIcon('slideshow:share', 'btnShare slideshowButton', true);
} }
html += '</div>'; html += '</div>';
@ -361,7 +367,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
function play() { function play() {
var btnSlideshowPause = dlg.querySelector('.btnSlideshowPause'); var btnSlideshowPause = dlg.querySelector('.btnSlideshowPause iron-icon');
if (btnSlideshowPause) { if (btnSlideshowPause) {
btnSlideshowPause.icon = "slideshow:pause"; btnSlideshowPause.icon = "slideshow:pause";
} }
@ -371,7 +377,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
function pause() { function pause() {
var btnSlideshowPause = dlg.querySelector('.btnSlideshowPause'); var btnSlideshowPause = dlg.querySelector('.btnSlideshowPause iron-icon');
if (btnSlideshowPause) { if (btnSlideshowPause) {
btnSlideshowPause.icon = "slideshow:play-arrow"; btnSlideshowPause.icon = "slideshow:play-arrow";
} }
@ -381,7 +387,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
function playPause() { function playPause() {
var paused = dlg.querySelector('.btnSlideshowPause').icon != "slideshow:pause"; var paused = dlg.querySelector('.btnSlideshowPause iron-icon').icon != "slideshow:pause";
if (paused) { if (paused) {
play(); play();
} else { } else {

View file

@ -45,7 +45,7 @@
top: 50%; top: 50%;
} }
.slideshowDialog paper-icon-button { .slideshowDialog .slideshowButton {
width: 5.2vh; width: 5.2vh;
height: 5.2vh; height: 5.2vh;
color: #fff; color: #fff;
@ -54,7 +54,7 @@
min-height: 40px; min-height: 40px;
} }
.layout-tv .slideshowDialog paper-icon-button { .layout-tv .slideshowDialog .slideshowButtonn {
width: 7vh; width: 7vh;
height: 7vh; height: 7vh;
} }

View file

@ -32,14 +32,14 @@
"web-component-tester": "^4.0.0", "web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"homepage": "https://github.com/PolymerElements/iron-icon", "homepage": "https://github.com/polymerelements/iron-icon",
"_release": "1.0.8", "_release": "1.0.8",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.8", "tag": "v1.0.8",
"commit": "f36b38928849ef3853db727faa8c9ef104d611eb" "commit": "f36b38928849ef3853db727faa8c9ef104d611eb"
}, },
"_source": "git://github.com/PolymerElements/iron-icon.git", "_source": "git://github.com/polymerelements/iron-icon.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-icon" "_originalSource": "polymerelements/iron-icon"
} }

View file

@ -36,7 +36,7 @@
"tag": "v1.5.1", "tag": "v1.5.1",
"commit": "e3e34408fad8f7cde59c4255cf3fe90f7dcf91d8" "commit": "e3e34408fad8f7cde59c4255cf3fe90f7dcf91d8"
}, },
"_source": "git://github.com/polymerelements/iron-selector.git", "_source": "git://github.com/PolymerElements/iron-selector.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "polymerelements/iron-selector" "_originalSource": "PolymerElements/iron-selector"
} }

View file

@ -34,6 +34,6 @@
"commit": "11c987b2eb3c73b388a79fc8aaea8ca01624f514" "commit": "11c987b2eb3c73b388a79fc8aaea8ca01624f514"
}, },
"_source": "git://github.com/Polymer/polymer.git", "_source": "git://github.com/Polymer/polymer.git",
"_target": "^1.1.0", "_target": "^1.0.0",
"_originalSource": "Polymer/polymer" "_originalSource": "Polymer/polymer"
} }

View file

@ -1,4 +1,4 @@
define(['dialogHelper', 'datetime', 'jQuery', 'paper-checkbox', 'paper-input', 'paper-item-body', 'paper-icon-item', 'paper-textarea', 'paper-fab'], function (dialogHelper, $, datetime) { define(['dialogHelper', 'datetime', 'jQuery', 'paper-checkbox', 'paper-input', 'paper-item-body', 'paper-icon-item', 'paper-textarea', 'paper-fab'], function (dialogHelper, datetime, $) {
var currentContext; var currentContext;
var metadataEditorInfo; var metadataEditorInfo;

View file

@ -210,7 +210,7 @@
} }
.dashboardDocument .viewMenuBar { .dashboardDocument .viewMenuBar {
background-color: #43A047; background-color: #222;
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12); box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
height: auto; height: auto;
} }
@ -224,7 +224,6 @@
} }
.dashboardDocument .viewMenuBar #selectionBar { .dashboardDocument .viewMenuBar #selectionBar {
background: #fff !important;
height: 3px; height: 3px;
} }

View file

@ -11,7 +11,7 @@
font-weight: 500; font-weight: 500;
position: relative; position: relative;
border-radius: 1000px; border-radius: 1000px;
background: #2E7D32; background: #444;
line-height: 28px; line-height: 28px;
min-width: 30px; min-width: 30px;
display: inline-flex; display: inline-flex;
@ -21,7 +21,7 @@
} }
.levelNormal { .levelNormal {
background-color: #444; background-color: #43A047;
} }
.levelWarning { .levelWarning {

View file

@ -0,0 +1,19 @@
[is=paper-icon-button-light] {
width: 40px;
height: 40px;
padding: .5em;
}
[is=paper-icon-button-light] iron-icon, [is=paper-icon-button-light] img {
width: 100%;
height: 100%;
}
[is=paper-icon-button-light] #background {
transition: opacity .3s ease-out;
}
[is=paper-icon-button-light]:focus #background {
background-color: currentcolor !important;
opacity: .2 !important;
}

View file

@ -489,7 +489,7 @@ div[data-role='page'] {
outline: none; outline: none;
} }
a[data-role='button'], button:not([data-role='none']):not(.clearButton) { a[data-role='button'], .type-interior button:not([data-role='none']):not(.clearButton) {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-webkit-user-select: none; -webkit-user-select: none;
background-clip: padding-box; background-clip: padding-box;
@ -512,24 +512,18 @@ a[data-role='button'], button:not([data-role='none']):not(.clearButton) {
box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.15) /*{global-box-shadow-color}*/; box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.15) /*{global-box-shadow-color}*/;
} }
a[data-role='button'][data-iconpos='notext'], button[data-iconpos='notext']:not([data-role='none']):not(.clearButton) { a[data-role='button'][data-iconpos='notext'], .type-interior button[data-iconpos='notext']:not([data-role='none']):not(.clearButton) {
padding: 4px; padding: 4px;
border-radius: 50px; border-radius: 50px;
outline: 0; outline: 0;
} }
a[data-role='button']:not([data-inline='true']), button:not([data-role='none']):not([data-inline='true']):not(.clearButton) { a[data-role='button']:not([data-inline='true']), .type-interior button:not([data-role='none']):not([data-inline='true']):not(.clearButton) {
display: block; display: block;
margin: .5em 0 !important; margin: .5em 0 !important;
} }
a[data-role='button']:focus, button:not([data-role='none']):focus { .type-interior button:not([data-role='none']):not([data-inline='true']):not(.clearButton) {
-webkit-box-shadow: 0 0 12px #3388cc /*{a-active-background-color}*/;
-moz-box-shadow: 0 0 12px #3388cc /*{a-active-background-color}*/;
box-shadow: 0 0 12px #3388cc /*{a-active-background-color}*/;
}
button:not([data-role='none']):not([data-inline='true']):not(.clearButton) {
width: 100%; width: 100%;
} }

View file

@ -6,7 +6,6 @@
<paper-tab>${TabGuide}</paper-tab> <paper-tab>${TabGuide}</paper-tab>
<paper-tab>${TabChannels}</paper-tab> <paper-tab>${TabChannels}</paper-tab>
<paper-tab>${TabRecordings}</paper-tab> <paper-tab>${TabRecordings}</paper-tab>
<paper-tab>${TabScheduled}</paper-tab>
<paper-tab>${TabSeries}</paper-tab> <paper-tab>${TabSeries}</paper-tab>
</paper-tabs> </paper-tabs>
<div class="legacyTabs"> <div class="legacyTabs">
@ -14,8 +13,7 @@
<a href="livetv.html?tab=1">${TabGuide}</a> <a href="livetv.html?tab=1">${TabGuide}</a>
<a href="livetv.html?tab=2">${TabChannels}</a> <a href="livetv.html?tab=2">${TabChannels}</a>
<a href="livetv.html?tab=3">${TabRecordings}</a> <a href="livetv.html?tab=3">${TabRecordings}</a>
<a href="livetv.html?tab=4">${TabScheduled}</a> <a href="livetv.html?tab=4">${TabSeries}</a>
<a href="livetv.html?tab=5">${TabSeries}</a>
</div> </div>
</div> </div>
@ -79,6 +77,13 @@
<div class="recordingItems itemsContainer"></div> <div class="recordingItems itemsContainer"></div>
<br /> <br />
</div> </div>
<div id="upcomingRecordings" class="homePageSection hide">
<div>
<h1 class="listHeader" style="display: inline-block; vertical-align: middle;">${HeaderUpcomingRecordings}</h1>
</div>
<div class="recordingItems itemsContainer"></div>
<br />
</div>
<div id="recordingGroups" style="display: none;" class="homePageSection"> <div id="recordingGroups" style="display: none;" class="homePageSection">
<h1 class="listHeader"> <h1 class="listHeader">
<a href="livetvrecordinglist.html">${HeaderAllRecordings}<img src="css/images/rightarrow.png" class="headerArrowImage" /></a> <a href="livetvrecordinglist.html">${HeaderAllRecordings}<img src="css/images/rightarrow.png" class="headerArrowImage" /></a>
@ -86,11 +91,7 @@
<div id="recordingGroupItems"></div> <div id="recordingGroupItems"></div>
</div> </div>
</div> </div>
<div class="pageTabContent timersTabContent hide" data-index="4"> <div class="pageTabContent seriesTimersTabContent hide" data-index="4">
<div style="max-width: 700px; margin: 0 auto;" id="items">
</div>
</div>
<div class="pageTabContent seriesTimersTabContent hide" data-index="5">
<div style="max-width: 700px; margin: 0 auto;" id="items"> <div style="max-width: 700px; margin: 0 auto;" id="items">
</div> </div>
</div> </div>

View file

@ -456,6 +456,9 @@
canShare: function (item, user) { canShare: function (item, user) {
if (item.Type == 'Timer') {
return false;
}
return user.Policy.EnablePublicSharing; return user.Policy.EnablePublicSharing;
}, },
@ -721,7 +724,7 @@
supportsEditing: function (itemType) { supportsEditing: function (itemType) {
if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView") { if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView" || itemType == 'Timer') {
return false; return false;
} }
@ -756,8 +759,11 @@
if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual') { if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual') {
commands.push('editsubtitles'); commands.push('editsubtitles');
} }
if (item.Type != 'Timer') {
commands.push('editimages'); commands.push('editimages');
} }
}
if (user.Policy.IsAdministrator) { if (user.Policy.IsAdministrator) {
@ -1139,6 +1145,9 @@
return "itemdetails.html?id=" + id; return "itemdetails.html?id=" + id;
} }
if (item.Type == "Timer") {
return "livetvtimer.html?id=" + id;
}
if (item.Type == "BoxSet") { if (item.Type == "BoxSet") {
return "itemdetails.html?id=" + id; return "itemdetails.html?id=" + id;
} }
@ -1531,7 +1540,7 @@
}); });
} }
if (item.UserData.PlaybackPositionTicks) { if (item.UserData && item.UserData.PlaybackPositionTicks) {
atts.push({ atts.push({
name: 'positionticks', name: 'positionticks',
value: (item.UserData.PlaybackPositionTicks || 0) value: (item.UserData.PlaybackPositionTicks || 0)
@ -1594,7 +1603,7 @@
supportsAddingToCollection: function (item) { supportsAddingToCollection: function (item) {
var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'Episode', 'TvChannel', 'Program', 'MusicAlbum']; var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'Episode', 'TvChannel', 'Program', 'MusicAlbum', 'Timer'];
return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo'; return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
}, },
@ -1675,7 +1684,10 @@
if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual') { if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual') {
itemCommands.push('editsubtitles'); itemCommands.push('editsubtitles');
} }
if (item.Type != 'Timer') {
itemCommands.push('editimages'); itemCommands.push('editimages');
}
return itemCommands; return itemCommands;
}, },
@ -1969,17 +1981,18 @@
showTitle = true; showTitle = true;
} }
var coverImage = options.coverImage; var coverImage = options.coverImage;
var imageItem = item.Type == 'Timer' ? (item.ProgramInfo || item) : item;
if (options.autoThumb && item.ImageTags && item.ImageTags.Primary && item.PrimaryImageAspectRatio && item.PrimaryImageAspectRatio >= 1.34) { if (options.autoThumb && imageItem.ImageTags && imageItem.ImageTags.Primary && imageItem.PrimaryImageAspectRatio && imageItem.PrimaryImageAspectRatio >= 1.34) {
width = posterWidth; width = posterWidth;
height = primaryImageAspectRatio ? Math.round(posterWidth / primaryImageAspectRatio) : null; height = primaryImageAspectRatio ? Math.round(posterWidth / primaryImageAspectRatio) : null;
imgUrl = ApiClient.getImageUrl(item.Id, { imgUrl = ApiClient.getImageUrl(imageItem.Id, {
type: "Primary", type: "Primary",
maxHeight: height, maxHeight: height,
maxWidth: width, maxWidth: width,
tag: item.ImageTags.Primary, tag: imageItem.ImageTags.Primary,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
@ -1991,80 +2004,80 @@
} }
} }
} else if (options.autoThumb && item.ImageTags && item.ImageTags.Thumb) { } else if (options.autoThumb && imageItem.ImageTags && imageItem.ImageTags.Thumb) {
imgUrl = ApiClient.getScaledImageUrl(item.Id, { imgUrl = ApiClient.getScaledImageUrl(imageItem.Id, {
type: "Thumb", type: "Thumb",
maxWidth: thumbWidth, maxWidth: thumbWidth,
tag: item.ImageTags.Thumb, tag: imageItem.ImageTags.Thumb,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} else if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) { } else if (options.preferBackdrop && imageItem.BackdropImageTags && imageItem.BackdropImageTags.length) {
imgUrl = ApiClient.getScaledImageUrl(item.Id, { imgUrl = ApiClient.getScaledImageUrl(imageItem.Id, {
type: "Backdrop", type: "Backdrop",
maxWidth: thumbWidth, maxWidth: thumbWidth,
tag: item.BackdropImageTags[0], tag: imageItem.BackdropImageTags[0],
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} else if (options.preferThumb && item.ImageTags && item.ImageTags.Thumb) { } else if (options.preferThumb && imageItem.ImageTags && imageItem.ImageTags.Thumb) {
imgUrl = ApiClient.getScaledImageUrl(item.Id, { imgUrl = ApiClient.getScaledImageUrl(imageItem.Id, {
type: "Thumb", type: "Thumb",
maxWidth: thumbWidth, maxWidth: thumbWidth,
tag: item.ImageTags.Thumb, tag: imageItem.ImageTags.Thumb,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} else if (options.preferBanner && item.ImageTags && item.ImageTags.Banner) { } else if (options.preferBanner && imageItem.ImageTags && imageItem.ImageTags.Banner) {
imgUrl = ApiClient.getScaledImageUrl(item.Id, { imgUrl = ApiClient.getScaledImageUrl(imageItem.Id, {
type: "Banner", type: "Banner",
maxWidth: bannerWidth, maxWidth: bannerWidth,
tag: item.ImageTags.Banner, tag: imageItem.ImageTags.Banner,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} else if (options.preferThumb && item.SeriesThumbImageTag && options.inheritThumb !== false) { } else if (options.preferThumb && imageItem.SeriesThumbImageTag && options.inheritThumb !== false) {
imgUrl = ApiClient.getScaledImageUrl(item.SeriesId, { imgUrl = ApiClient.getScaledImageUrl(imageItem.SeriesId, {
type: "Thumb", type: "Thumb",
maxWidth: thumbWidth, maxWidth: thumbWidth,
tag: item.SeriesThumbImageTag, tag: imageItem.SeriesThumbImageTag,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} else if (options.preferThumb && item.ParentThumbItemId && options.inheritThumb !== false) { } else if (options.preferThumb && imageItem.ParentThumbItemId && options.inheritThumb !== false) {
imgUrl = ApiClient.getThumbImageUrl(item.ParentThumbItemId, { imgUrl = ApiClient.getThumbImageUrl(imageItem.ParentThumbItemId, {
type: "Thumb", type: "Thumb",
maxWidth: thumbWidth, maxWidth: thumbWidth,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} else if (options.preferThumb && item.BackdropImageTags && item.BackdropImageTags.length) { } else if (options.preferThumb && imageItem.BackdropImageTags && imageItem.BackdropImageTags.length) {
imgUrl = ApiClient.getScaledImageUrl(item.Id, { imgUrl = ApiClient.getScaledImageUrl(imageItem.Id, {
type: "Backdrop", type: "Backdrop",
maxWidth: thumbWidth, maxWidth: thumbWidth,
tag: item.BackdropImageTags[0], tag: imageItem.BackdropImageTags[0],
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
forceName = true; forceName = true;
} else if (item.ImageTags && item.ImageTags.Primary) { } else if (imageItem.ImageTags && imageItem.ImageTags.Primary) {
width = posterWidth; width = posterWidth;
height = primaryImageAspectRatio ? Math.round(posterWidth / primaryImageAspectRatio) : null; height = primaryImageAspectRatio ? Math.round(posterWidth / primaryImageAspectRatio) : null;
imgUrl = ApiClient.getImageUrl(item.Id, { imgUrl = ApiClient.getImageUrl(imageItem.Id, {
type: "Primary", type: "Primary",
maxHeight: height, maxHeight: height,
maxWidth: width, maxWidth: width,
tag: item.ImageTags.Primary, tag: imageItem.ImageTags.Primary,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
@ -2076,25 +2089,25 @@
} }
} }
} }
else if (item.ParentPrimaryImageTag) { else if (imageItem.ParentPrimaryImageTag) {
imgUrl = ApiClient.getImageUrl(item.ParentPrimaryImageItemId, { imgUrl = ApiClient.getImageUrl(imageItem.ParentPrimaryImageItemId, {
type: "Primary", type: "Primary",
maxWidth: posterWidth, maxWidth: posterWidth,
tag: item.ParentPrimaryImageTag, tag: item.ParentPrimaryImageTag,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} }
else if (item.AlbumId && item.AlbumPrimaryImageTag) { else if (imageItem.AlbumId && imageItem.AlbumPrimaryImageTag) {
height = squareSize; height = squareSize;
width = primaryImageAspectRatio ? Math.round(height * primaryImageAspectRatio) : null; width = primaryImageAspectRatio ? Math.round(height * primaryImageAspectRatio) : null;
imgUrl = ApiClient.getScaledImageUrl(item.AlbumId, { imgUrl = ApiClient.getScaledImageUrl(imageItem.AlbumId, {
type: "Primary", type: "Primary",
maxHeight: height, maxHeight: height,
maxWidth: width, maxWidth: width,
tag: item.AlbumPrimaryImageTag, tag: imageItem.AlbumPrimaryImageTag,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
@ -2106,46 +2119,46 @@
} }
} }
} }
else if (item.Type == 'Season' && item.ImageTags && item.ImageTags.Thumb) { else if (imageItem.Type == 'Season' && imageItem.ImageTags && imageItem.ImageTags.Thumb) {
imgUrl = ApiClient.getScaledImageUrl(item.Id, { imgUrl = ApiClient.getScaledImageUrl(imageItem.Id, {
type: "Thumb", type: "Thumb",
maxWidth: thumbWidth, maxWidth: thumbWidth,
tag: item.ImageTags.Thumb, tag: imageItem.ImageTags.Thumb,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} }
else if (item.BackdropImageTags && item.BackdropImageTags.length) { else if (imageItem.BackdropImageTags && imageItem.BackdropImageTags.length) {
imgUrl = ApiClient.getScaledImageUrl(item.Id, { imgUrl = ApiClient.getScaledImageUrl(imageItem.Id, {
type: "Backdrop", type: "Backdrop",
maxWidth: thumbWidth, maxWidth: thumbWidth,
tag: item.BackdropImageTags[0], tag: imageItem.BackdropImageTags[0],
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} else if (item.ImageTags && item.ImageTags.Thumb) { } else if (imageItem.ImageTags && imageItem.ImageTags.Thumb) {
imgUrl = ApiClient.getScaledImageUrl(item.Id, { imgUrl = ApiClient.getScaledImageUrl(imageItem.Id, {
type: "Thumb", type: "Thumb",
maxWidth: thumbWidth, maxWidth: thumbWidth,
tag: item.ImageTags.Thumb, tag: imageItem.ImageTags.Thumb,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} else if (item.SeriesThumbImageTag) { } else if (imageItem.SeriesThumbImageTag) {
imgUrl = ApiClient.getScaledImageUrl(item.SeriesId, { imgUrl = ApiClient.getScaledImageUrl(imageItem.SeriesId, {
type: "Thumb", type: "Thumb",
maxWidth: thumbWidth, maxWidth: thumbWidth,
tag: item.SeriesThumbImageTag, tag: imageItem.SeriesThumbImageTag,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
}); });
} else if (item.ParentThumbItemId) { } else if (imageItem.ParentThumbItemId) {
imgUrl = ApiClient.getThumbImageUrl(item, { imgUrl = ApiClient.getThumbImageUrl(imageItem, {
type: "Thumb", type: "Thumb",
maxWidth: thumbWidth, maxWidth: thumbWidth,
enableImageEnhancers: enableImageEnhancers enableImageEnhancers: enableImageEnhancers
@ -2284,7 +2297,7 @@
html += '<div class="mediaSourceIndicator">' + mediaSourceCount + '</div>'; html += '<div class="mediaSourceIndicator">' + mediaSourceCount + '</div>';
} }
var progressHtml = options.showProgress === false || item.IsFolder ? '' : LibraryBrowser.getItemProgressBarHtml((item.Type == 'Recording' ? item : item.UserData)); var progressHtml = options.showProgress === false || item.IsFolder ? '' : LibraryBrowser.getItemProgressBarHtml((item.Type == 'Recording' ? item : item.UserData || {}));
var footerOverlayed = false; var footerOverlayed = false;
@ -2412,6 +2425,36 @@
lines.push(item.ProductionYear || ''); lines.push(item.ProductionYear || '');
} }
if (options.showChannelName) {
lines.push(item.ChannelName || '');
}
if (options.showAirTime) {
var airTimeText;
if (item.StartDate) {
try {
var date = datetime.parseISO8601Date(item.StartDate);
airTimeText = date.toLocaleDateString();
airTimeText += ', ' + datetime.getDisplayTime(date);
if (item.EndDate) {
date = datetime.parseISO8601Date(item.EndDate);
airTimeText += ' - ' + datetime.getDisplayTime(date);
}
}
catch (e) {
console.log("Error parsing date: " + item.PremiereDate);
}
}
lines.push(airTimeText || '');
}
if (item.Type == 'TvChannel') { if (item.Type == 'TvChannel') {
if (item.CurrentProgram) { if (item.CurrentProgram) {

View file

@ -229,6 +229,27 @@
} }
} }
function deleteTimer(id, itemsContainer) {
require(['confirm'], function (confirm) {
confirm(Globalize.translate('MessageConfirmRecordingCancellation'), Globalize.translate('HeaderConfirmRecordingCancellation')).then(function () {
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvTimer(id).then(function () {
require(['toast'], function (toast) {
toast(Globalize.translate('MessageRecordingCancelled'));
});
Dashboard.hideLoadingMsg();
itemsContainer.dispatchEvent(new CustomEvent('timercancelled', {}));
});
});
});
}
function showContextMenu(card, options) { function showContextMenu(card, options) {
var displayContextItem = card; var displayContextItem = card;
@ -323,8 +344,16 @@
}); });
} }
if (itemType == 'Timer' && user.Policy.EnableLiveTvManagement) {
items.push({ items.push({
name: Globalize.translate('ButtonOpen'), name: Globalize.translate('ButtonCancel'),
id: 'canceltimer',
ironIcon: 'cancel'
});
}
items.push({
name: itemType == 'Timer' ? Globalize.translate('ButtonEdit') : Globalize.translate('ButtonOpen'),
id: 'open', id: 'open',
ironIcon: 'folder-open' ironIcon: 'folder-open'
}); });
@ -420,7 +449,7 @@
}); });
} }
if (user.Policy.EnablePublicSharing) { if (user.Policy.EnablePublicSharing && commands.indexOf('share') != -1) {
items.push({ items.push({
name: Globalize.translate('ButtonShare'), name: Globalize.translate('ButtonShare'),
id: 'share', id: 'share',
@ -581,6 +610,9 @@
case 'externalplayer': case 'externalplayer':
LibraryBrowser.playInExternalPlayer(itemId); LibraryBrowser.playInExternalPlayer(itemId);
break; break;
case 'canceltimer':
deleteTimer(itemId, $(card).parents('.itemsContainer')[0]);
break;
case 'share': case 'share':
require(['sharingmanager'], function (sharingManager) { require(['sharingmanager'], function (sharingManager) {
sharingManager.showMenu({ sharingManager.showMenu({

View file

@ -9,37 +9,36 @@
html += '<div class="primaryIcons">'; html += '<div class="primaryIcons">';
var backIcon = browserInfo.safari ? 'chevron-left' : 'arrow-back'; var backIcon = browserInfo.safari ? 'chevron-left' : 'arrow-back';
html += '<paper-icon-button icon="' + backIcon + '" class="headerButton headerButtonLeft headerBackButton hide"></paper-icon-button>'; html += '<button is="paper-icon-button-light" class="headerButton headerButtonLeft headerBackButton hide"><iron-icon icon="' + backIcon + '"></iron-icon></button>';
html += '<paper-icon-button icon="menu" class="headerButton mainDrawerButton barsMenuButton headerButtonLeft"></paper-icon-button>'; html += '<button is="paper-icon-button-light" class="headerButton mainDrawerButton barsMenuButton headerButtonLeft"><iron-icon icon="menu"></iron-icon></button>';
html += '<button is="paper-icon-button-light" class="headerButton headerAppsButton barsMenuButton headerButtonLeft"><iron-icon icon="menu"></iron-icon></button>';
html += '<paper-icon-button icon="menu" class="headerButton headerAppsButton barsMenuButton headerButtonLeft"></paper-icon-button>';
html += '<div class="libraryMenuButtonText headerButton">' + Globalize.translate('ButtonHome') + '</div>'; html += '<div class="libraryMenuButtonText headerButton">' + Globalize.translate('ButtonHome') + '</div>';
html += '<div class="viewMenuSecondary">'; html += '<div class="viewMenuSecondary">';
html += '<span class="headerSelectedPlayer"></span>'; html += '<span class="headerSelectedPlayer"></span>';
html += '<paper-icon-button icon="cast" class="btnCast headerButton headerButtonRight hide"></paper-icon-button>'; html += '<button is="paper-icon-button-light" class="btnCast headerButton headerButtonRight hide"><iron-icon icon="cast"></iron-icon></button>';
if (AppInfo.enableSearchInTopMenu) { if (AppInfo.enableSearchInTopMenu) {
html += '<paper-icon-button icon="search" class="headerButton headerButtonRight headerSearchButton hide" onclick="Search.showSearchPanel();"></paper-icon-button>'; html += '<button is="paper-icon-button-light" class=headerButton headerButtonRight headerSearchButton hide" onclick="Search.showSearchPanel();"><iron-icon icon="search"></iron-icon></button>';
html += '<div class="viewMenuSearch hide">'; html += '<div class="viewMenuSearch hide">';
html += '<form class="viewMenuSearchForm">'; html += '<form class="viewMenuSearchForm">';
html += '<input type="text" data-role="none" data-type="search" class="headerSearchInput" autocomplete="off" spellcheck="off" />'; html += '<input type="text" data-role="none" data-type="search" class="headerSearchInput" autocomplete="off" spellcheck="off" />';
html += '<paper-icon-button icon="close" class="btnCloseSearch"></paper-icon-button>'; html += '<button is="paper-icon-button-light" class="btnCloseSearch"><iron-icon icon="close"></iron-icon></button>';
html += '</form>'; html += '</form>';
html += '</div>'; html += '</div>';
} }
html += '<paper-icon-button icon="mic" class="headerButton headerButtonRight headerVoiceButton hide"></paper-icon-button>'; html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight headerVoiceButton hide"><iron-icon icon="mic"></iron-icon></button>';
html += '<paper-button class="headerButton headerButtonRight btnNotifications clearButton" type="button" title="Notifications"><div class="btnNotificationsInner">0</div></paper-button>'; html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight btnNotifications clearButton"><div class="btnNotificationsInner">0</div></button>';
html += '<paper-icon-button icon="person" class="headerButton headerButtonRight headerUserButton"></paper-icon-button>'; html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight headerUserButton"><iron-icon icon="person"></iron-icon></button>';
if (!browserInfo.mobile && !Dashboard.isConnectMode()) { if (!browserInfo.mobile && !Dashboard.isConnectMode()) {
html += '<paper-icon-button icon="settings" class="headerButton headerButtonRight dashboardEntryHeaderButton" onclick="return LibraryMenu.onSettingsClicked(event);"></paper-icon-button>'; html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight dashboardEntryHeaderButton" onclick="return LibraryMenu.onSettingsClicked(event);"><iron-icon icon="settings"></iron-icon></button>';
} }
html += '</div>'; html += '</div>';
@ -108,26 +107,15 @@
function updateHeaderUserButton(headerUserButton, src, icon) { function updateHeaderUserButton(headerUserButton, src, icon) {
var oldButton = headerUserButton;
// There seems to be a bug in paper-icon-button where it doesn't refresh it's display after switching between icon and src image
// So work around that by just replacing the element altogether
var headerUserButton = document.createElement('paper-icon-button');
headerUserButton.className = oldButton.className;
headerUserButton.addEventListener('click', onHeaderUserButtonClick);
if (src) { if (src) {
headerUserButton.classList.add('headerUserButtonRound'); headerUserButton.classList.add('headerUserButtonRound');
headerUserButton.src = src; headerUserButton.innerHTML = '<img src="' + src + '" />';
} else if (icon) { } else if (icon) {
headerUserButton.classList.remove('headerUserButtonRound'); headerUserButton.classList.remove('headerUserButtonRound');
headerUserButton.icon = icon; headerUserButton.innerHTML = '<iron-icon icon="' + icon + '"></iron-icon>';
} else { } else {
headerUserButton.classList.remove('headerUserButtonRound'); headerUserButton.classList.remove('headerUserButtonRound');
} }
oldButton.parentNode.replaceChild(headerUserButton, oldButton);
} }
function updateLocalUser(user) { function updateLocalUser(user) {
@ -208,7 +196,7 @@
html += '<div class="adminAppsMenuRow">'; html += '<div class="adminAppsMenuRow">';
html += '<a class="adminAppsButton" href="home.html">'; html += '<a class="adminAppsButton" href="home.html">';
html += '<paper-icon-button icon="home"></paper-icon-button>'; html += '<button is="paper-icon-button-light"><iron-icon icon="home"></iron-icon></button>';
html += '<div>' + Globalize.translate('ButtonHome') + '</div>'; html += '<div>' + Globalize.translate('ButtonHome') + '</div>';
html += '</a>'; html += '</a>';
@ -217,11 +205,11 @@
html += '<div class="adminAppsMenuRow">'; html += '<div class="adminAppsMenuRow">';
html += '<a class="adminAppsButton" href="edititemmetadata.html">'; html += '<a class="adminAppsButton" href="edititemmetadata.html">';
html += '<paper-icon-button icon="mode-edit"></paper-icon-button>'; html += '<button is="paper-icon-button-light"><iron-icon icon="mode-edit"></iron-icon></button>';
html += '<div>' + Globalize.translate('ButtonMetadataManager') + '</div>'; html += '<div>' + Globalize.translate('ButtonMetadataManager') + '</div>';
html += '</a>'; html += '</a>';
html += '<a class="adminAppsButton" href="reports.html">'; html += '<a class="adminAppsButton" href="reports.html">';
html += '<paper-icon-button icon="insert-chart"></paper-icon-button>'; html += '<button is="paper-icon-button-light"><iron-icon icon="insert-chart"></iron-icon></button>';
html += '<div>' + Globalize.translate('ButtonReports') + '</div>'; html += '<div>' + Globalize.translate('ButtonReports') + '</div>';
html += '</a>'; html += '</a>';
@ -453,15 +441,6 @@
function createDashboardMenu() { function createDashboardMenu() {
var html = ''; var html = '';
//html += '<div class="userHeader">';
//html += '<div class="userHeaderActionMenu">';
//html += '<div>';
//html += localUser.Name;
//html += '</div>';
//html += '<paper-icon-button icon="expand-more"></paper-icon-button>';
//html += '</div>';
//html += '</div>';
html += '<a class="adminDrawerLogo clearLink" href="home.html">' html += '<a class="adminDrawerLogo clearLink" href="home.html">'
html += '<img src="css/images/logo.png" />'; html += '<img src="css/images/logo.png" />';
html += '</a>'; html += '</a>';
@ -760,7 +739,7 @@
var helpUrl = page.getAttribute('data-helpurl'); var helpUrl = page.getAttribute('data-helpurl');
if (helpUrl) { if (helpUrl) {
html += '<a href="' + helpUrl + '" target="_blank" class="clearLink" style="margin-left:1em;" title="' + Globalize.translate('ButtonHelp') + '"><paper-icon-button icon="info"></paper-icon-button></a>'; html += '<a href="' + helpUrl + '" target="_blank" class="clearLink" style="margin-left:1em;" title="' + Globalize.translate('ButtonHelp') + '"><button is="paper-icon-button-light"><iron-icon icon="info"></iron-icon></button></a>';
} }
} }
@ -1119,7 +1098,7 @@
var headerCreated; var headerCreated;
var userRequiresUpdateAfterHeader; var userRequiresUpdateAfterHeader;
require(['paper-icon-button', 'emby-icons', 'paper-button'], function () { require(['paper-icon-button-light', 'emby-icons'], function () {
renderHeader(); renderHeader();
headerCreated = true; headerCreated = true;

View file

@ -2,101 +2,23 @@
function getTimersHtml(timers) { function getTimersHtml(timers) {
return new Promise(function (resolve, reject) { var items = timers.map(function (t) {
t.Type = 'Timer';
require(['paper-fab', 'paper-item-body', 'paper-icon-item'], function () { return t;
var html = '';
var index = '';
var imgUrl;
for (var i = 0, length = timers.length; i < length; i++) {
var timer = timers[i];
var startDateText = LibraryBrowser.getFutureDateText(datetime.parseISO8601Date(timer.StartDate, true));
if (startDateText != index) {
if (index) {
html += '</div>';
html += '</div>';
}
html += '<div class="homePageSection">';
html += '<h1>' + startDateText + '</h1>';
html += '<div class="paperList">';
index = startDateText;
}
html += '<paper-icon-item>';
var program = timer.ProgramInfo || {};
imgUrl = null;
if (program.ImageTags && program.ImageTags.Primary) {
imgUrl = ApiClient.getScaledImageUrl(program.Id, {
height: 80,
tag: program.ImageTags.Primary,
type: "Primary"
}); });
}
if (imgUrl) { var html = LibraryBrowser.getPosterViewHtml({
html += '<paper-fab mini class="blue lazy" data-src="' + imgUrl + '" style="background-repeat:no-repeat;background-position:center center;background-size: cover;" item-icon></paper-fab>'; items: items,
} shape: "square",
else if (program.IsKids) { showTitle: true,
html += '<paper-fab mini style="background:#2196F3;" icon="person" item-icon></paper-fab>'; showAirTime: true,
} showChannelName: true,
else if (program.IsSports) { lazy: true,
html += '<paper-fab mini style="background:#8BC34A;" icon="person" item-icon></paper-fab>'; cardLayout: true,
} showDetailsMenu: true
else if (program.IsMovie) {
html += '<paper-fab mini icon="movie" item-icon></paper-fab>';
}
else if (program.IsNews) {
html += '<paper-fab mini style="background:#673AB7;" icon="new-releases" item-icon></paper-fab>';
}
else {
html += '<paper-fab mini class="blue" icon="live-tv" item-icon></paper-fab>';
}
html += '<paper-item-body two-line>';
html += '<a class="clearLink" href="livetvtimer.html?id=' + timer.Id + '">';
html += '<div>';
html += timer.Name;
html += '</div>';
html += '<div secondary>';
html += datetime.getDisplayTime(timer.StartDate);
html += ' - ' + datetime.getDisplayTime(timer.EndDate);
html += '</div>';
html += '</a>';
html += '</paper-item-body>';
if (timer.SeriesTimerId) {
html += '<div class="ui-li-aside" style="right:0;">';
html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '</div>';
}
html += '<paper-icon-button icon="cancel" data-timerid="' + timer.Id + '" title="' + Globalize.translate('ButonCancelRecording') + '" class="btnDeleteTimer"></paper-icon-button>';
html += '</paper-icon-item>';
}
if (timers.length) {
html += '</div>';
html += '</div>';
}
resolve(html);
});
}); });
return Promise.resolve(html);
} }
window.LiveTvHelpers = { window.LiveTvHelpers = {

View file

@ -78,9 +78,7 @@
ImageLoader.lazyChildren(recordingItems); ImageLoader.lazyChildren(recordingItems);
} }
function reload(page) { function renderActiveRecordings(page) {
Dashboard.showLoadingMsg();
ApiClient.getLiveTvRecordings({ ApiClient.getLiveTvRecordings({
@ -93,6 +91,9 @@
renderRecordings(page.querySelector('#activeRecordings'), result.Items); renderRecordings(page.querySelector('#activeRecordings'), result.Items);
}); });
}
function renderLatestRecordings(page) {
ApiClient.getLiveTvRecordings({ ApiClient.getLiveTvRecordings({
@ -105,6 +106,41 @@
renderRecordings(page.querySelector('#latestRecordings'), result.Items); renderRecordings(page.querySelector('#latestRecordings'), result.Items);
}); });
}
function renderTimers(page, timers) {
LiveTvHelpers.getTimersHtml(timers).then(function (html) {
var elem = page.querySelector('#upcomingRecordings');
if (html) {
elem.classList.remove('hide');
} else {
elem.classList.add('hide');
}
elem.querySelector('.itemsContainer').innerHTML = html;
ImageLoader.lazyChildren(elem);
});
}
function renderUpcomingRecordings(page) {
ApiClient.getLiveTvTimers().then(function (result) {
renderTimers(page, result.Items);
});
}
function reload(page) {
Dashboard.showLoadingMsg();
renderUpcomingRecordings(page);
renderActiveRecordings(page);
renderLatestRecordings(page);
ApiClient.getLiveTvRecordingGroups({ ApiClient.getLiveTvRecordingGroups({
@ -118,11 +154,16 @@
}); });
} }
window.LiveTvPage.initRecordingsTab = function (page, tabContent) {
tabContent.querySelector('#upcomingRecordings .itemsContainer').addEventListener('timercancelled', function () {
reload(tabContent);
});
};
window.LiveTvPage.renderRecordingsTab = function (page, tabContent) { window.LiveTvPage.renderRecordingsTab = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
reload(tabContent); reload(tabContent);
}
}; };
}); });

View file

@ -165,13 +165,10 @@
break; break;
case 3: case 3:
depends.push('scripts/livetvrecordings'); depends.push('scripts/livetvrecordings');
initMethod = 'initRecordingsTab';
renderMethod = 'renderRecordingsTab'; renderMethod = 'renderRecordingsTab';
break; break;
case 4: case 4:
depends.push('scripts/livetvtimers');
renderMethod = 'renderTimersTab';
break;
case 5:
depends.push('scripts/livetvseriestimers'); depends.push('scripts/livetvseriestimers');
renderMethod = 'renderSeriesTimersTab'; renderMethod = 'renderSeriesTimersTab';
break; break;

View file

@ -1,58 +0,0 @@
define(['jQuery'], function ($) {
function deleteTimer(page, id) {
require(['confirm'], function (confirm) {
confirm(Globalize.translate('MessageConfirmRecordingCancellation'), Globalize.translate('HeaderConfirmRecordingCancellation')).then(function () {
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvTimer(id).then(function () {
require(['toast'], function (toast) {
toast(Globalize.translate('MessageRecordingCancelled'));
});
reload(page);
});
});
});
}
function renderTimers(page, timers) {
LiveTvHelpers.getTimersHtml(timers).then(function (html) {
var elem = $('#items', page).html(html)[0];
ImageLoader.lazyChildren(elem);
$('.btnDeleteTimer', elem).on('click', function () {
var id = this.getAttribute('data-timerid');
deleteTimer(page, id);
});
Dashboard.hideLoadingMsg();
});
}
function reload(page) {
Dashboard.showLoadingMsg();
ApiClient.getLiveTvTimers().then(function (result) {
renderTimers(page, result.Items);
});
}
window.LiveTvPage.renderTimersTab = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
reload(tabContent);
}
};
});

View file

@ -1,4 +1,4 @@
define(['datetime', 'jQuery'], function (datetime, $) { define(['datetime', 'jQuery', 'paper-icon-button'], function (datetime, $) {
var currentPlayer; var currentPlayer;

View file

@ -14,6 +14,9 @@
if (item.Type == 'Program') { if (item.Type == 'Program') {
return false; return false;
} }
if (item.Type == 'Timer') {
return false;
}
return item.RunTimeTicks || item.IsFolder || item.Type == "Genre" || item.Type == "MusicGenre" || item.Type == "MusicArtist"; return item.RunTimeTicks || item.IsFolder || item.Type == "Genre" || item.Type == "MusicGenre" || item.Type == "MusicArtist";
} }
}; };

View file

@ -1893,7 +1893,7 @@ var AppInfo = {};
define("paper-dialog-scrollable", ["html!" + bowerPath + "/paper-dialog-scrollable/paper-dialog-scrollable.html"]); 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-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", ["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-icon-button-light", ["html!" + bowerPath + "/paper-icon-button/paper-icon-button-light.html", 'css!css/polymer/paper-icon-button-light.css']);
define("paper-drawer-panel", ["html!" + bowerPath + "/paper-drawer-panel/paper-drawer-panel.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-group", ["html!" + bowerPath + "/paper-radio-group/paper-radio-group.html"]);
define("paper-radio-button", ["html!" + bowerPath + "/paper-radio-button/paper-radio-button.html"]); define("paper-radio-button", ["html!" + bowerPath + "/paper-radio-button/paper-radio-button.html"]);

View file

@ -2349,5 +2349,6 @@
"LabelOriginalTitle": "Original title:", "LabelOriginalTitle": "Original title:",
"LabelSortTitle": "Sort title:", "LabelSortTitle": "Sort title:",
"OptionConvertRecordingPreserveAudio": "Preserve original audio when converting recordings", "OptionConvertRecordingPreserveAudio": "Preserve original audio when converting recordings",
"OptionConvertRecordingPreserveAudioHelp": "This will provide better audio but may require transcoding during playback on some devices." "OptionConvertRecordingPreserveAudioHelp": "This will provide better audio but may require transcoding during playback on some devices.",
"HeaderUpcomingRecordings": "Upcoming Recordings"
} }