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

update sync process

This commit is contained in:
Luke Pulverenti 2015-09-24 13:08:10 -04:00
parent cc428aac1d
commit 504384e83d
109 changed files with 553 additions and 289 deletions

View file

@ -1,6 +1,6 @@
(function ($, document) {
$(document).on('pageshowready', "#aboutPage", function () {
$(document).on('pageshow', "#aboutPage", function () {
var page = this;

View file

@ -172,7 +172,7 @@
$('.addPluginForm').off('submit', AddPluginPage.onSubmit).on('submit', AddPluginPage.onSubmit);
}).on('pageshowready', "#addPluginPage", function () {
}).on('pageshow', "#addPluginPage", function () {
var page = this;

View file

@ -70,7 +70,7 @@
return false;
}
$(document).on('pageshowready', "#advancedConfigurationPage", function () {
$(document).on('pageshow', "#advancedConfigurationPage", function () {
Dashboard.showLoadingMsg();

View file

@ -98,7 +98,7 @@
$('.sectionTabs', page).hide();
$('.' + context + 'SectionTabs', page).show();
}).on('pageshowready', "#appServicesPage", function () {
}).on('pageshow', "#appServicesPage", function () {
var page = this;

View file

@ -352,7 +352,7 @@
$('.episodeCorrectionForm').off('submit', onEpisodeCorrectionFormSubmit).on('submit', onEpisodeCorrectionFormSubmit);
}).on('pageshowready', "#libraryFileOrganizerLogPage", function () {
}).on('pageshow', "#libraryFileOrganizerLogPage", function () {
var page = this;

View file

@ -153,7 +153,7 @@
$('.libraryFileOrganizerForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#libraryFileOrganizerPage", function () {
}).on('pageshow', "#libraryFileOrganizerPage", function () {
var page = this;

View file

@ -31,7 +31,7 @@
$('.channelSettingsForm', page).off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#channelSettingsPage", function () {
}).on('pageshow', "#channelSettingsPage", function () {
Dashboard.showLoadingMsg();

View file

@ -75,7 +75,7 @@
$('.cinemaModeConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#cinemaModeConfigurationPage", function () {
}).on('pageshow', "#cinemaModeConfigurationPage", function () {
Dashboard.showLoadingMsg();

View file

@ -103,7 +103,7 @@
$('.dashboardGeneralForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#dashboardGeneralPage", function () {
}).on('pageshow', "#dashboardGeneralPage", function () {
Dashboard.showLoadingMsg();

View file

@ -40,7 +40,7 @@
return false;
}
$(document).on('pageshowready', "#dashboardHostingPage", function () {
$(document).on('pageshow', "#dashboardHostingPage", function () {
Dashboard.showLoadingMsg();

View file

@ -82,7 +82,7 @@
$('.deviceForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#devicePage", function () {
}).on('pageshow', "#devicePage", function () {
var page = this;

View file

@ -90,7 +90,7 @@
});
}
$(document).on('pageshowready', "#devicesPage", function () {
$(document).on('pageshow', "#devicesPage", function () {
var page = this;

View file

@ -136,7 +136,7 @@
$('.devicesUploadForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#devicesUploadPage", function () {
}).on('pageshow', "#devicesUploadPage", function () {
var page = this;

View file

@ -1066,7 +1066,7 @@
$('.xmlAttributeForm').off('submit', DlnaProfilePage.onXmlAttributeFormSubmit).on('submit', DlnaProfilePage.onXmlAttributeFormSubmit);
$('.subtitleProfileForm').off('submit', DlnaProfilePage.onSubtitleProfileFormSubmit).on('submit', DlnaProfilePage.onSubtitleProfileFormSubmit);
}).on('pageshowready', "#dlnaProfilePage", function () {
}).on('pageshow', "#dlnaProfilePage", function () {
var page = this;

View file

@ -104,7 +104,7 @@
}
$(document).on('pageshowready', "#dlnaProfilesPage", function () {
$(document).on('pageshow', "#dlnaProfilesPage", function () {
var page = this;

View file

@ -43,7 +43,7 @@
$('.dlnaServerSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#dlnaServerSettingsPage", function () {
}).on('pageshow', "#dlnaServerSettingsPage", function () {
Dashboard.showLoadingMsg();

View file

@ -32,7 +32,7 @@
$('.dlnaSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#dlnaSettingsPage", function () {
}).on('pageshow', "#dlnaSettingsPage", function () {
Dashboard.showLoadingMsg();

View file

@ -1475,7 +1475,7 @@
showMoreMenu(page, this);
});
}).on('pageshowready', "#editItemMetadataPage", function () {
}).on('pageshow', "#editItemMetadataPage", function () {
var page = this;

View file

@ -68,7 +68,7 @@
$('.encodingSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#encodingSettingsPage", function () {
}).on('pageshow', "#encodingSettingsPage", function () {
Dashboard.showLoadingMsg();

View file

@ -141,10 +141,24 @@
});
}
window.HomePage.renderFavorites = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
loadSections(tabContent, Dashboard.getCurrentUserId());
function initHomePage() {
window.HomePage.renderFavorites = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
loadSections(tabContent, Dashboard.getCurrentUserId());
}
};
}
initHomePage();
pageIdOn('pageshow', "favoritesPage", function () {
var page = this;
if (LibraryBrowser.needsRefresh(page)) {
loadSections(page, Dashboard.getCurrentUserId());
}
};
});
})(jQuery, document);

View file

@ -40,7 +40,7 @@
if (duration) {
if (time >= (duration - 1)) {
onEnded();
//onEnded();
return;
}
}

View file

@ -246,7 +246,7 @@
});
});
pageIdOn('pageshowready', "indexPage", function () {
pageIdOn('pageshow', "indexPage", function () {
var page = this;
$(MediaController).on('playbackstop', onPlaybackStop);

View file

@ -1085,30 +1085,29 @@
var reviews = result.Items;
html += '<div class="paperList">';
for (var i = 0, length = reviews.length; i < length; i++) {
var review = reviews[i];
html += '<div class="criticReview">';
html += '<div class="reviewScore">';
html += '<paper-icon-item style="padding-top:.5em;padding-bottom:.5em;">';
if (review.Score != null) {
html += review.Score;
//html += review.Score;
}
else if (review.Likes != null) {
if (review.Likes) {
html += '<img src="css/images/fresh.png" />';
html += '<paper-fab class="listAvatar" style="background-color:transparent;background-image:url(\'css/images/fresh.png\');background-repeat:no-repeat;background-position:center center;background-size: cover;" item-icon></paper-fab>';
} else {
html += '<img src="css/images/rotten.png" />';
html += '<paper-fab class="listAvatar" style="background-color:transparent;background-image:url(\'css/images/rotten.png\');background-repeat:no-repeat;background-position:center center;background-size: cover;" item-icon></paper-fab>';
}
}
html += '</div>';
html += '<paper-item-body three-line>';
html += '<div class="reviewCaption">' + review.Caption + '</div>';
html += '<div style="white-space:normal;">' + review.Caption + '</div>';
var vals = [];
@ -1119,8 +1118,7 @@
vals.push(review.Publisher);
}
html += '<div class="reviewerName">' + vals.join(', ') + '.';
html += '<div secondary>' + vals.join(', ') + '.';
if (review.Date) {
try {
@ -1134,15 +1132,17 @@
}
}
html += '</div>';
if (review.Url) {
html += '<div class="reviewLink"><a class="textlink" href="' + review.Url + '" target="_blank">' + Globalize.translate('ButtonFullReview') + '</a></div>';
html += '<div secondary><a class="textlink" href="' + review.Url + '" target="_blank">' + Globalize.translate('ButtonFullReview') + '</a></div>';
}
html += '</div>';
html += '</paper-item-body>';
html += '</paper-icon-item>';
}
html += '</div>';
if (limit && result.TotalRecordCount > limit) {
html += '<p style="margin: 0;"><paper-button raised class="more moreCriticReviews">' + Globalize.translate('ButtonMore') + '</paper-button></p>';

View file

@ -75,7 +75,7 @@
return false;
}
$(document).on('pageshowready', "#kidsPage", function () {
$(document).on('pageshow', "#kidsPage", function () {
var page = this;

View file

@ -223,11 +223,6 @@
tabs.noink = true;
}
if (AppInfo.enableBottomTabs) {
tabs.alignBottom = true;
tabs.classList.add('bottomTabs');
}
if (LibraryBrowser.enableFullPaperTabs()) {
if ($.browser.safari) {
@ -255,7 +250,7 @@
$('.libraryViewNav', ownerpage).removeClass('libraryViewNavWithMinHeight');
}
$(ownerpage).on('pageshowready', LibraryBrowser.onTabbedpagebeforeshow);
$(ownerpage).on('pageshow', LibraryBrowser.onTabbedpagebeforeshow);
pages.addEventListener('iron-select', function () {
// When transition animations are used, add a content loading delay to allow the animations to finish
@ -389,13 +384,20 @@
pages.exitAnimation = null;
var tabs = this.querySelector('paper-tabs');
var noSlide = tabs.noSlide;
tabs.noSlide = true;
tabs.selected = index;
pages.entryAnimation = entryAnimation;
pages.exitAnimation = exitAnimation;
tabs.noSlide = noSlide;
// For some reason the live tv page will not switch tabs in IE and safari
var delay = $.browser.chrome ? 0 : 100;
setTimeout(function () {
var noSlide = tabs.noSlide;
tabs.noSlide = true;
tabs.selected = index;
pages.entryAnimation = entryAnimation;
pages.exitAnimation = exitAnimation;
tabs.noSlide = noSlide;
}, delay);
}
}
};
@ -404,7 +406,7 @@
afterNavigate.call($($.mobile.activePage)[0]);
} else {
$(document).one('pageshowready', '.page', afterNavigate);
$(document).one('pageshow', '.page', afterNavigate);
Dashboard.navigate(url);
}
},

View file

@ -818,7 +818,7 @@
});
pageClassOn('pageshowready', 'page', function () {
pageClassOn('pageshow', 'page', function () {
var page = this;

View file

@ -117,7 +117,7 @@
$('.libraryPathMappingForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#libraryPathMappingPage", function () {
}).on('pageshow', "#libraryPathMappingPage", function () {
Dashboard.showLoadingMsg();

View file

@ -39,7 +39,7 @@
return false;
}
$(document).on('pageshowready', "#librarySettingsPage", function () {
$(document).on('pageshow', "#librarySettingsPage", function () {
Dashboard.showLoadingMsg();

View file

@ -30,7 +30,7 @@
});
}
$(document).on('pageshowready', "#liveTvGuideProviderPage", function () {
$(document).on('pageshow', "#liveTvGuideProviderPage", function () {
Dashboard.showLoadingMsg();

View file

@ -63,7 +63,7 @@
});
});
}).on('pageshowready', "#liveTvSettingsPage", function () {
}).on('pageshow', "#liveTvSettingsPage", function () {
Dashboard.showLoadingMsg();

View file

@ -487,7 +487,7 @@
addProvider(this);
});
}).on('pageshowready', "#liveTvStatusPage", function () {
}).on('pageshow', "#liveTvStatusPage", function () {
var page = this;

View file

@ -67,7 +67,7 @@
return false;
});
}).on('pageshowready', "#liveTvTunerProviderHdHomerunPage", function () {
}).on('pageshow', "#liveTvTunerProviderHdHomerunPage", function () {
var providerId = getParameterByName('id');
var page = this;

View file

@ -60,7 +60,7 @@
return false;
});
}).on('pageshowready', "#liveTvTunerProviderM3UPage", function () {
}).on('pageshow', "#liveTvTunerProviderM3UPage", function () {
var providerId = getParameterByName('id');
var page = this;

View file

@ -226,4 +226,4 @@ $(document).on('pageinit', "#loginPage", function () {
Dashboard.navigate('forgotpassword.html');
});
}).on('pageshowready', "#loginPage", LoginPage.onPageShow);
}).on('pageshow', "#loginPage", LoginPage.onPageShow);

View file

@ -1,6 +1,6 @@
(function () {
$(document).on('pageshowready', "#logPage", function () {
$(document).on('pageshow', "#logPage", function () {
var page = this;

View file

@ -347,7 +347,7 @@
}
};
$(document).on('pageinit', ".mediaLibraryPage", MediaLibraryPage.onPageInit).on('pageshowready', ".mediaLibraryPage", MediaLibraryPage.onPageShow);
$(document).on('pageinit', ".mediaLibraryPage", MediaLibraryPage.onPageInit).on('pageshow', ".mediaLibraryPage", MediaLibraryPage.onPageShow);
var WizardLibraryPage = {
@ -371,7 +371,7 @@ var WizardLibraryPage = {
(function ($, document, window) {
$(document).on('pageshowready', "#mediaLibraryPage", function () {
$(document).on('pageshow', "#mediaLibraryPage", function () {
var page = this;

View file

@ -94,7 +94,7 @@
$('.advancedMetadataConfigurationForm').on('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#advancedMetadataConfigurationPage", function () {
}).on('pageshow', "#advancedMetadataConfigurationPage", function () {
var page = this;

View file

@ -42,7 +42,7 @@
$('.metadataConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#metadataConfigurationPage", function () {
}).on('pageshow', "#metadataConfigurationPage", function () {
Dashboard.showLoadingMsg();

View file

@ -562,7 +562,7 @@
$('.metadataImagesConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#metadataImagesConfigurationPage", function () {
}).on('pageshow', "#metadataImagesConfigurationPage", function () {
Dashboard.showLoadingMsg();

View file

@ -43,7 +43,7 @@
$('.metadataNfoForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#metadataNfoPage", function () {
}).on('pageshow', "#metadataNfoPage", function () {
Dashboard.showLoadingMsg();

View file

@ -81,7 +81,7 @@
$('.metadataSubtitlesForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#metadataSubtitlesPage", function () {
}).on('pageshow', "#metadataSubtitlesPage", function () {
Dashboard.showLoadingMsg();

View file

@ -338,7 +338,7 @@
});
});
pageIdOn('pageshowready', "moviesPage", function () {
pageIdOn('pageshow', "moviesPage", function () {
var page = this;

View file

@ -288,7 +288,7 @@
loadTab(page, parseInt(this.selected));
});
}).on('pageshowready', "#musicRecommendedPage", function () {
}).on('pageshow', "#musicRecommendedPage", function () {
var page = this;

View file

@ -1,4 +1,4 @@
$(document).on('pageshowready', "#myPreferencesMenuPage", function () {
$(document).on('pageshow', "#myPreferencesMenuPage", function () {
var page = this;
@ -15,4 +15,10 @@
} else {
page.querySelector('.lnkSync').classList.add('hide');
}
if (AppInfo.isNativeApp && $.browser.safari) {
page.querySelector('.lnkServer').classList.remove('hide');
} else {
page.querySelector('.lnkServer').classList.add('hide');
}
});

View file

@ -59,7 +59,7 @@
$('.displayPreferencesForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#displayPreferencesPage", function () {
}).on('pageshow', "#displayPreferencesPage", function () {
var page = this;

View file

@ -269,7 +269,7 @@
$('.homeScreenPreferencesForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#homeScreenPreferencesPage", function () {
}).on('pageshow', "#homeScreenPreferencesPage", function () {
var page = this;

View file

@ -143,7 +143,7 @@
$('.languagePreferencesForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#languagePreferencesPage", function () {
}).on('pageshow', "#languagePreferencesPage", function () {
var page = this;

View file

@ -413,7 +413,7 @@
$('.updatePasswordForm').off('submit', UpdatePasswordPage.onSubmit).on('submit', UpdatePasswordPage.onSubmit);
$('.localAccessForm').off('submit', UpdatePasswordPage.onLocalAccessSubmit).on('submit', UpdatePasswordPage.onLocalAccessSubmit);
}).on('pageshowready', ".userPasswordPage", function () {
}).on('pageshow', ".userPasswordPage", function () {
var page = this;

View file

@ -47,7 +47,7 @@
syncNow(page);
});
}).on('pageshowready', "#mySyncActivityPage", function () {
}).on('pageshow', "#mySyncActivityPage", function () {
var page = this;

View file

@ -52,7 +52,7 @@
});
});
}).on('pageshowready', "#syncPreferencesPage", function () {
}).on('pageshow', "#syncPreferencesPage", function () {
var page = this;

View file

@ -1,6 +1,6 @@
(function ($, document, Notifications) {
$(document).on("pageshowready", "#notificationsPage", function () {
$(document).on("pageshow", "#notificationsPage", function () {
// If there is no user logged in there can be no notifications
if (!Dashboard.getCurrentUserId()) return;

View file

@ -199,7 +199,7 @@
});
});
pageClassOn('pageshowready', "type-interior", function () {
pageClassOn('pageshow', "type-interior", function () {
var page = $(this);

View file

@ -177,7 +177,7 @@
$('.notificationSettingForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#notificationSettingPage", function () {
}).on('pageshow', "#notificationSettingPage", function () {
var page = this;

View file

@ -60,7 +60,7 @@
});
}
$(document).on('pageshowready', "#notificationSettingsPage", function () {
$(document).on('pageshow', "#notificationSettingsPage", function () {
var page = this;

View file

@ -31,7 +31,7 @@
$('.playbackConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#playbackConfigurationPage", function () {
}).on('pageshow', "#playbackConfigurationPage", function () {
Dashboard.showLoadingMsg();

View file

@ -271,7 +271,7 @@
reloadList(page);
});
}).on('pageshowready', "#pluginCatalogPage", function () {
}).on('pageshow', "#pluginCatalogPage", function () {
var page = this;

View file

@ -219,7 +219,7 @@
});
}
$(document).on('pageshowready', "#pluginsPage", function () {
$(document).on('pageshow', "#pluginsPage", function () {
reloadList(this);
});

View file

@ -847,7 +847,7 @@
reloadItems(page);
});
})
.on('pageshowready', "#libraryReportManagerPage", function () {
.on('pageshow', "#libraryReportManagerPage", function () {
query.UserId = Dashboard.getCurrentUserId();
var page = this;

View file

@ -314,7 +314,7 @@
$('.addTriggerForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#scheduledTaskPage", function () {
}).on('pageshow', "#scheduledTaskPage", function () {
ScheduledTaskPage.refreshScheduledTask();
});

View file

@ -219,7 +219,7 @@
});
});
}).on('pageshowready', "#scheduledTasksPage", function () {
}).on('pageshow', "#scheduledTasksPage", function () {
var page = this;

View file

@ -4,7 +4,7 @@
var options = {
SortBy: "IsFavoriteOrLike,Random",
SortBy: "IsFavoriteOrLiked,Random",
IncludeItemTypes: "Movie,Series,MusicArtist",
Limit: 20,
Recursive: true,
@ -18,9 +18,9 @@
var href = LibraryBrowser.getHref(i);
var itemHtml = '<a href="' + href + '" style="display:block;padding:.5em 0;">';
var itemHtml = '<div><a style="display:inline-block;padding:.55em 1em;" href="' + href + '">';
itemHtml += i.Name;
itemHtml += '</a>';
itemHtml += '</a></div>';
return itemHtml;
}).join('');
@ -29,7 +29,7 @@
});
}
pageIdOn('pageshowready', "searchPage", function () {
pageIdOn('pageshow', "searchPage", function () {
var page = this;
loadSuggestions(page);

View file

@ -346,7 +346,7 @@
var page = this;
updatePageStyle(page);
}).on('pageshowready', "#selectServerPage", function () {
}).on('pageshow', "#selectServerPage", function () {
var page = this;

View file

@ -79,7 +79,7 @@
});
}).on('pageshowready', "#publicSharedItemPage", function () {
}).on('pageshow', "#publicSharedItemPage", function () {
var page = this;

View file

@ -1564,7 +1564,7 @@ var Dashboard = {
// The native app can handle a little bit more than safari
if (AppInfo.isNativeApp) {
quality -= 10;
quality -= 5;
} else {
@ -1724,6 +1724,8 @@ var AppInfo = {};
AppInfo.enableMovieHomeSuggestions = true;
AppInfo.enableNavDrawer = true;
AppInfo.enableSearchInTopMenu = true;
AppInfo.enableHomeFavorites = true;
AppInfo.enableNowPlayingBar = true;
AppInfo.enableAppStorePolicy = isCordova;
@ -1741,6 +1743,8 @@ var AppInfo = {};
//AppInfo.enableSectionTransitions = true;
AppInfo.enableNavDrawer = false;
AppInfo.enableSearchInTopMenu = false;
AppInfo.enableHomeFavorites = false;
AppInfo.enableNowPlayingBar = false;
} else {
if (isMobile) {
@ -1915,6 +1919,10 @@ var AppInfo = {};
if (AppInfo.isNativeApp) {
elem.classList.add('nativeApp');
}
if (!AppInfo.enableHomeFavorites) {
elem.classList.add('homeFavoritesDisabled');
}
}
function onDocumentReady() {
@ -1990,6 +1998,11 @@ var AppInfo = {};
}
}
if (AppInfo.enableNowPlayingBar) {
require(['scripts/nowplayingbar']);
Dashboard.importCss('css/nowplayingbar.css');
}
if (navigator.splashscreen) {
navigator.splashscreen.hide();
}

View file

@ -49,7 +49,7 @@
$('.streamingSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#streamingSettingsPage", function () {
}).on('pageshow', "#streamingSettingsPage", function () {
Dashboard.showLoadingMsg();

View file

@ -120,7 +120,7 @@
};
$(document).on('pageshowready', "#supporterKeyPage", SupporterKeyPage.onPageShow);
$(document).on('pageshow', "#supporterKeyPage", SupporterKeyPage.onPageShow);
(function () {
@ -267,7 +267,7 @@ $(document).on('pageshowready', "#supporterKeyPage", SupporterKeyPage.onPageShow
$('#linkKeysForm').on('submit', SupporterKeyPage.linkSupporterKeys);
$('.popupAddUserForm').on('submit', SupporterKeyPage.onAddConnectUserSubmit).on('submit', SupporterKeyPage.onAddConnectUserSubmit);
}).on('pageshowready', "#supporterKeyPage", function () {
}).on('pageshow', "#supporterKeyPage", function () {
var page = this;
loadConnectSupporters(page);

View file

@ -182,7 +182,7 @@
$('.supporterForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#supporterPage", function () {
}).on('pageshow', "#supporterPage", function () {
var page = this;

View file

@ -407,7 +407,7 @@
onCategorySyncButtonClick(page, this);
});
}).on('pageshowready', ".libraryPage", function () {
}).on('pageshow', ".libraryPage", function () {
var page = this;

View file

@ -48,7 +48,7 @@
}
var html = '';
html += '<div class="syncStatusBanner" data-status="' + job.Status + '" style="background-color:' + background + ';position:absolute;top:0;right:0;padding:.5em .5em; text-align:left;color: #fff; font-weight: 500; text-transform:uppercase; border-bottom-left-radius: 3px;">';
html += '<div class="syncStatus" secondary data-status="' + job.Status + '" style="color:' + background + ';">';
html += text;
html += '</div>';
@ -59,59 +59,23 @@
var html = '';
html += "<div class='card squareCard' data-id='" + job.Id + "' data-status='" + job.Status + "'>";
html += '<div class="' + cardBoxCssClass + '">';
html += '<div class="cardScalable">';
html += '<div class="cardPadder"></div>';
syncJobPage += '?id=' + job.Id;
html += '<a class="cardContent" href="' + syncJobPage + '">';
var imgUrl;
var style = '';
html += '<paper-icon-item class="syncJobItem" data-id="' + job.Id + '" data-status="' + job.Status + '">';
if (job.PrimaryImageItemId) {
imgUrl = ApiClient.getScaledImageUrl(job.PrimaryImageItemId, {
var imgUrl = ApiClient.getScaledImageUrl(job.PrimaryImageItemId, {
type: "Primary",
width: 400,
tag: job.PrimaryImageTag
width: 40,
tag: job.PrimaryImageTag,
minScale: 3
});
style = "background-position:center center;";
html += '<paper-fab class="listAvatar blue" style="background-image:url(\'' + imgUrl + '\');background-repeat:no-repeat;background-position:center center;background-size: cover;" item-icon></paper-fab>';
} else {
style = "background-color:#38c;background-position:center center;";
imgUrl = "css/images/items/detail/video.png";
html += '<paper-fab class="listAvatar blue" icon="sync" item-icon></paper-fab>';
}
html += '<div class="cardImage coveredCardImage lazy" data-src="' + imgUrl + '" style="' + style + '">';
var progress = job.Progress || 0;
var footerClass = 'cardFooter fullCardFooter lightCardFooter';
if (progress == 0 || progress >= 100) {
footerClass += ' hide';
}
html += '<div class="' + footerClass + '">';
html += "<div class='cardText cardProgress'>";
html += '<progress class="itemProgressBar" min="0" max="100" value="' + progress + '"></progress>';
html += "</div>";
html += "</div>";
html += "</div>";
html += getSyncStatusBanner(job);
// cardContent
html += "</a>";
// cardScalable
html += "</div>";
html += '<div class="cardFooter outerCardFooter">';
html += '<paper-item-body three-line style="min-height:120px;">';
syncJobPage += '?id=' + job.Id;
html += '<a class="clearLink" href="' + syncJobPage + '">';
var textLines = [];
@ -131,24 +95,80 @@
textLines.push('&nbsp;');
}
html += '<div class="cardText" style="text-align:right; float:right;padding:0;">';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="btnJobMenu"></paper-icon-button>';
html += "</div>";
for (var i = 0, length = textLines.length; i < length; i++) {
html += "<div class='cardText' style='margin-right:30px;'>";
if (i == 0) {
html += "<div>";
} else {
html += "<div secondary>";
}
html += textLines[i];
html += "</div>";
}
// cardFooter
html += "</div>";
html += getSyncStatusBanner(job);
// cardBox
html += "</div>";
html += '<div secondary class="syncProgresContainer" style="padding-top:5px;">';
html += '<paper-progress class="mini" style="width:100%;" value="' + (job.Progress || 0) + '"></paper-progress>';
html += '</div>';
// card
html += "</div>";
html += '</a>';
html += '</paper-item-body>';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="btnJobMenu"></paper-icon-button>';
html += '</paper-icon-item>';
//html += "<div class='card squareCard'>";
//html += '<div class="' + cardBoxCssClass + '">';
//html += '<div class="cardScalable">';
//html += '<div class="cardPadder"></div>';
//html += '<a class="cardContent" href="' + syncJobPage + '">';
//var imgUrl;
//var style = '';
//html += '<div class="cardImage coveredCardImage lazy" data-src="' + imgUrl + '" style="' + style + '">';
//var progress = job.Progress || 0;
//var footerClass = 'cardFooter fullCardFooter lightCardFooter';
//if (progress == 0 || progress >= 100) {
// footerClass += ' hide';
//}
//html += '<div class="' + footerClass + '">';
//html += "<div class='cardText cardProgress'>";
//html += '<progress class="itemProgressBar" min="0" max="100" value="' + progress + '"></progress>';
//html += "</div>";
//html += "</div>";
//html += "</div>";
//// cardContent
//html += "</a>";
//// cardScalable
//html += "</div>";
//html += '<div class="cardFooter outerCardFooter">';
//html += '<div class="cardText" style="text-align:right; float:right;padding:0;">';
//html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="btnJobMenu"></paper-icon-button>';
//html += "</div>";
//// cardFooter
//html += "</div>";
//// cardBox
//html += "</div>";
//// card
//html += "</div>";
return html;
}
@ -187,24 +207,26 @@
if (targetName != lastTargetName) {
if (lastTargetName) {
html += '<br/>';
html += '<br/>';
html += '<br/>';
html += '</div>';
html += '</div>';
}
lastTargetName = targetName;
html += '<div class="detailSectionHeader">';
html += '<div>' + targetName + '</div>';
html += '</div>';
html += '<div class="syncActivityForTarget">';
html += '<h1>' + targetName + '</h1>';
html += '<div class="paperList">';
}
}
html += getSyncJobHtml(page, job, cardBoxCssClass, syncJobPage);
}
if (jobs.length) {
html += '</div>';
html += '</div>';
}
var elem = $('.syncActivity', page).html(html).lazyChildren();
Events.trigger(elem[0], 'create');
@ -229,38 +251,32 @@
function refreshJob(page, job) {
var card = page.querySelector('.card[data-id=\'' + job.Id + '\']');
var card = page.querySelector('.syncJobItem[data-id=\'' + job.Id + '\']');
if (!card) {
return;
}
var banner = card.querySelector('.syncStatusBanner');
var banner = card.querySelector('.syncStatus');
if (banner.getAttribute('data-status') == job.Status) {
var elem = document.createElement('div');
elem.innerHTML = getSyncStatusBanner(job);
elem = elem.querySelector('.syncStatusBanner');
elem = elem.querySelector('.syncStatus');
elem.parentNode.removeChild(elem);
banner.parentNode.replaceChild(elem, banner);
}
var progress = job.Progress || 0;
var cardFooter = card.querySelector('.cardFooter');
var syncProgresContainer = card.querySelector('.syncProgresContainer');
if (progress == 0 || progress >= 100) {
cardFooter.classList.add('hide');
}
else {
cardFooter.classList.remove('hide');
cardFooter.querySelector('.itemProgressBar').value = progress;
}
syncProgresContainer.querySelector('paper-progress').value = progress;
}
function showJobMenu(page, elem) {
var card = $(elem).parents('.card');
var card = $(elem).parents('.syncJobItem');
var jobId = card.attr('data-id');
var status = card.attr('data-status');
@ -377,7 +393,7 @@
}
$(document).on('pageshowready', ".syncActivityPage", function () {
$(document).on('pageshow', ".syncActivityPage", function () {
var page = this;
lastDataLoad = 0;

View file

@ -394,7 +394,7 @@
$('.syncJobForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', ".syncJobPage", function () {
}).on('pageshow', ".syncJobPage", function () {
var page = this;
loadJob(page);

View file

@ -52,7 +52,7 @@
$('.syncSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#syncSettingsPage", function () {
}).on('pageshow', "#syncSettingsPage", function () {
Dashboard.showLoadingMsg();

View file

@ -285,7 +285,7 @@
});
});
pageIdOn('pageshowready', "tvRecommendedPage", function () {
pageIdOn('pageshow', "tvRecommendedPage", function () {
var page = this;

View file

@ -201,7 +201,7 @@
$('.userLibraryAccessForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#userLibraryAccessPage", function () {
}).on('pageshow', "#userLibraryAccessPage", function () {
var page = this;

View file

@ -151,7 +151,7 @@
$('.newUserProfileForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#newUserPage", function () {
}).on('pageshow', "#newUserPage", function () {
var page = this;

View file

@ -388,7 +388,7 @@
$('.scheduleForm').off('submit', UserParentalControlPage.onScheduleFormSubmit).on('submit', UserParentalControlPage.onScheduleFormSubmit);
$('.userParentalControlForm').off('submit', UserParentalControlPage.onSubmit).on('submit', UserParentalControlPage.onSubmit);
}).on('pageshowready', "#userParentalControlPage", function () {
}).on('pageshow', "#userParentalControlPage", function () {
var page = this;

View file

@ -91,7 +91,7 @@
$('.btnSkip', page).on('click', skip);
$('.btnNext', page).on('click', next);
}).on('pageshowready', "#wizardGuidePage", function () {
}).on('pageshow', "#wizardGuidePage", function () {
var page = this;

View file

@ -89,7 +89,7 @@
$('.btnSkip', page).on('click', skip);
}).on('pageshowready', "#wizardTunerPage", function () {
}).on('pageshow', "#wizardTunerPage", function () {
var page = this;

View file

@ -76,7 +76,7 @@
$('.wizardSettingsForm', page).off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#wizardSettingsPage", function () {
}).on('pageshow', "#wizardSettingsPage", function () {
var page = this;

View file

@ -46,7 +46,7 @@
$('.wizardStartForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#wizardStartPage", function () {
}).on('pageshow', "#wizardStartPage", function () {
Dashboard.showLoadingMsg();
var page = this;

View file

@ -60,7 +60,7 @@
$('.wizardUserForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#wizardUserPage", function () {
}).on('pageshow', "#wizardUserPage", function () {
Dashboard.showLoadingMsg();