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

re-enable chromecast

This commit is contained in:
Luke Pulverenti 2014-08-17 01:38:13 -04:00
parent 4d679e90a4
commit 3d1ee1233c
15 changed files with 901 additions and 796 deletions

View file

@ -17,7 +17,11 @@
} }
.backdropPage { .backdropPage {
background-color: rgba(15, 15,15, .94) !important; background-color: rgba(15, 15,15, .86) !important;
}
.backdropPage:not(.lightBackdropPage) {
background-color: rgba(15, 15,15, .92) !important;
} }
.backdropContainer { .backdropContainer {
@ -125,7 +129,7 @@
} }
} }
.detailPageContent { .detailPageContent, .detailPageContent>table {
margin: 0 auto; margin: 0 auto;
padding: 0; padding: 0;
border-spacing: 0; border-spacing: 0;
@ -441,6 +445,11 @@ a.itemTag:hover {
box-shadow: 0 0 20px 3px #38c; box-shadow: 0 0 20px 3px #38c;
} }
.itemByNameImageContainer .itemDetailImage {
margin: 0 !important;
max-height: 220px;
}
.parentName { .parentName {
font-size: 14px; font-size: 14px;
display: block; display: block;
@ -457,13 +466,13 @@ a.itemTag:hover {
.itemOverview { .itemOverview {
text-overflow: ellipsis; text-overflow: ellipsis;
max-height: 100px;
overflow-y: auto;
padding-right: .5em;
} }
.desktopOverview { .desktopOverview {
min-width: 500px; min-width: 500px;
max-height: 100px;
overflow-y: auto;
padding-right: 1em;
} }
.mobileOverview { .mobileOverview {
@ -471,6 +480,10 @@ a.itemTag:hover {
padding: 0 1em; padding: 0 1em;
} }
.empty {
margin: 0;
}
.mobileGenres { .mobileGenres {
display: none; display: none;
padding: 0 1em; padding: 0 1em;
@ -608,7 +621,7 @@ a.itemTag:hover {
margin-top: 0; margin-top: 0;
} }
.mobileOverview, .mobileGenres, .mobileDetailButtons { .mobileOverview:not(.hide), .mobileGenres, .mobileDetailButtons {
display: block; display: block;
} }
@ -626,13 +639,9 @@ a.itemTag:hover {
display: block !important; display: block !important;
} }
.primaryDetailPageContent {
margin: 0 1em;
}
.primaryDetailPageContent .userDataIcons { .primaryDetailPageContent .userDataIcons {
margin-left: 0 !important; margin-left: 0 !important;
margin-top: 1.5em; margin-top: 1em;
display: block; display: block;
} }
} }
@ -656,13 +665,6 @@ a.itemTag:hover {
} }
} }
/*@media all and (min-width: 1000px) {
.primaryDetailPageContent {
max-width: 850px;
}
}*/
.detailPageParentLink { .detailPageParentLink {
text-decoration: none; text-decoration: none;
} }
@ -956,17 +958,6 @@ a.itemTag:hover {
margin-right: auto; margin-right: auto;
} }
@media all and (min-width: 750px) {
.lnkSibling:not(.hide) {
display: block;
}
.itemBackdrop:not(.noBackdrop) {
border-bottom: 1px solid #111;
}
}
@media all and (min-height: 500px) { @media all and (min-height: 500px) {
.alphabetPicker { .alphabetPicker {
@ -1209,8 +1200,8 @@ a.itemTag:hover {
} }
.itemsListview .playedIndicator { .itemsListview .playedIndicator {
right: 1em; left: 55px;
top: 55%; top: 2px;
background: rgba(82, 181, 75, .8); background: rgba(82, 181, 75, .8);
} }
@ -1266,7 +1257,8 @@ a.itemTag:hover {
} }
.listItem a + a { .listItem a + a {
background-color: #202020 !important; background-color: transparent !important;
z-index: 1000;
} }
.listItem:hover a { .listItem:hover a {

View file

@ -4,7 +4,8 @@
<title></title> <title></title>
</head> </head>
<body> <body>
<div id="itemByNameDetailPage" data-role="page" class="page libraryPage itemDetailPage" data-theme="b">
<div id="itemByNameDetailPage" data-role="page" class="page libraryPage itemDetailPage lightBackdropPage" data-theme="b">
<div id="movieGenreTabs" class="itemTabs" style="display: none;"> <div id="movieGenreTabs" class="itemTabs" style="display: none;">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="movieslatest.html">${TabLatest}</a> <a href="movieslatest.html">${TabLatest}</a>
@ -113,15 +114,14 @@
</div> </div>
</div> </div>
<div id="itemBackdrop" class="itemBackdrop noBackdrop"> <div style="padding: 1em 0;">
<div class="itemBackdropContent">
<table class="detailPageContent primaryDetailPageContent"> <table class="detailPageContent primaryDetailPageContent">
<tr> <tr>
<td style="vertical-align: top; padding: 0 1em 0 0;"> <td style="vertical-align: top; padding: 0 1em 0 0;">
<div id="itemImage" class="itemImageContainer"></div> <div id="itemImage" class="itemImageContainer itemByNameImageContainer"></div>
</td> </td>
<td style="vertical-align: top; padding: 0;"> <td style="vertical-align: top; padding: 0;">
<p><span class="itemName inlineItemName"></span><span class="itemMiscInfo" style="display: inline;"></span></p> <p style="margin-top:0;"><span class="itemName inlineItemName"></span><span class="itemMiscInfo" style="display: inline;"></span></p>
<p> <p>
<span class="itemCommunityRating"></span> <span class="itemCommunityRating"></span>
<span class="userDataIcons"></span> <span class="userDataIcons"></span>
@ -142,21 +142,20 @@
</table> </table>
</div> </div>
<p class="itemOverview mobileOverview"></p> <p class="itemOverview mobileOverview"></p>
</div>
<div class="detailButtonsContainer mobileDetailButtons"> <div class="detailButtonsContainer mobileDetailButtons">
<button class="btnPlay hide" type="button" data-icon="play" data-inline="true" data-mini="true">${ButtonPlay}</button> <button class="btnPlay hide" type="button" data-icon="play" data-inline="true" data-mini="true">${ButtonPlay}</button>
<a class="btnEdit hide" data-role="button" data-icon="edit" data-inline="true" data-mini="true" href="#">${ButtonEdit}</a> <a class="btnEdit hide" data-role="button" data-icon="edit" data-inline="true" data-mini="true" href="#">${ButtonEdit}</a>
</div> </div>
<div data-role="content"> <div data-role="content" style="padding-top: 0;">
<div id="itemTabs" style="text-align: center; margin: 1em 0;"></div> <div id="itemTabs" style="text-align: center; margin: 0 0 1em;"></div>
<div class="viewSettings"> <div class="viewSettings">
<div class="viewControls"> <div class="viewControls">
</div> </div>
<div class="listTopPaging"> <div class="listTopPaging">
</div> </div>
</div> </div>
<div id="items" class="itemsContainer" style="text-align: center;"> <div id="items" class="itemsContainer">
</div> </div>
</div> </div>
</div> </div>

View file

@ -107,6 +107,41 @@
return val == '1' || (val != '0' && !$.browser.mobile); return val == '1' || (val != '0' && !$.browser.mobile);
} }
function setBackdrops(page, items) {
var images = items.filter(function (i) {
return i.BackdropImageTags.length > 0;
}).map(function (i) {
return {
id: i.Id,
tag: i.BackdropImageTags[0]
};
});
if (images.length) {
$(page).addClass('backdropPage');
var index = getRandom(0, images.length - 1);
var item = images[index];
var screenWidth = $(window).width();
var imgUrl = ApiClient.getScaledImageUrl(item.id, {
type: "Backdrop",
tag: item.tag,
maxWidth: screenWidth,
quality: 80
});
getElement().css('backgroundImage', 'url(\'' + imgUrl + '\')');
} else {
$(page).removeClass('backdropPage');
}
}
$(document).on('pagebeforeshow', ".page", function () { $(document).on('pagebeforeshow', ".page", function () {
var page = this; var page = this;
@ -128,4 +163,9 @@
}); });
window.Backdrops = {
setBackdrops: setBackdrops
};
})(jQuery, document); })(jQuery, document);

View file

@ -27,9 +27,13 @@
}; };
var PlayerName = 'Chromecast'; var PlayerName = 'Chromecast';
var messageNamespace = 'urn:x-cast:com.google.cast.sample.playlist';
var cPlayer = { var cPlayer = {
deviceState: DEVICE_STATE.IDLE deviceState: DEVICE_STATE.IDLE
}; };
var CastPlayer = function () { var CastPlayer = function () {
/* device variables */ /* device variables */
@ -109,7 +113,7 @@
// v2 Id 472F0435 // v2 Id 472F0435
// default receiver chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID // default receiver chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID
var applicationID = chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID; var applicationID = "472F0435";
// request session // request session
var sessionRequest = new chrome.cast.SessionRequest(applicationID); var sessionRequest = new chrome.cast.SessionRequest(applicationID);
@ -146,18 +150,30 @@
* status gets synced up with current media of the session * status gets synced up with current media of the session
*/ */
CastPlayer.prototype.sessionListener = function (e) { CastPlayer.prototype.sessionListener = function (e) {
this.session = e; this.session = e;
if (this.session) { if (this.session) {
console.log('sessionListener');
this.deviceState = DEVICE_STATE.ACTIVE; this.deviceState = DEVICE_STATE.ACTIVE;
MediaController.setActivePlayer(PlayerName); MediaController.setActivePlayer(PlayerName);
if (this.session.media[0]) { if (this.session.media[0]) {
this.onMediaDiscovered('activeSession', this.session.media[0]); this.onMediaDiscovered('activeSession', this.session.media[0]);
} }
this.session.addMessageListener(messageNamespace, this.messageListener.bind(this));
this.session.addUpdateListener(this.sessionUpdateListener.bind(this)); this.session.addUpdateListener(this.sessionUpdateListener.bind(this));
} }
}; };
CastPlayer.prototype.messageListener = function (namespace, message) {
console.log('Message from receiver, namespace: ' + namespace + ', message: ' + message);
};
/** /**
* @param {string} e Receiver availability * @param {string} e Receiver availability
* This indicates availability of receivers but * This indicates availability of receivers but
@ -179,7 +195,12 @@
* session update listener * session update listener
*/ */
CastPlayer.prototype.sessionUpdateListener = function (isAlive) { CastPlayer.prototype.sessionUpdateListener = function (isAlive) {
if (!isAlive) {
console.log('sessionUpdateListener alive: ' + isAlive);
if (isAlive) {
}
else {
this.session = null; this.session = null;
this.deviceState = DEVICE_STATE.IDLE; this.deviceState = DEVICE_STATE.IDLE;
this.castPlayerState = PLAYER_STATE.IDLE; this.castPlayerState = PLAYER_STATE.IDLE;
@ -255,21 +276,31 @@
* Loads media into a running receiver application * Loads media into a running receiver application
* @param {Number} mediaIndex An index number to indicate current media content * @param {Number} mediaIndex An index number to indicate current media content
*/ */
CastPlayer.prototype.loadMedia = function (userId, options, command) { CastPlayer.prototype.loadMedia = function (options, command) {
if (!this.session) { if (!this.session) {
console.log("no session"); console.log("no session");
return; return;
} }
options.userId = userId;
var message = { var message = {
playOptions: options, options: options,
command: command command: command,
userId: Dashboard.getCurrentUserId(),
deviceId: ApiClient.deviceId(),
accessToken: ApiClient.accessToken(),
serverAddress: ApiClient.serverAddress()
}; };
this.session.sendMessage('urn:x-cast:com.google.cast.sample.playlist', JSON.stringify(message)); message = JSON.stringify(message);
//console.log(message);
this.session.sendMessage(messageNamespace, message, this.onPlayCommandSuccess.bind(this), this.errorHandler);
};
CastPlayer.prototype.onPlayCommandSuccess = function() {
console.log('Play command was sent ok.');
}; };
/** /**
@ -503,6 +534,9 @@
* @param {Object} e An media status update object * @param {Object} e An media status update object
*/ */
CastPlayer.prototype.updateProgressBar = function (e) { CastPlayer.prototype.updateProgressBar = function (e) {
console.log('CastPlayer.updateProgressBar');
if (e.idleReason == 'FINISHED' && e.playerState == 'IDLE') { if (e.idleReason == 'FINISHED' && e.playerState == 'IDLE') {
clearInterval(this.timer); clearInterval(this.timer);
this.castPlayerState = PLAYER_STATE.STOPPED; this.castPlayerState = PLAYER_STATE.STOPPED;
@ -529,6 +563,9 @@
* Update progress bar based on timer * Update progress bar based on timer
*/ */
CastPlayer.prototype.updateProgressBarByTimer = function () { CastPlayer.prototype.updateProgressBarByTimer = function () {
console.log('CastPlayer.updateProgressBarByTimer');
if (!this.currentMediaTime) { if (!this.currentMediaTime) {
this.currentMediaDuration = this.session.media[0].currentTime; this.currentMediaDuration = this.session.media[0].currentTime;
} }
@ -575,22 +612,35 @@
// Create Cast Player // Create Cast Player
var castPlayer = new CastPlayer(); var castPlayer = new CastPlayer();
function getCustomData(item, mediaSourceId, startTimeTicks) { function chromecastPlayer() {
return { var self = this;
serverAddress: ApiClient.serverAddress(), var getItemFields = "MediaSources,Chapters";
itemId: item.Id,
userId: Dashboard.getCurrentUserId(), // MediaController needs this
deviceName: ApiClient.deviceName(), self.name = PlayerName;
//deviceId: ApiClient.deviceId(),
startTimeTicks: startTimeTicks || 0, self.isPaused = false;
runTimeTicks: item.RunTimeTicks
self.isMuted = false;
self.positionTicks = 0;
self.runtimeTicks = 0;
self.getItemsForPlayback = function (query) {
var userId = Dashboard.getCurrentUserId();
query.Limit = query.Limit || 100;
query.Fields = getItemFields;
query.ExcludeLocationTypes = "Virtual";
return ApiClient.getItems(userId, query);
}; };
} self.translateItemsForPlayback = function(items) {
function translateItemsForPlayback(items) {
var deferred = $.Deferred(); var deferred = $.Deferred();
@ -602,8 +652,7 @@
promise = self.getItemsForPlayback({ promise = self.getItemsForPlayback({
ParentId: firstItem.Id, ParentId: firstItem.Id,
}); });
} } else if (firstItem.Type == "MusicArtist") {
else if (firstItem.Type == "MusicArtist") {
promise = self.getItemsForPlayback({ promise = self.getItemsForPlayback({
Artists: firstItem.Name, Artists: firstItem.Name,
@ -613,8 +662,7 @@
MediaTypes: "Audio" MediaTypes: "Audio"
}); });
} } else if (firstItem.Type == "MusicGenre") {
else if (firstItem.Type == "MusicGenre") {
promise = self.getItemsForPlayback({ promise = self.getItemsForPlayback({
Genres: firstItem.Name, Genres: firstItem.Name,
@ -623,8 +671,7 @@
SortBy: "SortName", SortBy: "SortName",
MediaTypes: "Audio" MediaTypes: "Audio"
}); });
} } else if (firstItem.IsFolder) {
else if (firstItem.IsFolder) {
promise = self.getItemsForPlayback({ promise = self.getItemsForPlayback({
ParentId: firstItem.Id, ParentId: firstItem.Id,
@ -645,41 +692,25 @@
} }
return deferred.promise(); return deferred.promise();
} };
function chromecastPlayer() { //$(castPlayer).on("/playback/complete", function (e) {
var self = this; // var state = self.getPlayerStateInternal();
var getItemFields = "MediaSources,Chapters"; // $(self).trigger("playbackstop", [state]);
self.name = PlayerName; //});
self.isPaused = false; //$(castPlayer).on("/playback/update", function (e, data) {
self.isMuted = false; // self.positionTicks = data.positionTicks;
// self.runtimeTicks = data.runtimeTicks;
self.positionTicks = 0; // var state = self.getPlayerStateInternal();
self.runtimeTicks = 0; // $(self).trigger("positionchange", [state]);
//});
$(castPlayer).on("/playback/complete", function (e) {
var state = self.getPlayerStateInternal();
$(self).trigger("playbackstop", [state]);
});
$(castPlayer).on("/playback/update", function (e, data) {
self.positionTicks = data.positionTicks;
self.runtimeTicks = data.runtimeTicks;
var state = self.getPlayerStateInternal();
$(self).trigger("positionchange", [state]);
});
self.play = function (options) { self.play = function (options) {
@ -687,7 +718,7 @@
if (options.items) { if (options.items) {
translateItemsForPlayback(options.items).done(function (items) { self.translateItemsForPlayback(options.items).done(function (items) {
self.playWithIntros(items, options, user); self.playWithIntros(items, options, user);
}); });
@ -700,7 +731,7 @@
}).done(function (result) { }).done(function (result) {
translateItemsForPlayback(result.Items).done(function (items) { self.translateItemsForPlayback(result.Items).done(function (items) {
self.playWithIntros(items, options, user); self.playWithIntros(items, options, user);
}); });
@ -716,9 +747,9 @@
var firstItem = items[0]; var firstItem = items[0];
if (options.startPositionTicks || firstItem.MediaType !== 'Video' || !self.canAutoPlayVideo()) { if (options.startPositionTicks || firstItem.MediaType !== 'Video') {
self.playWithCommand(options, 'PlayNow'); self.playWithCommand(options, 'PlayNow');
return;
} }
ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/' + firstItem.Id + '/Intros')).done(function (intros) { ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/' + firstItem.Id + '/Intros')).done(function (intros) {
@ -731,7 +762,17 @@
self.playWithCommand = function (options, command) { self.playWithCommand = function (options, command) {
castPlayer.loadMedia(Dashboard.getCurrentUserId(), options, command); if (!options.items) {
ApiClient.getItem(Dashboard.getCurrentUserId(), options.ids[0]).done(function(item) {
options.items = [item];
self.playWithCommand(options, command);
});
return;
}
castPlayer.loadMedia(options, command);
}; };
self.unpause = function () { self.unpause = function () {
@ -896,6 +937,7 @@
self.getCurrentTargetInfo = function () { self.getCurrentTargetInfo = function () {
var appName = null; var appName = null;
if (castPlayer.session && castPlayer.session.receiver && castPlayer.session.receiver.friendlyName) { if (castPlayer.session && castPlayer.session.receiver && castPlayer.session.receiver.friendlyName) {
appName = castPlayer.session.receiver.friendlyName; appName = castPlayer.session.receiver.friendlyName;
} }
@ -903,10 +945,11 @@
return { return {
name: PlayerName, name: PlayerName,
id: PlayerName, id: PlayerName,
playerName: self.name, // TODO: PlayerName == self.name, so do we need to use either/or? playerName: PlayerName,
playableMediaTypes: ["Audio", "Video"], playableMediaTypes: ["Audio", "Video"],
isLocalPlayer: false, isLocalPlayer: false,
appName: appName, appName: PlayerName,
deviceName: appName,
supportedCommands: ["VolumeUp", supportedCommands: ["VolumeUp",
"VolumeDown", "VolumeDown",
"Mute", "Mute",
@ -1014,15 +1057,15 @@
}; };
} }
//MediaController.registerPlayer(new chromecastPlayer()); MediaController.registerPlayer(new chromecastPlayer());
//$(MediaController).on('playerchange', function () { $(MediaController).on('playerchange', function () {
// if (MediaController.getPlayerInfo().name == PlayerName) { if (MediaController.getPlayerInfo().name == PlayerName) {
// if (castPlayer.deviceState != DEVICE_STATE.ACTIVE && castPlayer.isInitialized) { if (castPlayer.deviceState != DEVICE_STATE.ACTIVE && castPlayer.isInitialized) {
// castPlayer.launchApp(); castPlayer.launchApp();
// } }
// } }
//}); });
})(window, window.chrome, console); })(window, window.chrome, console);

View file

@ -310,7 +310,7 @@
html += '<div class="editorTile imageEditorTile">'; html += '<div class="editorTile imageEditorTile">';
html += '<div style="height:144px;vertical-align:top;background-repeat:no-repeat;background-size:contain;background-image:url(\'' + LibraryBrowser.getImageUrl(currentItem, image.ImageType, image.ImageIndex, { height: 144 }) + '\');"></div>'; html += '<div style="height:144px;vertical-align:top;background-repeat:no-repeat;background-size:contain;background-image:url(\'' + LibraryBrowser.getImageUrl(currentItem, image.ImageType, image.ImageIndex, { enableImageEnhancers: false, height: 144 }) + '\');"></div>';
html += '<div>'; html += '<div>';

View file

@ -330,7 +330,7 @@ function parseISO8601Date(s, options) {
} }
return new Date(ms); return new Date(ms);
}; }
// jqm.page.params.js - version 0.1 // jqm.page.params.js - version 0.1
// Copyright (c) 2011, Kin Blas // Copyright (c) 2011, Kin Blas

View file

@ -70,6 +70,8 @@
currentItem = item; currentItem = item;
Backdrops.setBackdrops(page, [item]);
renderHeader(page, item, context); renderHeader(page, item, context);
var name = item.Name; var name = item.Name;
@ -97,7 +99,7 @@
var editImagesHref = user.Configuration.IsAdministrator ? 'edititemimages.html' + editQuery : null; var editImagesHref = user.Configuration.IsAdministrator ? 'edititemimages.html' + editQuery : null;
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item, editImagesHref)); $('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item, editImagesHref, true));
if (user.Configuration.IsAdministrator && item.LocationType !== "Offline") { if (user.Configuration.IsAdministrator && item.LocationType !== "Offline") {
$('.btnEdit', page).show(); $('.btnEdit', page).show();
@ -162,49 +164,49 @@
if (item.MovieCount) { if (item.MovieCount) {
html += '<input type="radio" name="ibnItems" id="radioMovies" class="context-movies" value="on" data-mini="true">'; html += '<input type="radio" name="ibnItems" id="radioMovies" class="context-movies" value="on" data-mini="true">';
html += '<label for="radioMovies">Movies (' + item.MovieCount + ')</label>'; html += '<label for="radioMovies">Movies</label>';
} }
if (item.SeriesCount) { if (item.SeriesCount) {
html += '<input type="radio" name="ibnItems" id="radioShows" class="context-tv" value="on" data-mini="true">'; html += '<input type="radio" name="ibnItems" id="radioShows" class="context-tv" value="on" data-mini="true">';
html += '<label for="radioShows">TV Shows (' + item.SeriesCount + ')</label>'; html += '<label for="radioShows">TV Shows</label>';
} }
if (item.EpisodeCount) { if (item.EpisodeCount) {
html += '<input type="radio" name="ibnItems" id="radioEpisodes" class="context-tv" value="on" data-mini="true">'; html += '<input type="radio" name="ibnItems" id="radioEpisodes" class="context-tv" value="on" data-mini="true">';
html += '<label for="radioEpisodes">Episodes (' + item.EpisodeCount + ')</label>'; html += '<label for="radioEpisodes">Episodes</label>';
} }
if (item.TrailerCount) { if (item.TrailerCount) {
html += '<input type="radio" name="ibnItems" id="radioTrailers" class="context-movies" value="on" data-mini="true">'; html += '<input type="radio" name="ibnItems" id="radioTrailers" class="context-movies" value="on" data-mini="true">';
html += '<label for="radioTrailers">Trailers (' + item.TrailerCount + ')</label>'; html += '<label for="radioTrailers">Trailers</label>';
} }
if (item.GameCount) { if (item.GameCount) {
html += '<input type="radio" name="ibnItems" id="radioGames" class="context-games" value="on" data-mini="true">'; html += '<input type="radio" name="ibnItems" id="radioGames" class="context-games" value="on" data-mini="true">';
html += '<label for="radioGames">Games (' + item.GameCount + ')</label>'; html += '<label for="radioGames">Games</label>';
} }
if (item.AlbumCount) { if (item.AlbumCount) {
html += '<input type="radio" name="ibnItems" id="radioAlbums" class="context-music" value="on" data-mini="true">'; html += '<input type="radio" name="ibnItems" id="radioAlbums" class="context-music" value="on" data-mini="true">';
html += '<label for="radioAlbums">Albums (' + item.AlbumCount + ')</label>'; html += '<label for="radioAlbums">Albums</label>';
} }
if (item.SongCount) { if (item.SongCount) {
html += '<input type="radio" name="ibnItems" id="radioSongs" class="context-music" value="on" data-mini="true">'; html += '<input type="radio" name="ibnItems" id="radioSongs" class="context-music" value="on" data-mini="true">';
html += '<label for="radioSongs">Songs (' + item.SongCount + ')</label>'; html += '<label for="radioSongs">Songs</label>';
} }
if (item.MusicVideoCount) { if (item.MusicVideoCount) {
html += '<input type="radio" name="ibnItems" id="radioMusicVideos" class="context-music" value="on" data-mini="true">'; html += '<input type="radio" name="ibnItems" id="radioMusicVideos" class="context-music" value="on" data-mini="true">';
html += '<label for="radioMusicVideos">Music Videos (' + item.MusicVideoCount + ')</label>'; html += '<label for="radioMusicVideos">Music Videos</label>';
} }
html += '</fieldset>'; html += '</fieldset>';
@ -321,7 +323,7 @@
function renderDetails(page, item, context) { function renderDetails(page, item, context) {
LibraryBrowser.renderDetailPageBackdrop(page, item); //LibraryBrowser.renderDetailPageBackdrop(page, item);
LibraryBrowser.renderOverview($('.itemOverview', page), item); LibraryBrowser.renderOverview($('.itemOverview', page), item);
renderUserDataIcons(page, item); renderUserDataIcons(page, item);
@ -472,22 +474,17 @@
} }
else if (query.IncludeItemTypes == "MusicAlbum") { else if (query.IncludeItemTypes == "MusicAlbum") {
html = LibraryBrowser.getPosterViewHtml({ html = LibraryBrowser.getListViewHtml({
items: result.Items, items: result.Items,
shape: "square", smallIcon: true
context: 'music',
showTitle: true,
showParentTitle: true
}); });
} }
else { else {
html = LibraryBrowser.getPosterViewHtml({ html = LibraryBrowser.getListViewHtml({
items: result.Items, items: result.Items,
shape: "square", smallIcon: true
showTitle: true,
centerText: true
}); });
} }

View file

@ -726,7 +726,9 @@
$('#childrenContent', page).html(LibraryBrowser.getListViewHtml({ $('#childrenContent', page).html(LibraryBrowser.getListViewHtml({
items: result.Items, items: result.Items,
smallIcon: true smallIcon: true,
showIndex: true,
index: 'disc'
})).trigger('create').createCardMenus(); })).trigger('create').createCardMenus();

View file

@ -27,7 +27,7 @@
getDefaultItemsView: function (view, mobileView) { getDefaultItemsView: function (view, mobileView) {
return view; return $.browser.mobile ? mobileView : view;
}, },
@ -578,9 +578,14 @@
}, },
getListViewIndex: function (item, sortBy) { getListViewIndex: function (item, options) {
sortBy = (sortBy || '').toLowerCase(); if (options.index == 'disc') {
return item.ParentIndexNumber == null ? '' : 'Disc ' + item.ParentIndexNumber;
}
var sortBy = (options.sortBy || '').toLowerCase();
var code, name; var code, name;
if (sortBy.indexOf('sortname') == 0) { if (sortBy.indexOf('sortname') == 0) {
@ -666,7 +671,8 @@
var html = ''; var html = '';
if (options.showIndex !== false) { if (options.showIndex !== false) {
var itemGroupTitle = LibraryBrowser.getListViewIndex(item, options.sortBy);
var itemGroupTitle = LibraryBrowser.getListViewIndex(item, options);
if (itemGroupTitle != groupTitle) { if (itemGroupTitle != groupTitle) {
@ -2026,7 +2032,7 @@
}); });
}, },
getDetailImageHtml: function (item, href) { getDetailImageHtml: function (item, href, preferThumb) {
var imageTags = item.ImageTags || {}; var imageTags = item.ImageTags || {};
@ -2040,7 +2046,15 @@
var imageHeight = 280; var imageHeight = 280;
if (imageTags.Primary) { if (preferThumb && imageTags.Thumb) {
url = ApiClient.getScaledImageUrl(item.Id, {
type: "Thumb",
maxHeight: imageHeight,
tag: item.ImageTags.Thumb
});
}
else if (imageTags.Primary) {
url = ApiClient.getScaledImageUrl(item.Id, { url = ApiClient.getScaledImageUrl(item.Id, {
type: "Primary", type: "Primary",
@ -2263,6 +2277,12 @@
$(this).attr("target", "_blank"); $(this).attr("target", "_blank");
}); });
if (overview) {
elem.removeClass('empty');
} else {
elem.addClass('empty');
}
}, },
renderStudios: function (elem, item, context) { renderStudios: function (elem, item, context) {

View file

@ -254,7 +254,8 @@
} else { } else {
$('.btnCast').removeClass('btnDefaultCast').addClass('btnActiveCast'); $('.btnCast').removeClass('btnDefaultCast').addClass('btnActiveCast');
$('.headerSelectedPlayer').html(info.deviceName || info.name);
$('.headerSelectedPlayer').html((info.deviceName || info.name));
} }
} }

View file

@ -396,6 +396,10 @@
start.setHours(0, 0, 0, 0); start.setHours(0, 0, 0, 0);
end.setHours(0, 0, 0, 0); end.setHours(0, 0, 0, 0);
if (start.getTime() >= end.getTime()) {
end.setDate(start.getDate() + 1);
}
start = new Date(Math.max(today, start)); start = new Date(Math.max(today, start));
var html = ''; var html = '';
@ -417,7 +421,10 @@
var val = elem.val(); var val = elem.val();
var date = new Date(); var date = new Date();
if (val) {
date.setTime(parseInt(val)); date.setTime(parseInt(val));
}
changeDate(page, date); changeDate(page, date);
} }

View file

@ -439,7 +439,7 @@
var mirror = (!target.isLocalPlayer && target.supportedCommands.indexOf('DisplayContent') != -1) ? 'true' : 'false'; var mirror = (!target.isLocalPlayer && target.supportedCommands.indexOf('DisplayContent') != -1) ? 'true' : 'false';
html += '<input type="radio" class="radioSelectPlayerTarget" name="radioSelectPlayerTarget" data-mirror="' + mirror + '" data-commands="' + target.supportedCommands.join(',') + '" data-mediatypes="' + target.playableMediaTypes.join(',') + '" data-playername="' + target.playerName + '" data-targetid="' + target.id + '" data-targetname="' + target.name + '" data-devicename="' + target.deviceName + '" id="' + id + '" value="' + target.id + '"' + checkedHtml + '>'; html += '<input type="radio" class="radioSelectPlayerTarget" name="radioSelectPlayerTarget" data-mirror="' + mirror + '" data-commands="' + target.supportedCommands.join(',') + '" data-mediatypes="' + target.playableMediaTypes.join(',') + '" data-playername="' + target.playerName + '" data-targetid="' + target.id + '" data-targetname="' + target.name + '" data-devicename="' + (target.deviceName || '') + '" id="' + id + '" value="' + target.id + '"' + checkedHtml + '>';
html += '<label for="' + id + '" style="font-weight:normal;">' + target.name; html += '<label for="' + id + '" style="font-weight:normal;">' + target.name;
if (target.appName) { if (target.appName) {

View file

@ -7,7 +7,7 @@
if (this.checked) { if (this.checked) {
SupporterPage.addRecurringFields(); SupporterPage.addRecurringFields();
} else { } else {
SupporterPage.removeRecurringFields(); SupporterPage.removeRecurringFields(page);
} }
}); });
}, },
@ -17,7 +17,7 @@
$("<input type='hidden' name='a3' class='pprecurring' />") $("<input type='hidden' name='a3' class='pprecurring' />")
.attr('value', $('#donateAmt', '#supporterPage').val()) .attr('value', $('#donateAmt', '#supporterPage').val())
.appendTo("#payPalForm", '#supporterPage'); .appendTo("#payPalForm", '#supporterPage');
$("<input type='hidden' name='p3' value='6' class='pprecurring' />") $("<input type='hidden' name='p3' value='1' class='pprecurring' />")
.appendTo("#payPalForm", '#supporterPage'); .appendTo("#payPalForm", '#supporterPage');
$("<input type='hidden' name='t3' value='M' class='pprecurring' />") $("<input type='hidden' name='t3' value='M' class='pprecurring' />")
.appendTo("#payPalForm", '#supporterPage'); .appendTo("#payPalForm", '#supporterPage');
@ -33,11 +33,11 @@
}, },
removeRecurringFields: function() { removeRecurringFields: function(page) {
$('.pprecurring', '#supporterPage').remove(); $('.pprecurring', page).remove();
//change command back //change command back
$('#ppCmd', '#supporterPage').val('_xclick'); $('#ppCmd', page).val('_xclick');
}, },

View file

@ -24,9 +24,9 @@
method="post"> method="post">
<label for="donateAmt">${LabelSupportAmount}</label> <label for="donateAmt">${LabelSupportAmount}</label>
<select id="donateAmt" name="amount"> <select id="donateAmt" name="amount">
<option value="15" selected="selected">$15</option> <option value="20" selected="selected">$20</option>
<option value="20">$20</option>
<option value="30">$30</option> <option value="30">$30</option>
<option value="40">$40</option>
<option value="50">$50</option> <option value="50">$50</option>
</select> </select>
<div> <div>

View file

@ -70,6 +70,10 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
return currentUserId; return currentUserId;
}; };
self.accessToken = function() {
return accessToken;
};
self.setCurrentUserId = function (userId, token) { self.setCurrentUserId = function (userId, token) {
currentUserId = userId; currentUserId = userId;