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

View file

@ -4,7 +4,8 @@
<title></title>
</head>
<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 class="libraryViewNav scopedLibraryViewNav">
<a href="movieslatest.html">${TabLatest}</a>
@ -113,15 +114,14 @@
</div>
</div>
<div id="itemBackdrop" class="itemBackdrop noBackdrop">
<div class="itemBackdropContent">
<div style="padding: 1em 0;">
<table class="detailPageContent primaryDetailPageContent">
<tr>
<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 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>
<span class="itemCommunityRating"></span>
<span class="userDataIcons"></span>
@ -142,21 +142,20 @@
</table>
</div>
<p class="itemOverview mobileOverview"></p>
</div>
<div class="detailButtonsContainer mobileDetailButtons">
<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>
</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="viewControls">
</div>
<div class="listTopPaging">
</div>
</div>
<div id="items" class="itemsContainer" style="text-align: center;">
<div id="items" class="itemsContainer">
</div>
</div>
</div>

View file

@ -107,6 +107,41 @@
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 () {
var page = this;
@ -128,4 +163,9 @@
});
window.Backdrops = {
setBackdrops: setBackdrops
};
})(jQuery, document);

View file

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

View file

@ -310,7 +310,7 @@
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>';

View file

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

View file

@ -70,6 +70,8 @@
currentItem = item;
Backdrops.setBackdrops(page, [item]);
renderHeader(page, item, context);
var name = item.Name;
@ -97,7 +99,7 @@
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") {
$('.btnEdit', page).show();
@ -162,49 +164,49 @@
if (item.MovieCount) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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>';
@ -321,7 +323,7 @@
function renderDetails(page, item, context) {
LibraryBrowser.renderDetailPageBackdrop(page, item);
//LibraryBrowser.renderDetailPageBackdrop(page, item);
LibraryBrowser.renderOverview($('.itemOverview', page), item);
renderUserDataIcons(page, item);
@ -472,22 +474,17 @@
}
else if (query.IncludeItemTypes == "MusicAlbum") {
html = LibraryBrowser.getPosterViewHtml({
html = LibraryBrowser.getListViewHtml({
items: result.Items,
shape: "square",
context: 'music',
showTitle: true,
showParentTitle: true
smallIcon: true
});
}
else {
html = LibraryBrowser.getPosterViewHtml({
html = LibraryBrowser.getListViewHtml({
items: result.Items,
shape: "square",
showTitle: true,
centerText: true
smallIcon: true
});
}

View file

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

View file

@ -27,7 +27,7 @@
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;
if (sortBy.indexOf('sortname') == 0) {
@ -666,7 +671,8 @@
var html = '';
if (options.showIndex !== false) {
var itemGroupTitle = LibraryBrowser.getListViewIndex(item, options.sortBy);
var itemGroupTitle = LibraryBrowser.getListViewIndex(item, options);
if (itemGroupTitle != groupTitle) {
@ -2026,7 +2032,7 @@
});
},
getDetailImageHtml: function (item, href) {
getDetailImageHtml: function (item, href, preferThumb) {
var imageTags = item.ImageTags || {};
@ -2040,7 +2046,15 @@
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, {
type: "Primary",
@ -2263,6 +2277,12 @@
$(this).attr("target", "_blank");
});
if (overview) {
elem.removeClass('empty');
} else {
elem.addClass('empty');
}
},
renderStudios: function (elem, item, context) {

View file

@ -254,7 +254,8 @@
} else {
$('.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);
end.setHours(0, 0, 0, 0);
if (start.getTime() >= end.getTime()) {
end.setDate(start.getDate() + 1);
}
start = new Date(Math.max(today, start));
var html = '';
@ -417,7 +421,10 @@
var val = elem.val();
var date = new Date();
if (val) {
date.setTime(parseInt(val));
}
changeDate(page, date);
}

View file

@ -439,7 +439,7 @@
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;
if (target.appName) {

View file

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

View file

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

View file

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