';
- if (i == 0) {
- html += '
';
- } else {
- html += '
';
- }
- html += textlines[i] || ' ';
- html += '
';
+ var style = "";
+
+ if (imgUrl && !options.lazy) {
+ style += 'background-image:url(\'' + imgUrl + '\');';
}
- //html += LibraryBrowser.getSyncIndicator(item);
+ var imageCssClass = 'cardImage';
- //if (item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.MediaType == 'Video') {
- // if (item.UserData.UnplayedItemCount) {
- // //html += '
' + item.UserData.UnplayedItemCount + '';
- // } else if (item.UserData.Played && item.Type != 'TvChannel') {
- // html += '
';
- // }
- //}
- html += '';
- html += '';
-
- html += '';
- html += '
';
- html += LibraryBrowser.getUserDataIconsHtml(item);
- html += '';
-
- html += '';
-
- index++;
- return html;
-
- }).join('');
-
- outerHtml += '
';
-
- return outerHtml;
- },
-
- getItemDataAttributes: function (item, options, index) {
-
- var atts = [];
-
- var itemCommands = LibraryBrowser.getItemCommands(item, options);
-
- atts.push('data-itemid="' + item.Id + '"');
- atts.push('data-commands="' + itemCommands.join(',') + '"');
-
- if (options.context) {
- atts.push('data-context="' + (options.context || '') + '"');
- }
-
- if (item.IsFolder) {
- atts.push('data-isfolder="' + item.IsFolder + '"');
- }
-
- atts.push('data-itemtype="' + item.Type + '"');
-
- if (item.MediaType) {
- atts.push('data-mediatype="' + (item.MediaType || '') + '"');
- }
-
- if (item.UserData.PlaybackPositionTicks) {
- atts.push('data-positionticks="' + (item.UserData.PlaybackPositionTicks || 0) + '"');
- }
-
- atts.push('data-playaccess="' + (item.PlayAccess || '') + '"');
- atts.push('data-locationtype="' + (item.LocationType || '') + '"');
- atts.push('data-index="' + index + '"');
-
- if (item.AlbumId) {
- atts.push('data-albumid="' + item.AlbumId + '"');
- }
-
- if (item.ChannelId) {
- atts.push('data-channelid="' + item.ChannelId + '"');
- }
-
- if (item.ArtistItems && item.ArtistItems.length) {
- atts.push('data-artistid="' + item.ArtistItems[0].Id + '"');
- }
-
- var html = atts.join(' ');
-
- if (html) {
- html = ' ' + html;
- }
-
- return html;
- },
-
- supportsAddingToCollection: function (item) {
-
- var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'Episode', 'TvChannel', 'Program', 'MusicAlbum'];
-
- return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
- },
-
- getItemCommands: function (item, options) {
-
- var itemCommands = [];
-
- //if (MediaController.canPlay(item)) {
- // itemCommands.push('playmenu');
- //}
-
- if (LibraryBrowser.supportsEditing(item.Type)) {
- itemCommands.push('edit');
- }
-
- if (item.LocalTrailerCount) {
- itemCommands.push('trailer');
- }
-
- if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "MusicGenre" || item.CollectionType == "music") {
- itemCommands.push('instantmix');
- }
-
- if (item.IsFolder || item.Type == "MusicArtist" || item.Type == "MusicGenre") {
- itemCommands.push('shuffle');
- }
-
- if (PlaylistManager.supportsPlaylists(item)) {
-
- if (options.showRemoveFromPlaylist) {
- itemCommands.push('removefromplaylist');
- } else {
- itemCommands.push('playlist');
- }
- }
-
- if (options.showAddToCollection !== false) {
- if (LibraryBrowser.supportsAddingToCollection(item)) {
- itemCommands.push('addtocollection');
- }
- }
-
- if (options.showRemoveFromCollection) {
- itemCommands.push('removefromcollection');
- }
-
- if (options.playFromHere) {
- itemCommands.push('playfromhere');
- itemCommands.push('queuefromhere');
- }
-
- if (item.CanDelete) {
- itemCommands.push('delete');
- }
-
- if (SyncManager.isAvailable(item)) {
- itemCommands.push('sync');
- }
-
- if (item.Type == 'Program' && (!item.TimerId && !item.SeriesTimerId)) {
-
- itemCommands.push('record');
- }
-
- if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual') {
- itemCommands.push('editsubtitles');
- }
- itemCommands.push('editimages');
-
- return itemCommands;
- },
-
- screenWidth: function () {
-
- var screenWidth = $(window).width();
-
- return screenWidth;
- },
-
- shapes: ['square', 'portrait', 'banner', 'smallBackdrop', 'homePageSmallBackdrop', 'backdrop', 'overflowBackdrop', 'overflowPortrait', 'overflowSquare'],
-
- getPostersPerRow: function (screenWidth) {
-
- var cache = true;
- function getValue(shape) {
- var div = $('
').appendTo(document.body);
- var innerWidth = $('.cardImage', div).innerWidth();
-
- if (!innerWidth || isNaN(innerWidth)) {
- cache = false;
- innerWidth = Math.min(400, screenWidth / 2);
+ if (icon) {
+ imageCssClass += " iconCardImage";
}
- var width = screenWidth / innerWidth;
- div.remove();
- return Math.floor(width);
- }
-
- var info = {};
-
- for (var i = 0, length = LibraryBrowser.shapes.length; i < length; i++) {
- var currentShape = LibraryBrowser.shapes[i];
- info[currentShape] = getValue(currentShape);
- }
- info.cache = cache;
- return info;
- },
-
- posterSizes: [],
-
- getPosterViewInfo: function () {
-
- var screenWidth = LibraryBrowser.screenWidth();
-
- var cachedResults = LibraryBrowser.posterSizes;
-
- for (var i = 0, length = cachedResults.length; i < length; i++) {
-
- if (cachedResults[i].screenWidth == screenWidth) {
- return cachedResults[i];
- }
- }
-
- var result = LibraryBrowser.getPosterViewInfoInternal(screenWidth);
- result.screenWidth = screenWidth;
-
- if (result.cache) {
- cachedResults.push(result);
- }
-
- return result;
- },
-
- getPosterViewInfoInternal: function (screenWidth) {
-
- var imagesPerRow = LibraryBrowser.getPostersPerRow(screenWidth);
-
- var result = {};
- result.screenWidth = screenWidth;
-
- if (!AppInfo.hasLowImageBandwidth) {
- screenWidth *= 1.2;
- }
-
- var roundTo = 100;
-
- for (var i = 0, length = LibraryBrowser.shapes.length; i < length; i++) {
- var currentShape = LibraryBrowser.shapes[i];
-
- var shapeWidth = screenWidth / imagesPerRow[currentShape];
-
- if (!browserInfo.mobile) {
-
- shapeWidth = Math.round(shapeWidth / roundTo) * roundTo;
- }
-
- result[currentShape + 'Width'] = Math.round(shapeWidth);
- }
-
- result.cache = imagesPerRow.cache;
-
- return result;
- },
-
- getPosterViewHtml: function (options) {
-
- var items = options.items;
- var currentIndexValue;
-
- options.shape = options.shape || "portrait";
-
- var html = "";
-
- var primaryImageAspectRatio = LibraryBrowser.getAveragePrimaryImageAspectRatio(items);
- var isThumbAspectRatio = primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.777777778) < .3;
- var isSquareAspectRatio = primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1) < .33 ||
- primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.3333334) < .01;
-
- if (options.shape == 'auto' || options.shape == 'autohome') {
-
- if (isThumbAspectRatio) {
- options.shape = options.shape == 'auto' ? 'backdrop' : 'backdrop';
- } else if (isSquareAspectRatio) {
- options.coverImage = true;
- options.shape = 'square';
- } else if (primaryImageAspectRatio && primaryImageAspectRatio > 1.9) {
- options.shape = 'banner';
- options.coverImage = true;
- } else if (primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 0.6666667) < .2) {
- options.shape = options.shape == 'auto' ? 'portrait' : 'portrait';
- } else {
- options.shape = options.defaultShape || (options.shape == 'auto' ? 'square' : 'square');
- }
- }
-
- var posterInfo = LibraryBrowser.getPosterViewInfo();
-
- var thumbWidth = posterInfo.backdropWidth;
- var posterWidth = posterInfo.portraitWidth;
- var squareSize = posterInfo.squareWidth;
- var bannerWidth = posterInfo.bannerWidth;
-
- if (isThumbAspectRatio) {
- posterWidth = thumbWidth;
- }
- else if (isSquareAspectRatio) {
- posterWidth = squareSize;
- }
-
- if (options.shape == 'overflowBackdrop') {
- thumbWidth = posterInfo.overflowBackdropWidth;
- }
- else if (options.shape == 'overflowPortrait') {
- posterWidth = posterInfo.overflowPortraitWidth;
- }
- else if (options.shape == 'overflowSquare') {
- squareSize = posterInfo.overflowSquareWidth;
- }
- else if (options.shape == 'smallBackdrop') {
- thumbWidth = posterInfo.smallBackdropWidth;
- }
- else if (options.shape == 'homePageSmallBackdrop') {
- thumbWidth = posterInfo.homePageSmallBackdropWidth;
- posterWidth = posterInfo.homePageSmallBackdropWidth;
- }
- else if (options.shape == 'detailPagePortrait') {
- posterWidth = 200;
- }
- else if (options.shape == 'detailPageSquare') {
- posterWidth = 240;
- squareSize = 240;
- }
- else if (options.shape == 'detailPage169') {
- posterWidth = 320;
- thumbWidth = 320;
- }
-
- var dateText;
- var uiAspect = getDesiredAspect(options.shape);
-
- for (var i = 0, length = items.length; i < length; i++) {
-
- var item = items[i];
-
- dateText = null;
-
- primaryImageAspectRatio = LibraryBrowser.getAveragePrimaryImageAspectRatio([item]);
-
- if (options.showStartDateIndex) {
-
- if (item.StartDate) {
- try {
-
- dateText = LibraryBrowser.getFutureDateText(parseISO8601Date(item.StartDate, { toLocal: true }), true);
-
- } catch (err) {
- }
- }
-
- var newIndexValue = dateText || Globalize.translate('HeaderUnknownDate');
-
- if (newIndexValue != currentIndexValue) {
-
- html += '';
- currentIndexValue = newIndexValue;
- }
- } else if (options.timeline) {
- var year = item.ProductionYear || Globalize.translate('HeaderUnknownYear');
-
- if (year != currentIndexValue) {
-
- html += '';
- currentIndexValue = year;
+ if (coverImage) {
+ imageCssClass += " coveredCardImage";
+ if (item.MediaType == 'Photo' || item.Type == 'PhotoAlbum' || item.Type == 'Folder') {
+ imageCssClass += " noScale";
}
}
-
- html += LibraryBrowser.getPosterViewItemHtml(item, i, options, primaryImageAspectRatio, thumbWidth, posterWidth, squareSize, bannerWidth, uiAspect);
- }
-
- return html;
- },
-
- getPosterViewItemHtml: function (item, index, options, primaryImageAspectRatio, thumbWidth, posterWidth, squareSize, bannerWidth, uiAspect) {
-
- var html = '';
- var imgUrl = null;
- var icon;
- var width = null;
- var height = null;
-
- var forceName = false;
-
- var enableImageEnhancers = options.enableImageEnhancers !== false;
-
- var cssClass = "card";
-
- if (options.fullWidthOnMobile) {
- cssClass += " fullWidthCardOnMobile";
- }
-
- var showTitle = options.showTitle == 'auto' ? true : options.showTitle;
- var coverImage = options.coverImage;
-
- if (options.autoThumb && item.ImageTags && item.ImageTags.Primary && item.PrimaryImageAspectRatio && item.PrimaryImageAspectRatio >= 1.34) {
-
- width = posterWidth;
- height = primaryImageAspectRatio ? Math.round(posterWidth / primaryImageAspectRatio) : null;
-
- imgUrl = ApiClient.getImageUrl(item.Id, {
- type: "Primary",
- maxHeight: height,
- maxWidth: width,
- tag: item.ImageTags.Primary,
- enableImageEnhancers: enableImageEnhancers
- });
-
- if (primaryImageAspectRatio) {
- if (uiAspect) {
- if (Math.abs(primaryImageAspectRatio - uiAspect) <= .2) {
- coverImage = true;
- }
- }
+ if (options.centerImage) {
+ imageCssClass += " centeredCardImage";
}
- } else if (options.autoThumb && item.ImageTags && item.ImageTags.Thumb) {
+ var dataSrc = "";
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Thumb",
- maxWidth: thumbWidth,
- tag: item.ImageTags.Thumb,
- enableImageEnhancers: enableImageEnhancers
- });
-
- } else if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Backdrop",
- maxWidth: thumbWidth,
- tag: item.BackdropImageTags[0],
- enableImageEnhancers: enableImageEnhancers
- });
-
- } else if (options.preferThumb && item.ImageTags && item.ImageTags.Thumb) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Thumb",
- maxWidth: thumbWidth,
- tag: item.ImageTags.Thumb,
- enableImageEnhancers: enableImageEnhancers
- });
-
- } else if (options.preferBanner && item.ImageTags && item.ImageTags.Banner) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Banner",
- maxWidth: bannerWidth,
- tag: item.ImageTags.Banner,
- enableImageEnhancers: enableImageEnhancers
- });
-
- } else if (options.preferThumb && item.SeriesThumbImageTag && options.inheritThumb !== false) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.SeriesId, {
- type: "Thumb",
- maxWidth: thumbWidth,
- tag: item.SeriesThumbImageTag,
- enableImageEnhancers: enableImageEnhancers
- });
-
- } else if (options.preferThumb && item.ParentThumbItemId && options.inheritThumb !== false) {
-
- imgUrl = ApiClient.getThumbImageUrl(item.ParentThumbItemId, {
- type: "Thumb",
- maxWidth: thumbWidth,
- enableImageEnhancers: enableImageEnhancers
- });
-
- } else if (options.preferThumb && item.BackdropImageTags && item.BackdropImageTags.length) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Backdrop",
- maxWidth: thumbWidth,
- tag: item.BackdropImageTags[0],
- enableImageEnhancers: enableImageEnhancers
- });
-
- forceName = true;
-
- } else if (item.ImageTags && item.ImageTags.Primary) {
-
- width = posterWidth;
- height = primaryImageAspectRatio ? Math.round(posterWidth / primaryImageAspectRatio) : null;
-
- imgUrl = ApiClient.getImageUrl(item.Id, {
- type: "Primary",
- maxHeight: height,
- maxWidth: width,
- tag: item.ImageTags.Primary,
- enableImageEnhancers: enableImageEnhancers
- });
-
- if (primaryImageAspectRatio) {
- if (uiAspect) {
- if (Math.abs(primaryImageAspectRatio - uiAspect) <= .2) {
- coverImage = true;
- }
- }
- }
- }
- else if (item.ParentPrimaryImageTag) {
-
- imgUrl = ApiClient.getImageUrl(item.ParentPrimaryImageItemId, {
- type: "Primary",
- maxWidth: posterWidth,
- tag: item.ParentPrimaryImageTag,
- enableImageEnhancers: enableImageEnhancers
- });
- }
- else if (item.AlbumId && item.AlbumPrimaryImageTag) {
-
- height = squareSize;
- width = primaryImageAspectRatio ? Math.round(height * primaryImageAspectRatio) : null;
-
- imgUrl = ApiClient.getScaledImageUrl(item.AlbumId, {
- type: "Primary",
- maxHeight: height,
- maxWidth: width,
- tag: item.AlbumPrimaryImageTag,
- enableImageEnhancers: enableImageEnhancers
- });
-
- if (primaryImageAspectRatio) {
- if (uiAspect) {
- if (Math.abs(primaryImageAspectRatio - uiAspect) <= .2) {
- coverImage = true;
- }
- }
- }
- }
- else if (item.Type == 'Season' && item.ImageTags && item.ImageTags.Thumb) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Thumb",
- maxWidth: thumbWidth,
- tag: item.ImageTags.Thumb,
- enableImageEnhancers: enableImageEnhancers
- });
-
- }
- else if (item.BackdropImageTags && item.BackdropImageTags.length) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Backdrop",
- maxWidth: thumbWidth,
- tag: item.BackdropImageTags[0],
- enableImageEnhancers: enableImageEnhancers
- });
-
- } else if (item.ImageTags && item.ImageTags.Thumb) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Thumb",
- maxWidth: thumbWidth,
- tag: item.ImageTags.Thumb,
- enableImageEnhancers: enableImageEnhancers
- });
-
- } else if (item.SeriesThumbImageTag) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.SeriesId, {
- type: "Thumb",
- maxWidth: thumbWidth,
- tag: item.SeriesThumbImageTag,
- enableImageEnhancers: enableImageEnhancers
- });
-
- } else if (item.ParentThumbItemId) {
-
- imgUrl = ApiClient.getThumbImageUrl(item, {
- type: "Thumb",
- maxWidth: thumbWidth,
- enableImageEnhancers: enableImageEnhancers
- });
-
- } else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist") {
-
- if (item.Name && showTitle) {
- icon = 'library-music';
- }
- cssClass += " defaultBackground";
-
- } else if (item.Type == "Recording" || item.Type == "Program" || item.Type == "TvChannel") {
-
- if (item.Name && showTitle) {
- icon = 'folder-open';
+ if (options.lazy && imgUrl) {
+ imageCssClass += " lazy";
+ dataSrc = ' data-src="' + imgUrl + '"';
}
- cssClass += " defaultBackground";
- } else if (item.MediaType == "Video" || item.Type == "Season" || item.Type == "Series") {
+ var cardboxCssClass = 'cardBox';
- if (item.Name && showTitle) {
- icon = 'videocam';
+ if (options.cardLayout) {
+ cardboxCssClass += ' visualCardBox';
}
- cssClass += " defaultBackground";
- } else if (item.Type == "Person") {
+ html += '
';
+ html += '
';
- if (item.Name && showTitle) {
- icon = 'person';
- }
- cssClass += " defaultBackground";
- } else {
- if (item.Name && showTitle) {
- icon = 'folder-open';
- }
- cssClass += " defaultBackground";
- }
+ html += '
';
- icon = item.icon || icon;
- cssClass += ' ' + options.shape + 'Card';
+ var anchorCssClass = "cardContent";
- var mediaSourceCount = item.MediaSourceCount || 1;
+ anchorCssClass += ' mediaItem';
- var href = options.linkItem === false ? '#' : LibraryBrowser.getHref(item, options.context);
-
- if (options.showChildCountIndicator && item.ChildCount && options.showLatestItemsPopup !== false) {
- cssClass += ' groupedCard';
- }
-
- if ((showTitle || options.showItemCounts) && !options.overlayText) {
- cssClass += ' bottomPaddedCard';
- }
-
- var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options, index);
-
- var defaultAction = options.defaultAction;
- if (defaultAction == 'play' || defaultAction == 'playallfromhere') {
- if (item.PlayAccess != 'Full') {
- defaultAction = null;
- }
- }
- var defaultActionAttribute = defaultAction ? (' data-action="' + defaultAction + '"') : '';
-
- // card
- html += '
';
-
- var style = "";
-
- if (imgUrl && !options.lazy) {
- style += 'background-image:url(\'' + imgUrl + '\');';
- }
-
- var imageCssClass = 'cardImage';
-
- if (icon) {
- imageCssClass += " iconCardImage";
- }
-
- if (coverImage) {
- imageCssClass += " coveredCardImage";
- if (item.MediaType == 'Photo' || item.Type == 'PhotoAlbum' || item.Type == 'Folder') {
- imageCssClass += " noScale";
- }
- }
- if (options.centerImage) {
- imageCssClass += " centeredCardImage";
- }
-
- var dataSrc = "";
-
- if (options.lazy && imgUrl) {
- imageCssClass += " lazy";
- dataSrc = ' data-src="' + imgUrl + '"';
- }
-
- var cardboxCssClass = 'cardBox';
-
- if (options.cardLayout) {
- cardboxCssClass += ' visualCardBox';
- }
- html += '
';
- html += '
';
-
- if (!options.overlayText && !footerOverlayed) {
- html += LibraryBrowser.getCardFooterText(item, options, showTitle, imgUrl, forceName, 'cardFooter outerCardFooter', progressHtml);
- }
-
- // cardBox
- html += '
';
-
- // card
- html += "
";
-
- return html;
- },
-
- getCardFooterText: function (item, options, showTitle, imgUrl, forceName, footerClass, progressHtml) {
-
- var html = '';
-
- if (options.cardLayout) {
- html += '
';
- html += '';
- html += "
";
- }
-
- var name = options.showTitle == 'auto' && !item.IsFolder && item.MediaType == 'Photo' ? '' : LibraryBrowser.getPosterViewDisplayName(item, options.displayAsSpecial);
-
- if (!imgUrl && !showTitle) {
- html += "
";
- html += htmlEncode(name);
- html += "
";
- }
-
- var cssClass = options.centerText ? "cardText cardTextCentered" : "cardText";
-
- var lines = [];
-
- if (options.showParentTitle) {
-
- lines.push(item.EpisodeTitle ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || ""));
- }
-
- if (showTitle || forceName) {
-
- lines.push(htmlEncode(name));
- }
-
- if (options.showItemCounts) {
-
- var itemCountHtml = LibraryBrowser.getItemCountsHtml(options, item);
-
- lines.push(itemCountHtml);
- }
-
- if (options.textLines) {
- var additionalLines = options.textLines(item);
- for (var i = 0, length = additionalLines.length; i < length; i++) {
- lines.push(additionalLines[i]);
- }
- }
-
- if (options.showSongCount) {
-
- var songLine = '';
-
- if (item.SongCount) {
- songLine = item.SongCount == 1 ?
- Globalize.translate('ValueOneSong') :
- Globalize.translate('ValueSongCount', item.SongCount);
+ if (options.defaultAction) {
+ anchorCssClass += ' itemWithAction';
}
- lines.push(songLine);
- }
-
- if (options.showPremiereDate) {
-
- if (item.PremiereDate) {
- try {
-
- lines.push(LibraryBrowser.getPremiereDateText(item));
-
- } catch (err) {
- lines.push('');
-
- }
- } else {
- lines.push('');
+ var transition = options.transition === false || !AppInfo.enableSectionTransitions ? '' : ' data-transition="slide"';
+ var onclick = item.onclick ? ' onclick="' + item.onclick + '"' : '';
+ html += '
';
+ html += '';
+ if (icon) {
+ html += '
';
}
- }
-
- if (options.showYear) {
-
- lines.push(item.ProductionYear || '');
- }
-
- if (options.showSeriesYear) {
-
- if (item.Status == "Continuing") {
-
- lines.push(Globalize.translate('ValueSeriesYearToPresent', item.ProductionYear || ''));
-
- } else {
- lines.push(item.ProductionYear || '');
- }
-
- }
-
- if (options.showProgramAirInfo) {
-
- var date = parseISO8601Date(item.StartDate, { toLocal: true });
-
- var text = item.StartDate ?
- date.toLocaleString() :
- '';
-
- lines.push(text || ' ');
-
- lines.push(item.ChannelName || ' ');
- }
-
- html += LibraryBrowser.getCardTextLines(lines, cssClass, !options.overlayText);
-
- if (options.overlayText) {
-
- if (progressHtml) {
- html += "
";
- html += progressHtml;
- html += "
";
- }
- }
-
- if (html) {
- html = '";
- }
-
- return html;
- },
-
- getListItemInfo: function (elem) {
-
- var elemWithAttributes = elem;
-
- while (!elemWithAttributes.getAttribute('data-itemid')) {
- elemWithAttributes = elemWithAttributes.parentNode;
- }
-
- var itemId = elemWithAttributes.getAttribute('data-itemid');
- var index = elemWithAttributes.getAttribute('data-index');
- var mediaType = elemWithAttributes.getAttribute('data-mediatype');
-
- return {
- id: itemId,
- index: index,
- mediaType: mediaType,
- context: elemWithAttributes.getAttribute('data-context')
- };
- },
-
- getCardTextLines: function (lines, cssClass, forceLines) {
-
- var html = '';
-
- var valid = 0;
- var i, length;
-
- for (i = 0, length = lines.length; i < length; i++) {
-
- var text = lines[i];
-
- if (text) {
- html += "
";
- html += text;
- html += "
";
- valid++;
- }
- }
-
- if (forceLines) {
- while (valid < length) {
- html += "
";
- valid++;
- }
- }
-
- return html;
- },
-
- getFutureDateText: function (date) {
-
- var weekday = [];
- weekday[0] = Globalize.translate('OptionSunday');
- weekday[1] = Globalize.translate('OptionMonday');
- weekday[2] = Globalize.translate('OptionTuesday');
- weekday[3] = Globalize.translate('OptionWednesday');
- weekday[4] = Globalize.translate('OptionThursday');
- weekday[5] = Globalize.translate('OptionFriday');
- weekday[6] = Globalize.translate('OptionSaturday');
-
- var day = weekday[date.getDay()];
- date = date.toLocaleDateString();
-
- if (date.toLowerCase().indexOf(day.toLowerCase()) == -1) {
- return day + " " + date;
- }
-
- return date;
- },
-
- getPremiereDateText: function (item, date) {
-
- if (!date) {
-
- var text = '';
-
- if (item.AirTime) {
- text += item.AirTime;
- }
-
- if (item.SeriesStudio) {
-
- if (text) {
- text += " on " + item.SeriesStudio;
- } else {
- text += item.SeriesStudio;
- }
- }
-
- return text;
- }
-
- var day = LibraryBrowser.getFutureDateText(date);
-
- if (item.AirTime) {
- day += " at " + item.AirTime;
- }
-
- if (item.SeriesStudio) {
- day += " on " + item.SeriesStudio;
- }
-
- return day;
- },
-
- getPosterViewDisplayName: function (item, displayAsSpecial, includeParentInfo) {
-
- if (!item) {
- throw new Error("null item passed into getPosterViewDisplayName");
- }
-
- var name = item.EpisodeTitle || item.Name || '';
-
- if (item.Type == "TvChannel") {
-
- if (item.Number) {
- return item.Number + ' ' + name;
- }
- return name;
- }
- if (displayAsSpecial && item.Type == "Episode" && item.ParentIndexNumber == 0) {
-
- name = Globalize.translate('ValueSpecialEpisodeName', name);
-
- } else if (item.Type == "Episode" && item.IndexNumber != null && item.ParentIndexNumber != null) {
-
- var displayIndexNumber = item.IndexNumber;
-
- var number = "E" + displayIndexNumber;
-
- if (includeParentInfo !== false) {
- number = "S" + item.ParentIndexNumber + ", " + number;
- }
-
- if (item.IndexNumberEnd) {
-
- displayIndexNumber = item.IndexNumberEnd;
- number += "-" + displayIndexNumber;
- }
-
- name = number + " - " + name;
-
- }
-
- return name;
- },
-
- getOfflineIndicatorHtml: function (item) {
-
- if (item.LocationType == "Offline") {
- return '
' + Globalize.translate('HeaderOffline') + '
';
- }
-
- if (item.Type == 'Episode') {
- try {
-
- var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
-
- if (item.PremiereDate && (new Date().getTime() < date.getTime())) {
- return '
' + Globalize.translate('HeaderUnaired') + '
';
- }
- } catch (err) {
-
- }
-
- return '
' + Globalize.translate('HeaderMissing') + '
';
- }
-
- return '';
- },
-
- getPlayedIndicatorHtml: function (item) {
-
- if (item.Type == "Series" || item.Type == "Season" || item.Type == "BoxSet" || item.MediaType == "Video" || item.MediaType == "Game" || item.MediaType == "Book") {
- if (item.UserData.UnplayedItemCount) {
- return '
' + item.UserData.UnplayedItemCount + '
';
- }
-
- if (item.Type != 'TvChannel') {
- if (item.UserData.PlayedPercentage && item.UserData.PlayedPercentage >= 100 || (item.UserData && item.UserData.Played)) {
- return '
';
- }
- }
- }
-
- return '';
- },
-
- getGroupCountIndicator: function (item) {
-
- if (item.ChildCount) {
- return '
' + item.ChildCount + '
';
- }
-
- return '';
- },
-
- getSyncIndicator: function (item) {
-
- if (item.SyncStatus == 'Synced') {
-
- return '
';
- }
-
- var syncPercent = item.SyncPercent;
- if (syncPercent) {
- return '
';
- }
-
- if (item.SyncStatus == 'Queued' || item.SyncStatus == 'Converting' || item.SyncStatus == 'ReadyToTransfer' || item.SyncStatus == 'Transferring') {
-
- return '
';
- }
-
- return '';
- },
-
- getAveragePrimaryImageAspectRatio: function (items) {
-
- var values = [];
-
- for (var i = 0, length = items.length; i < length; i++) {
-
- var ratio = items[i].PrimaryImageAspectRatio || 0;
-
- if (!ratio) {
- continue;
- }
-
- values[values.length] = ratio;
- }
-
- if (!values.length) {
- return null;
- }
-
- // Use the median
- values.sort(function (a, b) { return a - b; });
-
- var half = Math.floor(values.length / 2);
-
- var result;
-
- if (values.length % 2)
- result = values[half];
- else
- result = (values[half - 1] + values[half]) / 2.0;
-
- // If really close to 2:3 (poster image), just return 2:3
- if (Math.abs(0.66666666667 - result) <= .15) {
- return 0.66666666667;
- }
-
- // If really close to 16:9 (episode image), just return 16:9
- if (Math.abs(1.777777778 - result) <= .2) {
- return 1.777777778;
- }
-
- // If really close to 1 (square image), just return 1
- if (Math.abs(1 - result) <= .15) {
- return 1;
- }
-
- // If really close to 4:3 (poster image), just return 2:3
- if (Math.abs(1.33333333333 - result) <= .15) {
- return 1.33333333333;
- }
-
- return result;
- },
-
- metroColors: ["#6FBD45", "#4BB3DD", "#4164A5", "#E12026", "#800080", "#E1B222", "#008040", "#0094FF", "#FF00C7", "#FF870F", "#7F0037"],
-
- getRandomMetroColor: function () {
-
- var index = Math.floor(Math.random() * (LibraryBrowser.metroColors.length - 1));
-
- return LibraryBrowser.metroColors[index];
- },
-
- getMetroColor: function (str) {
-
- if (str) {
- var character = String(str.substr(0, 1).charCodeAt());
- var sum = 0;
- for (var i = 0; i < character.length; i++) {
- sum += parseInt(character.charAt(i));
- }
- var index = String(sum).substr(-1);
-
- return LibraryBrowser.metroColors[index];
- } else {
- return LibraryBrowser.getRandomMetroColor();
- }
-
- },
-
- renderName: function (item, nameElem, linkToElement, context) {
-
- var name = LibraryBrowser.getPosterViewDisplayName(item, false, false);
-
- Dashboard.setPageTitle(name);
-
- if (linkToElement) {
- nameElem.html('
' + name + '');
- } else {
- nameElem.html(name);
- }
- },
-
- renderParentName: function (item, parentNameElem, context) {
-
- var html = [];
-
- var contextParam = context ? ('&context=' + context) : '';
-
- if (item.AlbumArtists) {
- html.push(LibraryBrowser.getArtistLinksHtml(item.AlbumArtists, "detailPageParentLink"));
- } else if (item.ArtistItems && item.ArtistItems.length && item.Type == "MusicVideo") {
- html.push(LibraryBrowser.getArtistLinksHtml(item.ArtistItems, "detailPageParentLink"));
- } else if (item.SeriesName && item.Type == "Episode") {
-
- html.push('
' + item.SeriesName + '');
- }
-
- if (item.SeriesName && item.Type == "Season") {
-
- html.push('
' + item.SeriesName + '');
-
- } else if (item.ParentIndexNumber != null && item.Type == "Episode") {
-
- html.push('
' + item.SeasonName + '');
-
- } else if (item.Album && item.Type == "Audio" && (item.AlbumId || item.ParentId)) {
- html.push('
' + item.Album + '');
-
- } else if (item.Album && item.Type == "MusicVideo" && item.AlbumId) {
- html.push('
' + item.Album + '');
-
- } else if (item.Album) {
- html.push(item.Album);
- } else if (item.Type == 'Program' && item.EpisodeTitle) {
- html.push(item.Name);
- }
-
- if (html.length) {
- parentNameElem.show().html(html.join(' - '));
- } else {
- parentNameElem.hide();
- }
- },
-
- renderLinks: function (linksElem, item) {
-
- var links = [];
-
- if (item.HomePageUrl) {
- links.push('
' + Globalize.translate('ButtonWebsite') + '');
- }
-
- if (item.ExternalUrls) {
-
- for (var i = 0, length = item.ExternalUrls.length; i < length; i++) {
-
- var url = item.ExternalUrls[i];
-
- links.push('
' + url.Name + '');
- }
- }
-
- if (links.length) {
-
- var html = links.join(' / ');
-
- html = Globalize.translate('ValueLinks', html);
-
- linksElem.innerHTML = html;
- $(linksElem);
- $(linksElem).show();
-
- } else {
- $(linksElem).hide();
- }
- },
-
- getDefaultPageSizeSelections: function () {
-
- return [20, 50, 100, 200, 300, 400, 500];
- },
-
- showLayoutMenu: function (button, currentLayout) {
-
- // Add banner and list once all screens support them
- var views = button.getAttribute('data-layouts');
-
- views = views ? views.split(',') : ['List', 'Poster', 'PosterCard', 'Thumb', 'ThumbCard'];
-
- var menuItems = views.map(function (v) {
- return {
- name: Globalize.translate('Option' + v),
- id: v,
- ironIcon: currentLayout == v ? 'check' : null
- };
- });
-
- require(['actionsheet'], function (actionsheet) {
-
- actionsheet.show({
- items: menuItems,
- positionTo: button,
- callback: function (id) {
-
- $(button).trigger('layoutchange', [id]);
- }
- });
-
- });
-
- },
-
- openViewPanel: function (btn, className) {
-
- $('.' + className, jQuery(btn).parents('.page')).removeClass('hide').panel('toggle');
- },
-
- getQueryPagingHtml: function (options) {
-
- var startIndex = options.startIndex;
- var limit = options.limit;
- var totalRecordCount = options.totalRecordCount;
-
- if (limit && options.updatePageSizeSetting !== false) {
- try {
- appStorage.setItem(options.pageSizeKey || pageSizeKey, limit);
- } catch (e) {
-
- }
- }
-
- var html = '';
-
- var recordsEnd = Math.min(startIndex + limit, totalRecordCount);
-
- // 20 is the minimum page size
- var showControls = totalRecordCount > 20 || limit < totalRecordCount;
-
- html += '
';
-
- if (showControls) {
- html += '
';
-
- var startAtDisplay = totalRecordCount ? startIndex + 1 : 0;
- html += startAtDisplay + '-' + recordsEnd + ' of ' + totalRecordCount;
-
- html += '';
- }
-
- if (showControls || options.viewButton || options.filterButton || options.sortButton || options.addLayoutButton) {
-
- html += '
';
-
- if (showControls) {
-
- html += '
';
- html += '
= totalRecordCount ? 'disabled' : '') + '>';
- }
-
- if (options.addLayoutButton) {
-
- html += '
';
- }
-
- if (options.sortButton) {
-
- html += '
';
- }
-
- if (options.viewButton) {
-
- //html += '
';
- var viewPanelClass = options.viewPanelClass || 'viewPanel';
- var title = options.viewIcon == 'filter-list' ? Globalize.translate('ButtonFilter') : Globalize.translate('ButtonMenu');
- html += '
';
- }
-
- if (options.filterButton) {
-
- html += '
';
- }
-
html += '
';
- if (showControls && options.showLimit) {
-
- var id = "selectPageSize";
-
- var pageSizes = options.pageSizes || LibraryBrowser.getDefaultPageSizeSelections();
-
- var optionsHtml = pageSizes.map(function (val) {
-
- if (limit == val) {
-
- return '
';
-
- } else {
- return '
';
- }
- }).join('');
-
- // Add styles to defeat jquery mobile
- html += '
';
+ if (item.LocationType == "Virtual" || item.LocationType == "Offline") {
+ if (options.showLocationTypeIndicator !== false) {
+ html += LibraryBrowser.getOfflineIndicatorHtml(item);
+ }
+ } else if (options.showUnplayedIndicator !== false) {
+ html += LibraryBrowser.getPlayedIndicatorHtml(item);
+ } else if (options.showChildCountIndicator) {
+ html += LibraryBrowser.getGroupCountIndicator(item);
}
- }
- html += '
';
+ html += LibraryBrowser.getSyncIndicator(item);
- return html;
- },
+ if (mediaSourceCount > 1) {
+ html += '
' + mediaSourceCount + '
';
+ }
- showSortMenu: function (options) {
+ var progressHtml = options.showProgress === false || item.IsFolder ? '' : LibraryBrowser.getItemProgressBarHtml((item.Type == 'Recording' ? item : item.UserData));
- require(['paperdialoghelper', 'paper-radio-button', 'paper-radio-group'], function (paperDialogHelper) {
+ var footerOverlayed = false;
- var dlg = paperDialogHelper.createDialog({
- removeOnClose: true,
- modal: false,
- entryAnimationDuration: 160,
- exitAnimationDuration: 200
- });
+ if (options.overlayText || (forceName && !showTitle)) {
- dlg.classList.add('ui-body-a');
- dlg.classList.add('background-theme-a');
+ var footerCssClass = progressHtml ? 'cardFooter fullCardFooter' : 'cardFooter';
+
+ html += LibraryBrowser.getCardFooterText(item, options, showTitle, imgUrl, forceName, footerCssClass, progressHtml);
+ footerOverlayed = true;
+ }
+ else if (progressHtml) {
+ html += '";
+
+ progressHtml = '';
+ }
+
+ // cardContent
+ html += '';
+
+ if (options.overlayPlayButton && !item.IsPlaceHolder && (item.LocationType != 'Virtual' || !item.MediaType || item.Type == 'Program') && item.Type != 'Person') {
+ html += '
';
+ }
+ if (options.overlayMoreButton) {
+ html += '
';
+ }
+
+ // cardScalable
+ html += '
';
+
+ if (!options.overlayText && !footerOverlayed) {
+ html += LibraryBrowser.getCardFooterText(item, options, showTitle, imgUrl, forceName, 'cardFooter outerCardFooter', progressHtml);
+ }
+
+ // cardBox
+ html += '';
+
+ // card
+ html += "
";
+
+ return html;
+ },
+
+ getCardFooterText: function (item, options, showTitle, imgUrl, forceName, footerClass, progressHtml) {
var html = '';
- html += '
';
-
- html += '
';
- html += Globalize.translate('HeaderSortBy');
- html += '
';
-
- html += '
';
- for (var i = 0, length = options.items.length; i < length; i++) {
-
- var option = options.items[i];
-
- html += '';
- }
- html += '';
-
- html += '
';
- html += Globalize.translate('HeaderSortOrder');
- html += '
';
- html += '
';
- html += '';
- html += '';
- html += '';
- html += '
';
-
- html += '
';
-
- dlg.innerHTML = html;
- document.body.appendChild(dlg);
-
- var fireCallbackOnClose = false;
-
- paperDialogHelper.open(dlg).then(function () {
-
- if (options.callback && fireCallbackOnClose) {
- options.callback();
- }
- });
-
- $('.groupSortBy', dlg).on('iron-select', function () {
-
- var newValue = this.selected.replace('_', ',');
- var changed = options.query.SortBy != newValue;
-
- options.query.SortBy = newValue;
- options.query.StartIndex = 0;
-
- if (options.callback && changed) {
- fireCallbackOnClose = true;
- }
- });
-
- $('.groupSortOrder', dlg).on('iron-select', function () {
-
- var newValue = this.selected;
- var changed = options.query.SortOrder != newValue;
-
- options.query.SortOrder = newValue;
- options.query.StartIndex = 0;
-
- if (options.callback && changed) {
- fireCallbackOnClose = true;
- }
- });
- });
- },
-
- getRatingHtml: function (item, metascore) {
-
- var html = "";
-
- if (item.CommunityRating) {
-
- html += "
";
- html += '
';
- html += item.CommunityRating.toFixed(1);
- html += '
';
- }
-
- if (item.CriticRating != null) {
-
- if (item.CriticRating >= 60) {
- html += '
';
- } else {
- html += '
';
+ if (options.cardLayout) {
+ html += '
';
+ html += '';
+ html += "
";
}
- html += '
' + item.CriticRating + '%
';
- }
+ var name = options.showTitle == 'auto' && !item.IsFolder && item.MediaType == 'Photo' ? '' : LibraryBrowser.getPosterViewDisplayName(item, options.displayAsSpecial);
- //if (item.Metascore && metascore !== false) {
+ if (!imgUrl && !showTitle) {
+ html += "
";
+ html += htmlEncode(name);
+ html += "
";
+ }
- // if (item.Metascore >= 60) {
- // html += '
' + item.Metascore + '
';
- // }
- // else if (item.Metascore >= 40) {
- // html += '
' + item.Metascore + '
';
- // } else {
- // html += '
' + item.Metascore + '
';
- // }
- //}
+ var cssClass = options.centerText ? "cardText cardTextCentered" : "cardText";
- return html;
- },
+ var lines = [];
- getItemProgressBarHtml: function (item) {
+ if (options.showParentTitle) {
+ lines.push(item.EpisodeTitle ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || ""));
+ }
- if (item.Type == "Recording" && item.CompletionPercentage) {
+ if (showTitle || forceName) {
- return '
';
- }
+ lines.push(htmlEncode(name));
+ }
- var pct = item.PlayedPercentage;
+ if (options.showItemCounts) {
- if (pct && pct < 100) {
+ var itemCountHtml = LibraryBrowser.getItemCountsHtml(options, item);
- return '
';
- }
+ lines.push(itemCountHtml);
+ }
- return null;
- },
+ if (options.textLines) {
+ var additionalLines = options.textLines(item);
+ for (var i = 0, length = additionalLines.length; i < length; i++) {
+ lines.push(additionalLines[i]);
+ }
+ }
- getUserDataButtonHtml: function (method, itemId, btnCssClass, icon, tooltip, style) {
+ if (options.showSongCount) {
- var tagName = style == 'fab' ? 'paper-fab' : 'paper-icon-button';
+ var songLine = '';
- return '<' + tagName + ' title="' + tooltip + '" data-itemid="' + itemId + '" icon="' + icon + '" class="' + btnCssClass + '" onclick="LibraryBrowser.' + method + '(this);return false;">' + tagName + '>';
+ if (item.SongCount) {
+ songLine = item.SongCount == 1 ?
+ Globalize.translate('ValueOneSong') :
+ Globalize.translate('ValueSongCount', item.SongCount);
+ }
- },
+ lines.push(songLine);
+ }
- getUserDataIconsHtml: function (item, includePlayed, style) {
+ if (options.showPremiereDate) {
- var html = '';
+ if (item.PremiereDate) {
+ try {
- var userData = item.UserData || {};
+ lines.push(LibraryBrowser.getPremiereDateText(item));
- var itemId = item.Id;
+ } catch (err) {
+ lines.push('');
- if (includePlayed !== false) {
- var tooltipPlayed = Globalize.translate('TooltipPlayed');
+ }
+ } else {
+ lines.push('');
+ }
+ }
- if (item.MediaType == 'Video' || item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.Type == 'Playlist') {
- if (item.Type != 'TvChannel') {
- if (userData.Played) {
- html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating btnUserItemRatingOn', 'check', tooltipPlayed, style);
+ if (options.showYear) {
+
+ lines.push(item.ProductionYear || '');
+ }
+
+ if (options.showSeriesYear) {
+
+ if (item.Status == "Continuing") {
+
+ lines.push(Globalize.translate('ValueSeriesYearToPresent', item.ProductionYear || ''));
+
+ } else {
+ lines.push(item.ProductionYear || '');
+ }
+
+ }
+
+ if (options.showProgramAirInfo) {
+
+ var date = parseISO8601Date(item.StartDate, { toLocal: true });
+
+ var text = item.StartDate ?
+ date.toLocaleString() :
+ '';
+
+ lines.push(text || ' ');
+
+ lines.push(item.ChannelName || ' ');
+ }
+
+ html += LibraryBrowser.getCardTextLines(lines, cssClass, !options.overlayText);
+
+ if (options.overlayText) {
+
+ if (progressHtml) {
+ html += "
";
+ html += progressHtml;
+ html += "
";
+ }
+ }
+
+ if (html) {
+ html = '";
+ }
+
+ return html;
+ },
+
+ getListItemInfo: function (elem) {
+
+ var elemWithAttributes = elem;
+
+ while (!elemWithAttributes.getAttribute('data-itemid')) {
+ elemWithAttributes = elemWithAttributes.parentNode;
+ }
+
+ var itemId = elemWithAttributes.getAttribute('data-itemid');
+ var index = elemWithAttributes.getAttribute('data-index');
+ var mediaType = elemWithAttributes.getAttribute('data-mediatype');
+
+ return {
+ id: itemId,
+ index: index,
+ mediaType: mediaType,
+ context: elemWithAttributes.getAttribute('data-context')
+ };
+ },
+
+ getCardTextLines: function (lines, cssClass, forceLines) {
+
+ var html = '';
+
+ var valid = 0;
+ var i, length;
+
+ for (i = 0, length = lines.length; i < length; i++) {
+
+ var text = lines[i];
+
+ if (text) {
+ html += "
";
+ html += text;
+ html += "
";
+ valid++;
+ }
+ }
+
+ if (forceLines) {
+ while (valid < length) {
+ html += "
";
+ valid++;
+ }
+ }
+
+ return html;
+ },
+
+ getFutureDateText: function (date) {
+
+ var weekday = [];
+ weekday[0] = Globalize.translate('OptionSunday');
+ weekday[1] = Globalize.translate('OptionMonday');
+ weekday[2] = Globalize.translate('OptionTuesday');
+ weekday[3] = Globalize.translate('OptionWednesday');
+ weekday[4] = Globalize.translate('OptionThursday');
+ weekday[5] = Globalize.translate('OptionFriday');
+ weekday[6] = Globalize.translate('OptionSaturday');
+
+ var day = weekday[date.getDay()];
+ date = date.toLocaleDateString();
+
+ if (date.toLowerCase().indexOf(day.toLowerCase()) == -1) {
+ return day + " " + date;
+ }
+
+ return date;
+ },
+
+ getPremiereDateText: function (item, date) {
+
+ if (!date) {
+
+ var text = '';
+
+ if (item.AirTime) {
+ text += item.AirTime;
+ }
+
+ if (item.SeriesStudio) {
+
+ if (text) {
+ text += " on " + item.SeriesStudio;
} else {
- html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating', 'check', tooltipPlayed, style);
+ text += item.SeriesStudio;
+ }
+ }
+
+ return text;
+ }
+
+ var day = LibraryBrowser.getFutureDateText(date);
+
+ if (item.AirTime) {
+ day += " at " + item.AirTime;
+ }
+
+ if (item.SeriesStudio) {
+ day += " on " + item.SeriesStudio;
+ }
+
+ return day;
+ },
+
+ getPosterViewDisplayName: function (item, displayAsSpecial, includeParentInfo) {
+
+ if (!item) {
+ throw new Error("null item passed into getPosterViewDisplayName");
+ }
+
+ var name = item.EpisodeTitle || item.Name || '';
+
+ if (item.Type == "TvChannel") {
+
+ if (item.Number) {
+ return item.Number + ' ' + name;
+ }
+ return name;
+ }
+ if (displayAsSpecial && item.Type == "Episode" && item.ParentIndexNumber == 0) {
+
+ name = Globalize.translate('ValueSpecialEpisodeName', name);
+
+ } else if (item.Type == "Episode" && item.IndexNumber != null && item.ParentIndexNumber != null) {
+
+ var displayIndexNumber = item.IndexNumber;
+
+ var number = "E" + displayIndexNumber;
+
+ if (includeParentInfo !== false) {
+ number = "S" + item.ParentIndexNumber + ", " + number;
+ }
+
+ if (item.IndexNumberEnd) {
+
+ displayIndexNumber = item.IndexNumberEnd;
+ number += "-" + displayIndexNumber;
+ }
+
+ name = number + " - " + name;
+
+ }
+
+ return name;
+ },
+
+ getOfflineIndicatorHtml: function (item) {
+
+ if (item.LocationType == "Offline") {
+ return '
' + Globalize.translate('HeaderOffline') + '
';
+ }
+
+ if (item.Type == 'Episode') {
+ try {
+
+ var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
+
+ if (item.PremiereDate && (new Date().getTime() < date.getTime())) {
+ return '
' + Globalize.translate('HeaderUnaired') + '
';
+ }
+ } catch (err) {
+
+ }
+
+ return '
' + Globalize.translate('HeaderMissing') + '
';
+ }
+
+ return '';
+ },
+
+ getPlayedIndicatorHtml: function (item) {
+
+ if (item.Type == "Series" || item.Type == "Season" || item.Type == "BoxSet" || item.MediaType == "Video" || item.MediaType == "Game" || item.MediaType == "Book") {
+ if (item.UserData.UnplayedItemCount) {
+ return '
' + item.UserData.UnplayedItemCount + '
';
+ }
+
+ if (item.Type != 'TvChannel') {
+ if (item.UserData.PlayedPercentage && item.UserData.PlayedPercentage >= 100 || (item.UserData && item.UserData.Played)) {
+ return '
';
}
}
}
- }
- var tooltipLike = Globalize.translate('TooltipLike');
- var tooltipDislike = Globalize.translate('TooltipDislike');
+ return '';
+ },
- if (typeof userData.Likes == "undefined") {
- html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating', 'thumb-down', tooltipDislike, style);
- html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating', 'thumb-up', tooltipLike, style);
- }
- else if (userData.Likes) {
- html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating', 'thumb-down', tooltipDislike, style);
- html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating btnUserItemRatingOn', 'thumb-up', tooltipLike, style);
- }
- else {
- html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating btnUserItemRatingOn', 'thumb-down', tooltipDislike, style);
- html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating', 'thumb-up', tooltipLike, style);
- }
+ getGroupCountIndicator: function (item) {
- var tooltipFavorite = Globalize.translate('TooltipFavorite');
- if (userData.IsFavorite) {
+ if (item.ChildCount) {
+ return '
' + item.ChildCount + '
';
+ }
- html += LibraryBrowser.getUserDataButtonHtml('markFavorite', itemId, 'btnUserItemRating btnUserItemRatingOn', 'favorite', tooltipFavorite, style);
- } else {
- html += LibraryBrowser.getUserDataButtonHtml('markFavorite', itemId, 'btnUserItemRating', 'favorite', tooltipFavorite, style);
- }
+ return '';
+ },
- return html;
- },
+ getSyncIndicator: function (item) {
- markPlayed: function (link) {
+ if (item.SyncStatus == 'Synced') {
- var id = link.getAttribute('data-itemid');
+ return '
';
+ }
- var markAsPlayed = !link.classList.contains('btnUserItemRatingOn');
+ var syncPercent = item.SyncPercent;
+ if (syncPercent) {
+ return '
';
+ }
- if (markAsPlayed) {
- ApiClient.markPlayed(Dashboard.getCurrentUserId(), id);
- link.classList.add('btnUserItemRatingOn');
- } else {
- ApiClient.markUnplayed(Dashboard.getCurrentUserId(), id);
- link.classList.remove('btnUserItemRatingOn');
- }
- },
+ if (item.SyncStatus == 'Queued' || item.SyncStatus == 'Converting' || item.SyncStatus == 'ReadyToTransfer' || item.SyncStatus == 'Transferring') {
- markFavorite: function (link) {
+ return '
';
+ }
- var id = link.getAttribute('data-itemid');
+ return '';
+ },
- var $link = $(link);
+ getAveragePrimaryImageAspectRatio: function (items) {
- var markAsFavorite = !$link.hasClass('btnUserItemRatingOn');
+ var values = [];
- ApiClient.updateFavoriteStatus(Dashboard.getCurrentUserId(), id, markAsFavorite);
+ for (var i = 0, length = items.length; i < length; i++) {
- if (markAsFavorite) {
- $link.addClass('btnUserItemRatingOn');
- } else {
- $link.removeClass('btnUserItemRatingOn');
- }
- },
+ var ratio = items[i].PrimaryImageAspectRatio || 0;
- markLike: function (link) {
+ if (!ratio) {
+ continue;
+ }
- var id = link.getAttribute('data-itemid');
+ values[values.length] = ratio;
+ }
- var $link = $(link);
+ if (!values.length) {
+ return null;
+ }
- if (!$link.hasClass('btnUserItemRatingOn')) {
+ // Use the median
+ values.sort(function (a, b) { return a - b; });
- ApiClient.updateUserItemRating(Dashboard.getCurrentUserId(), id, true);
+ var half = Math.floor(values.length / 2);
- $link.addClass('btnUserItemRatingOn');
+ var result;
- } else {
+ if (values.length % 2)
+ result = values[half];
+ else
+ result = (values[half - 1] + values[half]) / 2.0;
- ApiClient.clearUserItemRating(Dashboard.getCurrentUserId(), id);
+ // If really close to 2:3 (poster image), just return 2:3
+ if (Math.abs(0.66666666667 - result) <= .15) {
+ return 0.66666666667;
+ }
- $link.removeClass('btnUserItemRatingOn');
- }
+ // If really close to 16:9 (episode image), just return 16:9
+ if (Math.abs(1.777777778 - result) <= .2) {
+ return 1.777777778;
+ }
- $link.prev().removeClass('btnUserItemRatingOn');
- },
+ // If really close to 1 (square image), just return 1
+ if (Math.abs(1 - result) <= .15) {
+ return 1;
+ }
- markDislike: function (link) {
+ // If really close to 4:3 (poster image), just return 2:3
+ if (Math.abs(1.33333333333 - result) <= .15) {
+ return 1.33333333333;
+ }
- var id = link.getAttribute('data-itemid');
+ return result;
+ },
- var $link = $(link);
+ metroColors: ["#6FBD45", "#4BB3DD", "#4164A5", "#E12026", "#800080", "#E1B222", "#008040", "#0094FF", "#FF00C7", "#FF870F", "#7F0037"],
- if (!$link.hasClass('btnUserItemRatingOn')) {
+ getRandomMetroColor: function () {
- ApiClient.updateUserItemRating(Dashboard.getCurrentUserId(), id, false);
+ var index = Math.floor(Math.random() * (LibraryBrowser.metroColors.length - 1));
- $link.addClass('btnUserItemRatingOn');
+ return LibraryBrowser.metroColors[index];
+ },
- } else {
+ getMetroColor: function (str) {
- ApiClient.clearUserItemRating(Dashboard.getCurrentUserId(), id);
+ if (str) {
+ var character = String(str.substr(0, 1).charCodeAt());
+ var sum = 0;
+ for (var i = 0; i < character.length; i++) {
+ sum += parseInt(character.charAt(i));
+ }
+ var index = String(sum).substr(-1);
- $link.removeClass('btnUserItemRatingOn');
- }
+ return LibraryBrowser.metroColors[index];
+ } else {
+ return LibraryBrowser.getRandomMetroColor();
+ }
- $link.next().removeClass('btnUserItemRatingOn');
- },
+ },
- renderDetailImage: function (elem, item, editable, preferThumb) {
+ renderName: function (item, nameElem, linkToElement, context) {
- var imageTags = item.ImageTags || {};
+ var name = LibraryBrowser.getPosterViewDisplayName(item, false, false);
- if (item.PrimaryImageTag) {
- imageTags.Primary = item.PrimaryImageTag;
- }
+ Dashboard.setPageTitle(name);
- var html = '';
+ if (linkToElement) {
+ nameElem.html('
' + name + '');
+ } else {
+ nameElem.html(name);
+ }
+ },
- var url;
- var shape = 'portrait';
+ renderParentName: function (item, parentNameElem, context) {
- var imageHeight = 360;
- var detectRatio = false;
+ var html = [];
- if (preferThumb && imageTags.Thumb) {
+ var contextParam = context ? ('&context=' + context) : '';
- url = ApiClient.getScaledImageUrl(item.Id, {
- type: "Thumb",
- maxHeight: imageHeight,
- tag: item.ImageTags.Thumb
+ if (item.AlbumArtists) {
+ html.push(LibraryBrowser.getArtistLinksHtml(item.AlbumArtists, "detailPageParentLink"));
+ } else if (item.ArtistItems && item.ArtistItems.length && item.Type == "MusicVideo") {
+ html.push(LibraryBrowser.getArtistLinksHtml(item.ArtistItems, "detailPageParentLink"));
+ } else if (item.SeriesName && item.Type == "Episode") {
+
+ html.push('
' + item.SeriesName + '');
+ }
+
+ if (item.SeriesName && item.Type == "Season") {
+
+ html.push('
' + item.SeriesName + '');
+
+ } else if (item.ParentIndexNumber != null && item.Type == "Episode") {
+
+ html.push('
' + item.SeasonName + '');
+
+ } else if (item.Album && item.Type == "Audio" && (item.AlbumId || item.ParentId)) {
+ html.push('
' + item.Album + '');
+
+ } else if (item.Album && item.Type == "MusicVideo" && item.AlbumId) {
+ html.push('
' + item.Album + '');
+
+ } else if (item.Album) {
+ html.push(item.Album);
+ } else if (item.Type == 'Program' && item.EpisodeTitle) {
+ html.push(item.Name);
+ }
+
+ if (html.length) {
+ parentNameElem.show().html(html.join(' - '));
+ } else {
+ parentNameElem.hide();
+ }
+ },
+
+ renderLinks: function (linksElem, item) {
+
+ var links = [];
+
+ if (item.HomePageUrl) {
+ links.push('
' + Globalize.translate('ButtonWebsite') + '');
+ }
+
+ if (item.ExternalUrls) {
+
+ for (var i = 0, length = item.ExternalUrls.length; i < length; i++) {
+
+ var url = item.ExternalUrls[i];
+
+ links.push('
' + url.Name + '');
+ }
+ }
+
+ if (links.length) {
+
+ var html = links.join(' / ');
+
+ html = Globalize.translate('ValueLinks', html);
+
+ linksElem.innerHTML = html;
+ $(linksElem);
+ $(linksElem).show();
+
+ } else {
+ $(linksElem).hide();
+ }
+ },
+
+ getDefaultPageSizeSelections: function () {
+
+ return [20, 50, 100, 200, 300, 400, 500];
+ },
+
+ showLayoutMenu: function (button, currentLayout) {
+
+ // Add banner and list once all screens support them
+ var views = button.getAttribute('data-layouts');
+
+ views = views ? views.split(',') : ['List', 'Poster', 'PosterCard', 'Thumb', 'ThumbCard'];
+
+ var menuItems = views.map(function (v) {
+ return {
+ name: Globalize.translate('Option' + v),
+ id: v,
+ ironIcon: currentLayout == v ? 'check' : null
+ };
});
- shape = 'thumb';
- }
- else if (imageTags.Primary) {
- url = ApiClient.getScaledImageUrl(item.Id, {
- type: "Primary",
- maxHeight: imageHeight,
- tag: item.ImageTags.Primary
+ require(['actionsheet'], function (actionsheet) {
+
+ actionsheet.show({
+ items: menuItems,
+ positionTo: button,
+ callback: function (id) {
+
+ $(button).trigger('layoutchange', [id]);
+ }
+ });
+
});
- detectRatio = true;
- }
- else if (item.BackdropImageTags && item.BackdropImageTags.length) {
- url = ApiClient.getScaledImageUrl(item.Id, {
- type: "Backdrop",
- maxHeight: imageHeight,
- tag: item.BackdropImageTags[0]
+ },
+
+ openViewPanel: function (btn, className) {
+
+ $('.' + className, jQuery(btn).parents('.page')).removeClass('hide').panel('toggle');
+ },
+
+ getQueryPagingHtml: function (options) {
+
+ var startIndex = options.startIndex;
+ var limit = options.limit;
+ var totalRecordCount = options.totalRecordCount;
+
+ if (limit && options.updatePageSizeSetting !== false) {
+ try {
+ appStorage.setItem(options.pageSizeKey || pageSizeKey, limit);
+ } catch (e) {
+
+ }
+ }
+
+ var html = '';
+
+ var recordsEnd = Math.min(startIndex + limit, totalRecordCount);
+
+ // 20 is the minimum page size
+ var showControls = totalRecordCount > 20 || limit < totalRecordCount;
+
+ html += '
';
+
+ if (showControls) {
+ html += '
';
+
+ var startAtDisplay = totalRecordCount ? startIndex + 1 : 0;
+ html += startAtDisplay + '-' + recordsEnd + ' of ' + totalRecordCount;
+
+ html += '';
+ }
+
+ if (showControls || options.viewButton || options.filterButton || options.sortButton || options.addLayoutButton) {
+
+ html += '
';
+
+ if (showControls) {
+
+ html += '
';
+ html += '
= totalRecordCount ? 'disabled' : '') + '>';
+ }
+
+ if (options.addLayoutButton) {
+
+ html += '
';
+ }
+
+ if (options.sortButton) {
+
+ html += '
';
+ }
+
+ if (options.viewButton) {
+
+ //html += '
';
+ var viewPanelClass = options.viewPanelClass || 'viewPanel';
+ var title = options.viewIcon == 'filter-list' ? Globalize.translate('ButtonFilter') : Globalize.translate('ButtonMenu');
+ html += '
';
+ }
+
+ if (options.filterButton) {
+
+ html += '
';
+ }
+
+ html += '
';
+
+ if (showControls && options.showLimit) {
+
+ var id = "selectPageSize";
+
+ var pageSizes = options.pageSizes || LibraryBrowser.getDefaultPageSizeSelections();
+
+ var optionsHtml = pageSizes.map(function (val) {
+
+ if (limit == val) {
+
+ return '
';
+
+ } else {
+ return '
';
+ }
+ }).join('');
+
+ // Add styles to defeat jquery mobile
+ html += '
';
+ }
+ }
+
+ html += '
';
+
+ return html;
+ },
+
+ showSortMenu: function (options) {
+
+ require(['paperdialoghelper', 'paper-radio-button', 'paper-radio-group'], function (paperDialogHelper) {
+
+ var dlg = paperDialogHelper.createDialog({
+ removeOnClose: true,
+ modal: false,
+ entryAnimationDuration: 160,
+ exitAnimationDuration: 200
+ });
+
+ dlg.classList.add('ui-body-a');
+ dlg.classList.add('background-theme-a');
+
+ var html = '';
+
+ html += '
';
+
+ html += '
';
+ html += Globalize.translate('HeaderSortBy');
+ html += '
';
+
+ html += '
';
+ for (var i = 0, length = options.items.length; i < length; i++) {
+
+ var option = options.items[i];
+
+ html += '';
+ }
+ html += '';
+
+ html += '
';
+ html += Globalize.translate('HeaderSortOrder');
+ html += '
';
+ html += '
';
+ html += '';
+ html += '';
+ html += '';
+ html += '
';
+
+ html += '
';
+
+ dlg.innerHTML = html;
+ document.body.appendChild(dlg);
+
+ var fireCallbackOnClose = false;
+
+ paperDialogHelper.open(dlg).then(function () {
+
+ if (options.callback && fireCallbackOnClose) {
+ options.callback();
+ }
+ });
+
+ $('.groupSortBy', dlg).on('iron-select', function () {
+
+ var newValue = this.selected.replace('_', ',');
+ var changed = options.query.SortBy != newValue;
+
+ options.query.SortBy = newValue;
+ options.query.StartIndex = 0;
+
+ if (options.callback && changed) {
+ fireCallbackOnClose = true;
+ }
+ });
+
+ $('.groupSortOrder', dlg).on('iron-select', function () {
+
+ var newValue = this.selected;
+ var changed = options.query.SortOrder != newValue;
+
+ options.query.SortOrder = newValue;
+ options.query.StartIndex = 0;
+
+ if (options.callback && changed) {
+ fireCallbackOnClose = true;
+ }
+ });
});
- shape = 'thumb';
- }
- else if (imageTags.Thumb) {
+ },
- url = ApiClient.getScaledImageUrl(item.Id, {
- type: "Thumb",
- maxHeight: imageHeight,
- tag: item.ImageTags.Thumb
- });
- shape = 'thumb';
- }
- else if (imageTags.Disc) {
+ getRatingHtml: function (item, metascore) {
- url = ApiClient.getScaledImageUrl(item.Id, {
- type: "Disc",
- maxHeight: imageHeight,
- tag: item.ImageTags.Disc
- });
- shape = 'square';
- }
- else if (item.AlbumId && item.AlbumPrimaryImageTag) {
+ var html = "";
- url = ApiClient.getScaledImageUrl(item.AlbumId, {
- type: "Primary",
- maxHeight: imageHeight,
- tag: item.AlbumPrimaryImageTag
- });
- shape = 'square';
- }
- else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicGenre") {
- url = "css/images/items/detail/audio.png";
- shape = 'square';
- }
- else if (item.MediaType == "Game" || item.Type == "GameGenre") {
- url = "css/images/items/detail/game.png";
- shape = 'square';
- }
- else if (item.Type == "Person") {
- url = "css/images/items/detail/person.png";
- shape = 'square';
- }
- else if (item.Type == "Genre" || item.Type == "Studio") {
- url = "css/images/items/detail/video.png";
- shape = 'square';
- }
- else if (item.Type == "TvChannel") {
- url = "css/images/items/detail/tv.png";
- shape = 'square';
- }
- else {
- url = "css/images/items/detail/video.png";
- shape = 'square';
- }
+ if (item.CommunityRating) {
- html += '
';
+ html += "
";
+ html += '
';
+ html += item.CommunityRating.toFixed(1);
+ html += '
';
+ }
- if (editable) {
- html += "
";
- }
+ if (item.CriticRating != null) {
- if (detectRatio && item.PrimaryImageAspectRatio) {
+ if (item.CriticRating >= 60) {
+ html += '';
+ } else {
+ html += '';
+ }
- if (item.PrimaryImageAspectRatio >= 1.48) {
+ html += '' + item.CriticRating + '%
';
+ }
+
+ //if (item.Metascore && metascore !== false) {
+
+ // if (item.Metascore >= 60) {
+ // html += '' + item.Metascore + '
';
+ // }
+ // else if (item.Metascore >= 40) {
+ // html += '' + item.Metascore + '
';
+ // } else {
+ // html += '' + item.Metascore + '
';
+ // }
+ //}
+
+ return html;
+ },
+
+ getItemProgressBarHtml: function (item) {
+
+
+ if (item.Type == "Recording" && item.CompletionPercentage) {
+
+ return '';
+ }
+
+ var pct = item.PlayedPercentage;
+
+ if (pct && pct < 100) {
+
+ return '';
+ }
+
+ return null;
+ },
+
+ getUserDataButtonHtml: function (method, itemId, btnCssClass, icon, tooltip, style) {
+
+ var tagName = style == 'fab' ? 'paper-fab' : 'paper-icon-button';
+
+ return '<' + tagName + ' title="' + tooltip + '" data-itemid="' + itemId + '" icon="' + icon + '" class="' + btnCssClass + '" onclick="LibraryBrowser.' + method + '(this);return false;">' + tagName + '>';
+
+ },
+
+ getUserDataIconsHtml: function (item, includePlayed, style) {
+
+ var html = '';
+
+ var userData = item.UserData || {};
+
+ var itemId = item.Id;
+
+ if (includePlayed !== false) {
+ var tooltipPlayed = Globalize.translate('TooltipPlayed');
+
+ if (item.MediaType == 'Video' || item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.Type == 'Playlist') {
+ if (item.Type != 'TvChannel') {
+ if (userData.Played) {
+ html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating btnUserItemRatingOn', 'check', tooltipPlayed, style);
+ } else {
+ html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating', 'check', tooltipPlayed, style);
+ }
+ }
+ }
+ }
+
+ var tooltipLike = Globalize.translate('TooltipLike');
+ var tooltipDislike = Globalize.translate('TooltipDislike');
+
+ if (typeof userData.Likes == "undefined") {
+ html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating', 'thumb-down', tooltipDislike, style);
+ html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating', 'thumb-up', tooltipLike, style);
+ }
+ else if (userData.Likes) {
+ html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating', 'thumb-down', tooltipDislike, style);
+ html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating btnUserItemRatingOn', 'thumb-up', tooltipLike, style);
+ }
+ else {
+ html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating btnUserItemRatingOn', 'thumb-down', tooltipDislike, style);
+ html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating', 'thumb-up', tooltipLike, style);
+ }
+
+ var tooltipFavorite = Globalize.translate('TooltipFavorite');
+ if (userData.IsFavorite) {
+
+ html += LibraryBrowser.getUserDataButtonHtml('markFavorite', itemId, 'btnUserItemRating btnUserItemRatingOn', 'favorite', tooltipFavorite, style);
+ } else {
+ html += LibraryBrowser.getUserDataButtonHtml('markFavorite', itemId, 'btnUserItemRating', 'favorite', tooltipFavorite, style);
+ }
+
+ return html;
+ },
+
+ markPlayed: function (link) {
+
+ var id = link.getAttribute('data-itemid');
+
+ var markAsPlayed = !link.classList.contains('btnUserItemRatingOn');
+
+ if (markAsPlayed) {
+ ApiClient.markPlayed(Dashboard.getCurrentUserId(), id);
+ link.classList.add('btnUserItemRatingOn');
+ } else {
+ ApiClient.markUnplayed(Dashboard.getCurrentUserId(), id);
+ link.classList.remove('btnUserItemRatingOn');
+ }
+ },
+
+ markFavorite: function (link) {
+
+ var id = link.getAttribute('data-itemid');
+
+ var $link = $(link);
+
+ var markAsFavorite = !$link.hasClass('btnUserItemRatingOn');
+
+ ApiClient.updateFavoriteStatus(Dashboard.getCurrentUserId(), id, markAsFavorite);
+
+ if (markAsFavorite) {
+ $link.addClass('btnUserItemRatingOn');
+ } else {
+ $link.removeClass('btnUserItemRatingOn');
+ }
+ },
+
+ markLike: function (link) {
+
+ var id = link.getAttribute('data-itemid');
+
+ var $link = $(link);
+
+ if (!$link.hasClass('btnUserItemRatingOn')) {
+
+ ApiClient.updateUserItemRating(Dashboard.getCurrentUserId(), id, true);
+
+ $link.addClass('btnUserItemRatingOn');
+
+ } else {
+
+ ApiClient.clearUserItemRating(Dashboard.getCurrentUserId(), id);
+
+ $link.removeClass('btnUserItemRatingOn');
+ }
+
+ $link.prev().removeClass('btnUserItemRatingOn');
+ },
+
+ markDislike: function (link) {
+
+ var id = link.getAttribute('data-itemid');
+
+ var $link = $(link);
+
+ if (!$link.hasClass('btnUserItemRatingOn')) {
+
+ ApiClient.updateUserItemRating(Dashboard.getCurrentUserId(), id, false);
+
+ $link.addClass('btnUserItemRatingOn');
+
+ } else {
+
+ ApiClient.clearUserItemRating(Dashboard.getCurrentUserId(), id);
+
+ $link.removeClass('btnUserItemRatingOn');
+ }
+
+ $link.next().removeClass('btnUserItemRatingOn');
+ },
+
+ renderDetailImage: function (elem, item, editable, preferThumb) {
+
+ var imageTags = item.ImageTags || {};
+
+ if (item.PrimaryImageTag) {
+ imageTags.Primary = item.PrimaryImageTag;
+ }
+
+ var html = '';
+
+ var url;
+ var shape = 'portrait';
+
+ var imageHeight = 360;
+ var detectRatio = false;
+
+ if (preferThumb && imageTags.Thumb) {
+
+ url = ApiClient.getScaledImageUrl(item.Id, {
+ type: "Thumb",
+ maxHeight: imageHeight,
+ tag: item.ImageTags.Thumb
+ });
shape = 'thumb';
- } else if (item.PrimaryImageAspectRatio >= .85 && item.PrimaryImageAspectRatio <= 1.34) {
+ }
+ else if (imageTags.Primary) {
+
+ url = ApiClient.getScaledImageUrl(item.Id, {
+ type: "Primary",
+ maxHeight: imageHeight,
+ tag: item.ImageTags.Primary
+ });
+ detectRatio = true;
+ }
+ else if (item.BackdropImageTags && item.BackdropImageTags.length) {
+
+ url = ApiClient.getScaledImageUrl(item.Id, {
+ type: "Backdrop",
+ maxHeight: imageHeight,
+ tag: item.BackdropImageTags[0]
+ });
+ shape = 'thumb';
+ }
+ else if (imageTags.Thumb) {
+
+ url = ApiClient.getScaledImageUrl(item.Id, {
+ type: "Thumb",
+ maxHeight: imageHeight,
+ tag: item.ImageTags.Thumb
+ });
+ shape = 'thumb';
+ }
+ else if (imageTags.Disc) {
+
+ url = ApiClient.getScaledImageUrl(item.Id, {
+ type: "Disc",
+ maxHeight: imageHeight,
+ tag: item.ImageTags.Disc
+ });
shape = 'square';
}
- }
+ else if (item.AlbumId && item.AlbumPrimaryImageTag) {
- html += "
";
-
- if (editable) {
- html += "";
- }
-
- var progressHtml = item.IsFolder || !item.UserData ? '' : LibraryBrowser.getItemProgressBarHtml((item.Type == 'Recording' ? item : item.UserData));
-
- html += '
';
- if (progressHtml) {
- html += progressHtml;
- }
- html += "
";
-
- html += "
";
-
- elem.innerHTML = html;
-
- if (shape == 'thumb') {
- elem.classList.add('thumbDetailImageContainer');
- elem.classList.remove('portraitDetailImageContainer');
- elem.classList.remove('squareDetailImageContainer');
- }
- else if (shape == 'square') {
- elem.classList.remove('thumbDetailImageContainer');
- elem.classList.remove('portraitDetailImageContainer');
- elem.classList.add('squareDetailImageContainer');
- } else {
- elem.classList.remove('thumbDetailImageContainer');
- elem.classList.add('portraitDetailImageContainer');
- elem.classList.remove('squareDetailImageContainer');
- }
-
- var img = elem.querySelector('img');
- img.onload = function () {
- if (img.src.indexOf('empty.png') == -1) {
- img.classList.add('loaded');
+ url = ApiClient.getScaledImageUrl(item.AlbumId, {
+ type: "Primary",
+ maxHeight: imageHeight,
+ tag: item.AlbumPrimaryImageTag
+ });
+ shape = 'square';
}
- };
- ImageLoader.lazyImage(img, url);
- },
-
- refreshDetailImageUserData: function (elem, item) {
-
- var progressHtml = item.IsFolder || !item.UserData ? '' : LibraryBrowser.getItemProgressBarHtml((item.Type == 'Recording' ? item : item.UserData));
-
- var detailImageProgressContainer = elem.querySelector('.detailImageProgressContainer');
-
- detailImageProgressContainer.innerHTML = progressHtml || '';
- },
-
- getDisplayTime: function (date) {
-
- if ((typeof date).toString().toLowerCase() === 'string') {
- try {
-
- date = parseISO8601Date(date, { toLocal: true });
-
- } catch (err) {
- return date;
+ else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicGenre") {
+ url = "css/images/items/detail/audio.png";
+ shape = 'square';
+ }
+ else if (item.MediaType == "Game" || item.Type == "GameGenre") {
+ url = "css/images/items/detail/game.png";
+ shape = 'square';
+ }
+ else if (item.Type == "Person") {
+ url = "css/images/items/detail/person.png";
+ shape = 'square';
+ }
+ else if (item.Type == "Genre" || item.Type == "Studio") {
+ url = "css/images/items/detail/video.png";
+ shape = 'square';
+ }
+ else if (item.Type == "TvChannel") {
+ url = "css/images/items/detail/tv.png";
+ shape = 'square';
+ }
+ else {
+ url = "css/images/items/detail/video.png";
+ shape = 'square';
}
- }
- var lower = date.toLocaleTimeString().toLowerCase();
+ html += '
";
+
+ elem.innerHTML = html;
+
+ if (shape == 'thumb') {
+ elem.classList.add('thumbDetailImageContainer');
+ elem.classList.remove('portraitDetailImageContainer');
+ elem.classList.remove('squareDetailImageContainer');
+ }
+ else if (shape == 'square') {
+ elem.classList.remove('thumbDetailImageContainer');
+ elem.classList.remove('portraitDetailImageContainer');
+ elem.classList.add('squareDetailImageContainer');
+ } else {
+ elem.classList.remove('thumbDetailImageContainer');
+ elem.classList.add('portraitDetailImageContainer');
+ elem.classList.remove('squareDetailImageContainer');
+ }
+
+ var img = elem.querySelector('img');
+ img.onload = function () {
+ if (img.src.indexOf('empty.png') == -1) {
+ img.classList.add('loaded');
+ }
+ };
+ ImageLoader.lazyImage(img, url);
+ },
+
+ refreshDetailImageUserData: function (elem, item) {
+
+ var progressHtml = item.IsFolder || !item.UserData ? '' : LibraryBrowser.getItemProgressBarHtml((item.Type == 'Recording' ? item : item.UserData));
+
+ var detailImageProgressContainer = elem.querySelector('.detailImageProgressContainer');
+
+ detailImageProgressContainer.innerHTML = progressHtml || '';
+ },
+
+ getDisplayTime: function (date) {
+
+ if ((typeof date).toString().toLowerCase() === 'string') {
+ try {
+
+ date = parseISO8601Date(date, { toLocal: true });
+
+ } catch (err) {
+ return date;
+ }
+ }
+
+ var lower = date.toLocaleTimeString().toLowerCase();
+
+ var hours = date.getHours();
+ var minutes = date.getMinutes();
+
+ var text;
+
+ if (lower.indexOf('am') != -1 || lower.indexOf('pm') != -1) {
+
+ var suffix = hours > 11 ? 'pm' : 'am';
+
+ hours = (hours % 12) || 12;
+
+ text = hours;
+
+ if (minutes) {
+
+ text += ':';
+ if (minutes < 10) {
+ text += '0';
+ }
+ text += minutes;
+ }
+
+ text += suffix;
+
+ } else {
+ text = hours + ':';
- text += ':';
if (minutes < 10) {
text += '0';
}
text += minutes;
}
- text += suffix;
+ return text;
+ },
- } else {
- text = hours + ':';
+ getMiscInfoHtml: function (item) {
+
+ var miscInfo = [];
+ var text, date;
+
+ if (item.IsSeries && !item.IsRepeat) {
+
+ require(['livetvcss']);
+ miscInfo.push('
' + Globalize.translate('LabelNewProgram') + '');
- if (minutes < 10) {
- text += '0';
}
- text += minutes;
- }
- return text;
- },
+ if (item.IsLive) {
- getMiscInfoHtml: function (item) {
+ miscInfo.push('
' + Globalize.translate('LabelLiveProgram') + '');
- var miscInfo = [];
- var text, date;
-
- if (item.IsSeries && !item.IsRepeat) {
-
- require(['livetvcss']);
- miscInfo.push('
' + Globalize.translate('LabelNewProgram') + '');
-
- }
-
- if (item.IsLive) {
-
- miscInfo.push('
' + Globalize.translate('LabelLiveProgram') + '');
-
- }
-
- if (item.ChannelId && item.ChannelName) {
- if (item.Type == 'Program' || item.Type == 'Recording') {
- miscInfo.push('
' + item.ChannelName + '');
}
- }
- if (item.Type == "Episode" || item.MediaType == 'Photo') {
+ if (item.ChannelId && item.ChannelName) {
+ if (item.Type == 'Program' || item.Type == 'Recording') {
+ miscInfo.push('
' + item.ChannelName + '');
+ }
+ }
- if (item.PremiereDate) {
+ if (item.Type == "Episode" || item.MediaType == 'Photo') {
+
+ if (item.PremiereDate) {
+
+ try {
+ date = parseISO8601Date(item.PremiereDate, { toLocal: true });
+
+ text = date.toLocaleDateString();
+ miscInfo.push(text);
+ }
+ catch (e) {
+ console.log("Error parsing date: " + item.PremiereDate);
+ }
+ }
+ }
+
+ if (item.StartDate) {
try {
- date = parseISO8601Date(item.PremiereDate, { toLocal: true });
+ date = parseISO8601Date(item.StartDate, { toLocal: true });
text = date.toLocaleDateString();
miscInfo.push(text);
+
+ if (item.Type != "Recording") {
+ text = LibraryBrowser.getDisplayTime(date);
+ miscInfo.push(text);
+ }
}
catch (e) {
console.log("Error parsing date: " + item.PremiereDate);
}
}
- }
- if (item.StartDate) {
+ if (item.ProductionYear && item.Type == "Series") {
- try {
- date = parseISO8601Date(item.StartDate, { toLocal: true });
+ if (item.Status == "Continuing") {
+ miscInfo.push(Globalize.translate('ValueSeriesYearToPresent', item.ProductionYear));
- text = date.toLocaleDateString();
- miscInfo.push(text);
+ }
+ else if (item.ProductionYear) {
+
+ text = item.ProductionYear;
+
+ if (item.EndDate) {
+
+ try {
+
+ var endYear = parseISO8601Date(item.EndDate, { toLocal: true }).getFullYear();
+
+ if (endYear != item.ProductionYear) {
+ text += "-" + parseISO8601Date(item.EndDate, { toLocal: true }).getFullYear();
+ }
+
+ }
+ catch (e) {
+ console.log("Error parsing date: " + item.EndDate);
+ }
+ }
- if (item.Type != "Recording") {
- text = LibraryBrowser.getDisplayTime(date);
miscInfo.push(text);
}
}
- catch (e) {
- console.log("Error parsing date: " + item.PremiereDate);
- }
- }
- if (item.ProductionYear && item.Type == "Series") {
+ if (item.Type != "Series" && item.Type != "Episode" && item.MediaType != 'Photo') {
- if (item.Status == "Continuing") {
- miscInfo.push(Globalize.translate('ValueSeriesYearToPresent', item.ProductionYear));
+ if (item.ProductionYear) {
- }
- else if (item.ProductionYear) {
-
- text = item.ProductionYear;
-
- if (item.EndDate) {
+ miscInfo.push(item.ProductionYear);
+ }
+ else if (item.PremiereDate) {
try {
-
- var endYear = parseISO8601Date(item.EndDate, { toLocal: true }).getFullYear();
-
- if (endYear != item.ProductionYear) {
- text += "-" + parseISO8601Date(item.EndDate, { toLocal: true }).getFullYear();
- }
-
+ text = parseISO8601Date(item.PremiereDate, { toLocal: true }).getFullYear();
+ miscInfo.push(text);
}
catch (e) {
- console.log("Error parsing date: " + item.EndDate);
+ console.log("Error parsing date: " + item.PremiereDate);
+ }
+ }
+ }
+
+ var minutes;
+
+ if (item.RunTimeTicks && item.Type != "Series") {
+
+ if (item.Type == "Audio") {
+
+ miscInfo.push(Dashboard.getDisplayTime(item.RunTimeTicks));
+
+ } else {
+ minutes = item.RunTimeTicks / 600000000;
+
+ minutes = minutes || 1;
+
+ miscInfo.push(Math.round(minutes) + "min");
+ }
+ }
+
+ if (item.CumulativeRunTimeTicks && item.Type != "Series" && item.Type != "Season") {
+
+ miscInfo.push(Dashboard.getDisplayTime(item.CumulativeRunTimeTicks));
+ }
+
+ if (item.OfficialRating && item.Type !== "Season" && item.Type !== "Episode") {
+ miscInfo.push(item.OfficialRating);
+ }
+
+ if (item.IsHD) {
+
+ miscInfo.push(Globalize.translate('LabelHDProgram'));
+ }
+
+ //if (item.Audio) {
+
+ // miscInfo.push(item.Audio);
+
+ //}
+
+ if (item.Video3DFormat) {
+ miscInfo.push("3D");
+ }
+
+ if (item.MediaType == 'Photo' && item.Width && item.Height) {
+ miscInfo.push(item.Width + "x" + item.Height);
+ }
+
+ if (item.SeriesTimerId) {
+ var html = '';
+ html += '
';
+ html += '';
+ html += '';
+ html += '';
+ html += '';
+ miscInfo.push(html);
+ require(['livetvcss']);
+ }
+ else if (item.TimerId) {
+
+ var html = '';
+ html += '
';
+ html += '';
+ html += '';
+ miscInfo.push(html);
+ require(['livetvcss']);
+ }
+
+ return miscInfo.join(' ');
+ },
+
+ renderOverview: function (elems, item) {
+
+ $(elems).each(function () {
+ var elem = this;
+ var overview = item.Overview || '';
+
+ $('a', elem).each(function () {
+ this.setAttribute("target", "_blank");
+ });
+
+ if (overview) {
+ elem.innerHTML = overview;
+
+ elem.classList.remove('empty');
+ } else {
+ elem.innerHTML = '';
+
+ elem.classList.add('empty');
+ }
+ });
+
+ },
+
+ renderStudios: function (elem, item, isStatic) {
+
+ if (item.Studios && item.Studios.length && item.Type != "Series") {
+
+ var html = '';
+
+ for (var i = 0, length = item.Studios.length; i < length; i++) {
+
+ if (i > 0) {
+ html += ' / ';
+ }
+
+ if (isStatic) {
+ html += item.Studios[i].Name;
+ } else {
+ html += '
' + item.Studios[i].Name + '';
}
}
- miscInfo.push(text);
- }
- }
+ var translationKey = item.Studios.length > 1 ? "ValueStudios" : "ValueStudio";
- if (item.Type != "Series" && item.Type != "Episode" && item.MediaType != 'Photo') {
+ html = Globalize.translate(translationKey, html);
- if (item.ProductionYear) {
+ elem.show().html(html).trigger('create');
- miscInfo.push(item.ProductionYear);
- }
- else if (item.PremiereDate) {
-
- try {
- text = parseISO8601Date(item.PremiereDate, { toLocal: true }).getFullYear();
- miscInfo.push(text);
- }
- catch (e) {
- console.log("Error parsing date: " + item.PremiereDate);
- }
- }
- }
-
- var minutes;
-
- if (item.RunTimeTicks && item.Type != "Series") {
-
- if (item.Type == "Audio") {
-
- miscInfo.push(Dashboard.getDisplayTime(item.RunTimeTicks));
} else {
- minutes = item.RunTimeTicks / 600000000;
-
- minutes = minutes || 1;
-
- miscInfo.push(Math.round(minutes) + "min");
+ elem.hide();
}
- }
+ },
- if (item.CumulativeRunTimeTicks && item.Type != "Series" && item.Type != "Season") {
-
- miscInfo.push(Dashboard.getDisplayTime(item.CumulativeRunTimeTicks));
- }
-
- if (item.OfficialRating && item.Type !== "Season" && item.Type !== "Episode") {
- miscInfo.push(item.OfficialRating);
- }
-
- if (item.IsHD) {
-
- miscInfo.push(Globalize.translate('LabelHDProgram'));
- }
-
- //if (item.Audio) {
-
- // miscInfo.push(item.Audio);
-
- //}
-
- if (item.Video3DFormat) {
- miscInfo.push("3D");
- }
-
- if (item.MediaType == 'Photo' && item.Width && item.Height) {
- miscInfo.push(item.Width + "x" + item.Height);
- }
-
- if (item.SeriesTimerId) {
- var html = '';
- html += '
';
- html += '';
- html += '';
- html += '';
- html += '';
- miscInfo.push(html);
- require(['livetvcss']);
- }
- else if (item.TimerId) {
-
- var html = '';
- html += '
';
- html += '';
- html += '';
- miscInfo.push(html);
- require(['livetvcss']);
- }
-
- return miscInfo.join(' ');
- },
-
- renderOverview: function (elems, item) {
-
- $(elems).each(function () {
- var elem = this;
- var overview = item.Overview || '';
-
- $('a', elem).each(function () {
- this.setAttribute("target", "_blank");
- });
-
- if (overview) {
- elem.innerHTML = overview;
-
- elem.classList.remove('empty');
- } else {
- elem.innerHTML = '';
-
- elem.classList.add('empty');
- }
- });
-
- },
-
- renderStudios: function (elem, item, isStatic) {
-
- if (item.Studios && item.Studios.length && item.Type != "Series") {
+ renderGenres: function (elem, item, limit, isStatic) {
var html = '';
- for (var i = 0, length = item.Studios.length; i < length; i++) {
+ var genres = item.Genres || [];
+
+ for (var i = 0, length = genres.length; i < length; i++) {
+
+ if (limit && i >= limit) {
+ break;
+ }
if (i > 0) {
- html += ' / ';
+ html += '
/ ';
+ }
+
+ var param = item.Type == "Audio" || item.Type == "MusicArtist" || item.Type == "MusicAlbum" ? "musicgenre" : "genre";
+
+ if (item.MediaType == "Game") {
+ param = "gamegenre";
}
if (isStatic) {
- html += item.Studios[i].Name;
+ html += genres[i];
} else {
- html += '
' + item.Studios[i].Name + '';
+ html += '
' + genres[i] + '';
}
}
- var translationKey = item.Studios.length > 1 ? "ValueStudios" : "ValueStudio";
+ elem.html(html).trigger('create');
+ },
- html = Globalize.translate(translationKey, html);
+ renderPremiereDate: function (elem, item) {
+ if (item.PremiereDate) {
+ try {
- elem.show().html(html).trigger('create');
+ var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
+ var translationKey = new Date().getTime() > date.getTime() ? "ValuePremiered" : "ValuePremieres";
- } else {
- elem.hide();
- }
- },
+ elem.show().html(Globalize.translate(translationKey, date.toLocaleDateString()));
- renderGenres: function (elem, item, limit, isStatic) {
-
- var html = '';
-
- var genres = item.Genres || [];
-
- for (var i = 0, length = genres.length; i < length; i++) {
-
- if (limit && i >= limit) {
- break;
- }
-
- if (i > 0) {
- html += '
/ ';
- }
-
- var param = item.Type == "Audio" || item.Type == "MusicArtist" || item.Type == "MusicAlbum" ? "musicgenre" : "genre";
-
- if (item.MediaType == "Game") {
- param = "gamegenre";
- }
-
- if (isStatic) {
- html += genres[i];
+ } catch (err) {
+ elem.hide();
+ }
} else {
- html += '
' + genres[i] + '';
- }
- }
-
- elem.html(html).trigger('create');
- },
-
- renderPremiereDate: function (elem, item) {
- if (item.PremiereDate) {
- try {
-
- var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
-
- var translationKey = new Date().getTime() > date.getTime() ? "ValuePremiered" : "ValuePremieres";
-
- elem.show().html(Globalize.translate(translationKey, date.toLocaleDateString()));
-
- } catch (err) {
elem.hide();
}
- } else {
- elem.hide();
+ },
+
+ renderAwardSummary: function (elem, item) {
+ if (item.AwardSummary) {
+ elem.show().html(Globalize.translate('ValueAwards', item.AwardSummary));
+ } else {
+ elem.hide();
+ }
+ },
+
+ renderDetailPageBackdrop: function (page, item) {
+
+ var screenWidth = screen.availWidth;
+
+ var imgUrl;
+ var hasbackdrop = false;
+
+ if (item.BackdropImageTags && item.BackdropImageTags.length) {
+
+ imgUrl = ApiClient.getScaledImageUrl(item.Id, {
+ type: "Backdrop",
+ index: 0,
+ maxWidth: screenWidth,
+ tag: item.BackdropImageTags[0]
+ });
+
+ ImageLoader.lazyImage($('#itemBackdrop', page).addClass('noFade').removeClass('noBackdrop')[0], imgUrl);
+ hasbackdrop = true;
+ }
+ else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
+
+ imgUrl = ApiClient.getScaledImageUrl(item.ParentBackdropItemId, {
+ type: 'Backdrop',
+ index: 0,
+ tag: item.ParentBackdropImageTags[0],
+ maxWidth: screenWidth
+ });
+
+ ImageLoader.lazyImage($('#itemBackdrop', page).addClass('noFade').removeClass('noBackdrop')[0], imgUrl);
+ hasbackdrop = true;
+ }
+ else {
+
+ $('#itemBackdrop', page).addClass('noBackdrop').css('background-image', 'none');
+ }
+
+ return hasbackdrop;
}
- },
+ };
- renderAwardSummary: function (elem, item) {
- if (item.AwardSummary) {
- elem.show().html(Globalize.translate('ValueAwards', item.AwardSummary));
- } else {
- elem.hide();
- }
- },
-
- renderDetailPageBackdrop: function (page, item) {
-
- var screenWidth = screen.availWidth;
-
- var imgUrl;
- var hasbackdrop = false;
-
- if (item.BackdropImageTags && item.BackdropImageTags.length) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Backdrop",
- index: 0,
- maxWidth: screenWidth,
- tag: item.BackdropImageTags[0]
- });
-
- ImageLoader.lazyImage($('#itemBackdrop', page).addClass('noFade').removeClass('noBackdrop')[0], imgUrl);
- hasbackdrop = true;
- }
- else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.ParentBackdropItemId, {
- type: 'Backdrop',
- index: 0,
- tag: item.ParentBackdropImageTags[0],
- maxWidth: screenWidth
- });
-
- ImageLoader.lazyImage($('#itemBackdrop', page).addClass('noFade').removeClass('noBackdrop')[0], imgUrl);
- hasbackdrop = true;
- }
- else {
-
- $('#itemBackdrop', page).addClass('noBackdrop').css('background-image', 'none');
- }
-
- return hasbackdrop;
+ if (libraryBrowser.enableFullPaperTabs()) {
+ document.documentElement.classList.add('fullPaperLibraryTabs');
+ } else {
+ document.documentElement.classList.add('basicPaperLibraryTabs');
}
- };
- if (libraryBrowser.enableFullPaperTabs()) {
- document.documentElement.classList.add('fullPaperLibraryTabs');
- } else {
- document.documentElement.classList.add('basicPaperLibraryTabs');
- }
+ return libraryBrowser;
+
+ })(window, document, screen);
+
+ window.LibraryBrowser = libraryBrowser;
return libraryBrowser;
-
-})(window, document, screen);
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js
index d2c042bff2..65cd4c8119 100644
--- a/dashboard-ui/scripts/librarylist.js
+++ b/dashboard-ui/scripts/librarylist.js
@@ -468,7 +468,10 @@
});
break;
case 'playlist':
- PlaylistManager.showPanel([itemId]);
+ require(['playlistManager'], function (playlistManager) {
+
+ playlistManager.showPanel([itemId]);
+ });
break;
case 'delete':
LibraryBrowser.deleteItems([itemId]);
@@ -1164,8 +1167,11 @@
hideSelections();
break;
case 'playlist':
- PlaylistManager.showPanel(items);
- hideSelections();
+ require(['playlistManager'], function (playlistManager) {
+
+ playlistManager.showPanel(items);
+ hideSelections();
+ });
break;
case 'delete':
LibraryBrowser.deleteItems(items).then(function () {
diff --git a/dashboard-ui/scripts/playlistmanager.js b/dashboard-ui/scripts/playlistmanager.js
index 74bfdf1a2e..8878712b4c 100644
--- a/dashboard-ui/scripts/playlistmanager.js
+++ b/dashboard-ui/scripts/playlistmanager.js
@@ -1,6 +1,6 @@
-(function ($, document) {
+define([], function () {
- window.PlaylistManager = {
+ return {
showPanel: function (items) {
@@ -17,5 +17,4 @@
return item.RunTimeTicks || item.IsFolder || item.Type == "Genre" || item.Type == "MusicGenre" || item.Type == "MusicArtist";
}
};
-
-})(jQuery, document);
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index 1bb3d85f7a..cb1c78b5d9 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -1845,6 +1845,8 @@ var AppInfo = {};
paths.appStorage = apiClientBowerPath + "/appstorage";
}
+ paths.playlistManager = "scripts/playlistmanager";
+
var sha1Path = bowerPath + "/cryptojslib/components/sha1-min";
var md5Path = bowerPath + "/cryptojslib/components/md5-min";
var shim = {};
@@ -1955,7 +1957,6 @@ var AppInfo = {};
define("localassetmanager", [apiClientBowerPath + "/localassetmanager"]);
define("fileupload", [apiClientBowerPath + "/fileupload"]);
}
- define("apiclient-deferred", ["legacy/deferred"]);
define("connectionmanager", [apiClientBowerPath + "/connectionmanager"]);
define("contentuploader", [apiClientBowerPath + "/sync/contentuploader"]);
@@ -2228,6 +2229,8 @@ var AppInfo = {};
deps.push('css!devices/android/android.css');
} else if (AppInfo.isNativeApp && browserInfo.safari) {
deps.push('css!devices/ios/ios.css');
+ } else if (AppInfo.isNativeApp && browserInfo.edge) {
+ deps.push('css!devices/windowsphone/wp.css');
} else if (!browserInfo.android) {
deps.push('css!devices/android/android.css');
}
@@ -2255,7 +2258,6 @@ var AppInfo = {};
deps.push('scripts/search');
deps.push('scripts/librarylist');
deps.push('scripts/alphapicker');
- deps.push('scripts/playlistmanager');
deps.push('scripts/sync');
deps.push('scripts/backdrops');
deps.push('scripts/librarymenu');
@@ -2279,7 +2281,6 @@ var AppInfo = {};
postInitDependencies.push('scripts/remotecontrol');
postInitDependencies.push('css!css/notifications.css');
postInitDependencies.push('css!css/chromecast.css');
- postInitDependencies.push('apiclient-deferred');
if (Dashboard.isRunningInCordova()) {
From f220653d1b04741df50c3be33fa82f945d1b455c Mon Sep 17 00:00:00 2001
From: Luke Pulverenti
Date: Wed, 17 Feb 2016 22:18:28 -0500
Subject: [PATCH 03/25] update smart matches
---
dashboard-ui/autoorganizelog.html | 1 +
dashboard-ui/autoorganizetv.html | 1 +
.../components/fileorganizer/fileorganizer.template.html | 2 +-
dashboard-ui/scripts/autoorganizesmart.js | 6 +++---
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dashboard-ui/autoorganizelog.html b/dashboard-ui/autoorganizelog.html
index 07b1246478..3639141499 100644
--- a/dashboard-ui/autoorganizelog.html
+++ b/dashboard-ui/autoorganizelog.html
@@ -12,6 +12,7 @@
diff --git a/dashboard-ui/autoorganizetv.html b/dashboard-ui/autoorganizetv.html
index 8994b352cc..934ed8ec77 100644
--- a/dashboard-ui/autoorganizetv.html
+++ b/dashboard-ui/autoorganizetv.html
@@ -11,6 +11,7 @@
-
+
${OptionRememberOrganizeCorrection}
diff --git a/dashboard-ui/scripts/autoorganizesmart.js b/dashboard-ui/scripts/autoorganizesmart.js
index 6f9a823de9..a7375696b0 100644
--- a/dashboard-ui/scripts/autoorganizesmart.js
+++ b/dashboard-ui/scripts/autoorganizesmart.js
@@ -33,8 +33,8 @@
if (infos.length > 0) {
infos = infos.sort(function (a, b) {
- a = a.OrganizerType + " " + a.Name;
- b = b.OrganizerType + " " + b.Name;
+ a = a.OrganizerType + " " + (a.DisplayName || a.ItemName);
+ b = b.OrganizerType + " " + (b.DisplayName || b.ItemName);
if (a == b) {
return 0;
@@ -64,7 +64,7 @@
html += '
';
- html += "" + info.DisplayName + "
";
+ html += "" + (info.DisplayName || info.ItemName) + "
";
html += info.MatchStrings.map(function (m) {
return "" + m + "
";
From c49de6a93e1c32bb1710b5c3be2d12c8da84cb20 Mon Sep 17 00:00:00 2001
From: Luke Pulverenti
Date: Wed, 17 Feb 2016 23:57:19 -0500
Subject: [PATCH 04/25] trim loaded sync scripts
---
dashboard-ui/scripts/itemdetailpage.js | 8 +-
dashboard-ui/scripts/librarybrowser.js | 16 +++-
dashboard-ui/scripts/librarylist.js | 75 +++++++++++++++---
dashboard-ui/scripts/site.js | 2 +-
dashboard-ui/scripts/sync.js | 105 +++++--------------------
dashboard-ui/scripts/syncjob.js | 39 +++++----
6 files changed, 124 insertions(+), 121 deletions(-)
diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js
index f0483065e2..58761f1f06 100644
--- a/dashboard-ui/scripts/itemdetailpage.js
+++ b/dashboard-ui/scripts/itemdetailpage.js
@@ -112,7 +112,7 @@
$('.btnPlayTrailer', page).addClass('hide');
}
- if (SyncManager.isAvailable(item, user)) {
+ if (LibraryBrowser.enableSync(item, user)) {
$('.btnSync', page).removeClass('hide');
} else {
$('.btnSync', page).addClass('hide');
@@ -1987,8 +1987,10 @@
$('.btnSync', page).on('click', function () {
- SyncManager.showMenu({
- items: [currentItem]
+ require(['syncDialog'], function (syncDialog) {
+ syncDialog.showMenu({
+ items: [currentItem]
+ });
});
});
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index 32e79ef411..5b377a8f92 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -809,7 +809,7 @@
commands.push('refresh');
}
- if (SyncManager.isAvailable(item, user)) {
+ if (LibraryBrowser.enableSync(item, user)) {
commands.push('sync');
}
@@ -1581,6 +1581,18 @@
return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
},
+ enableSync: function(item, user) {
+ if (AppInfo.isNativeApp && !Dashboard.capabilities().SupportsSync) {
+ return false;
+ }
+
+ if (user && !user.Policy.EnableSync) {
+ return false;
+ }
+
+ return item.SupportsSync;
+ },
+
getItemCommands: function (item, options) {
var itemCommands = [];
@@ -1633,7 +1645,7 @@
itemCommands.push('delete');
}
- if (SyncManager.isAvailable(item)) {
+ if (LibraryBrowser.enableSync(item)) {
itemCommands.push('sync');
}
diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js
index 65cd4c8119..5d02aa6e1f 100644
--- a/dashboard-ui/scripts/librarylist.js
+++ b/dashboard-ui/scripts/librarylist.js
@@ -542,11 +542,13 @@
playAllFromHere(index, $(card).parents('.itemsContainer'), 'queue');
break;
case 'sync':
- SyncManager.showMenu({
- items: [
- {
- Id: itemId
- }]
+ require(['syncDialog'], function (syncDialog) {
+ syncDialog.showMenu({
+ items: [
+ {
+ Id: itemId
+ }]
+ });
});
break;
case 'editsubtitles':
@@ -1199,12 +1201,14 @@
hideSelections();
break;
case 'sync':
- SyncManager.showMenu({
- items: items.map(function (i) {
- return {
- Id: i
- };
- })
+ require(['syncDialog'], function (syncDialog) {
+ syncDialog.showMenu({
+ items: items.map(function (i) {
+ return {
+ Id: i
+ };
+ })
+ });
});
hideSelections();
break;
@@ -1325,6 +1329,41 @@
});
}
+ function showSyncButtonsPerUser(page) {
+
+ var apiClient = window.ApiClient;
+
+ if (!apiClient || !apiClient.getCurrentUserId()) {
+ return;
+ }
+
+ Dashboard.getCurrentUser().then(function (user) {
+
+ var item = {
+ SupportsSync: true
+ };
+
+ if (LibraryBrowser.enableSync(item, user)) {
+ $('.categorySyncButton', page).removeClass('hide');
+ } else {
+ $('.categorySyncButton', page).addClass('hide');
+ }
+ });
+ }
+
+ function onCategorySyncButtonClick(page, button) {
+
+ var category = button.getAttribute('data-category');
+ var parentId = LibraryMenu.getTopParentId();
+
+ require(['syncDialog'], function (syncDialog) {
+ syncDialog.showMenu({
+ ParentId: parentId,
+ Category: category
+ });
+ });
+ }
+
pageClassOn('pageinit', "libraryPage", function () {
var page = this;
@@ -1336,6 +1375,20 @@
$(itemsContainers[i]).createCardMenus();
}
+ $('.categorySyncButton', page).on('click', function () {
+
+ onCategorySyncButtonClick(page, this);
+ });
+
+ });
+
+ pageClassOn('pageshow', "libraryPage", function () {
+
+ var page = this;
+
+ if (!Dashboard.isServerlessPage()) {
+ showSyncButtonsPerUser(page);
+ }
});
pageClassOn('pagebeforehide', "libraryPage", function () {
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index cb1c78b5d9..a6e27728fa 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -1846,6 +1846,7 @@ var AppInfo = {};
}
paths.playlistManager = "scripts/playlistmanager";
+ paths.syncDialog = "scripts/sync";
var sha1Path = bowerPath + "/cryptojslib/components/sha1-min";
var md5Path = bowerPath + "/cryptojslib/components/md5-min";
@@ -2258,7 +2259,6 @@ var AppInfo = {};
deps.push('scripts/search');
deps.push('scripts/librarylist');
deps.push('scripts/alphapicker');
- deps.push('scripts/sync');
deps.push('scripts/backdrops');
deps.push('scripts/librarymenu');
deps.push('scripts/librarybrowser');
diff --git a/dashboard-ui/scripts/sync.js b/dashboard-ui/scripts/sync.js
index 7f085a5a3b..7a89494018 100644
--- a/dashboard-ui/scripts/sync.js
+++ b/dashboard-ui/scripts/sync.js
@@ -1,4 +1,4 @@
-(function (window, $) {
+define([], function () {
var currentDialogOptions;
@@ -52,7 +52,6 @@
}).then(function () {
paperDialogHelper.close(dlg);
- $(window.SyncManager).trigger('jobsubmit');
Dashboard.alert(Globalize.translate('MessageSyncJobCreated'));
});
}
@@ -299,6 +298,17 @@
};
}
+ function setQualityFieldVisible(form, visible) {
+
+ if (visible) {
+ $('.fldQuality', form).show();
+ $('#selectQuality', form).attr('required', 'required');
+ } else {
+ $('.fldQuality', form).hide();
+ $('#selectQuality', form).removeAttr('required');
+ }
+ }
+
function onProfileChange(form, profileId) {
var options = currentDialogOptions || {};
@@ -337,25 +347,6 @@
}
}
- function loadQualityOptions(form, targetId, dialogOptionsFn) {
-
- dialogOptionsFn(targetId).then(function (options) {
-
- renderTargetDialogOptions(form, options);
- });
- }
-
- function setQualityFieldVisible(form, visible) {
-
- if (visible) {
- $('.fldQuality', form).show();
- $('#selectQuality', form).attr('required', 'required');
- } else {
- $('.fldQuality', form).hide();
- $('#selectQuality', form).removeAttr('required');
- }
- }
-
function renderTargetDialogOptions(form, options) {
currentDialogOptions = options;
@@ -385,78 +376,18 @@
}).join('')).trigger('change');
}
- function isAvailable(item, user) {
+ function loadQualityOptions(form, targetId, dialogOptionsFn) {
- if (AppInfo.isNativeApp && !Dashboard.capabilities().SupportsSync) {
- return false;
- }
+ dialogOptionsFn(targetId).then(function (options) {
- if (user && !user.Policy.EnableSync) {
- return false;
- }
-
- return item.SupportsSync;
+ renderTargetDialogOptions(form, options);
+ });
}
- window.SyncManager = {
+ return {
showMenu: showSyncMenu,
- isAvailable: isAvailable,
renderForm: renderForm,
setJobValues: setJobValues
};
-
- function showSyncButtonsPerUser(page) {
-
- var apiClient = window.ApiClient;
-
- if (!apiClient || !apiClient.getCurrentUserId()) {
- return;
- }
-
- Dashboard.getCurrentUser().then(function (user) {
-
- var item = {
- SupportsSync: true
- };
-
- if (isAvailable(item, user)) {
- $('.categorySyncButton', page).removeClass('hide');
- } else {
- $('.categorySyncButton', page).addClass('hide');
- }
- });
- }
-
- function onCategorySyncButtonClick(page, button) {
-
- var category = button.getAttribute('data-category');
- var parentId = LibraryMenu.getTopParentId();
-
- SyncManager.showMenu({
- ParentId: parentId,
- Category: category
- });
- }
-
- $(document).on('pageinit', ".libraryPage", function () {
-
- var page = this;
-
- $('.categorySyncButton', page).on('click', function () {
-
- onCategorySyncButtonClick(page, this);
- });
-
- }).on('pageshow', ".libraryPage", function () {
-
- var page = this;
-
- if (!Dashboard.isServerlessPage()) {
- showSyncButtonsPerUser(page);
- }
-
- });
-
-
-})(window, jQuery);
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/dashboard-ui/scripts/syncjob.js b/dashboard-ui/scripts/syncjob.js
index 39c0901744..4b7218ec5d 100644
--- a/dashboard-ui/scripts/syncjob.js
+++ b/dashboard-ui/scripts/syncjob.js
@@ -17,14 +17,17 @@
html += '';
$('.syncJobForm', page).html(html);
- SyncManager.renderForm({
- elem: $('.formFields', page),
- dialogOptions: dialogOptions,
- dialogOptionsFn: getTargetDialogOptionsFn(dialogOptions),
- showName: true,
- readOnlySyncTarget: true
- }).then(function () {
- fillJobValues(page, job, dialogOptions);
+
+ require(['syncDialog'], function (syncDialog) {
+ syncDialog.renderForm({
+ elem: $('.formFields', page),
+ dialogOptions: dialogOptions,
+ dialogOptionsFn: getTargetDialogOptionsFn(dialogOptions),
+ showName: true,
+ readOnlySyncTarget: true
+ }).then(function () {
+ fillJobValues(page, job, dialogOptions);
+ });
});
}
@@ -344,19 +347,21 @@
ApiClient.getJSON(ApiClient.getUrl('Sync/Jobs/' + id)).then(function (job) {
- SyncManager.setJobValues(job, page);
+ require(['syncDialog'], function (syncDialog) {
+ syncDialog.setJobValues(job, page);
- ApiClient.ajax({
+ ApiClient.ajax({
- url: ApiClient.getUrl('Sync/Jobs/' + id),
- type: 'POST',
- data: JSON.stringify(job),
- contentType: "application/json"
+ url: ApiClient.getUrl('Sync/Jobs/' + id),
+ type: 'POST',
+ data: JSON.stringify(job),
+ contentType: "application/json"
- }).then(function () {
+ }).then(function () {
- Dashboard.hideLoadingMsg();
- Dashboard.alert(Globalize.translate('SettingsSaved'));
+ Dashboard.hideLoadingMsg();
+ Dashboard.alert(Globalize.translate('SettingsSaved'));
+ });
});
});
From 9e4ec97ed5822a7278f5ac88e1ecc6215f888c9f Mon Sep 17 00:00:00 2001
From: Luke Pulverenti
Date: Thu, 18 Feb 2016 00:34:53 -0500
Subject: [PATCH 05/25] fix chromecast queue command
---
dashboard-ui/scripts/chromecast.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dashboard-ui/scripts/chromecast.js b/dashboard-ui/scripts/chromecast.js
index 524e276e57..83150bac8b 100644
--- a/dashboard-ui/scripts/chromecast.js
+++ b/dashboard-ui/scripts/chromecast.js
@@ -621,7 +621,7 @@
};
self.queue = function (options) {
- self.playWithCommnd(options, 'PlayLast');
+ self.playWithCommand(options, 'PlayLast');
};
self.queueNext = function (options) {
From 02e924e3c5e582e17c99709fb8944ed482d57111 Mon Sep 17 00:00:00 2001
From: Luke Pulverenti
Date: Thu, 18 Feb 2016 13:19:18 -0500
Subject: [PATCH 06/25] update live tv images
---
dashboard-ui/scripts/livetvcomponents.js | 2 +-
dashboard-ui/scripts/livetvseriestimer.js | 4 +++-
dashboard-ui/scripts/livetvtimers.js | 4 +++-
dashboard-ui/thirdparty/paper-button-style.css | 2 +-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dashboard-ui/scripts/livetvcomponents.js b/dashboard-ui/scripts/livetvcomponents.js
index 7931af5bce..adc1e18c51 100644
--- a/dashboard-ui/scripts/livetvcomponents.js
+++ b/dashboard-ui/scripts/livetvcomponents.js
@@ -43,7 +43,7 @@
}
if (imgUrl) {
- html += '';
+ html += '';
}
else if (program.IsKids) {
html += '';
diff --git a/dashboard-ui/scripts/livetvseriestimer.js b/dashboard-ui/scripts/livetvseriestimer.js
index aa6ea665db..9c23f41465 100644
--- a/dashboard-ui/scripts/livetvseriestimer.js
+++ b/dashboard-ui/scripts/livetvseriestimer.js
@@ -144,7 +144,9 @@
var timers = result.Items;
LiveTvHelpers.getTimersHtml(timers).then(function(html) {
- var elem = $('.scheduleTab', page).html(html);
+ var elem = $('.scheduleTab', page).html(html)[0];
+
+ ImageLoader.lazyChildren(elem);
$('.btnDeleteTimer', elem).on('click', function () {
diff --git a/dashboard-ui/scripts/livetvtimers.js b/dashboard-ui/scripts/livetvtimers.js
index 49c29216cc..7ec5e5eea5 100644
--- a/dashboard-ui/scripts/livetvtimers.js
+++ b/dashboard-ui/scripts/livetvtimers.js
@@ -22,7 +22,9 @@
function renderTimers(page, timers) {
LiveTvHelpers.getTimersHtml(timers).then(function (html) {
- var elem = $('#items', page).html(html);
+ var elem = $('#items', page).html(html)[0];
+
+ ImageLoader.lazyChildren(elem);
$('.btnDeleteTimer', elem).on('click', function () {
diff --git a/dashboard-ui/thirdparty/paper-button-style.css b/dashboard-ui/thirdparty/paper-button-style.css
index 8da574464f..659fe0720f 100644
--- a/dashboard-ui/thirdparty/paper-button-style.css
+++ b/dashboard-ui/thirdparty/paper-button-style.css
@@ -240,7 +240,7 @@ paper-dialog[role="alertdialog"] + iron-overlay-backdrop {
}
paper-tabs {
- background-color: #111;
+ background-color: #080808;
color: #fff;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
}
From 05b25af69f030979597d9f0a60c2d97013eb5d00 Mon Sep 17 00:00:00 2001
From: Luke Pulverenti
Date: Thu, 18 Feb 2016 13:20:10 -0500
Subject: [PATCH 07/25] update components
---
.../iron-autogrow-textarea/.bower.json | 11 +-
.../iron-autogrow-textarea/.travis.yml | 13 +-
.../iron-autogrow-textarea/CONTRIBUTING.md | 11 +-
.../iron-autogrow-textarea/bower.json | 5 +-
.../iron-autogrow-textarea/demo/index.html | 102 ++-
.../iron-autogrow-textarea.html | 24 +-
.../iron-autogrow-textarea/test/index.html | 13 +-
.../iron-behaviors/.bower.json | 6 +-
.../iron-demo-helpers/.bower.json | 14 +-
.../iron-demo-helpers/.travis.yml | 27 +
.../iron-demo-helpers/CONTRIBUTING.md | 11 +-
.../iron-demo-helpers/bower.json | 8 +-
.../iron-demo-helpers/demo-snippet.html | 68 +-
.../iron-demo-helpers/demo/index.html | 2 +-
.../iron-demo-helpers/test/basic.html | 84 +--
.../iron-flex-layout/.bower.json | 22 +-
.../iron-flex-layout/.travis.yml | 15 +-
.../iron-flex-layout/CONTRIBUTING.md | 11 +-
.../iron-flex-layout/bower.json | 10 +-
.../iron-flex-layout/demo/demo-snippet.html | 95 ---
.../iron-flex-layout/demo/index.html | 88 +--
.../iron-flex-layout/iron-flex-layout.html | 2 +-
.../iron-flex-layout/test/index.html | 29 +
.../test/iron-flex-layout.html | 344 ++++++++++
.../iron-overlay-behavior/.bower.json | 8 +-
.../iron-overlay-behavior/bower.json | 2 +-
.../iron-overlay-behavior.html | 19 +-
.../test/iron-overlay-behavior.html | 639 +++++++++---------
.../iron-resizable-behavior/.bower.json | 11 +-
.../iron-resizable-behavior/.travis.yml | 25 +
.../iron-resizable-behavior/CONTRIBUTING.md | 77 +++
.../iron-resizable-behavior/bower.json | 7 +-
.../iron-resizable-behavior.html | 2 +
.../iron-resizable-behavior/test/basic.html | 118 ++--
.../iron-resizable-behavior/test/index.html | 19 +-
.../test/iron-resizable-behavior.html | 1 +
.../iron-selector/.bower.json | 8 +-
.../bower_components/iron-selector/bower.json | 2 +-
.../iron-selector/iron-multi-selectable.html | 31 +-
.../iron-selector/iron-selectable.html | 13 +-
.../iron-selector/iron-selection.html | 21 +-
.../iron-selector/test/index.html | 25 +-
.../iron-selector/test/multi.html | 127 +++-
.../test/selected-attribute.html | 56 ++
.../bower_components/paper-input/.bower.json | 10 +-
.../paper-input/CONTRIBUTING.md | 11 +-
.../bower_components/paper-input/bower.json | 4 +-
.../paper-input/paper-input-behavior.html | 36 +-
.../paper-input/paper-input-char-counter.html | 8 +-
.../paper-input/paper-input-container.html | 33 +-
.../paper-input/paper-input-error.html | 5 +-
.../test/paper-input-char-counter.html | 3 +-
.../paper-input/test/paper-input.html | 52 +-
.../paper-input/test/paper-textarea.html | 67 +-
.../bower_components/polymer/.bower.json | 6 +-
55 files changed, 1554 insertions(+), 907 deletions(-)
create mode 100644 dashboard-ui/bower_components/iron-demo-helpers/.travis.yml
delete mode 100644 dashboard-ui/bower_components/iron-flex-layout/demo/demo-snippet.html
create mode 100644 dashboard-ui/bower_components/iron-flex-layout/test/index.html
create mode 100644 dashboard-ui/bower_components/iron-flex-layout/test/iron-flex-layout.html
create mode 100644 dashboard-ui/bower_components/iron-resizable-behavior/.travis.yml
create mode 100644 dashboard-ui/bower_components/iron-resizable-behavior/CONTRIBUTING.md
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/.bower.json b/dashboard-ui/bower_components/iron-autogrow-textarea/.bower.json
index 81113ef022..0dbb4c1292 100644
--- a/dashboard-ui/bower_components/iron-autogrow-textarea/.bower.json
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-autogrow-textarea",
- "version": "1.0.10",
+ "version": "1.0.11",
"description": "A textarea element that automatically grows with input",
"authors": [
"The Polymer Authors"
@@ -29,17 +29,18 @@
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
- "web-component-tester": "polymer/web-component-tester#^3.4.0",
+ "web-component-tester": "^4.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.10",
+ "_release": "1.0.11",
"_resolution": {
"type": "version",
- "tag": "v1.0.10",
- "commit": "1ba4f97e250dc14e9638d95be582dd62b9083736"
+ "tag": "v1.0.11",
+ "commit": "8fe629c9fecb14b76319ab4fbeef7f0237d93004"
},
"_source": "git://github.com/PolymerElements/iron-autogrow-textarea.git",
"_target": "^1.0.0",
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/.travis.yml b/dashboard-ui/bower_components/iron-autogrow-textarea/.travis.yml
index 1929c8ae4c..771bf35d1e 100644
--- a/dashboard-ui/bower_components/iron-autogrow-textarea/.travis.yml
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/.travis.yml
@@ -1,22 +1,25 @@
language: node_js
sudo: false
before_script:
- - npm install web-component-tester
- - npm install bower
- - 'export PATH=$PWD/node_modules/.bin:$PATH'
+ - npm install -g bower polylint web-component-tester
- bower install
+ - polylint
env:
global:
- secure: lIogwlz5kFUKYy1OWASXxQgZE4YTyjUY0QcEgnqbv6wQ0GX8wRMgbI3zhbAv+xXU5ieYXg6Bd47ZFZZ1kVEWzQynAdd2od14Eu1vfN60/yc/llz62VTYuFsPt8r+Tgw41Iz8plwejK4a+V26Da5tXW+soJQOJKvE/MOiPzKi2m0=
- secure: cj3uSCQwLY6pyP3oTdGFjJoTRjv3G1lSe73fMd6i15XnMMxM4DVarfDtK+a0dPPxDY8BBhfr4sFClZuWX71bAHQuqUA84oigbeWt2xfl8d3HUuvr9aEnQxAGe2eQE7atpYJPC9M447sw48QKiUVgQo33DeJ1BGj6SBqkw0BJXO8=
-node_js: 4
+ - CXX=g++-4.8
+node_js: stable
addons:
- firefox: '42.0'
+ firefox: latest
apt:
sources:
- google-chrome
+ - ubuntu-toolchain-r-test
packages:
- google-chrome-stable
+ - g++-4.8
+ sauce_connect: true
script:
- xvfb-run wct
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/CONTRIBUTING.md b/dashboard-ui/bower_components/iron-autogrow-textarea/CONTRIBUTING.md
index 7b10141565..f147978a3e 100644
--- a/dashboard-ui/bower_components/iron-autogrow-textarea/CONTRIBUTING.md
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/CONTRIBUTING.md
@@ -5,6 +5,11 @@ https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
If you edit that file, it will get updated everywhere else.
If you edit this file, your changes will get overridden :)
+
+You can however override the jsbin link with one that's customized to this
+specific element:
+
+jsbin=https://jsbin.com/cagaye/edit?html,output
-->
# Polymer Elements
## Guide for Contributors
@@ -41,7 +46,7 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
3. Click the `paper-foo` element.
```
- 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output).
+ 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output).
3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
@@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
When submitting pull requests, please provide:
- 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax:
+ 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax:
```markdown
(For a single issue)
Fixes #20
(For multiple issues)
- Fixes #32, #40
+ Fixes #32, fixes #40
```
2. **A succinct description of the design** used to fix any related issues. For example:
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/bower.json b/dashboard-ui/bower_components/iron-autogrow-textarea/bower.json
index 61a9c49ac2..b775b23443 100644
--- a/dashboard-ui/bower_components/iron-autogrow-textarea/bower.json
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-autogrow-textarea",
- "version": "1.0.10",
+ "version": "1.0.11",
"description": "A textarea element that automatically grows with input",
"authors": [
"The Polymer Authors"
@@ -29,9 +29,10 @@
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
- "web-component-tester": "polymer/web-component-tester#^3.4.0",
+ "web-component-tester": "^4.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/demo/index.html b/dashboard-ui/bower_components/iron-autogrow-textarea/demo/index.html
index 0c7fdc052e..525d90a43e 100644
--- a/dashboard-ui/bower_components/iron-autogrow-textarea/demo/index.html
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/demo/index.html
@@ -18,46 +18,80 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
iron-autogrow-textarea demo
+
+
-
+
+
-
-
+
-
Updating the value imperatively
-
-
-
-
+
An iron-autogrow-textarea grows automatically as more text is entered
+
+
+
+
+
-
bind-value
:
[[bindValue]]
+
The maximum height can be controlled either through the max-rows
+ property, or through a fixed max height
+
+
+
+
+
+
-
- set bind-value
to:
-
-
-
+
The initial height can also be controlled using the rows property,
+ or through a fixed height
+
+
+
+
+
+
- set
textarea.value
to:
-
-
-
-
-
+
Example of updating the value imperatively
+
+
+
+
+
+
+
bind-value
:
[[bindValue]]
+
+ Imperatively changing bind-value
will also update
+ textarea.value
:
+
+
+
-
Custom
-
-
Scrolls after 4 rows:
-
-
Initial height of 4 rows
-
+ Imperatively updating
textarea.value
will update
+ the display, but not update
bind-value
:
+
+
+
+
+
-
-
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html b/dashboard-ui/bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html
index e255d79904..8ec9942772 100644
--- a/dashboard-ui/bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html
@@ -33,6 +33,7 @@ The following custom properties and mixins are available for styling:
Custom property | Description | Default
----------------|-------------|----------
`--iron-autogrow-textarea` | Mixin applied to the textarea | `{}`
+`--iron-autogrow-textarea-placeholder` | Mixin applied to the textarea placeholder | `{}`
@group Iron Elements
@hero hero.svg
@@ -50,6 +51,7 @@ Custom property | Description | Default
padding: 2px;
-moz-appearance: textarea;
-webkit-appearance: textarea;
+ overflow: hidden;
}
.mirror-text {
@@ -82,6 +84,21 @@ Custom property | Description | Default
box-shadow: none;
}
+ textarea::-webkit-input-placeholder {
+ @apply(--iron-autogrow-textarea-placeholder);
+ }
+
+ textarea:-moz-placeholder {
+ @apply(--iron-autogrow-textarea-placeholder);
+ }
+
+ textarea::-moz-placeholder {
+ @apply(--iron-autogrow-textarea-placeholder);
+ }
+
+ textarea:-ms-input-placeholder {
+ @apply(--iron-autogrow-textarea-placeholder);
+ }
@@ -120,8 +137,6 @@ Custom property | Description | Default
/**
* Use this property instead of `value` for two-way data binding.
- *
- * @type {string|number|undefined|null}
*/
bindValue: {
observer: '_bindValueChanged',
@@ -191,6 +206,7 @@ Custom property | Description | Default
value: {
notify: true,
type: String,
+ value: '',
computed: '_computeValue(bindValue)'
},
@@ -265,6 +281,10 @@ Custom property | Description | Default
set selectionEnd(value) {
this.$.textarea.selectionEnd = value;
},
+
+ ready: function() {
+ this.bindValue = this.value;
+ },
/**
* Returns true if `value` is valid. The validator provided in `validator`
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/test/index.html b/dashboard-ui/bower_components/iron-autogrow-textarea/test/index.html
index 8790abe4e9..c4c5215996 100644
--- a/dashboard-ui/bower_components/iron-autogrow-textarea/test/index.html
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/test/index.html
@@ -1,5 +1,4 @@
-
-
-
-
+-->
iron-autogrow-textarea tests
@@ -19,7 +16,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
-
-
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/.bower.json b/dashboard-ui/bower_components/iron-behaviors/.bower.json
index db08f2170c..17f68b3351 100644
--- a/dashboard-ui/bower_components/iron-behaviors/.bower.json
+++ b/dashboard-ui/bower_components/iron-behaviors/.bower.json
@@ -29,14 +29,14 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"ignore": [],
- "homepage": "https://github.com/PolymerElements/iron-behaviors",
+ "homepage": "https://github.com/polymerelements/iron-behaviors",
"_release": "1.0.12",
"_resolution": {
"type": "version",
"tag": "v1.0.12",
"commit": "657f526a2382a659cdf4e13be87ecc89261588a3"
},
- "_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"
}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-demo-helpers/.bower.json b/dashboard-ui/bower_components/iron-demo-helpers/.bower.json
index b5f3de2116..53bc0195d8 100644
--- a/dashboard-ui/bower_components/iron-demo-helpers/.bower.json
+++ b/dashboard-ui/bower_components/iron-demo-helpers/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-demo-helpers",
- "version": "1.0.3",
+ "version": "1.1.0",
"description": "Utility classes to make building demo pages easier",
"authors": [
"The Polymer Authors"
@@ -21,25 +21,27 @@
"ignore": [],
"dependencies": {
"polymer": "Polymer/polymer#^1.1.0",
+ "iron-icons": "PolymerElements/iron-icons#^1.0.0",
+ "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"marked-element": "polymerelements/marked-element#^1.0.0",
"prism-element": "PolymerElements/prism-element#^1.0.0"
},
"devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
- "web-component-tester": "polymer/web-component-tester#^3.4.0",
+ "web-component-tester": "^4.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.1.2",
- "paper-styles": "PolymerElements/paper-styles#1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.1.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^1.0.0"
},
- "_release": "1.0.3",
+ "_release": "1.1.0",
"_resolution": {
"type": "version",
- "tag": "v1.0.3",
- "commit": "dbcd14c318654f0e42d391af409efff9a8a241a2"
+ "tag": "v1.1.0",
+ "commit": "ea98e51e3ac7b52dd53cea05d3f027b3a41388ad"
},
"_source": "git://github.com/polymerelements/iron-demo-helpers.git",
"_target": "^1.0.0",
diff --git a/dashboard-ui/bower_components/iron-demo-helpers/.travis.yml b/dashboard-ui/bower_components/iron-demo-helpers/.travis.yml
new file mode 100644
index 0000000000..bb3c3cd820
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-demo-helpers/.travis.yml
@@ -0,0 +1,27 @@
+language: node_js
+sudo: false
+before_script:
+ - npm install -g bower polylint web-component-tester
+ - bower install
+ - polylint
+node_js: stable
+addons:
+ firefox: latest
+ apt:
+ sources:
+ - google-chrome
+ - ubuntu-toolchain-r-test
+ packages:
+ - google-chrome-stable
+ - g++-4.8
+ sauce_connect: true
+script:
+ - xvfb-run wct
+ - "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
+SAUCE_USERNAME=polymer-ci:
+ secure: MdclMoQBh7FSa11Mfw1Q7Gx5dYmsfHp5w3tSj5i798eMsrDrHIbmJwnYAIEHch4wpIteQL4dynfzWyfpU3S1WSCTR7vNsbzz8XlmT+t+Bk474XOsKQ/I+z1Fd3NMSNR73H/rJxH3nEJfDSR6TFKfoT/SAO0/yPE1taSvvYJV3dRD6A+ZrftgDzaDB3YukiE+OU4Hsk0Fy8JnF3Lb5iAl9jkd8G5i0IfYpcXJwlPq3C9krs7i/QhVCa/PI2TQNubihGnQc9oSVYxU4BV2oJ7JvEgPYLc21jL07c71Mr7Nl7ZCxnGqPYHxtwFMalBaenHg+CdnReOyh3CjbPhK/c0avX9Xgnpsex2pt3gXo98sZ0TBCfsEm/eKPpzxktAs2XwQXV3Xct1t8Oop4tbwUqgobXOSR3GM/YY8+FONr7D4NENtMiarujvywfhUK4dwc5sSY44uEocEUoYfcNEO3YAu0TyGhtjlTkhRscW6W10ASnLHQ3Vkg1/OOwBiQC1OSZHudffc11yY6rQGlD7K48n2TIu8yI8m2AyEXWxTF6XINCC80+rSNJEibiih1McGbwqACv71S6fBhCNdS2UXfO8MWDe6Lg7TgFXfLqkLRuNz+YR/Jpp9Kx5JgdDLbDvddSaOZII5WUcP+CjAwe+dOHXxuiIao18Y1AUs1K49zShukN8=
+env:
+ global:
+ - secure: ZdORgF+qeVeCULluFHTdv3rWkff5UZQB2R/XY4WlDX6VMNoa4ox+Bv9jEwC9dFISX3YGZP+jxA3EAm3vNUdnRfi0WgecISGpagRippqk6pj3sz1thsllVBZgxRo6x63BGog74zxE0Okv01p1gMF1xEmO7cKlkDl4Axo8H1CLU3zOaG3W8tuY9TMgghq9cJAi8ybsojh26LKWaD8UnOfyb406fjEtHMammJ0+mnCnqUFF4suEj0G3Pujld8DZsZG0A/xKCLfykPsIdEnsP823aCIJX99XE0clCd/FTlNTHRhgdcAFwc3jqOrRFwXkGG8aW0W+ciKFESwmS5cAZZ6an+4LsDoOLBlmReACNq85HAu45ID+xfIKuG4gROMwRdOeIH1Zh9SZ0szcnYO8/JsuxyoXHeaiQnHc0ZZ/bzO3AV5p1APflDi5V2/q4OdXRZ7K7CQNO7b3GQk1vvXWG+553BJLbyWv/D04NpvQbdQqI2Zt/SDTdb7zRQVDnk6rZuODe8LU4QtF7EaO5+KHWjOvEsEsstPS8NFelw6Iqv8sAMO7dErAjWFuDXCCyTGSN7PVLcOhVy2gnpAspX1OZ/rubsDjqe3tN3BHURlRoEq3wXs93ZHcakIIor8aVs1hLd1XeX46hGGoK215SiKoCJWN8Bs/0174hE2pDNuVG5Hm/VQ=
+ - secure: INTBdOGAsbGQ1aokMF/OX8SxTDlUH6VKcrdcOuVbu3aAllmMgOznRtOm8IbHa+c9Dn25nMEY7Nl9DvxA9EfkKbyKFCcwwYgzAtrs4U/9qmckw8yJikDyF06wwClxeXBDZr9qxHUarX770McBMfq+zOly6ls3v0TTrERO3MoV4dBJ+sj0Oj0TCjjt7hiaFq4xdSMpuGLoOdElL8zh+bgRj98R8uzOTYW4hdf80FZqO5gXOWMRDkZCI1Y4EDsAQSZQ9jDScT5qd4qYhujuFmAd1+a4EmRE+WF8Uvo2bwnm4/Fz8EEBYNzNQGftyTazXZqplhKlu1auTmOKxWadEWP2oD28FFFgnSyp/p9IzRi8DjKg7btumiL2bZOK5RFOP4OiN8+Fje7Hi9sA7utEunH8zqRYwZZehxQG3s/Ixi7wiOs9IoKxyjRpZTGMrb8tuCjsgtNTSsGbQ9Si3l/7q6zXd9ctC5F0HAhOANPUxqLt67NLxUDjp6mOcsdtEnB7hEGcC6g3NTGZnE6icTGi2f7SokK1dsxxoW8Z+FGWG+AT3FKTFJJlfoAx3Y/cSa/gI6/jyqheANbviD3qllrwvTCEjUPjMs0UoiLxEIb57aiY8cB1LplDnHQhZarXrOe1jcgOxs9H+YFaeSX6zL+WswLPwBvTgsvXuP018XBwBRpYbN8=
+ - CXX=g++-4.8
diff --git a/dashboard-ui/bower_components/iron-demo-helpers/CONTRIBUTING.md b/dashboard-ui/bower_components/iron-demo-helpers/CONTRIBUTING.md
index 7b10141565..f147978a3e 100644
--- a/dashboard-ui/bower_components/iron-demo-helpers/CONTRIBUTING.md
+++ b/dashboard-ui/bower_components/iron-demo-helpers/CONTRIBUTING.md
@@ -5,6 +5,11 @@ https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
If you edit that file, it will get updated everywhere else.
If you edit this file, your changes will get overridden :)
+
+You can however override the jsbin link with one that's customized to this
+specific element:
+
+jsbin=https://jsbin.com/cagaye/edit?html,output
-->
# Polymer Elements
## Guide for Contributors
@@ -41,7 +46,7 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
3. Click the `paper-foo` element.
```
- 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output).
+ 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output).
3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
@@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
When submitting pull requests, please provide:
- 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax:
+ 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax:
```markdown
(For a single issue)
Fixes #20
(For multiple issues)
- Fixes #32, #40
+ Fixes #32, fixes #40
```
2. **A succinct description of the design** used to fix any related issues. For example:
diff --git a/dashboard-ui/bower_components/iron-demo-helpers/bower.json b/dashboard-ui/bower_components/iron-demo-helpers/bower.json
index 4b1e02ebcb..dcf4c48f3b 100644
--- a/dashboard-ui/bower_components/iron-demo-helpers/bower.json
+++ b/dashboard-ui/bower_components/iron-demo-helpers/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-demo-helpers",
- "version": "1.0.3",
+ "version": "1.1.0",
"description": "Utility classes to make building demo pages easier",
"authors": [
"The Polymer Authors"
@@ -21,18 +21,20 @@
"ignore": [],
"dependencies": {
"polymer": "Polymer/polymer#^1.1.0",
+ "iron-icons": "PolymerElements/iron-icons#^1.0.0",
+ "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"marked-element": "polymerelements/marked-element#^1.0.0",
"prism-element": "PolymerElements/prism-element#^1.0.0"
},
"devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
- "web-component-tester": "polymer/web-component-tester#^3.4.0",
+ "web-component-tester": "^4.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.1.2",
- "paper-styles": "PolymerElements/paper-styles#1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.1.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^1.0.0"
}
}
diff --git a/dashboard-ui/bower_components/iron-demo-helpers/demo-snippet.html b/dashboard-ui/bower_components/iron-demo-helpers/demo-snippet.html
index 15c3a0ca98..e3ef1eee74 100644
--- a/dashboard-ui/bower_components/iron-demo-helpers/demo-snippet.html
+++ b/dashboard-ui/bower_components/iron-demo-helpers/demo-snippet.html
@@ -9,11 +9,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
-->
-
+
+
-
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
+
-
+
-
+
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+