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

add channels infrastructure

This commit is contained in:
Luke Pulverenti 2014-05-03 00:20:04 -04:00
parent 5218e67d4e
commit be0861a1ee
18 changed files with 453 additions and 224 deletions

View file

@ -4,15 +4,95 @@
<title>${TitleMediaBrowser}</title> <title>${TitleMediaBrowser}</title>
</head> </head>
<body> <body>
<div id="channelItemsPage" data-role="page" class="page libraryPage" data-theme="b" data-view="channels"> <div id="channelItemsPage" data-role="page" class="page libraryPage noSecondaryNavPage channelsPage" data-theme="b" data-view="channels">
<div data-role="content"> <div data-role="content">
<div class="viewSettings"> <div class="viewSettings">
<h1 style="margin: 0 1em 0 0; display: inline-block; vertical-align: middle;">Trailers</h1>
<div class="viewControls" data-role="controlgroup" data-type="horizontal">
<button data-mini="true" data-icon="sort" data-inline="true" data-iconpos="notext" title="${ButtonSort}" onclick="$('#sortPanel', $(this).parents('.page')).panel( 'toggle' );">${ButtonSort}</button>
<button data-mini="true" data-icon="filter" data-inline="true" data-iconpos="notext" title="${ButtonFilter}" onclick="$('#filterPanel', $(this).parents('.page')).panel( 'toggle' );">${ButtonFilter}</button>
</div>
<div class="listTopPaging"> <div class="listTopPaging">
</div> </div>
</div> </div>
<div id="items" class="itemsContainer"></div> <div id="items" class="itemsContainer"></div>
</div> </div>
<div data-role="popup" id="popupDialog" data-overlay-theme="b" data-theme="b" data-dismissible="false" style="max-width: 250px;" data-history="false">
<div style="padding: .5em 1.5em;">
<p style="color: #eee;">Loading channel content...</p>
</div>
</div>
<div data-role="panel" id="sortPanel" data-position="right" data-display="overlay" data-position-fixed="true">
<form>
<fieldset data-role="controlgroup">
<legend>
<strong>${HeaderSortBy}</strong>
</legend>
<input class="radioSortBy defaultSort" type="radio" name="radioSortBy" id="radioSortName" value="on" checked="checked" data-sortby="SortName" data-mini="true">
<label for="radioSortName">${OptionNameSort}</label>
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioCommunityRating" value="off" data-sortby="CommunityRating,SortName" data-mini="true">
<label for="radioCommunityRating">${OptionCommunityRating}</label>
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioDateCreated" value="off" data-sortby="DateCreated,SortName" data-mini="true">
<label for="radioDateCreated">${OptionDateAdded}</label>
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioDatePlayed" value="off" data-sortby="DatePlayed,SortName" data-mini="true">
<label for="radioDatePlayed">${OptionDatePlayed}</label>
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioPlayCount" value="off" data-sortby="PlayCount,SortName" data-mini="true">
<label for="radioPlayCount">${OptionPlayCount}</label>
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioPremiereDate" value="off" data-sortby="PremiereDate,SortName" data-mini="true">
<label for="radioPremiereDate">${OptionReleaseDate}</label>
<input class="radioSortBy" type="radio" name="radioSortBy" id="radioRuntime" value="off" data-sortby="Runtime,SortName" data-mini="true">
<label for="radioRuntime">${OptionRuntime}</label>
</fieldset>
<fieldset data-role="controlgroup">
<legend>
<strong>${HeaderSortOrder}</strong>
</legend>
<input class="radioSortOrder" type="radio" name="radioSortOrder" id="radioAscending" value="on" checked="checked" data-sortorder="Ascending" data-mini="true">
<label for="radioAscending">${OptionAscending}</label>
<input class="radioSortOrder" type="radio" name="radioSortOrder" id="radioDescending" value="off" data-sortorder="Descending" data-mini="true">
<label for="radioDescending">${OptionDescending}</label>
</fieldset>
</form>
</div>
<div data-role="panel" id="filterPanel" data-position="right" data-display="overlay" data-position-fixed="true">
<form>
<fieldset data-role="controlgroup">
<legend>
<strong>${HeaderFilters}</strong>
</legend>
<input class="chkStandardFilter" type="checkbox" name="chkPlayed" id="chkPlayed" data-filter="IsPlayed" data-mini="true">
<label for="chkPlayed">${OptionPlayed}</label>
<input class="chkStandardFilter" type="checkbox" name="chkUnplayed" id="chkUnplayed" data-filter="IsUnPlayed" data-mini="true">
<label for="chkUnplayed">${OptionUnplayed}</label>
<input class="chkStandardFilter" type="checkbox" name="chkResumable" id="chkResumable" data-filter="IsResumable" data-mini="true">
<label for="chkResumable">${OptionResumable}</label>
<input class="chkStandardFilter" type="checkbox" name="chkIsFavorite" id="chkIsFavorite" data-filter="IsFavorite" data-mini="true">
<label for="chkIsFavorite">${OptionFavorite}</label>
<input class="chkStandardFilter" type="checkbox" name="chkLikes" id="chkLikes" data-filter="Likes" data-mini="true">
<label for="chkLikes">${OptionLikes}</label>
<input class="chkStandardFilter" type="checkbox" name="chkDislikes" id="chkDislikes" data-filter="Dislikes" data-mini="true">
<label for="chkDislikes">${OptionDislikes}</label>
</fieldset>
</form>
</div>
</div> </div>
</body> </body>
</html> </html>

View file

@ -4,7 +4,7 @@
<title>${TitleMediaBrowser}</title> <title>${TitleMediaBrowser}</title>
</head> </head>
<body> <body>
<div id="channelsPage" data-role="page" class="page libraryPage" data-theme="b" data-view="channels"> <div id="channelsPage" data-role="page" class="page libraryPage noSecondaryNavPage channelsPage" data-theme="b" data-view="channels">
<div data-role="content"> <div data-role="content">
<div class="viewSettings"> <div class="viewSettings">

View file

@ -4,7 +4,7 @@
<title>${TitleMediaBrowser}</title> <title>${TitleMediaBrowser}</title>
</head> </head>
<body> <body>
<div id="boxsetsPage" data-role="page" class="page libraryPage" data-theme="b" data-view="boxsets"> <div id="boxsetsPage" data-role="page" class="page libraryPage noSecondaryNavPage" data-theme="b" data-view="boxsets">
<div class="alphabetPicker"> <div class="alphabetPicker">
</div> </div>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,178 @@
.libraryPage {
padding-top: 48px !important;
}
.libraryPage:not(.metadataEditorPage):not(.noSecondaryNavPage) {
padding-top: 91px !important;
}
.viewMenuBar {
font-weight: bold;
position: fixed;
right: 0;
left: 0;
z-index: 1000;
top: 0;
padding-left: 10px;
background: #181818;
border-bottom: 1px solid #080808;
}
.viewMenuLink {
font-size: 90%;
}
.viewMenuLink {
text-decoration: none;
color: #ccc!important;
padding: 7px .5em 6px;
display: inline-block;
vertical-align: middle;
}
.viewMenuBar .btnCurrentUser {
padding: 7px 1em 6px;
}
.viewMenuLink:hover {
color: #fff;
}
.viewMenuLink:hover img {
opacity: .5;
}
.viewMenuLink img {
height: 24px;
vertical-align: top;
}
.selectedMediaFolder {
color: #fff!important;
}
.viewMenuBar .selectedMediaFolder:before {
content: '\25BA';
color: #fff;
}
.viewMenuSecondary {
float: right;
}
.viewMenuTextLink {
display: none;
height: 20px;
padding-top: 9px;
text-transform: uppercase;
font-size: 14px;
font-weight: 400!important;
}
.viewMenuTextLink {
display: inline-block;
}
.viewName {
vertical-align: middle;
}
.selectedViewLink {
color: #fff!important;
}
.libraryViewNav {
height: 42px;
overflow: hidden;
border-bottom: 1px solid #333;
position: fixed;
left: 0;
right: 0;
top: 48px;
z-index: 1000;
background-color: #252525;
}
.libraryViewNavInner {
text-align: center;
font-size: 14px;
white-space: nowrap;
padding: 0 0 0;
overflow-x: auto;
height: 55px;
}
.libraryViewNav .ui-btn-active .libraryViewNavLinkContent {
border-bottom-color: #38c;
color: #fff;
}
.libraryViewNav a {
display: inline-block;
padding: 12px 0 0;
color: #eee!important;
text-decoration: none;
margin: 0 0;
position: relative;
font-weight: normal;
}
.libraryViewNav a:hover {
color: #bbb!important;
}
.libraryViewNavLinkContent {
border-bottom: 5px solid transparent;
display: inline-block;
padding: 0 .9em 7px;
color: #ddd;
}
@media all and (min-width: 950px) {
.libraryMenuButton {
display: none;
}
}
@media all and (max-width: 950px) {
.desktopHomeLink {
display: none;
}
.desktopViewMenuLink {
display: none;
}
.libraryViewNavInner {
text-align: left;
}
}
@media all and (min-width: 750px) {
.viewMenuLink {
padding-left: .8em;
padding-right: .8em;
}
.libraryMenuButton + .viewMenuTextLink {
padding-left: .6em !important;
}
.viewMenuBar .btnCurrentUser {
padding-right: 1.5em;
}
.lnkSibling:not(.hide) {
display: block;
}
.itemBackdrop:not(.noBackdrop) {
border-bottom: 1px solid #111;
}
}

View file

@ -55,10 +55,6 @@
background-color: #999; background-color: #999;
} }
.borderlessPosterItem .posterItemImage {
border-color: transparent;
}
.posterItemStoreText { .posterItemStoreText {
font-weight: normal; font-weight: normal;
text-overflow: ellipsis; text-overflow: ellipsis;

View file

@ -4,7 +4,7 @@
<title>${TitleMediaBrowser}</title> <title>${TitleMediaBrowser}</title>
</head> </head>
<body> <body>
<div id="indexPage" data-role="page" class="page type-home libraryPage noLibraryMenuSelectionPage" data-theme="b"> <div id="indexPage" data-role="page" class="page type-home libraryPage noLibraryMenuSelectionPage noSecondaryNavPage" data-theme="b">
<div data-role="content"> <div data-role="content">
<table class="ehsContent"> <table class="ehsContent">

View file

@ -4,7 +4,7 @@
<title></title> <title></title>
</head> </head>
<body> <body>
<div id="itemListPage" data-role="page" class="page libraryPage folderListPage" data-theme="b"> <div id="itemListPage" data-role="page" class="page libraryPage folderListPage noSecondaryNavPage" data-theme="b">
<div class="alphabetPicker"> <div class="alphabetPicker">
</div> </div>
<div data-role="content" class="itemListContent"> <div data-role="content" class="itemListContent">

View file

@ -4,7 +4,7 @@
<title>${TitleMediaBrowser}</title> <title>${TitleMediaBrowser}</title>
</head> </head>
<body> <body>
<div id="movieTrailersPage" data-role="page" class="page libraryPage trailerPage" data-theme="b" data-view="movies"> <div id="movieTrailersPage" data-role="page" class="page libraryPage noSecondaryNavPage" data-theme="b" data-view="movies">
<div class="alphabetPicker"> <div class="alphabetPicker">
</div> </div>

View file

@ -4,7 +4,7 @@
<title>${TitleMediaBrowser}</title> <title>${TitleMediaBrowser}</title>
</head> </head>
<body> <body>
<div id="nowPlayingPage" data-role="page" class="page libraryPage nowPlayingPage" data-theme="b"> <div id="nowPlayingPage" data-role="page" class="page libraryPage nowPlayingPage noSecondaryNavPage" data-theme="b">
<div data-role="content" style="padding: 1em 0;"> <div data-role="content" style="padding: 1em 0;">

View file

@ -3,6 +3,8 @@
// The base query options // The base query options
var query = { var query = {
SortBy: "SortName",
SortOrder: "Ascending",
StartIndex: 0 StartIndex: 0
}; };
@ -10,9 +12,18 @@
return 'channels-' + getParameterByName('id'); return 'channels-' + getParameterByName('id');
} }
function showLoadingMessage(page) {
$('#popupDialog', page).popup('open');
}
function hideLoadingMessage(page) {
$('#popupDialog', page).popup('close');
}
function reloadItems(page) { function reloadItems(page) {
Dashboard.showLoadingMsg(); showLoadingMessage(page);
var channelId = getParameterByName('id'); var channelId = getParameterByName('id');
@ -57,16 +68,90 @@
LibraryBrowser.saveQueryValues(getSavedQueryId(), query); LibraryBrowser.saveQueryValues(getSavedQueryId(), query);
Dashboard.hideLoadingMsg(); hideLoadingMessage(page);
}); });
} }
function updateFilterControls(page) { function updateFilterControls(page) {
// Reset form values using the last used query
$('.radioSortBy', page).each(function () {
this.checked = (query.SortBy || '').toLowerCase() == this.getAttribute('data-sortby').toLowerCase();
}).checkboxradio('refresh');
$('.radioSortOrder', page).each(function () {
this.checked = (query.SortOrder || '').toLowerCase() == this.getAttribute('data-sortorder').toLowerCase();
}).checkboxradio('refresh');
$('.chkStandardFilter', page).each(function () {
var filters = "," + (query.Filters || "");
var filterName = this.getAttribute('data-filter');
this.checked = filters.indexOf(',' + filterName) != -1;
}).checkboxradio('refresh');
$('.alphabetPicker', page).alphaValue(query.NameStartsWith);
} }
$(document).on('pagebeforeshow', "#channelItemsPage", function () { $(document).on('pageinit', "#channelItemsPage", function () {
var page = this;
$('.radioSortBy', this).on('click', function () {
query.StartIndex = 0;
query.SortBy = this.getAttribute('data-sortby');
reloadItems(page);
});
$('.radioSortOrder', this).on('click', function () {
query.StartIndex = 0;
query.SortOrder = this.getAttribute('data-sortorder');
reloadItems(page);
});
$('.chkStandardFilter', this).on('change', function () {
var filterName = this.getAttribute('data-filter');
var filters = query.Filters || "";
filters = (',' + filters).replace(',' + filterName, '').substring(1);
if (this.checked) {
filters = filters ? (filters + ',' + filterName) : filterName;
}
query.StartIndex = 0;
query.Filters = filters;
reloadItems(page);
});
$('.alphabetPicker', this).on('alphaselect', function (e, character) {
query.NameStartsWithOrGreater = character;
query.StartIndex = 0;
reloadItems(page);
}).on('alphaclear', function (e) {
query.NameStartsWithOrGreater = '';
reloadItems(page);
});
}).on('pagebeforeshow', "#channelItemsPage", function () {
}).on('pageshow', "#channelItemsPage", function () {
var page = this;
var limit = LibraryBrowser.getDefaultPageSize(); var limit = LibraryBrowser.getDefaultPageSize();
// If the default page size has changed, the start index will have to be reset // If the default page size has changed, the start index will have to be reset
@ -77,11 +162,9 @@
LibraryBrowser.loadSavedQueryValues(getSavedQueryId(), query); LibraryBrowser.loadSavedQueryValues(getSavedQueryId(), query);
reloadItems(this); reloadItems(page);
}).on('pageshow', "#channelItemsPage", function () { updateFilterControls(page);
updateFilterControls(this);
}); });
})(jQuery, document); })(jQuery, document);

View file

@ -25,10 +25,11 @@
html = LibraryBrowser.getPosterViewHtml({ html = LibraryBrowser.getPosterViewHtml({
items: result.Items, items: result.Items,
shape: "square", shape: "backdrop",
context: 'channels', context: 'channels',
showTitle: true, showTitle: true,
centerText: true centerText: true,
preferThumb: true
}); });
$('#items', page).html(html).trigger('create').createPosterItemMenus(); $('#items', page).html(html).trigger('create').createPosterItemMenus();

View file

@ -457,7 +457,7 @@
AdjacentTo: item.Id AdjacentTo: item.Id
}); });
} }
else if (item.Type == "Episode") { else if (item.Type == "Episode" && item.SeasonId) {
// Use dedicated episodes endpoint // Use dedicated episodes endpoint
promise = ApiClient.getEpisodes(item.SeriesId, { promise = ApiClient.getEpisodes(item.SeriesId, {

View file

@ -68,7 +68,7 @@
function getItemHref(item) { function getItemHref(item) {
if (item.Type == 'ManualCollectionsFolder' || item.CollectionType == 'boxsets') { if (item.Type == 'ManualCollectionsFolder') {
return 'collections.html?topParentId=' + item.Id; return 'collections.html?topParentId=' + item.Id;
} }
@ -106,7 +106,7 @@
}).join(''); }).join('');
if (counts.ChannelCount) { if (counts.ChannelCount) {
html += '<a class="viewMenuLink viewMenuTextLink desktopViewMenuLink lnkMediaFolder" href="channels.html"><span class="viewName">Channels</span></a>'; html += '<a class="viewMenuLink viewMenuTextLink desktopViewMenuLink lnkMediaFolder" data-itemid="channels" href="channels.html"><span class="viewName">Channels</span></a>';
} }
if (liveTvInfo.EnabledUsers.indexOf(user.Id) != -1) { if (liveTvInfo.EnabledUsers.indexOf(user.Id) != -1) {
@ -155,7 +155,7 @@
}).join(''); }).join('');
if (counts.ChannelCount) { if (counts.ChannelCount) {
html += '<li><a class="libraryPanelLink lnkMediaFolder" href="channels.html">Channels</a></li>'; html += '<li><a class="libraryPanelLink lnkMediaFolder" data-itemid="channels" href="channels.html">Channels</a></li>';
} }
if (liveTvInfo.EnabledUsers.indexOf(Dashboard.getCurrentUserId()) != -1) { if (liveTvInfo.EnabledUsers.indexOf(Dashboard.getCurrentUserId()) != -1) {
@ -203,8 +203,9 @@
page = $(page); page = $(page);
var isLiveTvPage = page.hasClass('liveTvPage'); var isLiveTvPage = page.hasClass('liveTvPage');
var isChannelsPage = page.hasClass('channelsPage');
var id = isLiveTvPage || page.hasClass('noLibraryMenuSelectionPage') ?
var id = isLiveTvPage || isChannelsPage || page.hasClass('noLibraryMenuSelectionPage') ?
'' : '' :
getTopParentId() || ''; getTopParentId() || '';
@ -214,7 +215,10 @@
var itemId = this.getAttribute('data-itemid'); var itemId = this.getAttribute('data-itemid');
if (isLiveTvPage && itemId == 'livetv') { if (isChannelsPage && itemId == 'channels') {
$(this).addClass('selectedMediaFolder');
}
else if (isLiveTvPage && itemId == 'livetv') {
$(this).addClass('selectedMediaFolder'); $(this).addClass('selectedMediaFolder');
} }
else if (id && itemId == id) { else if (id && itemId == id) {

View file

@ -215,7 +215,7 @@
}).on('pagebeforeshow', "#musicVideosPage", function () { }).on('pagebeforeshow', "#musicVideosPage", function () {
query.ParentId = LibraryMenu.getTopParentId(); //query.ParentId = LibraryMenu.getTopParentId();
var limit = LibraryBrowser.getDefaultPageSize(); var limit = LibraryBrowser.getDefaultPageSize();

View file

@ -70,14 +70,22 @@
var category = plugin.category || "General"; var category = plugin.category || "General";
if (category != currentCategory) { if (category != currentCategory) {
html += '<h2 class="listHeader">' + category + '</h2>';
if (currentCategory) {
html += '<br/>';
html += '<br/>';
html += '<br/>';
}
html += '<div class="ui-bar-a" style="padding: 0 1em;"><h3>' + category + '</h3></div>';
currentCategory = category; currentCategory = category;
} }
var href = plugin.externalUrl ? plugin.externalUrl : "addplugin.html?name=" + encodeURIComponent(plugin.name) + "&guid=" + plugin.guid; var href = plugin.externalUrl ? plugin.externalUrl : "addplugin.html?name=" + encodeURIComponent(plugin.name) + "&guid=" + plugin.guid;
var target = plugin.externalUrl ? ' target="_blank"' : ''; var target = plugin.externalUrl ? ' target="_blank"' : '';
html += "<a class='storeItem backdropPosterItem posterItem transparentPosterItem borderlessPosterItem' href='" + href + "' " + target + ">"; html += "<a class='backdropPosterItem posterItem' style='margin: .75em 5px 1em;' href='" + href + "' " + target + ">";
if (plugin.thumbImage) { if (plugin.thumbImage) {
html += '<div class="posterItemImage" style="background-image:url(\'' + plugin.thumbImage + '\');background-size:cover;">'; html += '<div class="posterItemImage" style="background-image:url(\'' + plugin.thumbImage + '\');background-size:cover;">';
@ -94,21 +102,13 @@
} }
html += "</div>"; html += "</div>";
html += "<div class='posterItemText' style='color:#000;font-weight:400;font-size:14px;'>"; html += "<div class='posterItemText' style='color:#000;'>";
var installedPlugin = plugin.isApp ? null : installedPlugins.filter(function (ip) { html += plugin.name;
return ip.Name == plugin.name;
})[0];
if (installedPlugin) {
html += plugin.name;
} else {
html += plugin.name;
}
html += "</div>"; html += "</div>";
html += "<div class='posterItemText packageReviewText' style='color:#000;font-weight:400;font-size:14px;'>"; html += "<div class='posterItemText packageReviewText' style='color:#000;'>";
html += plugin.price > 0 ? "$" + plugin.price.toFixed(2) : "Free"; html += plugin.price > 0 ? "$" + plugin.price.toFixed(2) : "Free";
html += Dashboard.getStoreRatingHtml(plugin.avgRating, plugin.id, plugin.name); html += Dashboard.getStoreRatingHtml(plugin.avgRating, plugin.id, plugin.name);
@ -117,6 +117,20 @@
html += "</span>"; html += "</span>";
html += "</div>"; html += "</div>";
var installedPlugin = plugin.isApp ? null : installedPlugins.filter(function (ip) {
return ip.Name == plugin.name;
})[0];
html += "<div class='posterItemText' style='color:#000;'>";
if (installedPlugin) {
html += installedPlugin.Version + ' installed';
} else {
html += '&nbsp;';
}
html += "</div>";
html += "</a>"; html += "</a>";
pluginhtml += html; pluginhtml += html;

View file

@ -60,7 +60,38 @@
html += '</fieldset>'; html += '</fieldset>';
$('.libraryAccess', page).html(html).trigger('create'); $('.mediaFolderAccess', page).html(html).trigger('create');
}
function loadChannels(page, user, channels) {
var html = '';
html += '<fieldset data-role="controlgroup">';
html += '<legend>Channels</legend>';
for (var i = 0, length = channels.length; i < length; i++) {
var folder = channels[i];
var id = 'channels' + i;
var checkedAttribute = user.Configuration.BlockedChannels.indexOf(folder.Name) == -1 ? ' checked="checked"' : '';
html += '<input class="chkChannel" data-foldername="' + folder.Name + '" type="checkbox" data-mini="true" id="' + id + '"' + checkedAttribute + ' />';
html += '<label for="' + id + '">' + folder.Name + '</label>';
}
html += '</fieldset>';
$('.channelAccess', page).show().html(html).trigger('create');
if (channels.length) {
$('.channelAccessContainer', page).show();
} else {
$('.channelAccessContainer', page).hide();
}
} }
function loadUnratedItems(page, user) { function loadUnratedItems(page, user) {
@ -68,6 +99,7 @@
var items = [ var items = [
{ name: 'Books', value: 'Book' }, { name: 'Books', value: 'Book' },
{ name: 'Games', value: 'Game' }, { name: 'Games', value: 'Game' },
{ name: 'Internet Channel Content', value: 'ChannelContent' },
{ name: 'Live TV Channels', value: 'LiveTvChannel' }, { name: 'Live TV Channels', value: 'LiveTvChannel' },
{ name: 'Live TV Programs', value: 'LiveTvProgram' }, { name: 'Live TV Programs', value: 'LiveTvProgram' },
{ name: 'Movies', value: 'Movie' }, { name: 'Movies', value: 'Movie' },
@ -100,10 +132,11 @@
$('.blockUnratedItems', page).html(html).trigger('create'); $('.blockUnratedItems', page).html(html).trigger('create');
} }
function loadUser(page, user, loggedInUser, allParentalRatings, mediaFolders) { function loadUser(page, user, loggedInUser, allParentalRatings, mediaFolders, channels) {
Dashboard.setPageTitle(user.Name); Dashboard.setPageTitle(user.Name);
loadChannels(page, user, channels);
loadMediaFolders(page, user, mediaFolders); loadMediaFolders(page, user, mediaFolders);
loadUnratedItems(page, user); loadUnratedItems(page, user);
@ -147,6 +180,12 @@
}).get(); }).get();
user.Configuration.BlockedChannels = $('.chkChannel:not(:checked)', page).map(function () {
return this.getAttribute('data-foldername');
}).get();
user.Configuration.BlockUnratedItems = $('.chkUnratedItem:checked', page).map(function () { user.Configuration.BlockUnratedItems = $('.chkUnratedItem:checked', page).map(function () {
return this.getAttribute('data-itemtype'); return this.getAttribute('data-itemtype');
@ -207,9 +246,11 @@
var promise4 = $.getJSON(ApiClient.getUrl("Library/MediaFolders")); var promise4 = $.getJSON(ApiClient.getUrl("Library/MediaFolders"));
$.when(promise1, promise2, promise3, promise4).done(function (response1, response2, response3, response4) { var promise5 = $.getJSON(ApiClient.getUrl("Channels"));
loadUser(page, response1[0] || response1, response2[0], response3[0], response4[0].Items); $.when(promise1, promise2, promise3, promise4, promise5).done(function (response1, response2, response3, response4, response5) {
loadUser(page, response1[0] || response1, response2[0], response3[0], response4[0].Items, response5[0].Items);
}); });
}); });

View file

@ -18,11 +18,18 @@
<form class="userParentalControlForm"> <form class="userParentalControlForm">
<div> <div>
<div class="libraryAccess"> <div class="mediaFolderAccess">
</div> </div>
<div class="fieldDescription">${LibraryAccessHelp}</div> <div class="fieldDescription">${LibraryAccessHelp}</div>
</div> </div>
<br /> <br />
<div class="channelAccessContainer">
<div class="channelAccess">
</div>
<div class="fieldDescription">${ChannelAccessHelp}</div>
<br />
</div>
<br /> <br />
<ul data-role="listview" class="ulForm"> <ul data-role="listview" class="ulForm">
<li> <li>