update components

This commit is contained in:
Luke Pulverenti 2017-01-11 00:18:59 -05:00
parent 5772a26964
commit 51d44957c3
7 changed files with 67 additions and 56 deletions

View File

@ -14,12 +14,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.4.458", "version": "1.4.460",
"_release": "1.4.458", "_release": "1.4.460",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.4.458", "tag": "1.4.460",
"commit": "122cc814d3faca2afd6ebc3b406016e382e0b026" "commit": "c25b2134e84594781f7eb2e6bd85bc2529a1d922"
}, },
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1", "_target": "^1.2.1",

View File

@ -118,7 +118,7 @@ define(['browser', 'pluginManager', 'events', 'apphost', 'loading', 'playbackMan
function updateVideoUrl(streamInfo) { function updateVideoUrl(streamInfo) {
var isHls = streamInfo.url.toLowerCase().indexOf('.m3u8') != -1; var isHls = streamInfo.url.toLowerCase().indexOf('.m3u8') !== -1;
var mediaSource = streamInfo.mediaSource; var mediaSource = streamInfo.mediaSource;
var item = streamInfo.item; var item = streamInfo.item;
@ -699,6 +699,7 @@ define(['browser', 'pluginManager', 'events', 'apphost', 'loading', 'playbackMan
if (!started) { if (!started) {
started = true; started = true;
this.removeAttribute('controls');
if (currentPlayOptions.title) { if (currentPlayOptions.title) {
self.originalDocumentTitle = document.title; self.originalDocumentTitle = document.title;
@ -709,8 +710,6 @@ define(['browser', 'pluginManager', 'events', 'apphost', 'loading', 'playbackMan
setCurrentTrackElement(subtitleTrackIndexToSetOnPlaying); setCurrentTrackElement(subtitleTrackIndexToSetOnPlaying);
this.removeAttribute('controls');
seekOnPlaybackStart(e.target); seekOnPlaybackStart(e.target);
if (currentPlayOptions.fullscreen) { if (currentPlayOptions.fullscreen) {
@ -1289,7 +1288,7 @@ define(['browser', 'pluginManager', 'events', 'apphost', 'loading', 'playbackMan
} else { } else {
// Chrome 35 won't play with preload none // Chrome 35 won't play with preload none
html += '<video class="htmlvideoplayer htmlvideoplayer-nocontrols" preload="metadata" autoplay="autoplay" webkit-playsinline playsinline>'; html += '<video class="htmlvideoplayer" preload="metadata" autoplay="autoplay" webkit-playsinline playsinline>';
} }
html += '</video>'; html += '</video>';

View File

@ -49,7 +49,7 @@
display: inline-block; display: inline-block;
} }
.htmlvideoplayer-nocontrols::-webkit-media-text-track-display { .htmlvideoplayer::-webkit-media-text-track-display {
/*Style the text itself*/ /*Style the text itself*/
margin-top: -2.5em; margin-top: -2.5em;
} }

View File

@ -845,8 +845,10 @@ define(['events', 'datetime', 'appSettings', 'pluginManager', 'userSettings', 'g
if (player) { if (player) {
playNextAfterEnded = false; playNextAfterEnded = false;
// TODO: remove second param // TODO: remove second param
player.stop(true, true); return player.stop(true, true);
} }
return Promise.resolve();
}; };
self.playPause = function (player) { self.playPause = function (player) {

View File

@ -53,14 +53,14 @@
html += '<div class="listItemBody three-line">'; html += '<div class="listItemBody three-line">';
html += '<div>'; html += '<h3 class="listItemBodyText">';
html += jobItem.ItemName; html += jobItem.ItemName;
html += '</div>'; html += '</h3>';
if (jobItem.Status === 'Failed') { if (jobItem.Status === 'Failed') {
html += '<div class="secondary" style="color:red;">'; html += '<div class="secondary listItemBodyText" style="color:red;">';
} else { } else {
html += '<div class="secondary">'; html += '<div class="secondary listItemBodyText">';
} }
html += globalize.translate('sharedcomponents#SyncJobItemStatus' + jobItem.Status); html += globalize.translate('sharedcomponents#SyncJobItemStatus' + jobItem.Status);
if (jobItem.Status === 'Synced' && jobItem.IsMarkedForRemoval) { if (jobItem.Status === 'Synced' && jobItem.IsMarkedForRemoval) {
@ -69,7 +69,7 @@
} }
html += '</div>'; html += '</div>';
html += '<div class="secondary" style="padding-top:5px;">'; html += '<div class="secondary listItemBodyText" style="padding-top:5px;">';
html += '<div style="background:#e0e0e0;height:4px;"><div style="background:#52B54B;width:' + (jobItem.Progress || 0) + '%;height:100%;"></div></div>'; html += '<div style="background:#e0e0e0;height:4px;"><div style="background:#52B54B;width:' + (jobItem.Progress || 0) + '%;height:100%;"></div></div>';
html += '</div>'; html += '</div>';

View File

@ -4,7 +4,7 @@
function onSyncJobsUpdated(e, apiClient, data) { function onSyncJobsUpdated(e, apiClient, data) {
var listInstance = this; var listInstance = this;
renderList(listInstance, data); renderList(listInstance, data, apiClient);
} }
function refreshList(listInstance, jobs) { function refreshList(listInstance, jobs) {
@ -54,28 +54,28 @@ globalize.translate('sharedcomponents#CancelSyncJobConfirmation');
return; return;
} }
var progress = job.Progress || 0; listItem.querySelector('.jobStatus').innerHTML = getProgressText(job);
var statusIcon = listItem.querySelector('.statusIcon');
if (progress === 0) {
statusIcon.innerHTML = 'file_download';
statusIcon.classList.add('md-icon');
statusIcon.classList.remove('status-text-icon');
statusIcon.classList.add('zeroProgressStatus');
} else if (progress >= 100) {
statusIcon.innerHTML = 'check';
statusIcon.classList.add('md-icon');
statusIcon.classList.remove('status-text-icon');
statusIcon.classList.remove('zeroProgressStatus');
} else {
statusIcon.classList.remove('md-icon');
statusIcon.classList.remove('zeroProgressStatus');
statusIcon.classList.add('status-text-icon');
statusIcon.innerHTML = (Math.round(progress)) + '%';
}
} }
function getSyncJobHtml(listInstance, job) { function getProgressText(job) {
var status = job.Status;
if (status === 'Completed') {
status = 'Synced';
}
var html = globalize.translate('sharedcomponents#SyncJobItemStatus' + status);
if (job.Status === 'Transferring' || job.Status === 'Converting' || job.Status === 'Completed') {
html += ' ';
html += (job.Progress || 0) + '%';
}
return html;
}
function getSyncJobHtml(listInstance, job, apiClient) {
var html = ''; var html = '';
@ -90,14 +90,24 @@ globalize.translate('sharedcomponents#CancelSyncJobConfirmation');
html += '<' + tagName + typeAttribute + ' class="' + listItemClass + '" data-id="' + job.Id + '" data-status="' + job.Status + '">'; html += '<' + tagName + typeAttribute + ' class="' + listItemClass + '" data-id="' + job.Id + '" data-status="' + job.Status + '">';
var progress = job.Progress || 0; var imgUrl;
if (progress === 0) { if (job.PrimaryImageItemId) {
html += '<i class="md-icon listItemIcon statusIcon zeroProgressStatus">file_download</i>';
} else if (progress >= 100) { imgUrl = apiClient.getImageUrl(job.PrimaryImageItemId, {
html += '<i class="md-icon listItemIcon statusIcon">check</i>'; type: "Primary",
} else { width: 80,
html += '<i class="listItemIcon statusIcon status-text-icon">' + (Math.round(progress)) + '%</i>'; tag: job.PrimaryImageTag,
minScale: 1.5
});
}
if (imgUrl) {
html += '<div class="listItemImage lazy" data-src="' + imgUrl + '" item-icon>';
html += '</div>';
}
else {
html += '<i class="md-icon listItemIcon">file_download</i>';
} }
var textLines = []; var textLines = [];
@ -114,11 +124,7 @@ globalize.translate('sharedcomponents#CancelSyncJobConfirmation');
textLines.push(globalize.translate('sharedcomponents#ItemCount', job.ItemCount)); textLines.push(globalize.translate('sharedcomponents#ItemCount', job.ItemCount));
} }
if (textLines >= 3) { html += '<div class="listItemBody three-line">';
html += '<div class="listItemBody three-line">';
} else {
html += '<div class="listItemBody two-line">';
}
for (var i = 0, length = textLines.length; i < length; i++) { for (var i = 0, length = textLines.length; i < length; i++) {
@ -133,6 +139,10 @@ globalize.translate('sharedcomponents#CancelSyncJobConfirmation');
} }
} }
html += '<div class="secondary listItemBodyText jobStatus" style="color:green;">';
html += getProgressText(job);
html += '</div>';
html += '</div>'; html += '</div>';
if (!layoutManager.tv) { if (!layoutManager.tv) {
@ -144,7 +154,7 @@ globalize.translate('sharedcomponents#CancelSyncJobConfirmation');
return html; return html;
} }
function renderList(listInstance, jobs) { function renderList(listInstance, jobs, apiClient) {
if ((new Date().getTime() - listInstance.lastDataLoad) < 60000) { if ((new Date().getTime() - listInstance.lastDataLoad) < 60000) {
refreshList(listInstance, jobs); refreshList(listInstance, jobs);
@ -187,7 +197,7 @@ globalize.translate('sharedcomponents#CancelSyncJobConfirmation');
} }
} }
html += getSyncJobHtml(listInstance, job); html += getSyncJobHtml(listInstance, job, apiClient);
} }
if (hasOpenSection) { if (hasOpenSection) {
@ -229,7 +239,7 @@ globalize.translate('sharedcomponents#CancelSyncJobConfirmation');
return apiClient.getJSON(apiClient.getUrl('Sync/Jobs', options)).then(function (response) { return apiClient.getJSON(apiClient.getUrl('Sync/Jobs', options)).then(function (response) {
renderList(listInstance, response.Items); renderList(listInstance, response.Items, apiClient);
loading.hide(); loading.hide();
}); });
} }

View File

@ -86,7 +86,7 @@ define(['appSettings', 'events', 'browser'], function (appsettings, events, brow
self.enableCinemaMode = function (val) { self.enableCinemaMode = function (val) {
if (val != null) { if (val != null) {
self.set('enableCinemaMode', val.toString()); self.set('enableCinemaMode', val.toString(), false);
} }
val = self.get('enableCinemaMode', false); val = self.get('enableCinemaMode', false);
@ -101,7 +101,7 @@ define(['appSettings', 'events', 'browser'], function (appsettings, events, brow
self.enableThemeSongs = function (val) { self.enableThemeSongs = function (val) {
if (val != null) { if (val != null) {
self.set('enableThemeSongs', val.toString()); self.set('enableThemeSongs', val.toString(), false);
} }
val = self.get('enableThemeSongs', false); val = self.get('enableThemeSongs', false);
@ -112,7 +112,7 @@ define(['appSettings', 'events', 'browser'], function (appsettings, events, brow
self.enableThemeVideos = function (val) { self.enableThemeVideos = function (val) {
if (val != null) { if (val != null) {
self.set('enableThemeVideos', val.toString()); self.set('enableThemeVideos', val.toString(), false);
} }
val = self.get('enableThemeVideos', false); val = self.get('enableThemeVideos', false);
@ -127,10 +127,10 @@ define(['appSettings', 'events', 'browser'], function (appsettings, events, brow
self.language = function (val) { self.language = function (val) {
if (val != null) { if (val != null) {
self.set('language', val.toString()); self.set('language', val.toString(), false);
} }
return self.get('language'); return self.get('language', false);
}; };
self.skipBackLength = function (val) { self.skipBackLength = function (val) {