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

minify resources

This commit is contained in:
Luke Pulverenti 2017-01-27 22:16:59 -05:00
parent 8a6884abef
commit 661eeac16e
201 changed files with 203 additions and 52376 deletions

View file

@ -1,73 +1 @@
define(['datetime', 'listView'], function (datetime, listView) {
'use strict';
function isSameDay(date1, date2) {
return date1.toDateString() === date2.toDateString();
}
function renderPrograms(page, result) {
var html = '';
var currentItems = [];
var currentStartDate = null;
for (var i = 0, length = result.Items.length; i < length; i++) {
var item = result.Items[i];
var itemStartDate = datetime.parseISO8601Date(item.StartDate);
if (!currentStartDate || !isSameDay(currentStartDate, itemStartDate)) {
if (currentItems.length) {
html += '<h1>' + datetime.toLocaleDateString(currentStartDate, { weekday: 'long', month: 'long', day: 'numeric' }) + '</h1>';
html += '<div is="emby-itemscontainer" class="vertical-list">' + listView.getListViewHtml({
items: currentItems,
enableUserDataButtons: false,
showParentTitle: true,
image: false,
showProgramTime: true,
mediaInfo: false,
parentTitleWithTitle: true
}) + '</div>';
}
currentStartDate = itemStartDate;
currentItems = [];
}
currentItems.push(item);
}
page.querySelector('#childrenContent').innerHTML = html;
}
function loadPrograms(page, channelId) {
ApiClient.getLiveTvPrograms({
ChannelIds: channelId,
UserId: Dashboard.getCurrentUserId(),
HasAired: false,
SortBy: "StartDate",
EnableTotalRecordCount: false,
EnableImages: false,
ImageTypeLimit: 0,
EnableUserData: false
}).then(function (result) {
renderPrograms(page, result);
Dashboard.hideLoadingMsg();
});
}
return {
renderPrograms: loadPrograms
};
});
define(["datetime","listView"],function(datetime,listView){"use strict";function isSameDay(date1,date2){return date1.toDateString()===date2.toDateString()}function renderPrograms(page,result){for(var html="",currentItems=[],currentStartDate=null,i=0,length=result.Items.length;i<length;i++){var item=result.Items[i],itemStartDate=datetime.parseISO8601Date(item.StartDate);currentStartDate&&isSameDay(currentStartDate,itemStartDate)||(currentItems.length&&(html+="<h1>"+datetime.toLocaleDateString(currentStartDate,{weekday:"long",month:"long",day:"numeric"})+"</h1>",html+='<div is="emby-itemscontainer" class="vertical-list">'+listView.getListViewHtml({items:currentItems,enableUserDataButtons:!1,showParentTitle:!0,image:!1,showProgramTime:!0,mediaInfo:!1,parentTitleWithTitle:!0})+"</div>"),currentStartDate=itemStartDate,currentItems=[]),currentItems.push(item)}page.querySelector("#childrenContent").innerHTML=html}function loadPrograms(page,channelId){ApiClient.getLiveTvPrograms({ChannelIds:channelId,UserId:Dashboard.getCurrentUserId(),HasAired:!1,SortBy:"StartDate",EnableTotalRecordCount:!1,EnableImages:!1,ImageTypeLimit:0,EnableUserData:!1}).then(function(result){renderPrograms(page,result),Dashboard.hideLoadingMsg()})}return{renderPrograms:loadPrograms}});