update script dependencies

This commit is contained in:
Luke Pulverenti 2016-03-16 17:30:49 -04:00
parent bd8391a61c
commit b53f6c1d3f
17 changed files with 225 additions and 239 deletions

View File

@ -1,4 +1,4 @@
(function (window, document, $) {
define(['jQuery'], function ($) {
function getPickerHtml() {
@ -110,4 +110,4 @@
return this.alphaValue('');
};
})(window, document, jQuery);
});

View File

@ -1,4 +1,4 @@
(function ($, document) {
define(['jQuery'], function ($) {
function reloadList(page) {
@ -105,4 +105,4 @@
reloadList(page);
});
})(jQuery, document);
});

View File

@ -1,4 +1,4 @@
(function ($, document, window) {
define(['jQuery'], function ($) {
function getNode(item, folderState, selected) {
@ -463,4 +463,4 @@
setCurrentItemId: setCurrentItemId
};
})(jQuery, document, window);
});

View File

@ -1,4 +1,4 @@
define(['appSettings', 'paper-slider', 'paper-button'], function (appSettings) {
define(['appSettings', 'jQuery', 'paper-slider', 'paper-button'], function (appSettings, $) {
function getDeviceProfile(serverAddress, deviceId, item, startPositionTicks, maxBitrate, mediaSourceId, audioStreamIndex, subtitleStreamIndex) {

View File

@ -1,198 +1,197 @@
(function ($, document) {
function enableScrollX() {
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getThumbShape() {
return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
}
function getPosterShape() {
return enableScrollX() ? 'overflowPortrait' : 'portrait';
}
function getSquareShape() {
return enableScrollX() ? 'overflowSquare' : 'square';
}
function getSections() {
return [
{ name: 'HeaderFavoriteMovies', types: "Movie", id: "favoriteMovies", shape: getPosterShape(), showTitle: false, overlayPlayButton: true },
{ name: 'HeaderFavoriteShows', types: "Series", id: "favoriteShows", shape: getPosterShape(), showTitle: false, overlayPlayButton: true },
{ name: 'HeaderFavoriteEpisodes', types: "Episode", id: "favoriteEpisode", shape: getThumbShape(), preferThumb: false, showTitle: true, showParentTitle: true, overlayPlayButton: true },
{ name: 'HeaderFavoriteGames', types: "Game", id: "favoriteGames", shape: getSquareShape(), preferThumb: false, showTitle: true },
{ name: 'HeaderFavoriteArtists', types: "MusicArtist", id: "favoriteArtists", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayPlayButton: true },
{ name: 'HeaderFavoriteAlbums', types: "MusicAlbum", id: "favoriteAlbums", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayPlayButton: true },
{ name: 'HeaderFavoriteSongs', types: "Audio", id: "favoriteSongs", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayMoreButton: true, defaultAction: 'instantmix' }
];
}
define(['libraryBrowser'], function (libraryBrowser) {
function enableScrollX() {
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getThumbShape() {
return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
}
function getPosterShape() {
return enableScrollX() ? 'overflowPortrait' : 'portrait';
}
function getSquareShape() {
return enableScrollX() ? 'overflowSquare' : 'square';
}
function getSections() {
return [
{ name: 'HeaderFavoriteMovies', types: "Movie", id: "favoriteMovies", shape: getPosterShape(), showTitle: false, overlayPlayButton: true },
{ name: 'HeaderFavoriteShows', types: "Series", id: "favoriteShows", shape: getPosterShape(), showTitle: false, overlayPlayButton: true },
{ name: 'HeaderFavoriteEpisodes', types: "Episode", id: "favoriteEpisode", shape: getThumbShape(), preferThumb: false, showTitle: true, showParentTitle: true, overlayPlayButton: true },
{ name: 'HeaderFavoriteGames', types: "Game", id: "favoriteGames", shape: getSquareShape(), preferThumb: false, showTitle: true },
{ name: 'HeaderFavoriteArtists', types: "MusicArtist", id: "favoriteArtists", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayPlayButton: true },
{ name: 'HeaderFavoriteAlbums', types: "MusicAlbum", id: "favoriteAlbums", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayPlayButton: true },
{ name: 'HeaderFavoriteSongs', types: "Audio", id: "favoriteSongs", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayMoreButton: true, defaultAction: 'instantmix' }
];
}
function loadSection(elem, userId, topParentId, section, isSingleSection) {
var screenWidth = $(window).width();
var options = {
SortBy: "SortName",
SortOrder: "Ascending",
Filters: "IsFavorite",
Recursive: true,
Fields: "PrimaryImageAspectRatio,SyncInfo",
CollapseBoxSetItems: false,
ExcludeLocationTypes: "Virtual"
};
if (topParentId) {
options.ParentId = topParentId;
}
if (!isSingleSection) {
options.Limit = screenWidth >= 1920 ? 10 : (screenWidth >= 1440 ? 8 : 6);
if (enableScrollX()) {
options.Limit = 16;
}
}
var promise;
if (section.types == 'MusicArtist') {
promise = ApiClient.getArtists(userId, options);
} else {
options.IncludeItemTypes = section.types;
promise = ApiClient.getItems(userId, options);
}
return promise.then(function (result) {
var html = '';
if (result.Items.length) {
html += '<div>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="listHeader">' + Globalize.translate(section.name) + '</h1>';
if (result.TotalRecordCount > result.Items.length) {
var href = "secondaryitems.html?type=" + section.types + "&filters=IsFavorite&titlekey=" + section.name;
html += '<a class="clearLink" href="' + href + '" style="margin-left:2em;"><paper-button raised class="more mini">' + Globalize.translate('ButtonMore') + '</paper-button></a>';
}
html += '</div>';
if (enableScrollX()) {
html += '<div class="itemsContainer hiddenScrollX">';
} else {
html += '<div class="itemsContainer">';
}
html += LibraryBrowser.getPosterViewHtml({
items: result.Items,
preferThumb: section.preferThumb,
shape: section.shape,
overlayText: section.overlayText !== false,
showTitle: section.showTitle,
showParentTitle: section.showParentTitle,
lazy: true,
showDetailsMenu: true,
centerText: section.centerText,
overlayPlayButton: section.overlayPlayButton,
overlayMoreButton: section.overlayMoreButton,
context: 'home-favorites',
defaultAction: section.defaultAction
});
html += '</div>';
}
elem.innerHTML = html;
ImageLoader.lazyChildren(elem);
$(elem).createCardMenus();
});
}
function loadSections(page, userId, topParentId, types) {
Dashboard.showLoadingMsg();
var sections = getSections();
var sectionid = getParameterByName('sectionid');
if (sectionid) {
sections = sections.filter(function (s) {
return s.id == sectionid;
});
}
if (types) {
sections = sections.filter(function (s) {
return types.indexOf(s.id) != -1;
});
}
var i, length;
var elem = page.querySelector('.favoriteSections');
if (!elem.innerHTML) {
var html = '';
for (i = 0, length = sections.length; i < length; i++) {
html += '<div class="homePageSection section' + sections[i].id + '"></div>';
}
elem.innerHTML = html;
}
var promises = [];
for (i = 0, length = sections.length; i < length; i++) {
var section = sections[i];
elem = page.querySelector('.section' + section.id);
promises.push(loadSection(elem, userId, topParentId, section, sections.length == 1));
}
Promise.all(promises).then(function () {
Dashboard.hideLoadingMsg();
LibraryBrowser.setLastRefreshed(page);
});
}
function initHomePage() {
if (window.HomePage) {
window.HomePage.renderFavorites = function (page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
loadSections(tabContent, Dashboard.getCurrentUserId());
}
};
}
}
initHomePage();
pageIdOn('pageinit', "indexPage", initHomePage);
pageIdOn('pagebeforeshow', "favoritesPage", function () {
var page = this;
if (LibraryBrowser.needsRefresh(page)) {
loadSections(page, Dashboard.getCurrentUserId());
}
});
window.FavoriteItems = {
render: loadSections
};
})(jQuery, document);
var screenWidth = window.innerWidth;
var options = {
SortBy: "SortName",
SortOrder: "Ascending",
Filters: "IsFavorite",
Recursive: true,
Fields: "PrimaryImageAspectRatio,SyncInfo",
CollapseBoxSetItems: false,
ExcludeLocationTypes: "Virtual"
};
if (topParentId) {
options.ParentId = topParentId;
}
if (!isSingleSection) {
options.Limit = screenWidth >= 1920 ? 10 : (screenWidth >= 1440 ? 8 : 6);
if (enableScrollX()) {
options.Limit = 16;
}
}
var promise;
if (section.types == 'MusicArtist') {
promise = ApiClient.getArtists(userId, options);
} else {
options.IncludeItemTypes = section.types;
promise = ApiClient.getItems(userId, options);
}
return promise.then(function (result) {
var html = '';
if (result.Items.length) {
html += '<div>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="listHeader">' + Globalize.translate(section.name) + '</h1>';
if (result.TotalRecordCount > result.Items.length) {
var href = "secondaryitems.html?type=" + section.types + "&filters=IsFavorite&titlekey=" + section.name;
html += '<a class="clearLink" href="' + href + '" style="margin-left:2em;"><paper-button raised class="more mini">' + Globalize.translate('ButtonMore') + '</paper-button></a>';
}
html += '</div>';
if (enableScrollX()) {
html += '<div class="itemsContainer hiddenScrollX">';
} else {
html += '<div class="itemsContainer">';
}
html += libraryBrowser.getPosterViewHtml({
items: result.Items,
preferThumb: section.preferThumb,
shape: section.shape,
overlayText: section.overlayText !== false,
showTitle: section.showTitle,
showParentTitle: section.showParentTitle,
lazy: true,
showDetailsMenu: true,
centerText: section.centerText,
overlayPlayButton: section.overlayPlayButton,
overlayMoreButton: section.overlayMoreButton,
context: 'home-favorites',
defaultAction: section.defaultAction
});
html += '</div>';
}
elem.innerHTML = html;
ImageLoader.lazyChildren(elem);
libraryBrowser.createCardMenus(elem);
});
}
function loadSections(page, userId, topParentId, types) {
Dashboard.showLoadingMsg();
var sections = getSections();
var sectionid = getParameterByName('sectionid');
if (sectionid) {
sections = sections.filter(function (s) {
return s.id == sectionid;
});
}
if (types) {
sections = sections.filter(function (s) {
return types.indexOf(s.id) != -1;
});
}
var i, length;
var elem = page.querySelector('.favoriteSections');
if (!elem.innerHTML) {
var html = '';
for (i = 0, length = sections.length; i < length; i++) {
html += '<div class="homePageSection section' + sections[i].id + '"></div>';
}
elem.innerHTML = html;
}
var promises = [];
for (i = 0, length = sections.length; i < length; i++) {
var section = sections[i];
elem = page.querySelector('.section' + section.id);
promises.push(loadSection(elem, userId, topParentId, section, sections.length == 1));
}
Promise.all(promises).then(function () {
Dashboard.hideLoadingMsg();
libraryBrowser.setLastRefreshed(page);
});
}
function initHomePage() {
if (window.HomePage) {
window.HomePage.renderFavorites = function (page, tabContent) {
if (libraryBrowser.needsRefresh(tabContent)) {
loadSections(tabContent, Dashboard.getCurrentUserId());
}
};
}
}
initHomePage();
pageIdOn('pageinit', "indexPage", initHomePage);
pageIdOn('pagebeforeshow', "favoritesPage", function () {
var page = this;
if (libraryBrowser.needsRefresh(page)) {
loadSections(page, Dashboard.getCurrentUserId());
}
});
window.FavoriteItems = {
render: loadSections
};
});

View File

@ -1,4 +1,4 @@
(function () {
define(['jQuery'], function ($) {
var supportsTextTracks;
var hlsPlayer;
@ -781,4 +781,4 @@
};
}
})();
});

View File

@ -84,7 +84,7 @@
values = JSON.parse(values);
return $.extend(query, values);
return Object.assign(query, values);
}
return query;
@ -492,7 +492,7 @@
if (window.location.href.toLowerCase().indexOf(url.toLowerCase()) != -1) {
afterNavigate.call($($.mobile.activePage)[0]);
afterNavigate.call($.mobile.activePage);
} else {
$(document).one('pagebeforeshow', '.page', afterNavigate);
Dashboard.navigate(url);
@ -1581,7 +1581,7 @@
return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
},
enableSync: function(item, user) {
enableSync: function (item, user) {
if (AppInfo.isNativeApp && !Dashboard.capabilities().SupportsSync) {
return false;
}
@ -2805,11 +2805,6 @@
},
openViewPanel: function (btn, className) {
$('.' + className, jQuery(btn).parents('.page')).removeClass('hide').panel('toggle');
},
getQueryPagingHtml: function (options) {
var startIndex = options.startIndex;
@ -2862,14 +2857,6 @@
html += '<paper-icon-button class="btnSort" title="' + Globalize.translate('ButtonSort') + '" icon="sort-by-alpha"></paper-icon-button>';
}
if (options.viewButton) {
//html += '<paper-button raised class="subdued notext"><iron-icon icon="view-comfy"></iron-icon></paper-button>';
var viewPanelClass = options.viewPanelClass || 'viewPanel';
var title = options.viewIcon == 'filter-list' ? Globalize.translate('ButtonFilter') : Globalize.translate('ButtonMenu');
html += '<paper-icon-button title="' + title + '" icon="' + (options.viewIcon || AppInfo.moreIcon) + '" onclick="LibraryBrowser.openViewPanel(this, \'' + viewPanelClass + '\');"></paper-icon-button>';
}
if (options.filterButton) {
html += '<paper-icon-button class="btnFilter" title="' + Globalize.translate('ButtonFilter') + '" icon="filter-list"></paper-icon-button>';
@ -2953,11 +2940,11 @@
// Seeing an issue in Firefox and IE where it's initially visible in the bottom right, then moves to the center
var delay = browserInfo.animate ? 0 : 100;
setTimeout(function() {
setTimeout(function () {
paperDialogHelper.open(dlg);
}, delay);
$('.groupSortBy', dlg).on('iron-select', function () {
dlg.querySelector('.groupSortBy').addEventListener('iron-select', function () {
var newValue = this.selected.replace('_', ',');
var changed = options.query.SortBy != newValue;
@ -2970,7 +2957,7 @@
}
});
$('.groupSortOrder', dlg).on('iron-select', function () {
dlg.querySelector('.groupSortOrder').addEventListener('iron-select', function () {
var newValue = this.selected;
var changed = options.query.SortOrder != newValue;

View File

@ -1,4 +1,4 @@
(function ($, document, window) {
define(['jQuery'], function ($) {
function reload(page, providerId) {
@ -75,4 +75,4 @@
reload(page, providerId);
});
})(jQuery, document, window);
});

View File

@ -1,4 +1,4 @@
(function ($, document, window) {
define(['jQuery'], function ($) {
function reload(page, providerId) {
@ -87,4 +87,4 @@
reload(page, providerId);
});
})(jQuery, document, window);
});

View File

@ -1,4 +1,4 @@
(function ($, document, window) {
define(['jQuery'], function ($) {
function reload(page, providerId) {
@ -110,4 +110,4 @@
reload(page, providerId);
});
})(jQuery, document, window);
});

View File

@ -1,4 +1,4 @@
define(['appSettings'], function (appSettings) {
define(['appSettings', 'jQuery'], function (appSettings, $) {
function createVideoPlayer(self) {

View File

@ -1598,7 +1598,7 @@ define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, use
NowPlayingItem: state.NowPlayingItem
};
info = $.extend(info, state.PlayState);
info = Object.assign(info, state.PlayState);
console.log('repeat mode ' + info.RepeatMode);
ApiClient.reportPlaybackProgress(info);
}

View File

@ -1,4 +1,4 @@
define([], function () {
define(['jQuery'], function ($) {
var currentPlayer;

View File

@ -1,4 +1,4 @@
define(['appStorage'], function (appStorage) {
define(['appStorage', 'jQuery'], function (appStorage, $) {
var data = {};
function getPageData() {

View File

@ -1,4 +1,4 @@
(function (window, document, $) {
define(['jQuery'], function ($) {
window.RatingDialog = function (page) {
@ -136,4 +136,4 @@
}
};
})(window, document, jQuery);
});

View File

@ -1,4 +1,4 @@
define([], function () {
define(['jQuery'], function ($) {
var currentDialogOptions;

View File

@ -1,4 +1,4 @@
define(['appStorage'], function (appStorage) {
define(['appStorage', 'jQuery'], function (appStorage, $) {
$.fn.taskButton = function (options) {