update now playing

This commit is contained in:
Luke Pulverenti 2015-09-26 10:51:26 -04:00
parent ad38cf4783
commit b5a723314b
23 changed files with 229 additions and 66 deletions

View File

@ -665,6 +665,19 @@
return deferred.promise();
}
self.getSavedServers = function () {
var credentials = credentialProvider.credentials();
var servers = credentials.Servers.slice(0);
servers.sort(function (a, b) {
return (b.DateLastAccessed || 0) - (a.DateLastAccessed || 0);
});
return servers;
};
self.getAvailableServers = function () {
logger.log('Begin getAvailableServers');

View File

@ -10,25 +10,6 @@
var apiClient = connectionManager.getApiClient(server.Id);
apiClient.getDevicesOptions().done(function (devicesOptions) {
if (!devicesOptions.EnabledCameraUploadDevices || devicesOptions.EnabledCameraUploadDevices.indexOf(apiClient.deviceId()) == -1) {
Logger.log("Camera upload is not enabled for this device.");
deferred.reject();
}
else {
uploadImagesInternal(server, apiClient, deferred);
}
}).fail(function () {
deferred.reject();
});
return deferred.promise();
};
function uploadImagesInternal(server, apiClient, deferred) {
apiClient.getContentUploadHistory().done(function (result) {
uploadImagesWithHistory(server, result, apiClient, deferred);
@ -36,7 +17,9 @@
}).fail(function () {
deferred.reject();
});
}
return deferred.promise();
};
function uploadImagesWithHistory(server, uploadHistory, apiClient, deferred) {

View File

@ -49,7 +49,13 @@
options = options || {};
if (options.uploadPhotos === false) {
var uploadPhotos = options.uploadPhotos !== false;
if (options.cameraUploadServers && options.cameraUploadServers.indexOf(server.Id) == -1) {
uploadPhotos = false;
}
if (!uploadPhotos) {
nextAction();
return;
}

View File

@ -25,14 +25,14 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/polymerelements/iron-meta",
"homepage": "https://github.com/PolymerElements/iron-meta",
"_release": "1.0.3",
"_resolution": {
"type": "version",
"tag": "v1.0.3",
"commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04"
},
"_source": "git://github.com/polymerelements/iron-meta.git",
"_source": "git://github.com/PolymerElements/iron-meta.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-meta"
"_originalSource": "PolymerElements/iron-meta"
}

View File

@ -42,7 +42,7 @@
"tag": "v1.0.4",
"commit": "a7ac7fbdb79b4d82416ec9b41613575386d0d226"
},
"_source": "git://github.com/PolymerElements/paper-behaviors.git",
"_source": "git://github.com/polymerelements/paper-behaviors.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-behaviors"
"_originalSource": "polymerelements/paper-behaviors"
}

View File

@ -30,14 +30,14 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-ripple",
"homepage": "https://github.com/polymerelements/paper-ripple",
"_release": "1.0.2",
"_resolution": {
"type": "version",
"tag": "v1.0.2",
"commit": "b546dbe6ad0b1f58cac80caec3136cf3232e12fc"
},
"_source": "git://github.com/PolymerElements/paper-ripple.git",
"_source": "git://github.com/polymerelements/paper-ripple.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-ripple"
"_originalSource": "polymerelements/paper-ripple"
}

View File

@ -1,6 +1,6 @@
{
"name": "velocity",
"version": "1.2.2",
"version": "1.2.3",
"homepage": "http://velocityjs.org",
"authors": [
{
@ -38,14 +38,13 @@
"type": "git",
"url": "http://github.com/julianshapiro/velocity.git"
},
"_release": "1.2.2",
"_release": "1.2.3",
"_resolution": {
"type": "version",
"tag": "1.2.2",
"commit": "6b227928631aab5694255df3c219736c4c02449d"
"tag": "1.2.3",
"commit": "1ad0a8196fa973f96e347a9b7f5bdaf7498ed1a6"
},
"_source": "git://github.com/julianshapiro/velocity.git",
"_target": "~1.2.2",
"_originalSource": "velocity",
"_direct": true
"_originalSource": "velocity"
}

View File

@ -1,6 +1,6 @@
{
"name": "velocity",
"version": "1.2.2",
"version": "1.2.3",
"homepage": "http://velocityjs.org",
"authors": [
{ "name" : "Julian Shapiro",
@ -31,7 +31,7 @@
"jquery": "*"
},
"repository" :
{
{
"type" : "git",
"url" : "http://github.com/julianshapiro/velocity.git"
}

View File

@ -42,7 +42,6 @@
<script>
// Needed tests:
// - "finish"
// - new stop behvaior
// - e/p/o shorthands
@ -986,6 +985,62 @@
}, asyncCheckDuration);
});
/******************
Command: Finish
******************/
QUnit.asyncTest("Command: Finish / FinishAll", function() {
expect(9);
var $target1 = getTarget();
/* Ensure an error isn't thrown when "finish" is called on a $target that isn't animating. */
Velocity($target1, "finish");
/* Animate to defaultProperties, and then "finish" to jump to the end of it. */
Velocity($target1, defaultProperties, Velocity.Utilities.extend({}, defaultOptions, { delay: 1000}));
Velocity($target1, "finish");
setTimeout(function() {
/* Ensure "finish" has removed all queued animations. */
/* We're using the element's queue length as a proxy. 0 and 1 both mean that the element's queue has been cleared -- a length of 1 just indicates that the animation is in progress. */
equal(Velocity.Utilities.queue($target1).length <= 1, true, "Queue cleared.");
/* End result of the animation should be applied */
equal(parseFloat(Velocity.CSS.getPropertyValue($target1, "width")), defaultProperties.width, "Standard end value #1 was set.");
equal(parseFloat(Velocity.CSS.getPropertyValue($target1, "opacity")), defaultProperties.opacity, "Standard end value #2 was set.");
}, asyncCheckDuration);
var $target2 = getTarget();
Velocity($target2, { opacity: 0 }, Velocity.Utilities.extend({}, defaultOptions, { delay: 1000 }));
Velocity($target2, { width: 0 }, defaultOptions);
Velocity($target2, "finish");
var $target3 = getTarget();
Velocity($target3, { opacity: 0, width: 50 }, Velocity.Utilities.extend({}, defaultOptions, { delay: 1000 }));
Velocity($target3, { width: 0 }, defaultOptions);
Velocity($target3, { width: 100 }, defaultOptions);
Velocity($target3, "finish", true);
var $target4 = getTarget();
Velocity($target4, { opacity: 0, width: 50 }, Velocity.Utilities.extend({}, defaultOptions, { delay: 1000 }));
Velocity($target4, { width: 0 }, defaultOptions);
Velocity($target4, { width: 100 }, defaultOptions);
Velocity($target4, "finishAll", true);
setTimeout(function() {
equal(Data($target2, pluginName).tweensContainer.opacity, undefined, "Active call stopped.");
notEqual(Data($target2, pluginName).tweensContainer.width, undefined, "Next queue item started.");
equal(Velocity.Utilities.queue($target3, "").length, 0, "Full queue array cleared.");
equal(parseFloat(Velocity.CSS.getPropertyValue($target3, "width")), 50, "Just the first call's width was applied.");
equal(Velocity.Utilities.queue($target4, "").length, 0, "Full queue array cleared.");
equal(parseFloat(Velocity.CSS.getPropertyValue($target4, "width")), 100, "The last call's width was applied.");
start();
}, asyncCheckDuration);
});
/***********************
Feature: Redirects
***********************/

View File

@ -1,4 +1,4 @@
/*! VelocityJS.org (1.2.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
/*! VelocityJS.org (1.2.3). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
/*************************
Velocity jQuery Shim
@ -2074,7 +2074,7 @@ return function (global, window, document, undefined) {
/* Support is included for jQuery's argument overloading: $.animate(propertyMap [, duration] [, easing] [, complete]).
Overloading is detected by checking for the absence of an object being passed into options. */
/* Note: The stop and finish actions do not accept animation options, and are therefore excluded from this check. */
if (!/^(stop|finish)$/i.test(propertiesMap) && !$.isPlainObject(options)) {
if (!/^(stop|finish|finishAll)$/i.test(propertiesMap) && !$.isPlainObject(options)) {
/* The utility function shifts all arguments one position to the right, so we adjust for that offset. */
var startingArgumentPosition = argumentIndex + 1;
@ -2140,6 +2140,7 @@ return function (global, window, document, undefined) {
break;
case "finish":
case "finishAll":
case "stop":
/*******************
Action: Stop
@ -2158,6 +2159,22 @@ return function (global, window, document, undefined) {
delete Data(element).delayTimer;
}
/* If we want to finish everything in the queue, we have to iterate through it
and call each function. This will make them active calls below, which will
cause them to be applied via the duration setting. */
if (propertiesMap === "finishAll" && (options === true || Type.isString(options))) {
/* Iterate through the items in the element's queue. */
$.each($.queue(element, Type.isString(options) ? options : ""), function(_, item) {
/* The queue array can contain an "inprogress" string, which we skip. */
if (Type.isFunction(item)) {
item();
}
});
/* Clearing the $.queue() array is achieved by resetting it to []. */
$.queue(element, Type.isString(options) ? options : "", []);
}
});
var callsToStop = [];
@ -2190,10 +2207,11 @@ return function (global, window, document, undefined) {
}
/* Iterate through the calls targeted by the stop command. */
$.each(elements, function(l, element) {
$.each(elements, function(l, element) {
/* Check that this call was applied to the target element. */
if (element === activeElement) {
/* Optionally clear the remaining queued calls. */
/* Optionally clear the remaining queued calls. If we're doing "finishAll" this won't find anything,
due to the queue-clearing above. */
if (options === true || Type.isString(options)) {
/* Iterate through the items in the element's queue. */
$.each($.queue(element, Type.isString(options) ? options : ""), function(_, item) {
@ -2221,7 +2239,7 @@ return function (global, window, document, undefined) {
}
callsToStop.push(i);
} else if (propertiesMap === "finish") {
} else if (propertiesMap === "finish" || propertiesMap === "finishAll") {
/* To get active tweens to finish immediately, we forcefully shorten their durations to 1ms so that
they finish upon the next rAf tick then proceed with normal call completion logic. */
activeCall[2].duration = 1;
@ -3473,7 +3491,7 @@ return function (global, window, document, undefined) {
tween.currentValue = currentValue;
/* If we're tweening a fake 'tween' property in order to log transition values, update the one-per-call variable so that
it can be passed into the progress callback. */
it can be passed into the progress callback. */
if (property === "tween") {
tweenDummyValue = currentValue;
} else {

File diff suppressed because one or more lines are too long

View File

@ -168,7 +168,6 @@
.searchResultsOverlay {
position: fixed;
background: rgba(34, 34, 34, 1);
top: 50px;
left: 0;
right: 0;

View File

@ -31,6 +31,19 @@
</div>
</div>
<br />
<h1>
${HeaderCameraUpload}
</h1>
<div class="detailSectionContent">
<p>${SelectCameraUploadServers}</p>
<br />
<div class="paperCheckboxList uploadServerList">
</div>
</div>
<br />
<br />
<button type="submit" data-role="none" class="clearButton">

View File

@ -4,16 +4,14 @@
<title>Emby</title>
</head>
<body>
<div id="nowPlayingPage" data-role="page" class="page libraryPage nowPlayingPage noSecondaryNavPage" data-contextname="${TitleRemoteControl}" data-theme="b" data-require="jqmcollapsible,scripts/nowplayingpage,paperbuttonstyle">
<div id="nowPlayingPage" data-role="page" class="page libraryPage nowPlayingPage noSecondaryNavPage" data-contextname="${TitleRemoteControl}" data-theme="b" data-require="jqmcollapsible,scripts/nowplayingpage">
<div class="libraryViewNav">
<paper-tabs class="nowPlayingPagePaperTabs" hidescrollbuttons noink>
<paper-tab>${TabNowPlaying}</paper-tab>
<paper-tab>${TabControls}</paper-tab>
<paper-tab>${TabPlaylist}</paper-tab>
</paper-tabs>
<div>
<a href="#" data-index="0">${TabNowPlaying}</a>
<a href="#" data-index="1">${TabControls}</a>
<a href="#" data-index="2">${TabPlaylist}</a>
</div>
</div>
<div data-role="content" style="overflow:visible;">
@ -27,7 +25,7 @@
</div>
</div>
<neon-animated-pages selected="{{selected}}">
<neon-animated-pages>
<neon-animatable>
<div style="text-align:center;">
@ -167,6 +165,13 @@
</div>
</div>
<paper-tabs class="nowPlayingPagePaperTabs" hidescrollbuttons noink>
<paper-tab>${TabNowPlaying}</paper-tab>
<paper-tab>${TabControls}</paper-tab>
<paper-tab>${TabPlaylist}</paper-tab>
</paper-tabs>
</div>
</body>
</html>

View File

@ -98,6 +98,21 @@
return appStorage.getItem('displayLanguage') || 'en-US';
},
cameraUploadServers: function (val) {
if (val != null) {
update('cameraUploadServers', val.join(','));
}
val = appStorage.getItem('cameraUploadServers');
if (val) {
return val.split(',');
}
return [];
},
displayPreferencesKey: function () {
if (AppInfo.isNativeApp) {
return 'Emby Mobile';

View File

@ -633,6 +633,18 @@
});
}
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
}
function getPortraitShape() {
return enableScrollX() ? 'overflowPortrait' : 'detailPagePortrait';
}
function getSquareShape() {
return enableScrollX() ? 'overflowSquare' : 'detailPageSquare';
}
function renderSimilarItems(page, item, context) {
if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "Series" || item.Type == "Program" || item.Type == "Recording" || item.Type == "Game" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "ChannelVideoItem") {
@ -643,7 +655,7 @@
return;
}
var shape = item.Type == "MusicAlbum" || item.Type == "MusicArtist" ? "detailPageSquare" : "detailPagePortrait";
var shape = item.Type == "MusicAlbum" || item.Type == "MusicArtist" ? getSquareShape() : getPortraitShape();
var screenWidth = $(window).width();
var screenHeight = $(window).height();
@ -657,6 +669,10 @@
options.limit *= 2;
}
if (enableScrollX()) {
options.limit = 12;
}
ApiClient.getSimilarItems(item.Id, options).done(function (result) {
if (!result.Items.length) {
@ -669,7 +685,14 @@
$('.similiarHeader', elem).html(Globalize.translate('HeaderIfYouLikeCheckTheseOut', item.Name));
var html = LibraryBrowser.getPosterViewHtml({
var html = '';
if (enableScrollX()) {
html += '<div class="hiddenScrollX itemsContainer">';
} else {
html += '<div class="itemsContainer">';
}
html += LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: shape,
showParentTitle: item.Type == "MusicAlbum",
@ -682,6 +705,7 @@
coverImage: item.Type == "MusicAlbum" || item.Type == "MusicArtist",
overlayPlayButton: true
});
html += '</div>';
$('#similarContent', page).html(html).lazyChildren().createCardMenus();
});

View File

@ -24,6 +24,8 @@
options.enableBackgroundTransfer = true;
}
options.cameraUploadServers = AppSettings.cameraUploadServers();
syncPromise = new MediaBrowser.MultiServerSync(ConnectionManager).sync(options).done(function () {
syncPromise = null;

View File

@ -6,6 +6,17 @@
page.querySelector('#chkWifi').checked = AppSettings.syncOnlyOnWifi();
page.querySelector('#chkSyncLosslessAudio').checked = AppSettings.syncLosslessAudio();
var uploadServers = AppSettings.cameraUploadServers();
page.querySelector('.uploadServerList').innerHTML = ConnectionManager.getSavedServers().map(function (s) {
var checkedHtml = uploadServers.indexOf(s.Id) == -1 ? '' : ' checked';
var html = '<paper-checkbox' + checkedHtml + ' class="chkUploadServer" data-id="' + s.Id + '">' + s.Name + '</paper-checkbox>';
return html;
}).join('');
Dashboard.hideLoadingMsg();
}

View File

@ -775,20 +775,37 @@
var tabs = page.querySelector('paper-tabs');
if (AppInfo.enableNowPlayingPageBottomTabs) {
tabs.alignBottom = true;
tabs.classList.add('bottom');
tabs.classList.remove('hide');
//page.classList.add('noSecondaryNavPage');
} else {
tabs.classList.remove('bottom');
tabs.classList.add('hide');
//page.classList.remove('noSecondaryNavPage');
}
tabs.classList.add('bottom');
tabs.alignBottom = true;
LibraryBrowser.configureSwipeTabs(page, tabs, page.querySelectorAll('neon-animated-pages')[0]);
$(tabs).on('iron-select', function () {
page.querySelector('neon-animated-pages').selected = this.selected;
});
$(page.querySelector('neon-animated-pages')).on('iron-select', function () {
var btn = page.querySelector('.libraryViewNav a.ui-btn-active');
if (btn) {
btn.classList.remove('ui-btn-active');
}
page.querySelector('.libraryViewNav a[data-index=\'' + this.selected + '\']').classList.add('ui-btn-active');
});
$(page.querySelectorAll('.libraryViewNav a')).on('click', function () {
var newSelected = this.getAttribute('data-index');
tabs.selected = newSelected;
page.querySelector('neon-animated-pages').selected = newSelected;
});
$(MediaController).on('playerchange', function () {
updateCastIcon(page);
});

View File

@ -147,7 +147,7 @@
if (createIfNeeded && !elem) {
var html = '<div class="searchResultsOverlay ui-body-b smoothScrollY">';
var html = '<div class="searchResultsOverlay ui-body-b smoothScrollY background-theme-b">';
html += '<div class="searchResultsContainer"><div class="itemsContainer"></div></div></div>';

View File

@ -1729,6 +1729,7 @@ var AppInfo = {};
AppInfo.enableCustomHomeSections = true;
AppInfo.enableHomeTabs = true;
AppInfo.enableNowPlayingPageBottomTabs = true;
AppInfo.enableNowPlayingPageBottomTabs = false;
AppInfo.enableAppStorePolicy = isCordova;
@ -1776,7 +1777,6 @@ var AppInfo = {};
AppInfo.enableMovieTrailersTab = true;
}
AppInfo.enableAppLayouts = true;
if (isCordova) {
AppInfo.enableAppLayouts = true;
AppInfo.hasKnownExternalPlayerSupport = true;
@ -1946,6 +1946,7 @@ var AppInfo = {};
Dashboard.importCss('themes/ios.css');
}
}
Dashboard.importCss('themes/ios.css');
if ($.browser.msie && $.browser.tv && ($.browser.version || 11) <= 10) {
Dashboard.importCss('thirdparty/paper-ie10.css');

View File

@ -1544,5 +1544,7 @@
"LabelHardwareVideoDecoderHelp": "Available on supported systems only.",
"ButtonServerDashboard": "Server Dashboard",
"HeaderAdmin": "Admin",
"ButtonSignOut": "Sign out"
"ButtonSignOut": "Sign out",
"HeaderCameraUpload": "Camera Upload",
"SelectCameraUploadServers": "Upload camera photos to the following servers:"
}

View File

@ -231,5 +231,5 @@ paper-tab {
}
.nowPlayingPage {
padding-top: 40px !important;
padding-top: 50px !important;
}