1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update lists

This commit is contained in:
Luke Pulverenti 2016-10-03 02:28:45 -04:00
parent 6f73ce4cc3
commit c2290dd41d
33 changed files with 540 additions and 627 deletions

View file

@ -1,4 +1,4 @@
<div id="addPluginPage" data-role="page" class="page type-interior pluginConfigurationPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Plugins" data-require="emby-select,emby-collapse,registrationservices,scripts/addpluginpage"> <div id="addPluginPage" data-role="page" class="page type-interior pluginConfigurationPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Plugins" data-require="emby-select,emby-collapse">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">
@ -77,14 +77,6 @@
</div> </div>
<br /> <br />
<div class="readOnlyContent"> <div class="readOnlyContent">
<div is="emby-collapse" title="${HeaderReviews}">
<div class="collapseContent">
<br />
<div id="ratingLine"></div>
<div id="latestReviews"></div>
</div>
</div>
<div is="emby-collapse" title="${HeaderDeveloperInfo}"> <div is="emby-collapse" title="${HeaderDeveloperInfo}">
<div class="collapseContent"> <div class="collapseContent">
<p id="developer"></p> <p id="developer"></p>

View file

@ -1087,6 +1087,11 @@
Servers: [server] Servers: [server]
}); });
} if (result.Id != server.Id) {
// http request succeeded, but it's a different server than what was expected
testNextConnectionMode(tests, index + 1, server, options, resolve);
} else { } else {
console.log('calling onSuccessfulConnection with connection mode ' + mode + ' with server ' + server.Name); console.log('calling onSuccessfulConnection with connection mode ' + mode + ' with server ' + server.Name);
onSuccessfulConnection(server, result, mode, options, resolve); onSuccessfulConnection(server, result, mode, options, resolve);

View file

@ -14,12 +14,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.4.281", "version": "1.4.283",
"_release": "1.4.281", "_release": "1.4.283",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.4.281", "tag": "1.4.283",
"commit": "6f766fd6733ce492387abd5d6f339983085f2359" "commit": "52a82ab789f4650d3b0ab7ee41cba96d417cfa76"
}, },
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1", "_target": "^1.2.1",

View file

@ -558,6 +558,15 @@ define(['browser'], function (browser) {
}] }]
}); });
if (browser.chrome) {
profile.CodecProfiles[profile.CodecProfiles.length - 1].Conditions.push({
Condition: 'NotEquals',
Property: 'IsAVC',
Value: 'false',
IsRequired: false
});
}
profile.CodecProfiles.push({ profile.CodecProfiles.push({
Type: 'Video', Type: 'Video',
Codec: 'vpx', Codec: 'vpx',

View file

@ -761,6 +761,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var lines = []; var lines = [];
var parentTitleUnderneath = item.Type === 'MusicAlbum' || item.Type === 'Audio' || item.Type === 'MusicVideo'; var parentTitleUnderneath = item.Type === 'MusicAlbum' || item.Type === 'Audio' || item.Type === 'MusicVideo';
var titleAdded;
if (showOtherText) { if (showOtherText) {
if ((options.showParentTitle || options.showParentTitleOrTitle) && !parentTitleUnderneath) { if ((options.showParentTitle || options.showParentTitleOrTitle) && !parentTitleUnderneath) {
@ -776,20 +777,30 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
} }
else { else {
var parentTitle = item.Type === 'Program' ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || ""); if (item.Type === 'Program') {
if (parentTitle || options.showParentTitle) { lines.push(item.Name);
lines.push(parentTitle);
if (!item.IsSeries) {
titleAdded = true;
}
} else {
var parentTitle = item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || "";
if (parentTitle || options.showParentTitle) {
lines.push(parentTitle);
}
} }
} }
} }
} }
if (showTitle || forceName || (options.showParentTitleOrTitle && !lines.length)) { if (((showTitle || forceName) && !titleAdded) || (options.showParentTitleOrTitle && !lines.length)) {
var name = options.showTitle === 'auto' && !item.IsFolder && item.MediaType === 'Photo' ? '' : itemHelper.getDisplayName(item); var name = options.showTitle === 'auto' && !item.IsFolder && item.MediaType === 'Photo' ? '' : itemHelper.getDisplayName(item);
lines.push(htmlEncode(name)); lines.push(name);
} }
if (showOtherText) { if (showOtherText) {

View file

@ -131,8 +131,8 @@
var currentLocale = getCurrentLocale(); var currentLocale = getCurrentLocale();
return currentLocale && toLocaleTimeStringSupportsLocales ? return currentLocale && toLocaleTimeStringSupportsLocales ?
date.toLocaleTimeString(currentLocale, options || {}) : date.toLocaleTimeString(currentLocale, options || {}).toLowerCase() :
date.toLocaleTimeString(); date.toLocaleTimeString().toLowerCase();
} }
function getDisplayTime(date) { function getDisplayTime(date) {
@ -147,38 +147,12 @@
} }
} }
var time = toLocaleTimeString(date); return toLocaleTimeString(date, {
var timeLower = time.toLowerCase(); hour: 'numeric',
minute: '2-digit'
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) {
hour = 12;
}
var minutes = date.getMinutes();
if (minutes < 10) {
minutes = '0' + minutes;
}
minutes = ':' + minutes;
time = hour + minutes + suffix;
} else {
var timeParts = time.split(':');
// Trim off seconds
if (timeParts.length > 2) {
timeParts.length -= 1;
time = timeParts.join(':');
}
}
return time;
} }
function isRelativeDay(date, offsetInDays) { function isRelativeDay(date, offsetInDays) {

View file

@ -131,7 +131,7 @@
animateDialogOpen(dlg); animateDialogOpen(dlg);
if (isHistoryEnabled(dlg)) { if (isHistoryEnabled(dlg)) {
historyManager.pushState({ dialogId: hash }, "Dialog", hash); historyManager.pushState({ dialogId: hash }, "Dialog", '#' + hash);
window.addEventListener('popstate', onHashChange); window.addEventListener('popstate', onHashChange);
} else { } else {

View file

@ -152,7 +152,7 @@
.paper-icon-button-light > i { .paper-icon-button-light > i {
width: auto; width: auto;
height: auto; height: auto;
font-size: 1.72em; font-size: 1.6em;
/* Make sure its on top of the ripple */ /* Make sure its on top of the ripple */
position: relative; position: relative;
z-index: 1; z-index: 1;

View file

@ -3,7 +3,7 @@
margin: 0; margin: 0;
margin-bottom: 0 !important; margin-bottom: 0 !important;
background: none; background: none;
border: 1px solid rgb(221, 221, 221); border: 1px solid #383838;
border-width: 0 0 1px 0; border-width: 0 0 1px 0;
/* Prefixed box-sizing rules necessary for older browsers */ /* Prefixed box-sizing rules necessary for older browsers */
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;

View file

@ -3,7 +3,7 @@
margin: 0; margin: 0;
margin-bottom: 0 !important; margin-bottom: 0 !important;
background: none; background: none;
border: 1px solid rgb(221, 221, 221); border: 1px solid #383838;
border-width: 0 0 1px 0; border-width: 0 0 1px 0;
/* Prefixed box-sizing rules necessary for older browsers */ /* Prefixed box-sizing rules necessary for older browsers */
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;

View file

@ -3,7 +3,7 @@
margin: 0; margin: 0;
margin-bottom: 0 !important; margin-bottom: 0 !important;
background: none; background: none;
border: 1px solid rgb(221, 221, 221); border: 1px solid #383838;
border-width: 0 0 1px 0; border-width: 0 0 1px 0;
/* Prefixed box-sizing rules necessary for older browsers */ /* Prefixed box-sizing rules necessary for older browsers */
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;

View file

@ -15,10 +15,6 @@
overflow: hidden; overflow: hidden;
} }
.listItem-border {
border-bottom: 1px solid #262626;
}
.listItem-button { .listItem-button {
width: 100%; width: 100%;
} }
@ -63,24 +59,8 @@
justify-content: center; justify-content: center;
} }
.listItemBody-nogrow { .listItem-odd {
flex-grow: initial; background: #171717;
flex-shrink: 0;
width: 9em;
opacity: .7;
}
@media all and (max-width: 800px) {
.listItemBody-nogrow {
width: 4em;
}
}
.two-line {
min-height: 5.15em;
padding-top: 0;
padding-bottom: 0;
} }
.three-line { .three-line {

View file

@ -180,8 +180,10 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
var cssClass = "listItem listItem-nosidepadding"; var cssClass = "listItem listItem-nosidepadding";
if (options.border !== false) { if (options.highlight !== false) {
cssClass += ' listItem-border'; if (i % 2 == 1) {
cssClass += ' listItem-odd';
}
} }
if (clickEntireItem) { if (clickEntireItem) {
@ -242,21 +244,32 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
html += '</div>'; html += '</div>';
} }
if (options.showProgramTimeColumn) { var textlines = [];
html += '<div class="listItemBody listItemBody-nogrow listItemBody-rightborder"><div class="listItemBodyText">';
html += datetime.getDisplayTime(datetime.parseISO8601Date(item.StartDate)); if (options.showProgramDateTime) {
html += '</div></div>'; textlines.push(datetime.toLocaleString(datetime.parseISO8601Date(item.StartDate), {
weekday: 'long',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: '2-digit'
}));
} }
var textlines = []; if (options.showProgramTime) {
textlines.push(datetime.getDisplayTime(datetime.parseISO8601Date(item.StartDate)));
}
var parentTitle;
if (options.showParentTitle) { if (options.showParentTitle) {
if (item.Type == 'Episode') { if (item.Type == 'Episode') {
textlines.push(item.SeriesName || '&nbsp;'); parentTitle = item.SeriesName;
} }
if (item.IsSeries) { else if (item.IsSeries) {
textlines.push(item.Name || '&nbsp;'); parentTitle = item.Name;
} }
} }
@ -265,7 +278,20 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
if (options.showIndexNumber && item.IndexNumber != null) { if (options.showIndexNumber && item.IndexNumber != null) {
displayName = item.IndexNumber + ". " + displayName; displayName = item.IndexNumber + ". " + displayName;
} }
if (displayName) {
if (options.showParentTitle && options.parentTitleWithTitle) {
if (parentTitle && displayName) {
parentTitle += ' - ' + displayName;
}
textlines.push(parentTitle || '&nbsp;');
}
else if (options.showParentTitle) {
textlines.push(parentTitle || '&nbsp;');
}
if (displayName && !options.parentTitleWithTitle) {
textlines.push(displayName); textlines.push(displayName);
} }
@ -302,14 +328,16 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
html += getTextLinesHtml(textlines, isLargeStyle); html += getTextLinesHtml(textlines, isLargeStyle);
if (!enableSideMediaInfo) { if (options.mediaInfo !== false) {
if (!enableSideMediaInfo) {
var mediaInfoClass = 'secondary listItemMediaInfo listItemBodyText'; var mediaInfoClass = 'secondary listItemMediaInfo listItemBodyText';
html += '<div class="' + mediaInfoClass + '">' + mediaInfo.getPrimaryMediaInfoHtml(item, { html += '<div class="' + mediaInfoClass + '">' + mediaInfo.getPrimaryMediaInfoHtml(item, {
episodeTitle: false, episodeTitle: false,
originalAirDate: false originalAirDate: false
}) + '</div>'; }) + '</div>';
}
} }
if (enableOverview && item.Overview) { if (enableOverview && item.Overview) {
@ -320,18 +348,23 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
html += '</div>'; html += '</div>';
if (enableSideMediaInfo) { if (options.mediaInfo !== false) {
html += '<div class="secondary listItemMediaInfo">' + mediaInfo.getPrimaryMediaInfoHtml(item, { if (enableSideMediaInfo) {
html += '<div class="secondary listItemMediaInfo">' + mediaInfo.getPrimaryMediaInfoHtml(item, {
year: false, year: false,
container: false, container: false,
episodeTitle: false episodeTitle: false
}) + '</div>'; }) + '</div>';
}
} }
if (!clickEntireItem) { if (!clickEntireItem) {
html += '<button is="paper-icon-button-light" class="listItemButton itemAction autoSize" data-action="menu"><i class="md-icon">' + moreIcon + '</i></button>';
if (options.moreButton !== false) {
html += '<button is="paper-icon-button-light" class="listItemButton itemAction autoSize" data-action="menu"><i class="md-icon">' + moreIcon + '</i></button>';
}
if (options.enableUserDataButtons !== false) { if (options.enableUserDataButtons !== false) {
html += '<span class="listViewUserDataButtons">'; html += '<span class="listViewUserDataButtons">';

View file

@ -16,12 +16,12 @@
html += '<div class="ssk-group ssk-round ssk-lg">'; html += '<div class="ssk-group ssk-round ssk-lg">';
// We can only do facebook if we can guarantee that the current page is available over the internet, since FB will try to probe it. // We can only do facebook if we can guarantee that the current page is available over the internet, since FB will try to probe it.
html += '<a href="#" class="ssk ssk-facebook"></a>'; html += '<a href="#" class="ssk ssk-facebook" style="color:#fff;"></a>';
html += '<a href="#" class="ssk ssk-twitter"></a>'; html += '<a href="#" class="ssk ssk-twitter" style="color:#fff;"></a>';
html += '<a href="#" class="ssk ssk-google-plus"></a>'; html += '<a href="#" class="ssk ssk-google-plus" style="color:#fff;"></a>';
html += '<a href="#" class="ssk ssk-pinterest"></a>'; html += '<a href="#" class="ssk ssk-pinterest" style="color:#fff;"></a>';
html += '<a href="#" class="ssk ssk-tumblr"></a>'; html += '<a href="#" class="ssk ssk-tumblr" style="color:#fff;"></a>';
html += '</div>'; html += '</div>';
dlg.style['padding'] = '.5em 1.5em 1.5em'; dlg.style['padding'] = '.5em 1.5em 1.5em';

View file

@ -35,16 +35,16 @@ html {
margin: 0; margin: 0;
padding: 0; padding: 0;
height: 100%; height: 100%;
font-family: -apple-system, BlinkMacSystemFont, 'Open Sans', "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", 'Open Sans', sans-serif;
font-size: 14px; font-size: 14px;
} }
h1 { h1 {
font-family: -apple-system-headline, BlinkMacSystemFont, 'Open Sans', "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif; font-family: -apple-system-headline, BlinkMacSystemFont, "Roboto", "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", 'Open Sans', sans-serif;
} }
h2 { h2 {
font-family: -apple-system-subheadline, BlinkMacSystemFont, 'Open Sans', "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif; font-family: -apple-system-subheadline, BlinkMacSystemFont, "Roboto", "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", 'Open Sans', sans-serif;
} }
body { body {
@ -165,9 +165,9 @@ input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='r
display: block; display: block;
} }
.ui-body-b select, .ui-body-b [is="emby-input"] { .ui-body-a select, .ui-body-a [is="emby-input"], .ui-body-a [is="emby-textarea"] {
background: none; background: none;
border-color: #454545; border-color: #ccc!important;
} }
.ui-body-b select option { .ui-body-b select option {

View file

@ -158,12 +158,9 @@
</div> </div>
<div id="scenesCollapsible" class="detailSection hide"> <div id="scenesCollapsible" class="detailSection hide">
<div style="display: flex; align-items: center; margin: .5em 0;"> <h1>
<h1 style="margin: 0;"> ${HeaderScenes}
${HeaderScenes} </h1>
</h1>
<button is="paper-icon-button-light" class="chapterSettingsButton hide"><i class="md-icon">settings</i></button>
</div>
<div is="emby-itemscontainer" id="scenesContent" class="itemsContainer"></div> <div is="emby-itemscontainer" id="scenesContent" class="itemsContainer"></div>
<button is="emby-button" type="button" class="raised more moreScenes hide">${ButtonMore}</button> <button is="emby-button" type="button" class="raised more moreScenes hide">${ButtonMore}</button>
</div> </div>

View file

@ -148,8 +148,7 @@
</div> </div>
</div> </div>
<div class="pageTabContent ehsContent" id="seriesTab" data-index="5"> <div class="pageTabContent ehsContent" id="seriesTab" data-index="5">
<div style="max-width: 700px; margin: 0 auto;" id="items"> <div is="emby-itemscontainer" class="vertical-wrap itemsContainer" id="items"></div>
</div>
</div> </div>
<div data-role="content"> <div data-role="content">

View file

@ -20,7 +20,7 @@
</div> </div>
<h1 style="margin-top:0;">${HeaderSchedule}</h1> <h1 style="margin-top:0;">${HeaderSchedule}</h1>
<div style="display:flex;align-items:center;"> <div style="display:flex;align-items:center;margin:1em 0;">
<i class="md-icon" style="color:#cc3333;font-size:1.5em;">&#xE062;</i> <i class="md-icon" style="color:#cc3333;font-size:1.5em;">&#xE062;</i>
<div style="margin-left:.25em;">${WillRecord}</div> <div style="margin-left:.25em;">${WillRecord}</div>
<i class="md-icon" style="color:gray;font-size:1.5em;margin-left: 1.5em;">&#xE062;</i> <i class="md-icon" style="color:gray;font-size:1.5em;margin-left: 1.5em;">&#xE062;</i>

View file

@ -8,7 +8,7 @@
<div class="listItem"> <div class="listItem">
<i class="md-icon listItemIcon" style="background-color: #03a9f4;">tv</i> <i class="md-icon listItemIcon" style="background-color: #03a9f4;">tv</i>
<div class="listItemBody"> <div class="listItemBody">
<div>${HeaderDisplay}</div> <div class="listItemBodyText">${HeaderDisplay}</div>
</div> </div>
</div> </div>
</a> </a>
@ -17,7 +17,7 @@
<div class="listItem"> <div class="listItem">
<i class="md-icon listItemIcon" style="background-color: #e57373;">home</i> <i class="md-icon listItemIcon" style="background-color: #e57373;">home</i>
<div class="listItemBody"> <div class="listItemBody">
<div>${TabHomeScreen}</div> <div class="listItemBodyText">${TabHomeScreen}</div>
</div> </div>
</div> </div>
</a> </a>
@ -26,7 +26,7 @@
<div class="listItem"> <div class="listItem">
<i class="md-icon listItemIcon" style="background-color: #81c784;">play_circle_filled</i> <i class="md-icon listItemIcon" style="background-color: #81c784;">play_circle_filled</i>
<div class="listItemBody"> <div class="listItemBody">
<div>${TitlePlayback}</div> <div class="listItemBodyText">${TitlePlayback}</div>
</div> </div>
</div> </div>
</a> </a>
@ -35,7 +35,7 @@
<div class="listItem"> <div class="listItem">
<i class="md-icon listItemIcon" style="background-color: #ffd54f;">person</i> <i class="md-icon listItemIcon" style="background-color: #ffd54f;">person</i>
<div class="listItemBody"> <div class="listItemBody">
<div>${ButtonProfile}</div> <div class="listItemBodyText">${ButtonProfile}</div>
</div> </div>
</div> </div>
</a> </a>
@ -44,7 +44,7 @@
<div class="listItem"> <div class="listItem">
<i class="md-icon listItemIcon" style="background-color: #673AB7;">photo</i> <i class="md-icon listItemIcon" style="background-color: #673AB7;">photo</i>
<div class="listItemBody"> <div class="listItemBody">
<div>${TabCameraUpload}</div> <div class="listItemBodyText">${TabCameraUpload}</div>
</div> </div>
</div> </div>
</a> </a>
@ -53,7 +53,7 @@
<div class="listItem"> <div class="listItem">
<i class="md-icon listItemIcon">file_download</i> <i class="md-icon listItemIcon">file_download</i>
<div class="listItemBody"> <div class="listItemBody">
<div>${HeaderOfflineSync}</div> <div class="listItemBodyText">${HeaderOfflineSync}</div>
</div> </div>
</div> </div>
</a> </a>
@ -65,14 +65,14 @@
<div class="listItem"> <div class="listItem">
<i class="md-icon listItemIcon">wifi</i> <i class="md-icon listItemIcon">wifi</i>
<div class="listItemBody"> <div class="listItemBody">
<div>${HeaderSelectServer}</div> <div class="listItemBodyText">${HeaderSelectServer}</div>
</div> </div>
</div> </div>
</a> </a>
<div class="listItem btnLogout"> <div class="listItem btnLogout">
<i class="md-icon listItemIcon" style="background-color:#444;">lock</i> <i class="md-icon listItemIcon" style="background-color:#444;">lock</i>
<div class="listItemBody"> <div class="listItemBody">
<div>${ButtonSignOut}</div> <div class="listItemBodyText">${ButtonSignOut}</div>
</div> </div>
</div> </div>
</div> </div>
@ -85,7 +85,7 @@
<div class="listItem"> <div class="listItem">
<i class="md-icon listItemIcon">settings</i> <i class="md-icon listItemIcon">settings</i>
<div class="listItemBody"> <div class="listItemBody">
<div>${ButtonServerDashboard}</div> <div class="listItemBodyText">${ButtonServerDashboard}</div>
</div> </div>
</div> </div>
</a> </a>

View file

@ -56,139 +56,95 @@
} }
} }
function populateReviews(id, page) {
ApiClient.getPackageReviews(id, null, null, 3).then(function (positive) {
var html = '';
if (positive && positive.length > 0) {
html += '<div style="margin-top: 2em;" >';
html += '<h3>' + Globalize.translate('HeaderLatestReviews') + '</h3>';
html += "<div><br/>";
for (var i = 0; i < positive.length; i++) {
var review = positive[i];
html += "<div>";
html += "<span class='storeItemReviewText' style='display:inline-flex;align-items:center;'>";
html += new Date(review.timestamp).toDateString();
if (review.rating) {
html += '<i class="md-icon" style="color:#cc3333;height:auto;width:auto;margin-left:.5em;">star</i>';
html += review.rating.toFixed(1);
}
html += " " + review.title;
html += "</span>";
if (review.review) {
html += "<p class='storeItemReviewText'>";
html += review.review;
html += "</p>";
}
html += "</div>";
html += "<hr/>";
}
html += "</div>";
html += "</div>";
}
$('#latestReviews', page).html(html).trigger('create');
});
}
function renderPluginInfo(page, pkg, pluginSecurityInfo) { function renderPluginInfo(page, pkg, pluginSecurityInfo) {
if (AppInfo.isNativeApp) { if (AppInfo.isNativeApp) {
return; return;
} }
require(['jQuery'], function ($) { if (pkg.isPremium) {
if (pkg.isPremium) { $('.premiumPackage', page).show();
$('.premiumPackage', page).show();
// Fill in registration info // Fill in registration info
var regStatus = ""; var regStatus = "";
if (pkg.isRegistered) { if (pkg.isRegistered) {
regStatus += "<p style='color:green;'>"; regStatus += "<p style='color:green;'>";
regStatus += Globalize.translate('MessageFeatureIncludedWithSupporter'); regStatus += Globalize.translate('MessageFeatureIncludedWithSupporter');
} else {
var expDateTime = new Date(pkg.expDate).getTime();
var nowTime = new Date().getTime();
if (expDateTime <= nowTime) {
regStatus += "<p style='color:red;'>";
regStatus += Globalize.translate('MessageTrialExpired');
} else if (expDateTime > new Date(1970, 1, 1).getTime()) {
regStatus += "<p style='color:blue;'>";
regStatus += Globalize.translate('MessageTrialWillExpireIn').replace('{0}', Math.round(expDateTime - nowTime) / (86400000));
}
}
regStatus += "</p>";
$('#regStatus', page).html(regStatus);
if (pluginSecurityInfo.IsMBSupporter) {
$('#regInfo', page).html(pkg.regInfo || "");
$('.premiumDescription', page).hide();
$('.supporterDescription', page).hide();
if (pkg.price > 0) {
$('.premiumHasPrice', page).show();
$('#featureId', page).val(pkg.featureId);
$('#featureName', page).val(pkg.name);
$('#amount', page).val(pkg.price);
$('#regPrice', page).html("<h3>" + Globalize.translate('ValuePriceUSD').replace('{0}', "$" + pkg.price.toFixed(2)) + "</h3>");
$('#ppButton', page).hide();
var url = "https://mb3admin.com/admin/service/user/getPayPalEmail?id=" + pkg.owner;
fetch(url).then(function (response) {
return response.json();
}).then(function (dev) {
if (dev.payPalEmail) {
$('#payPalEmail', page).val(dev.payPalEmail);
$('#ppButton', page).show();
}
});
} else {
// Supporter-only feature
$('.premiumHasPrice', page).hide();
}
} else {
if (pkg.price) {
$('.premiumDescription', page).show();
$('.supporterDescription', page).hide();
$('#regInfo', page).html("");
} else {
$('.premiumDescription', page).hide();
$('.supporterDescription', page).show();
$('#regInfo', page).html("");
}
$('#ppButton', page).hide();
}
} else { } else {
$('.premiumPackage', page).hide();
var expDateTime = new Date(pkg.expDate).getTime();
var nowTime = new Date().getTime();
if (expDateTime <= nowTime) {
regStatus += "<p style='color:red;'>";
regStatus += Globalize.translate('MessageTrialExpired');
} else if (expDateTime > new Date(1970, 1, 1).getTime()) {
regStatus += "<p style='color:blue;'>";
regStatus += Globalize.translate('MessageTrialWillExpireIn').replace('{0}', Math.round(expDateTime - nowTime) / (86400000));
}
} }
});
regStatus += "</p>";
$('#regStatus', page).html(regStatus);
if (pluginSecurityInfo.IsMBSupporter) {
$('#regInfo', page).html(pkg.regInfo || "");
$('.premiumDescription', page).hide();
$('.supporterDescription', page).hide();
if (pkg.price > 0) {
$('.premiumHasPrice', page).show();
$('#featureId', page).val(pkg.featureId);
$('#featureName', page).val(pkg.name);
$('#amount', page).val(pkg.price);
$('#regPrice', page).html("<h3>" + Globalize.translate('ValuePriceUSD').replace('{0}', "$" + pkg.price.toFixed(2)) + "</h3>");
$('#ppButton', page).hide();
var url = "https://mb3admin.com/admin/service/user/getPayPalEmail?id=" + pkg.owner;
fetch(url).then(function (response) {
return response.json();
}).then(function (dev) {
if (dev.payPalEmail) {
$('#payPalEmail', page).val(dev.payPalEmail);
$('#ppButton', page).show();
}
});
} else {
// Supporter-only feature
$('.premiumHasPrice', page).hide();
}
} else {
if (pkg.price) {
$('.premiumDescription', page).show();
$('.supporterDescription', page).hide();
$('#regInfo', page).html("");
} else {
$('.premiumDescription', page).hide();
$('.supporterDescription', page).show();
$('#regInfo', page).html("");
}
$('#ppButton', page).hide();
}
} else {
$('.premiumPackage', page).hide();
}
} }
function renderPackage(pkg, installedPlugins, pluginSecurityInfo, page) { function renderPackage(pkg, installedPlugins, pluginSecurityInfo, page) {
@ -199,7 +155,6 @@
populateVersions(pkg, page, installedPlugin); populateVersions(pkg, page, installedPlugin);
populateHistory(pkg, page); populateHistory(pkg, page);
if (pkg.totalRatings > 0) populateReviews(pkg.id, page);
$('.pluginName', page).html(pkg.name); $('.pluginName', page).html(pkg.name);
@ -228,18 +183,6 @@
renderPluginInfo(page, pkg, pluginSecurityInfo); renderPluginInfo(page, pkg, pluginSecurityInfo);
//Ratings and Reviews
var ratingHtml = '';
if (pkg.avgRating) {
ratingHtml += '<i class="md-icon" style="color:#cc3333;height:auto;width:auto;">star</i>';
ratingHtml += pkg.avgRating.toFixed(1);
}
ratingHtml += "<span>";
ratingHtml += " " + Globalize.translate('ValueReviewCount').replace('{0}', pkg.totalRatings);
ratingHtml += "</span>";
$('#ratingLine', page).html(ratingHtml);
if (pkg.richDescUrl) { if (pkg.richDescUrl) {
$('#pViewWebsite', page).show(); $('#pViewWebsite', page).show();
$('#pViewWebsite a', page).attr('href', pkg.richDescUrl); $('#pViewWebsite a', page).attr('href', pkg.richDescUrl);
@ -268,62 +211,6 @@
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
} }
$(document).on('pageinit', "#addPluginPage", function () {
$('.addPluginForm').off('submit', AddPluginPage.onSubmit).on('submit', AddPluginPage.onSubmit);
}).on('pageshow', "#addPluginPage", function () {
var page = this;
Dashboard.showLoadingMsg();
var name = getParameterByName('name');
var guid = getParameterByName('guid');
var promise1 = ApiClient.getPackageInfo(name, guid);
var promise2 = ApiClient.getInstalledPlugins();
var promise3 = ApiClient.getPluginSecurityInfo();
Promise.all([promise1, promise2, promise3]).then(function (responses) {
renderPackage(responses[0], responses[1], responses[2], page);
});
}).on('pagebeforeshow pageinit pageshow', "#addPluginPage", function () {
// This needs both events for the helpurl to get done at the right time
var page = this;
var context = getParameterByName('context');
$('.notificationsTabs', page).hide();
if (context == 'sync') {
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Sync');
LibraryMenu.setTitle(Globalize.translate('TitleSync'));
}
else if (context == 'livetv') {
LibraryMenu.setTitle(Globalize.translate('TitleLiveTV'));
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Live%20TV');
}
else if (context == 'notifications') {
$('.notificationsTabs', page).show();
LibraryMenu.setTitle(Globalize.translate('TitleNotifications'));
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Notifications');
}
else {
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Plugins');
LibraryMenu.setTitle(Globalize.translate('TitlePlugins'));
}
});
function performInstallation(page, packageName, guid, updateClass, version) { function performInstallation(page, packageName, guid, updateClass, version) {
var developer = $('#developer', page).html().toLowerCase(); var developer = $('#developer', page).html().toLowerCase();
@ -369,18 +256,44 @@
} }
} }
function addPluginpage() { function updateHelpUrl(page, params) {
var self = this; var context = params.context;
self.onSubmit = function () { $('.notificationsTabs', page).hide();
if (context == 'sync') {
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Sync');
LibraryMenu.setTitle(Globalize.translate('TitleSync'));
}
else if (context == 'livetv') {
LibraryMenu.setTitle(Globalize.translate('TitleLiveTV'));
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Live%20TV');
}
else if (context == 'notifications') {
$('.notificationsTabs', page).show();
LibraryMenu.setTitle(Globalize.translate('TitleNotifications'));
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Notifications');
}
else {
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Plugins');
LibraryMenu.setTitle(Globalize.translate('TitlePlugins'));
}
}
return function (view, params) {
var onSubmit = function () {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
var page = $(this).parents('#addPluginPage')[0]; var page = $(this).parents('#addPluginPage')[0];
var name = getParameterByName('name'); var name = params.name;
var guid = getParameterByName('guid'); var guid = params.guid;
ApiClient.getInstalledPlugins().then(function (plugins) { ApiClient.getInstalledPlugins().then(function (plugins) {
@ -407,8 +320,37 @@
return false; return false;
}; };
}
window.AddPluginPage = new addPluginpage(); $('.addPluginForm', view).on('submit', onSubmit);
updateHelpUrl(view, params);
view.addEventListener('viewbeforeshow', function () {
var page = this;
updateHelpUrl(page, params);
});
view.addEventListener('viewshow', function () {
var page = this;
Dashboard.showLoadingMsg();
var name = params.name;
var guid = params.guid;
var promise1 = ApiClient.getPackageInfo(name, guid);
var promise2 = ApiClient.getInstalledPlugins();
var promise3 = ApiClient.getPluginSecurityInfo();
Promise.all([promise1, promise2, promise3]).then(function (responses) {
renderPackage(responses[0], responses[1], responses[2], page);
});
updateHelpUrl(page, params);
});
};
}); });

View file

@ -207,12 +207,6 @@
} }
}); });
if (user.Policy.IsAdministrator) {
page.querySelector('.chapterSettingsButton').classList.remove('hide');
} else {
page.querySelector('.chapterSettingsButton').classList.add('hide');
}
var itemBirthday = page.querySelector('#itemBirthday'); var itemBirthday = page.querySelector('#itemBirthday');
if (item.Type == "Person" && item.PremiereDate) { if (item.Type == "Person" && item.PremiereDate) {
@ -2172,10 +2166,6 @@
} }
view.querySelector('.chapterSettingsButton').addEventListener('click', function () {
Dashboard.navigate('librarysettings.html');
});
view.addEventListener('viewbeforeshow', function () { view.addEventListener('viewbeforeshow', function () {
var page = this; var page = this;
reload(page, params); reload(page, params);

View file

@ -265,6 +265,10 @@
// Handle search hints // Handle search hints
var id = item.Id || item.ItemId; var id = item.Id || item.ItemId;
if (item.Type == "SeriesTimer") {
return "livetvseriestimer.html?id=" + id;
}
if (item.CollectionType == 'livetv') { if (item.CollectionType == 'livetv') {
return 'livetv.html'; return 'livetv.html';
} }

View file

@ -27,7 +27,9 @@
enableUserDataButtons: false, enableUserDataButtons: false,
showParentTitle: true, showParentTitle: true,
image: false, image: false,
showProgramTimeColumn: true showProgramTime: true,
mediaInfo: false,
parentTitleWithTitle: true
}) + '</div>'; }) + '</div>';
} }

View file

@ -1,4 +1,4 @@
define(['datetime', 'cardBuilder'], function (datetime, cardBuilder) { define(['datetime', 'cardBuilder', 'listView'], function (datetime, cardBuilder, listView) {
function enableScrollX() { function enableScrollX() {
return browserInfo.mobile && AppInfo.enableAppLayouts; return browserInfo.mobile && AppInfo.enableAppLayouts;
@ -8,101 +8,6 @@
return enableScrollX() ? 'overflowBackdrop' : 'backdrop'; return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
} }
function getProgramScheduleHtml(items, options) {
options = options || {};
var groups = [];
var currentGroupName = '';
var currentGroup = [];
var i, length;
for (i = 0, length = items.length; i < length; i++) {
var item = items[i];
var dateText = '';
if (options.indexByDate !== false && item.StartDate) {
try {
var premiereDate = datetime.parseISO8601Date(item.StartDate, true);
dateText = LibraryBrowser.getFutureDateText(premiereDate, true);
} catch (err) {
}
}
if (dateText != currentGroupName) {
if (currentGroup.length) {
groups.push({
name: currentGroupName,
items: currentGroup
});
}
currentGroupName = dateText;
currentGroup = [item];
} else {
currentGroup.push(item);
}
}
if (currentGroup.length) {
groups.push({
name: currentGroupName,
items: currentGroup
});
}
var html = '';
for (i = 0, length = groups.length; i < length; i++) {
var group = groups[i];
if (group.name) {
html += '<div class="homePageSection">';
html += '<h1 class="listHeader">' + group.name + '</h1>';
}
if (enableScrollX()) {
html += '<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">';
} else {
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">';
}
html += cardBuilder.getCardsHtml({
items: group.items,
shape: getBackdropShape(),
preferThumb: true,
showTitle: true,
showAirTime: true,
showAirEndTime: true,
showChannelName: true,
cardLayout: true,
action: 'programdialog',
cardFooterAside: 'none',
preferThumb: true,
coverImage: true,
overlayText: false
});
html += '</div>';
if (group.name) {
html += '</div>';
}
}
return Promise.resolve(html);
}
function getTimersHtml(timers, options) { function getTimersHtml(timers, options) {
options = options || {}; options = options || {};
@ -204,8 +109,7 @@
window.LiveTvHelpers = { window.LiveTvHelpers = {
getTimersHtml: getTimersHtml, getTimersHtml: getTimersHtml
getProgramScheduleHtml: getProgramScheduleHtml
}; };
}); });

View file

@ -92,13 +92,9 @@
ImageLoader.lazyChildren(recordingItems); ImageLoader.lazyChildren(recordingItems);
} }
function renderActiveRecordings(context) { function renderActiveRecordings(context, promise) {
ApiClient.getLiveTvTimers({ promise.then(function (result) {
IsActive: true
}).then(function (result) {
// The IsActive param is new, so handle older servers that don't support it // The IsActive param is new, so handle older servers that don't support it
if (result.Items.length && result.Items[0].Status != 'InProgress') { if (result.Items.length && result.Items[0].Status != 'InProgress') {
@ -111,18 +107,9 @@
}); });
} }
function renderLatestRecordings(context) { function renderLatestRecordings(context, promise) {
ApiClient.getLiveTvRecordings({ promise.then(function (result) {
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
EnableImageTypes: "Primary,Thumb,Backdrop"
}).then(function (result) {
renderRecordings(context.querySelector('#latestRecordings'), result.Items); renderRecordings(context.querySelector('#latestRecordings'), result.Items);
@ -130,18 +117,9 @@
}); });
} }
function renderMovieRecordings(context) { function renderMovieRecordings(context, promise) {
ApiClient.getLiveTvRecordings({ promise.then(function (result) {
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
IsMovie: true
}).then(function (result) {
renderRecordings(context.querySelector('#movieRecordings'), result.Items, { renderRecordings(context.querySelector('#movieRecordings'), result.Items, {
showYear: true, showYear: true,
@ -150,18 +128,9 @@
}); });
} }
function renderEpisodeRecordings(context) { function renderEpisodeRecordings(context, promise) {
ApiClient.getLiveTvRecordingSeries({ promise.then(function (result) {
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
IsSeries: true
}).then(function (result) {
renderRecordings(context.querySelector('#episodeRecordings'), result.Items, { renderRecordings(context.querySelector('#episodeRecordings'), result.Items, {
showItemCounts: true, showItemCounts: true,
@ -170,18 +139,9 @@
}); });
} }
function renderSportsRecordings(context) { function renderSportsRecordings(context, promise) {
ApiClient.getLiveTvRecordings({ promise.then(function (result) {
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
IsSports: true
}).then(function (result) {
renderRecordings(context.querySelector('#sportsRecordings'), result.Items, { renderRecordings(context.querySelector('#sportsRecordings'), result.Items, {
showYear: true, showYear: true,
@ -190,18 +150,9 @@
}); });
} }
function renderKidsRecordings(context) { function renderKidsRecordings(context, promise) {
ApiClient.getLiveTvRecordings({ promise.then(function (result) {
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
IsKids: true
}).then(function (result) {
renderRecordings(context.querySelector('#kidsRecordings'), result.Items, { renderRecordings(context.querySelector('#kidsRecordings'), result.Items, {
showYear: true, showYear: true,
@ -228,27 +179,6 @@
}); });
} }
function reload(context) {
Dashboard.showLoadingMsg();
renderActiveRecordings(context);
renderLatestRecordings(context);
renderMovieRecordings(context);
renderEpisodeRecordings(context);
renderSportsRecordings(context);
renderKidsRecordings(context);
ApiClient.getLiveTvRecordingGroups({
userId: Dashboard.getCurrentUserId()
}).then(function (result) {
renderRecordingGroups(context, result.Items);
});
}
function onMoreClick(e) { function onMoreClick(e) {
var type = this.getAttribute('data-type'); var type = this.getAttribute('data-type');
@ -280,6 +210,12 @@
return function (view, params, tabContent) { return function (view, params, tabContent) {
var self = this; var self = this;
var activeRecordingsPromise;
var sportsPromise;
var kidsPromise;
var moviesPromise;
var seriesPromise;
var latestPromise;
categorysyncbuttons.init(tabContent); categorysyncbuttons.init(tabContent);
@ -288,11 +224,83 @@
moreButtons[i].addEventListener('click', onMoreClick); moreButtons[i].addEventListener('click', onMoreClick);
} }
tabContent.querySelector('#activeRecordings .recordingItems').addEventListener('timercancelled', function () { tabContent.querySelector('#activeRecordings .recordingItems').addEventListener('timercancelled', function () {
reload(tabContent); self.preRender();
self.renderTab();
}); });
self.preRender = function () {
activeRecordingsPromise = ApiClient.getLiveTvTimers({
IsActive: true
});
latestPromise = ApiClient.getLiveTvRecordings({
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
EnableImageTypes: "Primary,Thumb,Backdrop"
});
moviesPromise = ApiClient.getLiveTvRecordings({
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
IsMovie: true
});
seriesPromise = ApiClient.getLiveTvRecordingSeries({
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
IsSeries: true
});
kidsPromise = ApiClient.getLiveTvRecordings({
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
IsKids: true
});
sportsPromise = ApiClient.getLiveTvRecordings({
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
IsSports: true
});
};
self.renderTab = function () { self.renderTab = function () {
reload(tabContent); Dashboard.showLoadingMsg();
renderActiveRecordings(tabContent, activeRecordingsPromise);
renderLatestRecordings(tabContent, latestPromise);
renderMovieRecordings(tabContent, moviesPromise);
renderEpisodeRecordings(tabContent, seriesPromise);
renderSportsRecordings(tabContent, sportsPromise);
renderKidsRecordings(tabContent, kidsPromise);
ApiClient.getLiveTvRecordingGroups({
userId: Dashboard.getCurrentUserId()
}).then(function (result) {
renderRecordingGroups(tabContent, result.Items);
});
}; };
}; };

View file

@ -1,12 +1,8 @@
define(['scripts/livetvcomponents', 'emby-button', 'emby-itemscontainer'], function () { define(['scripts/livetvcomponents', 'emby-button', 'emby-itemscontainer'], function () {
function renderActiveRecordings(context) { function renderActiveRecordings(context, promise) {
ApiClient.getLiveTvTimers({ promise.then(function (result) {
IsActive: true
}).then(function (result) {
// The IsActive param is new, so handle older servers that don't support it // The IsActive param is new, so handle older servers that don't support it
if (result.Items.length && result.Items[0].Status != 'InProgress') { if (result.Items.length && result.Items[0].Status != 'InProgress') {
@ -18,7 +14,7 @@
}); });
}); });
} }
function renderTimers(context, timers, options) { function renderTimers(context, timers, options) {
LiveTvHelpers.getTimersHtml(timers, options).then(function (html) { LiveTvHelpers.getTimersHtml(timers, options).then(function (html) {
@ -37,35 +33,41 @@
}); });
} }
function renderUpcomingRecordings(context) { function renderUpcomingRecordings(context, promise) {
ApiClient.getLiveTvTimers({ promise.then(function (result) {
IsActive: false
}).then(function (result) {
renderTimers(context.querySelector('#upcomingRecordings'), result.Items); renderTimers(context.querySelector('#upcomingRecordings'), result.Items);
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
} }
function reload(context) {
Dashboard.showLoadingMsg();
renderActiveRecordings(context);
renderUpcomingRecordings(context);
}
return function (view, params, tabContent) { return function (view, params, tabContent) {
var self = this; var self = this;
var activeRecordingsPromise;
var upcomingRecordingsPromise;
tabContent.querySelector('#upcomingRecordings .recordingItems').addEventListener('timercancelled', function () { tabContent.querySelector('#upcomingRecordings .recordingItems').addEventListener('timercancelled', function () {
reload(tabContent); self.preRender();
self.renderTab();
}); });
self.preRender = function () {
activeRecordingsPromise = ApiClient.getLiveTvTimers({
IsActive: true
});
upcomingRecordingsPromise = ApiClient.getLiveTvTimers({
IsActive: false
});
};
self.renderTab = function () { self.renderTab = function () {
reload(tabContent); Dashboard.showLoadingMsg();
renderActiveRecordings(tabContent, activeRecordingsPromise);
renderUpcomingRecordings(tabContent, upcomingRecordingsPromise);
}; };
}; };

View file

@ -1,4 +1,4 @@
define(['datetime', 'dom', 'seriesRecordingEditor', 'emby-itemscontainer'], function (datetime, dom, seriesRecordingEditor) { define(['datetime', 'dom', 'seriesRecordingEditor', 'listView', 'emby-itemscontainer'], function (datetime, dom, seriesRecordingEditor, listView) {
return function (view, params) { return function (view, params) {
@ -9,6 +9,27 @@
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
} }
function getProgramScheduleHtml(items, options) {
options = options || {};
var html = '';
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-list">';
html += listView.getListViewHtml({
items: items,
enableUserDataButtons: false,
image: false,
showProgramDateTime: true,
mediaInfo: false,
action: 'none',
moreButton: false
});
html += '</div>';
return html;
}
function renderSchedule(page) { function renderSchedule(page) {
ApiClient.getLiveTvPrograms({ ApiClient.getLiveTvPrograms({
@ -28,24 +49,13 @@
result.Items = []; result.Items = [];
} }
LiveTvHelpers.getProgramScheduleHtml(result.Items).then(function (html) { var html = getProgramScheduleHtml(result.Items);
var scheduleTab = page.querySelector('.scheduleTab'); var scheduleTab = page.querySelector('.scheduleTab');
scheduleTab.innerHTML = html; scheduleTab.innerHTML = html;
ImageLoader.lazyChildren(scheduleTab); ImageLoader.lazyChildren(scheduleTab);
});
}); });
//var timers = result.Items;
//LiveTvHelpers.getTimersHtml(timers).then(function (html) {
// var scheduleTab = page.querySelector('.scheduleTab');
// scheduleTab.innerHTML = html;
// ImageLoader.lazyChildren(scheduleTab);
//});
} }
function reload() { function reload() {

View file

@ -1,4 +1,4 @@
define(['datetime', 'paper-icon-button-light', 'emby-button', 'listViewStyle'], function (datetime) { define(['datetime', 'cardBuilder', 'paper-icon-button-light', 'emby-button'], function (datetime, cardBuilder) {
var query = { var query = {
@ -30,75 +30,88 @@
var html = ''; var html = '';
if (timers.length) { html += cardBuilder.getCardsHtml({
html += '<div class="paperList">'; items: timers,
} shape: 'backdrop',
showTitle: true,
cardLayout: true,
cardFooterAside: 'none',
preferThumb: true,
coverImage: true,
overlayText: false,
showSeriesTimerTime: true,
showSeriesTimerChannel: true
});
for (var i = 0, length = timers.length; i < length; i++) { //if (timers.length) {
// html += '<div class="paperList">';
//}
var timer = timers[i]; //for (var i = 0, length = timers.length; i < length; i++) {
html += '<div class="listItem">'; // var timer = timers[i];
html += '<i class="md-icon listItemIcon">live_tv</i>'; // html += '<div class="listItem">';
html += '<div class="listItemBody three-line">'; // html += '<i class="md-icon listItemIcon">live_tv</i>';
html += '<a class="clearLink" href="livetvseriestimer.html?id=' + timer.Id + '">';
html += '<h3 class="listItemBodyText">';
html += timer.Name;
html += '</h3>';
html += '<div class="secondary">'; // html += '<div class="listItemBody three-line">';
if (timer.DayPattern) { // html += '<a class="clearLink" href="livetvseriestimer.html?id=' + timer.Id + '">';
html += timer.DayPattern; // html += '<h3 class="listItemBodyText">';
} // html += timer.Name;
else { // html += '</h3>';
var days = timer.Days || [];
html += days.join(', '); // html += '<div class="secondary">';
} // if (timer.DayPattern) {
// html += timer.DayPattern;
// }
// else {
// var days = timer.Days || [];
if (timer.RecordAnyTime) { // html += days.join(', ');
// }
html += ' - ' + Globalize.translate('LabelAnytime'); // if (timer.RecordAnyTime) {
} else {
html += ' - ' + datetime.getDisplayTime(timer.StartDate);
}
html += '</div>';
html += '<div class="secondary">'; // html += ' - ' + Globalize.translate('LabelAnytime');
if (timer.RecordAnyChannel) { // } else {
html += Globalize.translate('LabelAllChannels'); // html += ' - ' + datetime.getDisplayTime(timer.StartDate);
} // }
else if (timer.ChannelId) { // html += '</div>';
html += timer.ChannelName;
}
html += '</div>';
html += '</a>'; // html += '<div class="secondary">';
html += '</div>'; // if (timer.RecordAnyChannel) {
// html += Globalize.translate('LabelAllChannels');
// }
// else if (timer.ChannelId) {
// html += timer.ChannelName;
// }
// html += '</div>';
html += '<button type="button" is="paper-icon-button-light" data-seriestimerid="' + timer.Id + '" title="' + Globalize.translate('ButtonCancelSeries') + '" class="btnCancelSeries autoSize"><i class="md-icon">cancel</i></button>'; // html += '</a>';
// html += '</div>';
html += '</div>'; // html += '<button type="button" is="paper-icon-button-light" data-seriestimerid="' + timer.Id + '" title="' + Globalize.translate('ButtonCancelSeries') + '" class="btnCancelSeries autoSize"><i class="md-icon">cancel</i></button>';
}
if (timers.length) { // html += '</div>';
html += '</div>'; //}
}
//if (timers.length) {
// html += '</div>';
//}
var elem = context.querySelector('#items'); var elem = context.querySelector('#items');
elem.innerHTML = html; elem.innerHTML = html;
if (timers.length) { //if (timers.length) {
elem.querySelector('.paperList').addEventListener('click', function (e) { // elem.querySelector('.paperList').addEventListener('click', function (e) {
var btnCancelSeries = parentWithClass(e.target, 'btnCancelSeries'); // var btnCancelSeries = parentWithClass(e.target, 'btnCancelSeries');
if (btnCancelSeries) { // if (btnCancelSeries) {
deleteSeriesTimer(context, btnCancelSeries.getAttribute('data-seriestimerid')); // deleteSeriesTimer(context, btnCancelSeries.getAttribute('data-seriestimerid'));
} // }
}); // });
} //}
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
} }
@ -116,11 +129,11 @@
return elem; return elem;
} }
function reload(context) { function reload(context, promise) {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
ApiClient.getLiveTvSeriesTimers(query).then(function (result) { promise.then(function (result) {
renderTimers(context, result.Items); renderTimers(context, result.Items);
}); });
@ -129,9 +142,13 @@
return function (view, params, tabContent) { return function (view, params, tabContent) {
var self = this; var self = this;
self.renderTab = function () { var timersPromise; self.preRender = function () {
timersPromise = ApiClient.getLiveTvSeriesTimers(query);
};
self.renderTab = function () {
reload(tabContent); reload(tabContent, timersPromise);
}; };
}; };

View file

@ -168,9 +168,11 @@
var tabControllers = []; var tabControllers = [];
var renderedTabs = []; var renderedTabs = [];
function loadTab(page, index) { var tabControllers = [];
var renderedTabs = [];
function getTabController(page, index, callback) {
var tabContent = page.querySelector('.pageTabContent[data-index=\'' + index + '\']');
var depends = []; var depends = [];
switch (index) { switch (index) {
@ -178,23 +180,18 @@
case 0: case 0:
break; break;
case 1: case 1:
document.body.classList.add('autoScrollY');
depends.push('scripts/livetvguide'); depends.push('scripts/livetvguide');
break; break;
case 2: case 2:
document.body.classList.remove('autoScrollY');
depends.push('scripts/livetvchannels'); depends.push('scripts/livetvchannels');
break; break;
case 3: case 3:
document.body.classList.remove('autoScrollY');
depends.push('scripts/livetvrecordings'); depends.push('scripts/livetvrecordings');
break; break;
case 4: case 4:
document.body.classList.remove('autoScrollY');
depends.push('scripts/livetvschedule'); depends.push('scripts/livetvschedule');
break; break;
case 5: case 5:
document.body.classList.remove('autoScrollY');
depends.push('scripts/livetvseriestimers'); depends.push('scripts/livetvseriestimers');
break; break;
default: default:
@ -202,12 +199,14 @@
} }
require(depends, function (controllerFactory) { require(depends, function (controllerFactory) {
var tabContent;
if (index == 0) { if (index == 0) {
tabContent = view.querySelector('.pageTabContent[data-index=\'' + index + '\']');
self.tabContent = tabContent; self.tabContent = tabContent;
} }
var controller = tabControllers[index]; var controller = tabControllers[index];
if (!controller) { if (!controller) {
tabContent = view.querySelector('.pageTabContent[data-index=\'' + index + '\']');
controller = index ? new controllerFactory(view, params, tabContent) : self; controller = index ? new controllerFactory(view, params, tabContent) : self;
tabControllers[index] = controller; tabControllers[index] = controller;
@ -216,8 +215,37 @@
} }
} }
callback(controller);
});
}
function preLoadTab(page, index) {
getTabController(page, index, function (controller) {
if (renderedTabs.indexOf(index) == -1) { if (renderedTabs.indexOf(index) == -1) {
renderedTabs.push(index); if (controller.preRender) {
controller.preRender();
}
}
});
}
function loadTab(page, index) {
getTabController(page, index, function (controller) {
if (index === 1) {
document.body.classList.add('autoScrollY');
} else {
document.body.classList.remove('autoScrollY');
}
if (renderedTabs.indexOf(index) == -1) {
if (index < 2) {
renderedTabs.push(index);
}
controller.renderTab(); controller.renderTab();
} }
}); });
@ -227,6 +255,10 @@
libraryBrowser.configurePaperLibraryTabs(view, viewTabs, view.querySelectorAll('.pageTabContent'), [0, 2, 3, 4, 5]); libraryBrowser.configurePaperLibraryTabs(view, viewTabs, view.querySelectorAll('.pageTabContent'), [0, 2, 3, 4, 5]);
viewTabs.addEventListener('beforetabchange', function (e) {
preLoadTab(view, parseInt(e.detail.selectedTabIndex));
});
viewTabs.addEventListener('tabchange', function (e) { viewTabs.addEventListener('tabchange', function (e) {
loadTab(view, parseInt(e.detail.selectedTabIndex)); loadTab(view, parseInt(e.detail.selectedTabIndex));
}); });

View file

@ -141,8 +141,7 @@
shape: "auto", shape: "auto",
context: 'movies', context: 'movies',
showTitle: true, showTitle: true,
showYear: true, centerText: false,
lazy: true,
cardLayout: true, cardLayout: true,
showItemCounts: true showItemCounts: true
}); });

View file

@ -38,7 +38,7 @@
itemHtml += '<i class="listItemIcon md-icon" style="background-color:#999;">notifications_off</i>'; itemHtml += '<i class="listItemIcon md-icon" style="background-color:#999;">notifications_off</i>';
} }
itemHtml += '<div class="listItemBody two-line">'; itemHtml += '<div class="listItemBody">';
itemHtml += '<div class="listItemBodyText">' + i.Name + '</div>'; itemHtml += '<div class="listItemBodyText">' + i.Name + '</div>';
itemHtml += '</div>'; itemHtml += '</div>';

View file

@ -693,8 +693,10 @@
lazy: true, lazy: true,
showDetailsMenu: true, showDetailsMenu: true,
centerText: true, centerText: true,
overlayText: false,
overlayPlayButton: true, overlayPlayButton: true,
allowBottomPadding: !enableScrollX() allowBottomPadding: !enableScrollX(),
preferThumb: true
}); });
html += '</div>'; html += '</div>';

View file

@ -1850,7 +1850,8 @@ var AppInfo = {};
path: '/addplugin.html', path: '/addplugin.html',
dependencies: [], dependencies: [],
autoFocus: false, autoFocus: false,
roles: 'admin' roles: 'admin',
controller: 'scripts/addpluginpage'
}); });
defineRoute({ defineRoute({
@ -2719,8 +2720,8 @@ var AppInfo = {};
// Prefer custom font over Segoe if on desktop windows // Prefer custom font over Segoe if on desktop windows
if (!browserInfo.mobile && navigator.userAgent.toLowerCase().indexOf('windows') != -1) { if (!browserInfo.mobile && navigator.userAgent.toLowerCase().indexOf('windows') != -1) {
postInitDependencies.push('opensansFont'); //postInitDependencies.push('opensansFont');
//postInitDependencies.push('robotoFont'); postInitDependencies.push('robotoFont');
} }
postInitDependencies.push('bower_components/emby-webcomponents/input/api'); postInitDependencies.push('bower_components/emby-webcomponents/input/api');