diff --git a/src/components/filterdialog/filterdialog.js b/src/components/filterdialog/filterdialog.js index 1dfd04c679..fb00181069 100644 --- a/src/components/filterdialog/filterdialog.js +++ b/src/components/filterdialog/filterdialog.js @@ -1,49 +1,59 @@ -define(['dom', 'dialogHelper', 'globalize', 'connectionManager', 'events', 'browser', 'require', 'emby-checkbox', 'emby-collapse', 'css!./style'], function (dom, dialogHelper, globalize, connectionManager, events, browser, require) { - 'use strict'; +import dom from "dom"; +import dialogHelper from "dialogHelper"; +import globalize from "globalize"; +import connectionManager from "connectionManager"; +import events from "events"; +import "emby-checkbox"; +import "emby-collapse"; +import "css!./style.css"; +/* eslint-disable indent */ function renderOptions(context, selector, cssClass, items, isCheckedFn) { - var elem = context.querySelector(selector); + const elem = context.querySelector(selector); if (items.length) { - elem.classList.remove('hide'); + elem.classList.remove("hide"); } else { - elem.classList.add('hide'); + elem.classList.add("hide"); } - var html = ''; + let html = ""; html += '
' + globalize.translate('MessageNoTrailersFound') + '
'; + html = '' + Globalize.translate("MessageNoTrailersFound") + "
"; } - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var itemsContainer = tabContent.querySelector(".itemsContainer"); itemsContainer.innerHTML = html; imageLoader.lazyChildren(itemsContainer); libraryBrowser.saveQueryValues(getSavedQueryKey(tabContent), query); @@ -180,13 +180,13 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' var isLoading = false; self.showFilterMenu = function () { - require(['components/filterdialog/filterdialog'], function (filterDialogFactory) { + require(["components/filterdialog/filterdialog"], function ({default: filterDialogFactory}) { var filterDialog = new filterDialogFactory({ query: getQuery(tabContent), - mode: 'movies', + mode: "movies", serverId: ApiClient.serverId() }); - events.on(filterDialog, 'filterchange', function () { + events.on(filterDialog, "filterchange", function () { getQuery(tabContent).StartIndex = 0; reloadItems(); }); @@ -199,9 +199,9 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' }; function initPage(tabContent) { - var alphaPickerElement = tabContent.querySelector('.alphaPicker'); - var itemsContainer = tabContent.querySelector('.itemsContainer'); - alphaPickerElement.addEventListener('alphavaluechanged', function (e) { + var alphaPickerElement = tabContent.querySelector(".alphaPicker"); + var itemsContainer = tabContent.querySelector(".itemsContainer"); + alphaPickerElement.addEventListener("alphavaluechanged", function (e) { var newValue = e.detail.value; var query = getQuery(tabContent); query.NameStartsWithOrGreater = newValue; @@ -210,39 +210,39 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' }); self.alphaPicker = new alphaPicker({ element: alphaPickerElement, - valueChangeEvent: 'click' + valueChangeEvent: "click" }); - tabContent.querySelector('.alphaPicker').classList.add('alphabetPicker-right'); - alphaPickerElement.classList.add('alphaPicker-fixed-right'); - itemsContainer.classList.add('padded-right-withalphapicker'); + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); + itemsContainer.classList.add("padded-right-withalphapicker"); - tabContent.querySelector('.btnFilter').addEventListener('click', function () { + tabContent.querySelector(".btnFilter").addEventListener("click", function () { self.showFilterMenu(); }); - tabContent.querySelector('.btnSort').addEventListener('click', function (e) { + tabContent.querySelector(".btnSort").addEventListener("click", function (e) { libraryBrowser.showSortMenu({ items: [{ - name: globalize.translate('OptionNameSort'), - id: 'SortName' + name: Globalize.translate("OptionNameSort"), + id: "SortName" }, { - name: globalize.translate('OptionImdbRating'), - id: 'CommunityRating,SortName' + name: Globalize.translate("OptionImdbRating"), + id: "CommunityRating,SortName" }, { - name: globalize.translate('OptionDateAdded'), - id: 'DateCreated,SortName' + name: Globalize.translate("OptionDateAdded"), + id: "DateCreated,SortName" }, { - name: globalize.translate('OptionDatePlayed'), - id: 'DatePlayed,SortName' + name: Globalize.translate("OptionDatePlayed"), + id: "DatePlayed,SortName" }, { - name: globalize.translate('OptionParentalRating'), - id: 'OfficialRating,SortName' + name: Globalize.translate("OptionParentalRating"), + id: "OfficialRating,SortName" }, { - name: globalize.translate('OptionPlayCount'), - id: 'PlayCount,SortName' + name: Globalize.translate("OptionPlayCount"), + id: "PlayCount,SortName" }, { - name: globalize.translate('OptionReleaseDate'), - id: 'PremiereDate,SortName' + name: Globalize.translate("OptionReleaseDate"), + id: "PremiereDate,SortName" }], callback: function () { getQuery(tabContent).StartIndex = 0; diff --git a/src/controllers/music/musicalbums.js b/src/controllers/music/musicalbums.js index ecb51f9dc3..2aaca4f2db 100644 --- a/src/controllers/music/musicalbums.js +++ b/src/controllers/music/musicalbums.js @@ -1,5 +1,5 @@ -define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', 'alphaPicker', 'listView', 'cardBuilder', 'userSettings', 'globalize', 'emby-itemscontainer'], function (layoutManager, playbackManager, loading, events, libraryBrowser, imageLoader, alphaPicker, listView, cardBuilder, userSettings, globalize) { - 'use strict'; +define(["layoutManager", "playbackManager", "loading", "events", "libraryBrowser", "imageLoader", "alphaPicker", "listView", "cardBuilder", "userSettings", "emby-itemscontainer"], function (layoutManager, playbackManager, loading, events, libraryBrowser, imageLoader, alphaPicker, listView, cardBuilder, userSettings) { + "use strict"; return function (view, params, tabContent) { function playAll() { @@ -23,16 +23,16 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser if (!pageData) { pageData = { query: { - SortBy: 'SortName', - SortOrder: 'Ascending', - IncludeItemTypes: 'MusicAlbum', + SortBy: "SortName", + SortOrder: "Ascending", + IncludeItemTypes: "MusicAlbum", Recursive: true, - Fields: 'PrimaryImageAspectRatio,SortName,BasicSyncInfo', + Fields: "PrimaryImageAspectRatio,SortName,BasicSyncInfo", ImageTypeLimit: 1, - EnableImageTypes: 'Primary,Backdrop,Banner,Thumb', + EnableImageTypes: "Primary,Backdrop,Banner,Thumb", StartIndex: 0 }, - view: libraryBrowser.getSavedView(key) || 'Poster' + view: libraryBrowser.getSavedView(key) || "Poster" }; if (userSettings.libraryPageSize() > 0) { @@ -52,7 +52,7 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser function getSavedQueryKey() { if (!savedQueryKey) { - savedQueryKey = libraryBrowser.getSavedQueryKey('musicalbums'); + savedQueryKey = libraryBrowser.getSavedQueryKey("musicalbums"); } return savedQueryKey; @@ -60,17 +60,17 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser function onViewStyleChange() { var viewStyle = self.getCurrentViewStyle(); - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var itemsContainer = tabContent.querySelector(".itemsContainer"); - if ('List' == viewStyle) { - itemsContainer.classList.add('vertical-list'); - itemsContainer.classList.remove('vertical-wrap'); + if ("List" == viewStyle) { + itemsContainer.classList.add("vertical-list"); + itemsContainer.classList.remove("vertical-wrap"); } else { - itemsContainer.classList.remove('vertical-list'); - itemsContainer.classList.add('vertical-wrap'); + itemsContainer.classList.remove("vertical-list"); + itemsContainer.classList.add("vertical-wrap"); } - itemsContainer.innerHTML = ''; + itemsContainer.innerHTML = ""; } function reloadItems(page) { @@ -114,18 +114,18 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser filterButton: false }); var viewStyle = self.getCurrentViewStyle(); - if (viewStyle == 'List') { + if (viewStyle == "List") { html = listView.getListViewHtml({ items: result.Items, - context: 'music', + context: "music", sortBy: query.SortBy, addToListButton: true }); - } else if (viewStyle == 'PosterCard') { + } else if (viewStyle == "PosterCard") { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'square', - context: 'music', + shape: "square", + context: "music", showTitle: true, coverImage: true, showParentTitle: true, @@ -135,8 +135,8 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser } else { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'square', - context: 'music', + shape: "square", + context: "music", showTitle: true, showParentTitle: true, lazy: true, @@ -146,30 +146,30 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser } var i; var length; - var elems = tabContent.querySelectorAll('.paging'); + var elems = tabContent.querySelectorAll(".paging"); for (i = 0, length = elems.length; i < length; i++) { elems[i].innerHTML = pagingHtml; } - elems = tabContent.querySelectorAll('.btnNextPage'); + elems = tabContent.querySelectorAll(".btnNextPage"); for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onNextPageClick); + elems[i].addEventListener("click", onNextPageClick); } - elems = tabContent.querySelectorAll('.btnPreviousPage'); + elems = tabContent.querySelectorAll(".btnPreviousPage"); for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onPreviousPageClick); + elems[i].addEventListener("click", onPreviousPageClick); } - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var itemsContainer = tabContent.querySelector(".itemsContainer"); itemsContainer.innerHTML = html; imageLoader.lazyChildren(itemsContainer); libraryBrowser.saveQueryValues(getSavedQueryKey(), query); loading.hide(); isLoading = false; - require(['autoFocuser'], function (autoFocuser) { + require(["autoFocuser"], function (autoFocuser) { autoFocuser.autoFocus(tabContent); }); }); @@ -186,13 +186,13 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser var isLoading = false; self.showFilterMenu = function () { - require(['components/filterdialog/filterdialog'], function (filterDialogFactory) { + require(["components/filterdialog/filterdialog"], function ({default: filterDialogFactory}) { var filterDialog = new filterDialogFactory({ query: getQuery(), - mode: 'albums', + mode: "albums", serverId: ApiClient.serverId() }); - events.on(filterDialog, 'filterchange', function () { + events.on(filterDialog, "filterchange", function () { getQuery().StartIndex = 0; reloadItems(tabContent); }); @@ -205,10 +205,10 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser }; function initPage(tabContent) { - var alphaPickerElement = tabContent.querySelector('.alphaPicker'); - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var alphaPickerElement = tabContent.querySelector(".alphaPicker"); + var itemsContainer = tabContent.querySelector(".itemsContainer"); - alphaPickerElement.addEventListener('alphavaluechanged', function (e) { + alphaPickerElement.addEventListener("alphavaluechanged", function (e) { var newValue = e.detail.value; var query = getQuery(); query.NameStartsWithOrGreater = newValue; @@ -217,39 +217,39 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser }); self.alphaPicker = new alphaPicker({ element: alphaPickerElement, - valueChangeEvent: 'click' + valueChangeEvent: "click" }); - tabContent.querySelector('.alphaPicker').classList.add('alphabetPicker-right'); - alphaPickerElement.classList.add('alphaPicker-fixed-right'); - itemsContainer.classList.add('padded-right-withalphapicker'); + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); + itemsContainer.classList.add("padded-right-withalphapicker"); - tabContent.querySelector('.btnFilter').addEventListener('click', function () { + tabContent.querySelector(".btnFilter").addEventListener("click", function () { self.showFilterMenu(); }); - tabContent.querySelector('.btnSort').addEventListener('click', function (e) { + tabContent.querySelector(".btnSort").addEventListener("click", function (e) { libraryBrowser.showSortMenu({ items: [{ - name: globalize.translate('OptionNameSort'), - id: 'SortName' + name: Globalize.translate("OptionNameSort"), + id: "SortName" }, { - name: globalize.translate('OptionAlbumArtist'), - id: 'AlbumArtist,SortName' + name: Globalize.translate("OptionAlbumArtist"), + id: "AlbumArtist,SortName" }, { - name: globalize.translate('OptionCommunityRating'), - id: 'CommunityRating,SortName' + name: Globalize.translate("OptionCommunityRating"), + id: "CommunityRating,SortName" }, { - name: globalize.translate('OptionCriticRating'), - id: 'CriticRating,SortName' + name: Globalize.translate("OptionCriticRating"), + id: "CriticRating,SortName" }, { - name: globalize.translate('OptionDateAdded'), - id: 'DateCreated,SortName' + name: Globalize.translate("OptionDateAdded"), + id: "DateCreated,SortName" }, { - name: globalize.translate('OptionReleaseDate'), - id: 'ProductionYear,PremiereDate,SortName' + name: Globalize.translate("OptionReleaseDate"), + id: "ProductionYear,PremiereDate,SortName" }, { - name: globalize.translate('OptionRandom'), - id: 'Random,SortName' + name: Globalize.translate("OptionRandom"), + id: "Random,SortName" }], callback: function () { getQuery().StartIndex = 0; @@ -259,11 +259,11 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser button: e.target }); }); - var btnSelectView = tabContent.querySelector('.btnSelectView'); - btnSelectView.addEventListener('click', function (e) { - libraryBrowser.showLayoutMenu(e.target, self.getCurrentViewStyle(), 'List,Poster,PosterCard'.split(',')); + var btnSelectView = tabContent.querySelector(".btnSelectView"); + btnSelectView.addEventListener("click", function (e) { + libraryBrowser.showLayoutMenu(e.target, self.getCurrentViewStyle(), "List,Poster,PosterCard".split(",")); }); - btnSelectView.addEventListener('layoutchange', function (e) { + btnSelectView.addEventListener("layoutchange", function (e) { var viewStyle = e.detail.viewStyle; getPageData().view = viewStyle; libraryBrowser.saveViewSetting(getSavedQueryKey(), viewStyle); @@ -271,8 +271,8 @@ define(['layoutManager', 'playbackManager', 'loading', 'events', 'libraryBrowser onViewStyleChange(); reloadItems(tabContent); }); - tabContent.querySelector('.btnPlayAll').addEventListener('click', playAll); - tabContent.querySelector('.btnShuffle').addEventListener('click', shuffle); + tabContent.querySelector(".btnPlayAll").addEventListener("click", playAll); + tabContent.querySelector(".btnShuffle").addEventListener("click", shuffle); } initPage(tabContent); diff --git a/src/controllers/music/musicartists.js b/src/controllers/music/musicartists.js index bd9341be6d..a3f05d381d 100644 --- a/src/controllers/music/musicartists.js +++ b/src/controllers/music/musicartists.js @@ -1,5 +1,5 @@ -define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', 'alphaPicker', 'listView', 'cardBuilder', 'apphost', 'userSettings', 'emby-itemscontainer'], function (layoutManager, loading, events, libraryBrowser, imageLoader, alphaPicker, listView, cardBuilder, appHost, userSettings) { - 'use strict'; +define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", "alphaPicker", "listView", "cardBuilder", "apphost", "userSettings", "emby-itemscontainer"], function (layoutManager, loading, events, libraryBrowser, imageLoader, alphaPicker, listView, cardBuilder, appHost, userSettings) { + "use strict"; return function (view, params, tabContent) { function getPageData(context) { @@ -8,13 +8,13 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' if (!pageData) { var queryValues = { - SortBy: 'SortName', - SortOrder: 'Ascending', + SortBy: "SortName", + SortOrder: "Ascending", Recursive: true, - Fields: 'PrimaryImageAspectRatio,SortName,BasicSyncInfo', + Fields: "PrimaryImageAspectRatio,SortName,BasicSyncInfo", StartIndex: 0, ImageTypeLimit: 1, - EnableImageTypes: 'Primary,Backdrop,Banner,Thumb' + EnableImageTypes: "Primary,Backdrop,Banner,Thumb" }; if (userSettings.libraryPageSize() > 0) { @@ -23,7 +23,7 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' pageData = data[key] = { query: queryValues, - view: libraryBrowser.getSavedView(key) || 'Poster' + view: libraryBrowser.getSavedView(key) || "Poster" }; pageData.query.ParentId = params.topParentId; libraryBrowser.loadSavedQueryValues(key, pageData.query); @@ -46,17 +46,17 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' function onViewStyleChange() { var viewStyle = self.getCurrentViewStyle(); - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var itemsContainer = tabContent.querySelector(".itemsContainer"); - if ('List' == viewStyle) { - itemsContainer.classList.add('vertical-list'); - itemsContainer.classList.remove('vertical-wrap'); + if ("List" == viewStyle) { + itemsContainer.classList.add("vertical-list"); + itemsContainer.classList.remove("vertical-wrap"); } else { - itemsContainer.classList.remove('vertical-list'); - itemsContainer.classList.add('vertical-wrap'); + itemsContainer.classList.remove("vertical-list"); + itemsContainer.classList.add("vertical-wrap"); } - itemsContainer.innerHTML = ''; + itemsContainer.innerHTML = ""; } function reloadItems(page) { @@ -103,16 +103,16 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' filterButton: false }); var viewStyle = self.getCurrentViewStyle(); - if (viewStyle == 'List') { + if (viewStyle == "List") { html = listView.getListViewHtml({ items: result.Items, sortBy: query.SortBy }); - } else if (viewStyle == 'PosterCard') { + } else if (viewStyle == "PosterCard") { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'square', - context: 'music', + shape: "square", + context: "music", showTitle: true, coverImage: true, cardLayout: true @@ -120,8 +120,8 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' } else { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'square', - context: 'music', + shape: "square", + context: "music", showTitle: true, coverImage: true, lazy: true, @@ -131,30 +131,30 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' } var i; var length; - var elems = tabContent.querySelectorAll('.paging'); + var elems = tabContent.querySelectorAll(".paging"); for (i = 0, length = elems.length; i < length; i++) { elems[i].innerHTML = pagingHtml; } - elems = tabContent.querySelectorAll('.btnNextPage'); + elems = tabContent.querySelectorAll(".btnNextPage"); for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onNextPageClick); + elems[i].addEventListener("click", onNextPageClick); } - elems = tabContent.querySelectorAll('.btnPreviousPage'); + elems = tabContent.querySelectorAll(".btnPreviousPage"); for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onPreviousPageClick); + elems[i].addEventListener("click", onPreviousPageClick); } - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var itemsContainer = tabContent.querySelector(".itemsContainer"); itemsContainer.innerHTML = html; imageLoader.lazyChildren(itemsContainer); libraryBrowser.saveQueryValues(getSavedQueryKey(page), query); loading.hide(); isLoading = false; - require(['autoFocuser'], function (autoFocuser) { + require(["autoFocuser"], function (autoFocuser) { autoFocuser.autoFocus(tabContent); }); }); @@ -170,13 +170,13 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' var isLoading = false; self.showFilterMenu = function () { - require(['components/filterdialog/filterdialog'], function (filterDialogFactory) { + require(["components/filterdialog/filterdialog"], function ({default: filterDialogFactory}) { var filterDialog = new filterDialogFactory({ query: getQuery(tabContent), mode: self.mode, serverId: ApiClient.serverId() }); - events.on(filterDialog, 'filterchange', function () { + events.on(filterDialog, "filterchange", function () { getQuery(tabContent).StartIndex = 0; reloadItems(tabContent); }); @@ -189,10 +189,10 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' }; function initPage(tabContent) { - var alphaPickerElement = tabContent.querySelector('.alphaPicker'); - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var alphaPickerElement = tabContent.querySelector(".alphaPicker"); + var itemsContainer = tabContent.querySelector(".itemsContainer"); - alphaPickerElement.addEventListener('alphavaluechanged', function (e) { + alphaPickerElement.addEventListener("alphavaluechanged", function (e) { var newValue = e.detail.value; var query = getQuery(tabContent); query.NameStartsWithOrGreater = newValue; @@ -201,21 +201,21 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' }); self.alphaPicker = new alphaPicker({ element: alphaPickerElement, - valueChangeEvent: 'click' + valueChangeEvent: "click" }); - tabContent.querySelector('.alphaPicker').classList.add('alphabetPicker-right'); - alphaPickerElement.classList.add('alphaPicker-fixed-right'); - itemsContainer.classList.add('padded-right-withalphapicker'); + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); + itemsContainer.classList.add("padded-right-withalphapicker"); - tabContent.querySelector('.btnFilter').addEventListener('click', function () { + tabContent.querySelector(".btnFilter").addEventListener("click", function () { self.showFilterMenu(); }); - var btnSelectView = tabContent.querySelector('.btnSelectView'); - btnSelectView.addEventListener('click', function (e) { - libraryBrowser.showLayoutMenu(e.target, self.getCurrentViewStyle(), 'List,Poster,PosterCard'.split(',')); + var btnSelectView = tabContent.querySelector(".btnSelectView"); + btnSelectView.addEventListener("click", function (e) { + libraryBrowser.showLayoutMenu(e.target, self.getCurrentViewStyle(), "List,Poster,PosterCard".split(",")); }); - btnSelectView.addEventListener('layoutchange', function (e) { + btnSelectView.addEventListener("layoutchange", function (e) { var viewStyle = e.detail.viewStyle; getPageData(tabContent).view = viewStyle; libraryBrowser.saveViewSetting(getSavedQueryKey(tabContent), viewStyle); diff --git a/src/controllers/music/songs.js b/src/controllers/music/songs.js index 8e50cd720c..21743bc922 100644 --- a/src/controllers/music/songs.js +++ b/src/controllers/music/songs.js @@ -1,5 +1,5 @@ -define(['events', 'libraryBrowser', 'imageLoader', 'listView', 'loading', 'userSettings', 'globalize', 'emby-itemscontainer'], function (events, libraryBrowser, imageLoader, listView, loading, userSettings, globalize) { - 'use strict'; +define(["events", "libraryBrowser", "imageLoader", "listView", "loading", "userSettings", "emby-itemscontainer"], function (events, libraryBrowser, imageLoader, listView, loading, userSettings) { + "use strict"; return function (view, params, tabContent) { function getPageData(context) { @@ -9,14 +9,14 @@ define(['events', 'libraryBrowser', 'imageLoader', 'listView', 'loading', 'userS if (!pageData) { pageData = data[key] = { query: { - SortBy: 'Album,SortName', - SortOrder: 'Ascending', - IncludeItemTypes: 'Audio', + SortBy: "Album,SortName", + SortOrder: "Ascending", + IncludeItemTypes: "Audio", Recursive: true, - Fields: 'AudioInfo,ParentId', + Fields: "AudioInfo,ParentId", StartIndex: 0, ImageTypeLimit: 1, - EnableImageTypes: 'Primary' + EnableImageTypes: "Primary" } }; @@ -37,7 +37,7 @@ define(['events', 'libraryBrowser', 'imageLoader', 'listView', 'loading', 'userS function getSavedQueryKey(context) { if (!context.savedQueryKey) { - context.savedQueryKey = libraryBrowser.getSavedQueryKey('songs'); + context.savedQueryKey = libraryBrowser.getSavedQueryKey("songs"); } return context.savedQueryKey; @@ -85,35 +85,35 @@ define(['events', 'libraryBrowser', 'imageLoader', 'listView', 'loading', 'userS }); var html = listView.getListViewHtml({ items: result.Items, - action: 'playallfromhere', + action: "playallfromhere", smallIcon: true, artist: true, addToListButton: true }); - var elems = tabContent.querySelectorAll('.paging'); + var elems = tabContent.querySelectorAll(".paging"); for (i = 0, length = elems.length; i < length; i++) { elems[i].innerHTML = pagingHtml; } - elems = tabContent.querySelectorAll('.btnNextPage'); + elems = tabContent.querySelectorAll(".btnNextPage"); for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onNextPageClick); + elems[i].addEventListener("click", onNextPageClick); } - elems = tabContent.querySelectorAll('.btnPreviousPage'); + elems = tabContent.querySelectorAll(".btnPreviousPage"); for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onPreviousPageClick); + elems[i].addEventListener("click", onPreviousPageClick); } - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var itemsContainer = tabContent.querySelector(".itemsContainer"); itemsContainer.innerHTML = html; imageLoader.lazyChildren(itemsContainer); libraryBrowser.saveQueryValues(getSavedQueryKey(page), query); loading.hide(); isLoading = false; - require(['autoFocuser'], function (autoFocuser) { + require(["autoFocuser"], function (autoFocuser) { autoFocuser.autoFocus(page); }); }); @@ -124,13 +124,13 @@ define(['events', 'libraryBrowser', 'imageLoader', 'listView', 'loading', 'userS var isLoading = false; self.showFilterMenu = function () { - require(['components/filterdialog/filterdialog'], function (filterDialogFactory) { + require(["components/filterdialog/filterdialog"], function ({default: filterDialogFactory}) { var filterDialog = new filterDialogFactory({ query: getQuery(tabContent), - mode: 'songs', + mode: "songs", serverId: ApiClient.serverId() }); - events.on(filterDialog, 'filterchange', function () { + events.on(filterDialog, "filterchange", function () { getQuery(tabContent).StartIndex = 0; reloadItems(tabContent); }); @@ -143,38 +143,38 @@ define(['events', 'libraryBrowser', 'imageLoader', 'listView', 'loading', 'userS }; function initPage(tabContent) { - tabContent.querySelector('.btnFilter').addEventListener('click', function () { + tabContent.querySelector(".btnFilter").addEventListener("click", function () { self.showFilterMenu(); }); - tabContent.querySelector('.btnSort').addEventListener('click', function (e) { + tabContent.querySelector(".btnSort").addEventListener("click", function (e) { libraryBrowser.showSortMenu({ items: [{ - name: globalize.translate('OptionTrackName'), - id: 'Name' + name: Globalize.translate("OptionTrackName"), + id: "Name" }, { - name: globalize.translate('OptionAlbum'), - id: 'Album,SortName' + name: Globalize.translate("OptionAlbum"), + id: "Album,SortName" }, { - name: globalize.translate('OptionAlbumArtist'), - id: 'AlbumArtist,Album,SortName' + name: Globalize.translate("OptionAlbumArtist"), + id: "AlbumArtist,Album,SortName" }, { - name: globalize.translate('OptionArtist'), - id: 'Artist,Album,SortName' + name: Globalize.translate("OptionArtist"), + id: "Artist,Album,SortName" }, { - name: globalize.translate('OptionDateAdded'), - id: 'DateCreated,SortName' + name: Globalize.translate("OptionDateAdded"), + id: "DateCreated,SortName" }, { - name: globalize.translate('OptionDatePlayed'), - id: 'DatePlayed,SortName' + name: Globalize.translate("OptionDatePlayed"), + id: "DatePlayed,SortName" }, { - name: globalize.translate('OptionPlayCount'), - id: 'PlayCount,SortName' + name: Globalize.translate("OptionPlayCount"), + id: "PlayCount,SortName" }, { - name: globalize.translate('OptionReleaseDate'), - id: 'PremiereDate,AlbumArtist,Album,SortName' + name: Globalize.translate("OptionReleaseDate"), + id: "PremiereDate,AlbumArtist,Album,SortName" }, { - name: globalize.translate('OptionRuntime'), - id: 'Runtime,AlbumArtist,Album,SortName' + name: Globalize.translate("OptionRuntime"), + id: "Runtime,AlbumArtist,Album,SortName" }], callback: function () { getQuery(tabContent).StartIndex = 0; diff --git a/src/controllers/shows/episodes.js b/src/controllers/shows/episodes.js index ca9a807cbf..b274952939 100644 --- a/src/controllers/shows/episodes.js +++ b/src/controllers/shows/episodes.js @@ -1,5 +1,5 @@ -define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardBuilder', 'userSettings', 'globalize', 'emby-itemscontainer'], function (loading, events, libraryBrowser, imageLoader, listView, cardBuilder, userSettings, globalize) { - 'use strict'; +define(["loading", "events", "libraryBrowser", "imageLoader", "listView", "cardBuilder", "userSettings", "emby-itemscontainer"], function (loading, events, libraryBrowser, imageLoader, listView, cardBuilder, userSettings) { + "use strict"; return function (view, params, tabContent) { function getPageData(context) { @@ -9,17 +9,17 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB if (!pageData) { pageData = data[key] = { query: { - SortBy: 'SeriesSortName,SortName', - SortOrder: 'Ascending', - IncludeItemTypes: 'Episode', + SortBy: "SeriesSortName,SortName", + SortOrder: "Ascending", + IncludeItemTypes: "Episode", Recursive: true, - Fields: 'PrimaryImageAspectRatio,MediaSourceCount,UserData', + Fields: "PrimaryImageAspectRatio,MediaSourceCount,UserData", IsMissing: false, ImageTypeLimit: 1, - EnableImageTypes: 'Primary,Backdrop,Thumb', + EnableImageTypes: "Primary,Backdrop,Thumb", StartIndex: 0 }, - view: libraryBrowser.getSavedView(key) || 'Poster' + view: libraryBrowser.getSavedView(key) || "Poster" }; if (userSettings.libraryPageSize() > 0) { @@ -39,7 +39,7 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB function getSavedQueryKey(context) { if (!context.savedQueryKey) { - context.savedQueryKey = libraryBrowser.getSavedQueryKey('episodes'); + context.savedQueryKey = libraryBrowser.getSavedQueryKey("episodes"); } return context.savedQueryKey; @@ -47,17 +47,17 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB function onViewStyleChange() { var viewStyle = self.getCurrentViewStyle(); - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var itemsContainer = tabContent.querySelector(".itemsContainer"); - if ('List' == viewStyle) { - itemsContainer.classList.add('vertical-list'); - itemsContainer.classList.remove('vertical-wrap'); + if ("List" == viewStyle) { + itemsContainer.classList.add("vertical-list"); + itemsContainer.classList.remove("vertical-wrap"); } else { - itemsContainer.classList.remove('vertical-list'); - itemsContainer.classList.add('vertical-wrap'); + itemsContainer.classList.remove("vertical-list"); + itemsContainer.classList.add("vertical-wrap"); } - itemsContainer.innerHTML = ''; + itemsContainer.innerHTML = ""; } function reloadItems(page) { @@ -100,17 +100,17 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB filterButton: false }); var viewStyle = self.getCurrentViewStyle(); - var itemsContainer = tabContent.querySelector('.itemsContainer'); - if (viewStyle == 'List') { + var itemsContainer = tabContent.querySelector(".itemsContainer"); + if (viewStyle == "List") { html = listView.getListViewHtml({ items: result.Items, sortBy: query.SortBy, showParentTitle: true }); - } else if (viewStyle == 'PosterCard') { + } else if (viewStyle == "PosterCard") { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'backdrop', + shape: "backdrop", showTitle: true, showParentTitle: true, scalable: true, @@ -119,7 +119,7 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB } else { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'backdrop', + shape: "backdrop", showTitle: true, showParentTitle: true, overlayText: false, @@ -132,19 +132,19 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB var length; var elems; - elems = tabContent.querySelectorAll('.paging'); + elems = tabContent.querySelectorAll(".paging"); for (i = 0, length = elems.length; i < length; i++) { elems[i].innerHTML = pagingHtml; } - elems = tabContent.querySelectorAll('.btnNextPage'); + elems = tabContent.querySelectorAll(".btnNextPage"); for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onNextPageClick); + elems[i].addEventListener("click", onNextPageClick); } - elems = tabContent.querySelectorAll('.btnPreviousPage'); + elems = tabContent.querySelectorAll(".btnPreviousPage"); for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onPreviousPageClick); + elems[i].addEventListener("click", onPreviousPageClick); } itemsContainer.innerHTML = html; @@ -153,7 +153,7 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB loading.hide(); isLoading = false; - require(['autoFocuser'], function (autoFocuser) { + require(["autoFocuser"], function (autoFocuser) { autoFocuser.autoFocus(page); }); }); @@ -164,13 +164,13 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB var isLoading = false; self.showFilterMenu = function () { - require(['components/filterdialog/filterdialog'], function (filterDialogFactory) { + require(["components/filterdialog/filterdialog"], function ({default: filterDialogFactory}) { var filterDialog = new filterDialogFactory({ query: getQuery(tabContent), - mode: 'episodes', + mode: "episodes", serverId: ApiClient.serverId() }); - events.on(filterDialog, 'filterchange', function () { + events.on(filterDialog, "filterchange", function () { reloadItems(tabContent); }); filterDialog.show(); @@ -182,35 +182,35 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB }; function initPage(tabContent) { - tabContent.querySelector('.btnFilter').addEventListener('click', function () { + tabContent.querySelector(".btnFilter").addEventListener("click", function () { self.showFilterMenu(); }); - tabContent.querySelector('.btnSort').addEventListener('click', function (e) { + tabContent.querySelector(".btnSort").addEventListener("click", function (e) { libraryBrowser.showSortMenu({ items: [{ - name: globalize.translate('OptionNameSort'), - id: 'SeriesSortName,SortName' + name: Globalize.translate("OptionNameSort"), + id: "SeriesSortName,SortName" }, { - name: globalize.translate('OptionTvdbRating'), - id: 'CommunityRating,SeriesSortName,SortName' + name: Globalize.translate("OptionTvdbRating"), + id: "CommunityRating,SeriesSortName,SortName" }, { - name: globalize.translate('OptionDateAdded'), - id: 'DateCreated,SeriesSortName,SortName' + name: Globalize.translate("OptionDateAdded"), + id: "DateCreated,SeriesSortName,SortName" }, { - name: globalize.translate('OptionPremiereDate'), - id: 'PremiereDate,SeriesSortName,SortName' + name: Globalize.translate("OptionPremiereDate"), + id: "PremiereDate,SeriesSortName,SortName" }, { - name: globalize.translate('OptionDatePlayed'), - id: 'DatePlayed,SeriesSortName,SortName' + name: Globalize.translate("OptionDatePlayed"), + id: "DatePlayed,SeriesSortName,SortName" }, { - name: globalize.translate('OptionParentalRating'), - id: 'OfficialRating,SeriesSortName,SortName' + name: Globalize.translate("OptionParentalRating"), + id: "OfficialRating,SeriesSortName,SortName" }, { - name: globalize.translate('OptionPlayCount'), - id: 'PlayCount,SeriesSortName,SortName' + name: Globalize.translate("OptionPlayCount"), + id: "PlayCount,SeriesSortName,SortName" }, { - name: globalize.translate('OptionRuntime'), - id: 'Runtime,SeriesSortName,SortName' + name: Globalize.translate("OptionRuntime"), + id: "Runtime,SeriesSortName,SortName" }], callback: function () { reloadItems(tabContent); @@ -219,11 +219,11 @@ define(['loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardB button: e.target }); }); - var btnSelectView = tabContent.querySelector('.btnSelectView'); - btnSelectView.addEventListener('click', function (e) { - libraryBrowser.showLayoutMenu(e.target, self.getCurrentViewStyle(), 'List,Poster,PosterCard'.split(',')); + var btnSelectView = tabContent.querySelector(".btnSelectView"); + btnSelectView.addEventListener("click", function (e) { + libraryBrowser.showLayoutMenu(e.target, self.getCurrentViewStyle(), "List,Poster,PosterCard".split(",")); }); - btnSelectView.addEventListener('layoutchange', function (e) { + btnSelectView.addEventListener("layoutchange", function (e) { var viewStyle = e.detail.viewStyle; getPageData(tabContent).view = viewStyle; libraryBrowser.saveViewSetting(getSavedQueryKey(tabContent), viewStyle); diff --git a/src/controllers/shows/tvshows.js b/src/controllers/shows/tvshows.js index 753516f902..96aef86ca0 100644 --- a/src/controllers/shows/tvshows.js +++ b/src/controllers/shows/tvshows.js @@ -1,5 +1,5 @@ -define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', 'listView', 'cardBuilder', 'alphaPicker', 'userSettings', 'globalize', 'emby-itemscontainer'], function (layoutManager, loading, events, libraryBrowser, imageLoader, listView, cardBuilder, alphaPicker, userSettings, globalize) { - 'use strict'; +define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", "listView", "cardBuilder", "alphaPicker", "userSettings", "emby-itemscontainer"], function (layoutManager, loading, events, libraryBrowser, imageLoader, listView, cardBuilder, alphaPicker, userSettings) { + "use strict"; return function (view, params, tabContent) { function getPageData(context) { @@ -9,16 +9,16 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' if (!pageData) { pageData = data[key] = { query: { - SortBy: 'SortName', - SortOrder: 'Ascending', - IncludeItemTypes: 'Series', + SortBy: "SortName", + SortOrder: "Ascending", + IncludeItemTypes: "Series", Recursive: true, - Fields: 'PrimaryImageAspectRatio,BasicSyncInfo', + Fields: "PrimaryImageAspectRatio,BasicSyncInfo", ImageTypeLimit: 1, - EnableImageTypes: 'Primary,Backdrop,Banner,Thumb', + EnableImageTypes: "Primary,Backdrop,Banner,Thumb", StartIndex: 0 }, - view: libraryBrowser.getSavedView(key) || 'Poster' + view: libraryBrowser.getSavedView(key) || "Poster" }; if (userSettings.libraryPageSize() > 0) { @@ -38,7 +38,7 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' function getSavedQueryKey(context) { if (!context.savedQueryKey) { - context.savedQueryKey = libraryBrowser.getSavedQueryKey('series'); + context.savedQueryKey = libraryBrowser.getSavedQueryKey("series"); } return context.savedQueryKey; @@ -46,17 +46,17 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' function onViewStyleChange() { var viewStyle = self.getCurrentViewStyle(); - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var itemsContainer = tabContent.querySelector(".itemsContainer"); - if ('List' == viewStyle) { - itemsContainer.classList.add('vertical-list'); - itemsContainer.classList.remove('vertical-wrap'); + if ("List" == viewStyle) { + itemsContainer.classList.add("vertical-list"); + itemsContainer.classList.remove("vertical-wrap"); } else { - itemsContainer.classList.remove('vertical-list'); - itemsContainer.classList.add('vertical-wrap'); + itemsContainer.classList.remove("vertical-list"); + itemsContainer.classList.add("vertical-wrap"); } - itemsContainer.innerHTML = ''; + itemsContainer.innerHTML = ""; } function reloadItems(page) { @@ -100,45 +100,45 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' filterButton: false }); var viewStyle = self.getCurrentViewStyle(); - if (viewStyle == 'Thumb') { + if (viewStyle == "Thumb") { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'backdrop', + shape: "backdrop", preferThumb: true, - context: 'tvshows', + context: "tvshows", overlayMoreButton: true, showTitle: true, centerText: true }); - } else if (viewStyle == 'ThumbCard') { + } else if (viewStyle == "ThumbCard") { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'backdrop', + shape: "backdrop", preferThumb: true, - context: 'tvshows', + context: "tvshows", cardLayout: true, showTitle: true, showYear: true, centerText: true }); - } else if (viewStyle == 'Banner') { + } else if (viewStyle == "Banner") { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'banner', + shape: "banner", preferBanner: true, - context: 'tvshows' + context: "tvshows" }); - } else if (viewStyle == 'List') { + } else if (viewStyle == "List") { html = listView.getListViewHtml({ items: result.Items, - context: 'tvshows', + context: "tvshows", sortBy: query.SortBy }); - } else if (viewStyle == 'PosterCard') { + } else if (viewStyle == "PosterCard") { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'portrait', - context: 'tvshows', + shape: "portrait", + context: "tvshows", showTitle: true, showYear: true, centerText: true, @@ -147,8 +147,8 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' } else { html = cardBuilder.getCardsHtml({ items: result.Items, - shape: 'portrait', - context: 'tvshows', + shape: "portrait", + context: "tvshows", centerText: true, lazy: true, overlayMoreButton: true, @@ -158,30 +158,30 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' } var i; var length; - var elems = tabContent.querySelectorAll('.paging'); + var elems = tabContent.querySelectorAll(".paging"); for (i = 0, length = elems.length; i < length; i++) { elems[i].innerHTML = pagingHtml; } - elems = tabContent.querySelectorAll('.btnNextPage'); + elems = tabContent.querySelectorAll(".btnNextPage"); for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onNextPageClick); + elems[i].addEventListener("click", onNextPageClick); } - elems = tabContent.querySelectorAll('.btnPreviousPage'); + elems = tabContent.querySelectorAll(".btnPreviousPage"); for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onPreviousPageClick); + elems[i].addEventListener("click", onPreviousPageClick); } - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var itemsContainer = tabContent.querySelector(".itemsContainer"); itemsContainer.innerHTML = html; imageLoader.lazyChildren(itemsContainer); libraryBrowser.saveQueryValues(getSavedQueryKey(page), query); loading.hide(); isLoading = false; - require(['autoFocuser'], function (autoFocuser) { + require(["autoFocuser"], function (autoFocuser) { autoFocuser.autoFocus(page); }); }); @@ -197,13 +197,13 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' var isLoading = false; self.showFilterMenu = function () { - require(['components/filterdialog/filterdialog'], function (filterDialogFactory) { + require(["components/filterdialog/filterdialog"], function ({default: filterDialogFactory}) { var filterDialog = new filterDialogFactory({ query: getQuery(tabContent), - mode: 'series', + mode: "series", serverId: ApiClient.serverId() }); - events.on(filterDialog, 'filterchange', function () { + events.on(filterDialog, "filterchange", function () { getQuery(tabContent).StartIndex = 0; reloadItems(tabContent); }); @@ -216,10 +216,10 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' }; function initPage(tabContent) { - var alphaPickerElement = tabContent.querySelector('.alphaPicker'); - var itemsContainer = tabContent.querySelector('.itemsContainer'); + var alphaPickerElement = tabContent.querySelector(".alphaPicker"); + var itemsContainer = tabContent.querySelector(".itemsContainer"); - alphaPickerElement.addEventListener('alphavaluechanged', function (e) { + alphaPickerElement.addEventListener("alphavaluechanged", function (e) { var newValue = e.detail.value; var query = getQuery(tabContent); query.NameStartsWithOrGreater = newValue; @@ -228,36 +228,36 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' }); self.alphaPicker = new alphaPicker({ element: alphaPickerElement, - valueChangeEvent: 'click' + valueChangeEvent: "click" }); - tabContent.querySelector('.alphaPicker').classList.add('alphabetPicker-right'); - alphaPickerElement.classList.add('alphaPicker-fixed-right'); - itemsContainer.classList.add('padded-right-withalphapicker'); + tabContent.querySelector(".alphaPicker").classList.add("alphabetPicker-right"); + alphaPickerElement.classList.add("alphaPicker-fixed-right"); + itemsContainer.classList.add("padded-right-withalphapicker"); - tabContent.querySelector('.btnFilter').addEventListener('click', function () { + tabContent.querySelector(".btnFilter").addEventListener("click", function () { self.showFilterMenu(); }); - tabContent.querySelector('.btnSort').addEventListener('click', function (e) { + tabContent.querySelector(".btnSort").addEventListener("click", function (e) { libraryBrowser.showSortMenu({ items: [{ - name: globalize.translate('OptionNameSort'), - id: 'SortName' + name: Globalize.translate("OptionNameSort"), + id: "SortName" }, { - name: globalize.translate('OptionImdbRating'), - id: 'CommunityRating,SortName' + name: Globalize.translate("OptionImdbRating"), + id: "CommunityRating,SortName" }, { - name: globalize.translate('OptionDateAdded'), - id: 'DateCreated,SortName' + name: Globalize.translate("OptionDateAdded"), + id: "DateCreated,SortName" }, { - name: globalize.translate('OptionDatePlayed'), - id: 'DatePlayed,SortName' + name: Globalize.translate("OptionDatePlayed"), + id: "DatePlayed,SortName" }, { - name: globalize.translate('OptionParentalRating'), - id: 'OfficialRating,SortName' + name: Globalize.translate("OptionParentalRating"), + id: "OfficialRating,SortName" }, { - name: globalize.translate('OptionReleaseDate'), - id: 'PremiereDate,SortName' + name: Globalize.translate("OptionReleaseDate"), + id: "PremiereDate,SortName" }], callback: function () { getQuery(tabContent).StartIndex = 0; @@ -267,11 +267,11 @@ define(['layoutManager', 'loading', 'events', 'libraryBrowser', 'imageLoader', ' button: e.target }); }); - var btnSelectView = tabContent.querySelector('.btnSelectView'); - btnSelectView.addEventListener('click', function (e) { - libraryBrowser.showLayoutMenu(e.target, self.getCurrentViewStyle(), 'Banner,List,Poster,PosterCard,Thumb,ThumbCard'.split(',')); + var btnSelectView = tabContent.querySelector(".btnSelectView"); + btnSelectView.addEventListener("click", function (e) { + libraryBrowser.showLayoutMenu(e.target, self.getCurrentViewStyle(), "Banner,List,Poster,PosterCard,Thumb,ThumbCard".split(",")); }); - btnSelectView.addEventListener('layoutchange', function (e) { + btnSelectView.addEventListener("layoutchange", function (e) { var viewStyle = e.detail.viewStyle; getPageData(tabContent).view = viewStyle; libraryBrowser.saveViewSetting(getSavedQueryKey(tabContent), viewStyle);