mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
#715 - Support creating/editing collections (boxsets) in web client
This commit is contained in:
parent
c353bf7d5e
commit
edc7f33329
27 changed files with 486 additions and 58 deletions
|
@ -17,6 +17,11 @@
|
|||
<form class="advancedServerSettingsForm">
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<label for="txtServerName">Friendly server name:</label>
|
||||
<input id="txtServerName" data-mini="true" />
|
||||
<div class="fieldDescription">This name will be used to identify this server. If left blank, the computer name will be used.</div>
|
||||
</li>
|
||||
<li>
|
||||
<label for="txtPortNumber">Http server port number: </label>
|
||||
<input type="number" id="txtPortNumber" name="txtPortNumber" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
||||
|
|
|
@ -144,8 +144,8 @@
|
|||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<label for="txtDeleteLeftOverFiles">Transfer Method</label>
|
||||
<select name="copyOrMoveFile" id="copyOrMoveFile" data-mini="true">
|
||||
<label for="copyOrMoveFile">Transfer Method</label>
|
||||
<select id="copyOrMoveFile" data-mini="true">
|
||||
<option value="true">Copy</option>
|
||||
<option value="false">Move</option>
|
||||
</select>
|
||||
|
|
|
@ -4,29 +4,19 @@
|
|||
<title>Media Browser</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="boxsetsPage" data-role="page" class="page libraryPage" data-theme="b" data-view="movies">
|
||||
|
||||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html" class="ui-btn-active">Collections</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
<a href="moviestudios.html">Studios</a>
|
||||
</div>
|
||||
<div id="boxsetsPage" data-role="page" class="page libraryPage" data-theme="b" data-view="boxsets">
|
||||
|
||||
<div class="alphabetPicker">
|
||||
</div>
|
||||
<div data-role="content">
|
||||
<div class="viewSettings">
|
||||
<div class="viewControls">
|
||||
<button data-mini="true" data-icon="plus" data-inline="true" onclick="$('#newCollectionPanel', $(this).parents('.page')).panel( 'toggle' );">New</button>
|
||||
<button data-mini="true" data-icon="sort" data-inline="true" onclick="$('#sortPanel', $(this).parents('.page')).panel( 'toggle' );">Sort</button>
|
||||
<button data-mini="true" data-icon="filter" data-inline="true" onclick="$('#filterPanel', $(this).parents('.page')).panel( 'toggle' );">Filter</button>
|
||||
</div>
|
||||
<div class="listTopPaging">
|
||||
</div>
|
||||
<button id="btnNewCollection" data-mini="true" data-icon="plus" data-inline="true">New</button>
|
||||
<div class="viewSummary"></div>
|
||||
</div>
|
||||
<div id="items" class="itemsContainer"></div>
|
||||
|
@ -48,7 +38,7 @@
|
|||
</div>
|
||||
<br />
|
||||
<p>
|
||||
<button type="submit" data-icon="plus" data-mini="true" data-theme="b">Create</button>
|
||||
<button id="btnSubmitNewCollection" type="submit" data-icon="plus" data-mini="true" data-theme="b">Create</button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
|
@ -333,6 +333,11 @@
|
|||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.collectionItemSearchResults {
|
||||
max-height: 65%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
||||
@media all and (min-height: 500px) {
|
||||
|
||||
|
@ -346,6 +351,10 @@
|
|||
.popupIdentifyForm, .identificationSearchResults {
|
||||
height: 450px;
|
||||
}
|
||||
|
||||
.collectionItemSearchResults {
|
||||
max-height: 70%;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-height: 700px) {
|
||||
|
@ -353,6 +362,10 @@
|
|||
.popupIdentifyForm, .identificationSearchResults {
|
||||
height: 550px;
|
||||
}
|
||||
|
||||
.collectionItemSearchResults {
|
||||
max-height: 75%;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-height: 800px) {
|
||||
|
@ -364,6 +377,10 @@
|
|||
.popupIdentifyForm, .identificationSearchResults {
|
||||
height: 600px;
|
||||
}
|
||||
|
||||
.collectionItemSearchResults {
|
||||
max-height: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-height: 900px) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
.posterItem {
|
||||
margin: 8px;
|
||||
margin: 5px;
|
||||
text-shadow: none;
|
||||
font-weight: normal!important;
|
||||
display: inline-block;
|
||||
|
@ -35,10 +35,6 @@
|
|||
padding: 11px 12px 10px;
|
||||
}
|
||||
|
||||
.smallBackdropPosterItem, .smallPosterItem {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.posterItemImage {
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="#" data-role="button" class="ui-btn-active">Home</a>
|
||||
<a href="dashboardinfopage.html" data-role="button">Info</a>
|
||||
|
|
74
dashboard-ui/editcollectionitems.html
Normal file
74
dashboard-ui/editcollectionitems.html
Normal file
|
@ -0,0 +1,74 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Media Browser</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="editCollectionTitlesPage" data-role="page" data-theme="b" class="page libraryPage metadataEditorPage">
|
||||
<div data-role="content editPageContent">
|
||||
<div class="editPageSidebar">
|
||||
<div class="libraryTree">
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editPageInnerContent">
|
||||
<h1 class="itemName editPageName"> </h1>
|
||||
<br />
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="#" data-role="button" id="btnEditMetadata">Metadata</a>
|
||||
<a id="btnEditPeople" style="display: none;" href="#" data-role="button">People</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">Titles</a>
|
||||
<a id="btnEditImages" href="#" data-role="button">Images</a>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: -20px;">
|
||||
<button type="button" id="btnAddItem" data-icon="plus" data-inline="true" data-mini="true">Add</button>
|
||||
<button type="button" id="btnRemoveItems" data-icon="delete" data-inline="true" data-mini="true" disabled="disabled">Remove</button>
|
||||
</div>
|
||||
<br />
|
||||
<div class="collectionItems"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="popup" data-transition="slidefade" class="popupIdentify popup" data-theme="a">
|
||||
|
||||
<div class="ui-bar-a" style="text-align: center; padding: 0 20px;">
|
||||
<h3>Add Titles
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div data-role="content">
|
||||
|
||||
<form class="popupIdentifyForm" style="max-width: initial;">
|
||||
|
||||
<div>
|
||||
<label for="txtLookupName">Name:</label>
|
||||
|
||||
<div style="display: inline-block; width: 75%;">
|
||||
<input type="text" id="txtLookupName" data-mini="true" required="required" />
|
||||
</div>
|
||||
|
||||
<button type="submit" data-theme="b" data-icon="search" data-mini="true" data-inline="true" data-iconpos="notext">
|
||||
Search
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="collectionItemSearchResults">
|
||||
</div>
|
||||
|
||||
<button id="btnAddItems" type="button" data-icon="plus" data-mini="true">
|
||||
Add
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.popupIdentifyForm').off('submit', EditCollectionItemsPage.onSearchFormSubmit).on('submit', EditCollectionItemsPage.onSearchFormSubmit);
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -19,6 +19,7 @@
|
|||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="#" data-role="button" id="btnEditMetadata">Metadata</a>
|
||||
<a href="#" data-role="button" id="btnEditPeople" style="display: none;">People</a>
|
||||
<a id="btnEditCollectionTitles" style="display: none;" href="#" data-role="button">Titles</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">Images</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="#" data-role="button" class="ui-btn-active">Metadata</a>
|
||||
<a id="btnEditPeople" style="display: none;" href="#" data-role="button">People</a>
|
||||
<a id="btnEditCollectionTitles" style="display: none;" href="editcollectionitems.html" data-role="button">Titles</a>
|
||||
<a href="#" data-role="button" id="btnEditImages">Images</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="#" data-role="button" id="btnEditMetadata">Metadata</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">People</a>
|
||||
<a id="btnEditCollectionTitles" style="display: none;" href="#" data-role="button">Titles</a>
|
||||
<a href="#" data-role="button" id="btnEditImages">Images</a>
|
||||
</div>
|
||||
<div id="divAddPerson" style="display: none;">
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html">Box Sets</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html" class="ui-btn-active">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
|
@ -20,7 +19,6 @@
|
|||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html">Box Sets</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html" class="ui-btn-active">People</a>
|
||||
|
@ -31,7 +29,6 @@
|
|||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html">Box Sets</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html" class="ui-btn-active">Movies</a>
|
||||
<a href="boxsets.html">Collections</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
|
@ -17,21 +16,12 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id="boxsetTabs" class="itemTabs" style="display: none;">
|
||||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html" class="ui-btn-active">Collections</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
<a href="moviestudios.html">Studios</a>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
<div id="trailerTabs" class="itemTabs" style="display: none;">
|
||||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html">Collections</a>
|
||||
<a href="movietrailers.html" class="ui-btn-active">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
|
@ -174,7 +164,10 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id="childrenCollapsible" class="hide detailSection">
|
||||
<div class="detailSectionHeader"><span id="childrenTitle"></span></div>
|
||||
<div class="detailSectionHeader" style="position: relative;">
|
||||
<span id="childrenTitle"></span>
|
||||
<a id="btnEditCollectionTitles" href="#" data-role="button" data-icon="edit" data-iconpos="notext" data-inline="true" style="display: none; position: absolute; right: 0; top: 6px; margin-top: 0; margin-bottom: 0;">Edit</a>
|
||||
</div>
|
||||
<div id="childrenContent" class="detailSectionContent"></div>
|
||||
</div>
|
||||
<div id="trailersCollapsible" class="detailSection hide">
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html">Collections</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html" class="ui-btn-active">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html">Collections</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html" class="ui-btn-active">People</a>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html" class="ui-btn-active">Movies</a>
|
||||
<a href="boxsets.html">Collections</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html" class="ui-btn-active">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html">Collections</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html">Collections</a>
|
||||
<a href="movietrailers.html">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<div class="libraryViewNav">
|
||||
<a href="moviesrecommended.html">Suggested</a>
|
||||
<a href="movies.html">Movies</a>
|
||||
<a href="boxsets.html">Collections</a>
|
||||
<a href="movietrailers.html" class="ui-btn-active">Trailers</a>
|
||||
<a href="moviegenres.html">Genres</a>
|
||||
<a href="moviepeople.html">People</a>
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
$('#txtPortNumber', page).val(config.HttpServerPortNumber);
|
||||
|
||||
$('#txtDdns', page).val(config.WanDdns || '');
|
||||
$('#txtServerName', page).val(config.ServerName || '');
|
||||
|
||||
$('#chkEnableUpnp', page).checked(config.EnableUPnP).checkboxradio('refresh');
|
||||
|
||||
|
@ -52,6 +53,7 @@
|
|||
config.EnableUPnP = $('#chkEnableUpnp', form).checked();
|
||||
|
||||
config.WanDdns = $('#txtDdns', form).val();
|
||||
config.ServerName = $('#txtServerName', form).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
|
296
dashboard-ui/scripts/editcollectionitems.js
Normal file
296
dashboard-ui/scripts/editcollectionitems.js
Normal file
|
@ -0,0 +1,296 @@
|
|||
(function ($, document, window, FileReader, escape) {
|
||||
|
||||
var currentItem;
|
||||
|
||||
function updateTabs(page, item) {
|
||||
|
||||
var query = MetadataEditor.getEditQueryString(item);
|
||||
|
||||
$('#btnEditMetadata', page).attr('href', 'edititemmetadata.html?' + query);
|
||||
$('#btnEditImages', page).attr('href', 'edititemimages.html?' + query);
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
$('#btnRemoveItems', page).buttonEnabled(false);
|
||||
|
||||
MetadataEditor.getItemPromise().done(function (item) {
|
||||
|
||||
currentItem = item;
|
||||
|
||||
LibraryBrowser.renderName(item, $('.itemName', page), true);
|
||||
|
||||
updateTabs(page, item);
|
||||
|
||||
reloadTitles(page, item);
|
||||
});
|
||||
}
|
||||
|
||||
function getTitleHtml(item) {
|
||||
|
||||
var html = '<div style="display:inline-block;margin:5px;vertical-align:top;">';
|
||||
|
||||
html += '<div style="width:120px;height:180px;">';
|
||||
if (item.ImageTags.Primary) {
|
||||
|
||||
var imgUrl = ApiClient.getImageUrl(item.Id, {
|
||||
type: "Primary",
|
||||
width: 300,
|
||||
tag: item.ImageTags.Primary
|
||||
});
|
||||
|
||||
html += '<img src="' + imgUrl + '" style="max-width:120px;max-height:180px;" />';
|
||||
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
html += '<div style="text-align:center;margin-top:4px;max-width:100px;overflow:hidden;height: 32px;">' + item.Name + '</div>';
|
||||
|
||||
html += '<label for="chkRemove' + item.Id + '">Remove</label><input id="chkRemove' + item.Id + '" class="chkRemoveItem" type="checkbox" data-itemid="' + item.Id + '" data-mini="true" />';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function getSearchResultHtml(item) {
|
||||
|
||||
var html = '<div style="display:inline-block;margin:3px;vertical-align:top;">';
|
||||
|
||||
html += '<div style="width:100px;height:150px;">';
|
||||
|
||||
if (item.PrimaryImageTag) {
|
||||
|
||||
var imgUrl = ApiClient.getImageUrl(item.ItemId, {
|
||||
type: "Primary",
|
||||
width: 200,
|
||||
tag: item.PrimaryImageTag
|
||||
});
|
||||
|
||||
html += '<img src="' + imgUrl + '" style="max-width:100px;max-height:150px;" />';
|
||||
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
html += '<div style="text-align:center;margin-top:4px;max-width:100px;overflow:hidden;height: 32px;">' + item.Name + '</div>';
|
||||
|
||||
html += '<label for="chkAdd' + item.ItemId + '">Add</label><input id="chkAdd' + item.ItemId + '" class="chkAddItem" type="checkbox" data-itemid="' + item.ItemId + '" data-mini="true" />';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function reloadTitles(page, item) {
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), {
|
||||
|
||||
ParentId: item.Id
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
$(document).scrollTop(0);
|
||||
|
||||
var html = result.Items.map(getTitleHtml).join('');
|
||||
|
||||
var elem = $('.collectionItems', page).html(html).trigger('create');
|
||||
|
||||
$('.chkRemoveItem', elem).on('change', function () {
|
||||
|
||||
if ($('.chkRemoveItem:checked', elem).length) {
|
||||
$('#btnRemoveItems', page).buttonEnabled(true);
|
||||
} else {
|
||||
$('#btnRemoveItems', page).buttonEnabled(false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function showSearchResults(page, searchTerm) {
|
||||
|
||||
ApiClient.getSearchHints({
|
||||
|
||||
userId: Dashboard.getCurrentUserId(),
|
||||
searchTerm: searchTerm,
|
||||
limit: 50,
|
||||
|
||||
includePeople: false,
|
||||
includeGenres: false,
|
||||
includeStudios: false,
|
||||
includeArtists: false,
|
||||
|
||||
IncludeItemTypes: "Movie,Series,Game,MusicAlbum"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
renderSearchResults(page, result.SearchHints);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function renderSearchResults(page, items) {
|
||||
|
||||
var html = items.map(getSearchResultHtml).join('');
|
||||
|
||||
var elem = $('.collectionItemSearchResults', page).html(html).trigger('create');
|
||||
|
||||
$('.chkAddItem', elem).on('change', function () {
|
||||
|
||||
if ($('.chkAddItem:checked', elem).length) {
|
||||
$('#btnAddItems', page).buttonEnabled(true);
|
||||
} else {
|
||||
$('#btnAddItems', page).buttonEnabled(false);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function addItemsToCollection(page) {
|
||||
|
||||
var items = $('.chkAddItem:checked', page).get().map(function (c) {
|
||||
|
||||
return c.getAttribute('data-itemid');
|
||||
|
||||
});
|
||||
|
||||
if (!items.length) {
|
||||
Dashboard.alert('Please select at least one item.');
|
||||
return;
|
||||
}
|
||||
|
||||
var url = ApiClient.getUrl("Collections/" + currentItem.Id + "/Items", {
|
||||
|
||||
Ids: items.join(',')
|
||||
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url
|
||||
|
||||
}).done(function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
$('.popupIdentify', page).popup('close');
|
||||
|
||||
reload(page);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function removeItemsFromCollection(page) {
|
||||
var items = $('.chkRemoveItem:checked', page).get().map(function (c) {
|
||||
|
||||
return c.getAttribute('data-itemid');
|
||||
|
||||
});
|
||||
|
||||
if (!items.length) {
|
||||
Dashboard.alert('Please select at least one item.');
|
||||
return;
|
||||
}
|
||||
|
||||
var url = ApiClient.getUrl("Collections/" + currentItem.Id + "/Items", {
|
||||
|
||||
Ids: items.join(',')
|
||||
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: url
|
||||
|
||||
}).done(function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
reload(page);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#editCollectionTitlesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.libraryTree', page).on('itemclicked', function (event, data) {
|
||||
|
||||
if (data.itemType == "libraryreport") {
|
||||
Dashboard.navigate('libraryreport.html');
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.itemType == "livetvservice") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.id != currentItem.Id) {
|
||||
|
||||
MetadataEditor.currentItemId = data.id;
|
||||
MetadataEditor.currentItemName = data.itemName;
|
||||
MetadataEditor.currentItemType = data.itemType;
|
||||
//Dashboard.navigate('edititemmetadata.html?id=' + data.id);
|
||||
|
||||
//$.mobile.urlHistory.ignoreNextHashChange = true;
|
||||
window.location.hash = 'editItemImagesPage?id=' + data.id;
|
||||
|
||||
reload(page);
|
||||
}
|
||||
});
|
||||
|
||||
$('#btnAddItem', page).on('click', function () {
|
||||
|
||||
|
||||
var popup = $('.popupIdentify', page).popup('open');
|
||||
|
||||
$('#txtLookupName', popup).val('');
|
||||
$('.collectionItemSearchResults', popup).empty();
|
||||
$('#btnAddItems', popup).buttonEnabled(false);
|
||||
});
|
||||
|
||||
$('#btnAddItems', page).on('click', function () {
|
||||
|
||||
addItemsToCollection(page);
|
||||
});
|
||||
|
||||
$('#btnRemoveItems', page).on('click', function () {
|
||||
|
||||
|
||||
removeItemsFromCollection(page);
|
||||
});
|
||||
|
||||
}).on('pagebeforeshow', "#editCollectionTitlesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reload(page);
|
||||
|
||||
}).on('pagehide', "#editCollectionTitlesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
currentItem = null;
|
||||
|
||||
});
|
||||
|
||||
window.EditCollectionItemsPage = {
|
||||
|
||||
onSearchFormSubmit: function () {
|
||||
|
||||
var page = $(this).parents('.page');
|
||||
|
||||
showSearchResults(page, $('#txtLookupName', page).val());
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, document, window, window.FileReader, escape);
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
$('#btnEditPeople', page).attr('href', 'edititempeople.html?' + query);
|
||||
$('#btnEditMetadata', page).attr('href', 'edititemmetadata.html?' + query);
|
||||
$('#btnEditCollectionTitles', page).attr('href', 'editcollectionitems.html?' + query);
|
||||
}
|
||||
|
||||
function getBaseRemoteOptions() {
|
||||
|
@ -268,12 +269,18 @@
|
|||
|
||||
updateTabs(page, item);
|
||||
|
||||
if (item.Type == "Person" || item.Type == "Studio" || item.Type == "MusicGenre" || item.Type == "Genre" || item.Type == "MusicArtist" || item.Type == "GameGenre" || item.Type == "Channel") {
|
||||
if (item.Type == "Person" || item.Type == "Studio" || item.Type == "MusicGenre" || item.Type == "Genre" || item.Type == "MusicArtist" || item.Type == "GameGenre" || item.Type == "Channel" || item.Type == "BoxSet") {
|
||||
$('#btnEditPeople', page).hide();
|
||||
} else {
|
||||
$('#btnEditPeople', page).show();
|
||||
}
|
||||
|
||||
if (item.Type == "BoxSet") {
|
||||
$('#btnEditCollectionTitles', page).show();
|
||||
} else {
|
||||
$('#btnEditCollectionTitles', page).hide();
|
||||
}
|
||||
|
||||
ApiClient.getRemoteImageProviders(getBaseRemoteOptions()).done(function (providers) {
|
||||
|
||||
if (providers.length) {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
$('#btnEditPeople', page).attr('href', 'edititempeople.html?' + query);
|
||||
$('#btnEditImages', page).attr('href', 'edititemimages.html?' + query);
|
||||
$('#btnEditCollectionTitles', page).attr('href', 'editcollectionitems.html?' + query);
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
@ -82,12 +83,18 @@
|
|||
setFieldVisibilities(page, item);
|
||||
fillItemInfo(page, item);
|
||||
|
||||
if (item.Type == "Person" || item.Type == "Studio" || item.Type == "MusicGenre" || item.Type == "Genre" || item.Type == "MusicArtist" || item.Type == "GameGenre" || item.Type == "Channel") {
|
||||
if (item.Type == "Person" || item.Type == "Studio" || item.Type == "MusicGenre" || item.Type == "Genre" || item.Type == "MusicArtist" || item.Type == "GameGenre" || item.Type == "Channel" || item.Type == "BoxSet") {
|
||||
$('#btnEditPeople', page).hide();
|
||||
} else {
|
||||
$('#btnEditPeople', page).show();
|
||||
}
|
||||
|
||||
if (item.Type == "BoxSet") {
|
||||
$('#btnEditCollectionTitles', page).show();
|
||||
} else {
|
||||
$('#btnEditCollectionTitles', page).hide();
|
||||
}
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
$('#btnEditMetadata', page).attr('href', 'edititemmetadata.html?' + query);
|
||||
$('#btnEditImages', page).attr('href', 'edititemimages.html?' + query);
|
||||
$('#btnEditCollectionTitles', page).attr('href', 'editcollectionitems.html?' + query);
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
|
|
@ -31,10 +31,18 @@
|
|||
|
||||
if (user.Configuration.IsAdministrator) {
|
||||
$('#editButtonContainer', page).show();
|
||||
|
||||
} else {
|
||||
$('#editButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
if (user.Configuration.IsAdministrator && item.Type == "BoxSet") {
|
||||
$('#btnEditCollectionTitles', page).show().attr('href', 'editcollectionitems.html?id=' + item.Id);
|
||||
|
||||
} else {
|
||||
$('#btnEditCollectionTitles', page).hide();
|
||||
}
|
||||
|
||||
if (MediaPlayer.canPlay(item, user)) {
|
||||
|
||||
var url = MediaPlayer.getPlayUrl(item);
|
||||
|
@ -122,7 +130,7 @@
|
|||
if (item.Type == "Episode" || item.Type == "Series" || item.Type == "Season") {
|
||||
return "tv";
|
||||
}
|
||||
if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "BoxSet") {
|
||||
if (item.Type == "Movie" || item.Type == "Trailer") {
|
||||
return "movies";
|
||||
}
|
||||
if (item.Type == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "MusicVideo") {
|
||||
|
@ -131,6 +139,9 @@
|
|||
if (item.MediaType == "Game") {
|
||||
return "games";
|
||||
}
|
||||
if (item.Type == "BoxSet") {
|
||||
return "boxsets";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,8 @@
|
|||
html += '<a class="viewMenuLink viewMenuTextLink desktopViewMenuLink' + (view == 'games' ? selectedCssClass : '') + '" href="gamesrecommended.html">' + (view == 'games' ? selectedHtml : '') + '<span class="viewName">Games</span></a>';
|
||||
}
|
||||
|
||||
html += '<a class="viewMenuLink viewMenuTextLink desktopViewMenuLink' + (view == 'boxsets' ? selectedCssClass : '') + '" href="collections.html">' + (view == 'boxsets' ? selectedHtml : '') + '<span class="viewName">Collections</span></a>';
|
||||
|
||||
$('.viewMenuRemoteControlButton', page).before(html);
|
||||
}
|
||||
|
||||
|
@ -130,7 +132,7 @@
|
|||
|
||||
{ text: 'Suggested', href: 'moviesrecommended.html' },
|
||||
{ text: 'Movies', href: 'movies.html' },
|
||||
{ text: 'Collections', href: 'boxsets.html' },
|
||||
{ text: 'Collections', href: 'collections.html' },
|
||||
{ text: 'Trailers', href: 'movietrailers.html' },
|
||||
{ text: 'Genres', href: 'moviegenres.html' },
|
||||
{ text: 'People', href: 'moviepeople.html' },
|
||||
|
|
|
@ -95,6 +95,13 @@
|
|||
$('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater);
|
||||
}
|
||||
|
||||
function showNewCollectionPanel(page) {
|
||||
|
||||
$('#newCollectionPanel', page).panel('toggle');
|
||||
|
||||
$('#txtNewCollectionName', page).focus();
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#boxsetsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
@ -164,6 +171,11 @@
|
|||
reloadItems(page);
|
||||
});
|
||||
|
||||
$('#btnNewCollection', page).on('click', function () {
|
||||
|
||||
showNewCollectionPanel(page);
|
||||
});
|
||||
|
||||
}).on('pagebeforeshow', "#boxsetsPage", function () {
|
||||
|
||||
var limit = LibraryBrowser.getDefaultPageSize();
|
||||
|
@ -185,9 +197,33 @@
|
|||
|
||||
window.BoxSetsPage = {
|
||||
|
||||
onNewCollectionSubmit: function() {
|
||||
onNewCollectionSubmit: function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = $(this).parents('.page');
|
||||
|
||||
var url = ApiClient.getUrl("Collections", {
|
||||
|
||||
Name: $('#txtNewCollectionName', page).val(),
|
||||
IsLocked: !$('#chkEnableInternetMetadata', page).checked()
|
||||
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url
|
||||
|
||||
}).done(function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
$('#newCollectionPanel', page).panel('toggle');
|
||||
|
||||
reloadItems(page);
|
||||
|
||||
});
|
||||
|
||||
Dashboard.alert('Coming soon');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -721,14 +721,14 @@ var Dashboard = {
|
|||
name: "Metadata",
|
||||
href: "metadata.html",
|
||||
selected: pageElem.id == "metadataConfigurationPage" || pageElem.id == "advancedMetadataConfigurationPage" || pageElem.id == "metadataImagesConfigurationPage"
|
||||
}, {
|
||||
name: "Auto-Organize",
|
||||
href: "autoorganizelog.html",
|
||||
selected: page.hasClass("organizePage")
|
||||
}, {
|
||||
name: "Plugins",
|
||||
href: "plugins.html",
|
||||
selected: page.hasClass("pluginConfigurationPage")
|
||||
}, {
|
||||
name: "Auto-Organize",
|
||||
href: "autoorganizelog.html",
|
||||
selected: page.hasClass("organizePage")
|
||||
}, {
|
||||
name: "Live TV",
|
||||
href: "livetvstatus.html",
|
||||
|
@ -1141,9 +1141,7 @@ var Dashboard = {
|
|||
return;
|
||||
}
|
||||
|
||||
var pageElem = page[0];
|
||||
|
||||
if (pageElem.hasPageTitle) {
|
||||
if ($('.pageTitle', page).length) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1154,8 +1152,6 @@ var Dashboard = {
|
|||
}
|
||||
|
||||
$(parent).prepend("<h2 class='pageTitle'>" + (document.title || " ") + "</h2>");
|
||||
|
||||
pageElem.hasPageTitle = true;
|
||||
},
|
||||
|
||||
setPageTitle: function (title) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue