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

@ -194,16 +194,10 @@
}
};
getNewItem(jobItems[index], apiClient, serverInfo).done(goNext).fail(goNext);
options = options || {};
if (options.enableBackgroundTransfer) {
// Give it 2 seconds, then move on
setTimeout(goNext, 2000);
}
getNewItem(jobItems[index], apiClient, serverInfo, options).done(goNext).fail(goNext);
}
function getNewItem(jobItem, apiClient, serverInfo) {
function getNewItem(jobItem, apiClient, serverInfo, options) {
Logger.log('Begin getNewItem');
@ -214,7 +208,12 @@
var libraryItem = jobItem.Item;
LocalAssetManager.createLocalItem(libraryItem, serverInfo, jobItem.OriginalFileName).done(function (localItem) {
downloadMedia(apiClient, jobItem, localItem).done(function () {
downloadMedia(apiClient, jobItem, localItem, options).done(function (isQueued) {
if (isQueued) {
deferred.resolve();
return;
}
getImages(apiClient, jobItem, localItem).done(function () {
@ -238,7 +237,7 @@
return deferred.promise();
}
function downloadMedia(apiClient, jobItem, localItem) {
function downloadMedia(apiClient, jobItem, localItem, options) {
Logger.log('Begin downloadMedia');
var deferred = DeferredBuilder.Deferred();
@ -253,11 +252,17 @@
Logger.log('Downloading media. Url: ' + url + '. Local path: ' + localPath);
LocalAssetManager.downloadFile(url, localPath).done(function () {
options = options || {};
LocalAssetManager.downloadFile(url, localPath, options.enableBackgroundTransfer).done(function (path, isQueued) {
if (isQueued) {
deferred.resolveWith(null, [true]);
return;
}
LocalAssetManager.addOrUpdateLocalItem(localItem).done(function () {
deferred.resolve();
deferred.resolveWith(null, [false]);
}).fail(getOnFail(deferred));

View File

@ -1,6 +1,6 @@
{
"name": "iron-autogrow-textarea",
"version": "1.0.5",
"version": "1.0.6",
"description": "A textarea element that automatically grows with input",
"authors": [
"The Polymer Authors"
@ -37,11 +37,11 @@
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.0.5",
"_release": "1.0.6",
"_resolution": {
"type": "version",
"tag": "v1.0.5",
"commit": "2f354b99a4fda5d601629b0119d0a6c9dd77d336"
"tag": "v1.0.6",
"commit": "e0465d41019cf03827f4820a254ce80e56266e99"
},
"_source": "git://github.com/PolymerElements/iron-autogrow-textarea.git",
"_target": "^1.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "iron-autogrow-textarea",
"version": "1.0.5",
"version": "1.0.6",
"description": "A textarea element that automatically grows with input",
"authors": [
"The Polymer Authors"

View File

@ -218,6 +218,36 @@ this element's `bind-value` instead for imperative updates.
return this.$.textarea;
},
/**
* Returns textarea's selection start.
* @type Number
*/
get selectionStart() {
return this.$.textarea.selectionStart;
},
/**
* Returns textarea's selection end.
* @type Number
*/
get selectionEnd() {
return this.$.textarea.selectionEnd;
},
/**
* Sets the textarea's selection start.
*/
set selectionStart(value) {
this.$.textarea.selectionStart = value;
},
/**
* Sets the textarea's selection end.
*/
set selectionEnd(value) {
this.$.textarea.selectionEnd = value;
},
/**
* Returns true if `value` is valid. The validator provided in `validator`
* will be used first, if it exists; otherwise, the `textarea`'s validity

View File

@ -87,6 +87,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var finalHeight = autogrow.offsetHeight
assert.isTrue(finalHeight < initialHeight);
});
test('textarea selection works', function() {
var autogrow = fixture('basic');
var textarea = autogrow.textarea;
autogrow.bindValue = 'batman\nand\nrobin';
autogrow.selectionStart = 3;
autogrow.selectionEnd = 5;
assert.equal(textarea.selectionStart, 3);
assert.equal(textarea.selectionEnd, 5);
});
});
suite('focus/blur events', function() {

View File

@ -27,14 +27,14 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-behaviors",
"homepage": "https://github.com/polymerelements/iron-behaviors",
"_release": "1.0.8",
"_resolution": {
"type": "version",
"tag": "v1.0.8",
"commit": "663ad706b43989f4961d945b8116cf4db346532f"
},
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
"_source": "git://github.com/polymerelements/iron-behaviors.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-behaviors"
"_originalSource": "polymerelements/iron-behaviors"
}

View File

@ -23,14 +23,14 @@
"paper-styles": "polymerelements/paper-styles#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-flex-layout",
"homepage": "https://github.com/polymerelements/iron-flex-layout",
"_release": "1.0.3",
"_resolution": {
"type": "version",
"tag": "v1.0.3",
"commit": "e6c2cfec18354973ac03e70dcd8afcc3c72d09b9"
},
"_source": "git://github.com/PolymerElements/iron-flex-layout.git",
"_source": "git://github.com/polymerelements/iron-flex-layout.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-flex-layout"
"_originalSource": "polymerelements/iron-flex-layout"
}

View File

@ -1,13 +1,13 @@
{
"name": "paper-behaviors",
"version": "1.0.3",
"version": "1.0.4",
"description": "Common behaviors across the paper elements",
"authors": [
"The Polymer Authors"
],
"main": [
"paper-button-behavior.html",
"paper-radio-button-behavior.html"
"paper-inky-focus-behavior.html"
],
"keywords": [
"web-components",
@ -36,11 +36,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.0.3",
"_release": "1.0.4",
"_resolution": {
"type": "version",
"tag": "v1.0.3",
"commit": "90b54de14264c19693601b9fc16af6b68a9d48e4"
"tag": "v1.0.4",
"commit": "a7ac7fbdb79b4d82416ec9b41613575386d0d226"
},
"_source": "git://github.com/PolymerElements/paper-behaviors.git",
"_target": "^1.0.0",

View File

@ -1,13 +1,13 @@
{
"name": "paper-behaviors",
"version": "1.0.3",
"version": "1.0.4",
"description": "Common behaviors across the paper elements",
"authors": [
"The Polymer Authors"
],
"main": [
"paper-button-behavior.html",
"paper-radio-button-behavior.html"
"paper-inky-focus-behavior.html"
],
"keywords": [
"web-components",

View File

@ -1,6 +1,6 @@
{
"name": "paper-progress",
"version": "1.0.5",
"version": "1.0.6",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "A material design progress bar",
"authors": "The Polymer Authors",
@ -29,11 +29,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-progress",
"_release": "1.0.5",
"_release": "1.0.6",
"_resolution": {
"type": "version",
"tag": "v1.0.5",
"commit": "baf8049bb33c3f9557d0d3608dc0824847ac34c4"
"tag": "v1.0.6",
"commit": "520d84592d98cac975bfcedfcc5765e51d2c2871"
},
"_source": "git://github.com/PolymerElements/paper-progress.git",
"_target": "^1.0.0",

View File

@ -331,7 +331,7 @@ Custom property | Description
},
_disabledChanged: function(disabled) {
this.$.progressContainer.setAttribute('aria-disabled', disabled ? 'true' : 'false');
this.setAttribute('aria-disabled', disabled ? 'true' : 'false');
},
_hideSecondaryProgress: function(secondaryRatio) {

View File

@ -1,6 +1,6 @@
{
"name": "paper-tabs",
"version": "1.0.2",
"version": "1.0.3",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Material design tabs",
"private": true,
@ -39,11 +39,11 @@
"web-component-tester": "*"
},
"homepage": "https://github.com/PolymerElements/paper-tabs",
"_release": "1.0.2",
"_release": "1.0.3",
"_resolution": {
"type": "version",
"tag": "v1.0.2",
"commit": "61abed79e3c4e7c87dd826f7f81ef9c7ecb5df78"
"tag": "v1.0.3",
"commit": "19546ca9fbe23da457177cac8de1a7720cb62c57"
},
"_source": "git://github.com/PolymerElements/paper-tabs.git",
"_target": "~1.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "paper-tabs",
"version": "1.0.2",
"version": "1.0.3",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Material design tabs",
"private": true,

View File

@ -174,7 +174,7 @@ Custom property | Description | Default
<paper-icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollButtonClass(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onLeftScrollButtonDown"></paper-icon-button>
<div id="tabsContainer" class="flex" on-scroll="_scroll">
<div id="tabsContainer" class="flex" on-track="_scroll" on-down="_down">
<div id="tabsContent" class$="[[_computeTabsContentClass(scrollable)]]">
@ -310,6 +310,10 @@ Custom property | Description | Default
'iron-deselect': '_onIronDeselect'
},
ready: function() {
this.setScrollDirection('y', this.$.tabsContainer);
},
_computeScrollButtonClass: function(hideThisButton, scrollable, hideScrollButtons) {
if (!scrollable || hideScrollButtons) {
return 'hidden';
@ -364,24 +368,43 @@ Custom property | Description | Default
);
},
_scroll: function() {
var scrollLeft;
_scroll: function(e, detail) {
if (!this.scrollable) {
return;
}
scrollLeft = this.$.tabsContainer.scrollLeft;
var ddx = (detail && -detail.ddx) || 0;
this._affectScroll(ddx);
},
_down: function(e) {
// go one beat async to defeat IronMenuBehavior
// autorefocus-on-no-selection timeout
this.async(function() {
if (this._defaultFocusAsync) {
this.cancelAsync(this._defaultFocusAsync);
this._defaultFocusAsync = null;
}
}, 1);
},
_affectScroll: function(dx) {
this.$.tabsContainer.scrollLeft += dx;
var scrollLeft = this.$.tabsContainer.scrollLeft;
this._leftHidden = scrollLeft === 0;
this._rightHidden = scrollLeft === this._tabContainerScrollSize;
},
_onLeftScrollButtonDown: function() {
this._scrollToLeft();
this._holdJob = setInterval(this._scrollToLeft.bind(this), this._holdDelay);
},
_onRightScrollButtonDown: function() {
this._scrollToRight();
this._holdJob = setInterval(this._scrollToRight.bind(this), this._holdDelay);
},
@ -391,11 +414,11 @@ Custom property | Description | Default
},
_scrollToLeft: function() {
this.$.tabsContainer.scrollLeft -= this._step;
this._affectScroll(-this._step);
},
_scrollToRight: function() {
this.$.tabsContainer.scrollLeft += this._step;
this._affectScroll(this._step);
},
_tabChanged: function(tab, old) {

View File

@ -11,8 +11,8 @@
}
switch (name) {
case 'Featured':
Dashboard.navigate('index.html');
case 'Favorites':
Dashboard.navigate('favorites.html');
break;
case 'Library':
Dashboard.navigate('index.html');
@ -68,8 +68,8 @@
*/
var items = [
{ name: 'Featured', label: Globalize.translate('ButtonForYou'), image: 'tabButton:Featured', options: {} },
{ name: 'Library', label: Globalize.translate('ButtonLibrary'), image: 'tabbar/tab-library.png', options: {} },
{ name: 'Favorites', label: Globalize.translate('ButtonFavorites'), image: 'tabButton:Favorites', options: {} },
{ name: 'Search', label: Globalize.translate('ButtonSearch'), image: 'tabButton:Search', options: {} },
{ name: 'NowPlaying', label: Globalize.translate('ButtonNowPlaying'), image: 'tabbar/tab-nowplaying.png', options: {} },
{ name: 'Sync', label: Globalize.translate('ButtonSync'), image: 'tabbar/tab-sync.png', options: {} },
@ -113,11 +113,11 @@
Events.on(ConnectionManager, 'localusersignedin', showTabs);
Events.on(ConnectionManager, 'localusersignedout', hideTabs);
Events.on(ConnectionManager, 'playbackstart', onPlaybackStop);
Events.on(ConnectionManager, 'playbackstop', onPlaybackStart);
Events.on(MediaController, 'playbackstart', onPlaybackStop);
Events.on(MediaController, 'playbackstop', onPlaybackStart);
});
pageClassOn('pageshowready', "page", function () {
pageClassOn('pageshow', "page", function () {
var page = this;

View File

@ -459,10 +459,20 @@
return filename;
}
function downloadFile(url, localPath) {
function downloadFile(url, localPath, enableBackground) {
if (!enableBackground) {
return downloadWithFileTransfer(url, localPath);
}
var deferred = DeferredBuilder.Deferred();
if (localStorage.getItem('sync-' + url) == '1') {
Logger.log('file was downloaded previously');
deferred.resolveWith(null, [localPath]);
return deferred.promise();
}
Logger.log('downloading: ' + url + ' to ' + localPath);
getFileSystem().done(function (fileSystem) {
@ -478,10 +488,8 @@
var downloadPromise = download.startAsync().then(function () {
// on success
var localUrl = localPath;
Logger.log('Downloaded local url: ' + localUrl);
deferred.resolveWith(null, [localUrl]);
Logger.log('Downloaded local url: ' + localPath);
localStorage.setItem('sync-' + url, '1');
}, function () {
@ -495,6 +503,34 @@
//Logger.log('download progress: ' + value);
});
// true indicates that it's queued
deferred.resolveWith(null, [localPath, true]);
});
}).fail(getOnFail(deferred));;
}).fail(getOnFail(deferred));
return deferred.promise();
}
function downloadWithFileTransfer(url, localPath) {
var deferred = DeferredBuilder.Deferred();
Logger.log('downloading: ' + url + ' to ' + localPath);
getFileSystem().done(function (fileSystem) {
createDirectory(getParentDirectoryPath(localPath)).done(function () {
var path = fileSystem.root.toURL() + "/emby/cache/" + key;
var ft = new FileTransfer();
ft.download(url, path, function (entry) {
deferred.resolveWith(null, [localPath]);
});
}).fail(getOnFail(deferred));;
@ -552,10 +588,6 @@
return deferred.promise();
}
function getParentDirectoryPath(path) {
return path.substring(0, path.lastIndexOf('/'));;
}
function downloadSubtitles(url, localItem, subtitleStream) {
var path = item.LocalPath;

View File

@ -458,10 +458,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
padding: 0;
}
.lnkSibling:hover {
text-decoration: underline;
}
.lnkSibling:not(.hide) {
display: block;
}
@ -973,10 +969,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
text-decoration: none;
}
.detailPageParentLink:hover {
text-decoration: underline;
}
.itemMiscInfo {
text-overflow: ellipsis;
overflow: hidden;
@ -1049,7 +1041,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
border-radius: 50%;
color: #fff;
line-height: 19px;
background-color: #38c;
background-color: #52B54B;
}
.playedIndicator + .syncIndicator {
@ -1556,6 +1548,10 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
display: none !important;
}
.homeFavoritesDisabled .homeFavoritesTab {
display: none !important;
}
.detailsMenu {
width: 280px;
}

View File

@ -352,10 +352,6 @@ body {
text-decoration: none;
}
.textlink:hover {
text-decoration: underline;
}
h1, h1 a {
font-weight: 300 !important;
font-size: 24px;
@ -382,7 +378,7 @@ h2 {
font-weight: 500 !important;
}
a {
a, a:active, a:hover {
text-decoration: none;
}
@ -1105,10 +1101,6 @@ paper-input + .fieldDescription {
background-color: rgba(26,26,26,.94);
}
.footerOverBottomTabs {
bottom: 52px !important;
}
.footerNotification {
padding: .75em 1em;
margin: 0;
@ -1588,3 +1580,22 @@ progress {
.supporterMembershipDisabled .tabSupporterMembership {
display: none;
}
.syncActivityForTarget {
margin: 0 0 3em 0;
}
.syncActivityForTarget paper-fab {
border-radius: 0;
}
@media all and (min-width: 800px) {
.syncActivityForTarget {
max-width: 600px;
margin: 0 3em 3em 0;
display: inline-block;
vertical-align: top;
min-width: 400px;
}
}

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>Emby</title>
</head>
<body>
<div id="favoritesPage" data-role="page" class="page homePage libraryPage allLibraryPage noSecondaryNavPage" data-title="${TabFavorites}" data-require="scripts/favorites">
<div data-role="content">
<div class="sections"></div>
</div>
</div>
</body>
</html>

View File

@ -10,13 +10,13 @@
<paper-tabs hidescrollbuttons noink>
<paper-tab>${TabHome}</paper-tab>
<paper-tab>${TabNextUp}</paper-tab>
<paper-tab>${TabFavorites}</paper-tab>
<paper-tab class="homeFavoritesTab">${TabFavorites}</paper-tab>
<paper-tab>${TabUpcoming}</paper-tab>
</paper-tabs>
<div class="legacyTabs">
<a href="index.html">${TabHome}</a>
<a href="index.html?tab=1">${TabNextUp}</a>
<a href="index.html?tab=2">${TabFavorites}</a>
<a href="index.html?tab=2" class="homeFavoritesTab">${TabFavorites}</a>
<a href="index.html?tab=3">${TabUpcoming}</a>
</div>
</div>

View File

@ -7,7 +7,7 @@
<div id="liveTvSuggestedPage" data-dom-cache="true" data-role="page" class="page libraryPage liveTvPage pageWithAbsoluteTabs" data-contextname="${HeaderLiveTv}" data-backdroptype="series,movie" data-require="jqmpanel,scripts/livetvsuggested,livetvcss,scripts/livetvcomponents">
<div class="libraryViewNav libraryViewNavWithMinHeight">
<paper-tabs hidescrollbuttons>
<paper-tabs hidescrollbuttons noink>
<paper-tab>${TabSuggestions}</paper-tab>
<paper-tab>${TabGuide}</paper-tab>
<paper-tab>${TabChannels}</paper-tab>

View File

@ -77,6 +77,15 @@
</paper-item-body>
</paper-icon-item>
</a>
<a href="dashboard.html" class="clearLink lnkServer hide">
<paper-icon-item>
<paper-fab class="listAvatar" icon="settings" style="background-color:#444;" item-icon></paper-fab>
<paper-item-body two-line>
<div>${ButtonManageServer}</div>
</paper-item-body>
</paper-icon-item>
</a>
</div>
</div>
</div>

View File

@ -24,7 +24,7 @@
<div class="localSyncStatus hide" style="text-align:right;margin:0 0 1em;">
<span style="vertical-align: middle;margin-right:.5em;" class="labelSyncStatus"></span>
<paper-spinner class="syncSpinner" active style="vertical-align: middle;"></paper-spinner>
<paper-fab class="btnSyncNow mini accent" icon="sync"></paper-fab>
<paper-fab class="btnSyncNow mini accent" icon="sync" style="margin-right:.5em;"></paper-fab>
</div>
<div class="syncActivity">

View File

@ -8,7 +8,7 @@
<div data-role="content" style="overflow:visible;">
<paper-fab mini icon="arrow-back" class="white" onclick="history.back()" style="position:relative;top:5px;left:5px;"></paper-fab>
<paper-fab mini icon="arrow-back" class="white nowPlayingPageBackButton" onclick="history.back()" style="position:relative;top:5px;left:5px;"></paper-fab>
<div style="float:right;position:relative;top:5px;right:5px;text-align:right;">
<div>
<span class="nowPlayingSelectedPlayer"></span>
@ -149,7 +149,7 @@
</neon-animatable>
</neon-animated-pages>
<paper-tabs selected="{{selected}}" style="position:fixed;bottom:0;left:0;right:0;" class="bottomTabs" hidescrollbuttons noink>
<paper-tabs selected="{{selected}}" style="position:fixed;bottom:0;left:0;right:0;" class="bottomTabs nowPlayingPagePaperTabs" hidescrollbuttons noink>
<paper-tab>${TabNowPlaying}</paper-tab>
<paper-tab>${TabControls}</paper-tab>

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;

Some files were not shown because too many files have changed in this diff Show More