mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
lazy load scripts
This commit is contained in:
parent
7e55abc130
commit
3818349496
27 changed files with 510 additions and 443 deletions
|
@ -259,14 +259,14 @@
|
||||||
@media all and (min-width: 800px) {
|
@media all and (min-width: 800px) {
|
||||||
|
|
||||||
.dashboardDocument .dashboardMenuButton {
|
.dashboardDocument .dashboardMenuButton {
|
||||||
display: none;
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (max-width: 800px) {
|
@media all and (max-width: 800px) {
|
||||||
|
|
||||||
.dashboardDocument .libraryMenuButton {
|
.dashboardDocument .libraryMenuButton {
|
||||||
display: none;
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,10 +282,10 @@
|
||||||
|
|
||||||
/* They can use the left menu */
|
/* They can use the left menu */
|
||||||
.dashboardEntryHeaderButton {
|
.dashboardEntryHeaderButton {
|
||||||
display: none;
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.libraryDocument .dashboardMenuButton {
|
.libraryDocument .dashboardMenuButton {
|
||||||
display: none;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="liveTvChannelPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}">
|
<div id="liveTvChannelPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}" data-require="scripts/livetvcomponents,scripts/livetvchannel">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
||||||
<a href="livetvguide.html">${TabGuide}</a>
|
<a href="livetvguide.html">${TabGuide}</a>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="liveTvGuidePage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}">
|
<div id="liveTvGuidePage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}" data-require="scripts/registrationservices,scripts/livetvcomponents,scripts/livetvguide">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
||||||
<a href="livetvguide.html" class="ui-btn-active">${TabGuide}</a>
|
<a href="livetvguide.html" class="ui-btn-active">${TabGuide}</a>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="liveTvNewRecordingPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}">
|
<div id="liveTvNewRecordingPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}" data-require="scripts/livetvcomponents,scripts/livetvnewrecording">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
||||||
<a href="livetvguide.html">${TabGuide}</a>
|
<a href="livetvguide.html">${TabGuide}</a>
|
||||||
|
@ -116,9 +116,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
|
||||||
$('.liveTvNewRecordingForm').off('submit', LiveTvNewRecordingPage.onSubmit).on('submit', LiveTvNewRecordingPage.onSubmit);
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="liveTvProgramPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}">
|
<div id="liveTvProgramPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}" data-require="scripts/livetvcomponents,scripts/livetvprogram">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
||||||
<a href="livetvguide.html">${TabGuide}</a>
|
<a href="livetvguide.html">${TabGuide}</a>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="liveTvRecordingPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}">
|
<div id="liveTvRecordingPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}" data-require="scripts/livetvcomponents">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
||||||
<a href="livetvguide.html">${TabGuide}</a>
|
<a href="livetvguide.html">${TabGuide}</a>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="liveTvRecordingListPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}">
|
<div id="liveTvRecordingListPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}" data-require="scripts/livetvrecordinglist">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
||||||
<a href="livetvguide.html">${TabGuide}</a>
|
<a href="livetvguide.html">${TabGuide}</a>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="liveTvSeriesTimerPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}">
|
<div id="liveTvSeriesTimerPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}" data-require="scripts/livetvcomponents">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
||||||
<a href="livetvguide.html">${TabGuide}</a>
|
<a href="livetvguide.html">${TabGuide}</a>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="liveTvTimerPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}">
|
<div id="liveTvTimerPage" data-role="page" class="page libraryPage liveTvPage" data-contextname="${HeaderLiveTv}" data-require="scripts/livetvcomponents">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
<a href="livetvsuggested.html">${TabSuggestions}</a>
|
||||||
<a href="livetvguide.html">${TabGuide}</a>
|
<a href="livetvguide.html">${TabGuide}</a>
|
||||||
|
|
|
@ -2619,6 +2619,56 @@
|
||||||
elem.lazyChildren();
|
elem.lazyChildren();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
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 + ':';
|
||||||
|
|
||||||
|
if (minutes < 10) {
|
||||||
|
text += '0';
|
||||||
|
}
|
||||||
|
text += minutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
},
|
||||||
|
|
||||||
getMiscInfoHtml: function (item) {
|
getMiscInfoHtml: function (item) {
|
||||||
|
|
||||||
var miscInfo = [];
|
var miscInfo = [];
|
||||||
|
@ -2649,7 +2699,7 @@
|
||||||
miscInfo.push(text);
|
miscInfo.push(text);
|
||||||
|
|
||||||
if (item.Type != "Recording") {
|
if (item.Type != "Recording") {
|
||||||
text = LiveTvHelpers.getDisplayTime(date);
|
text = LibraryBrowser.getDisplayTime(date);
|
||||||
miscInfo.push(text);
|
miscInfo.push(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '<div class="' + cssClass + '">';
|
html += '<div class="' + cssClass + '">';
|
||||||
html += '<div class="tvProgramTimeSlotInner">' + LiveTvHelpers.getDisplayTime(startDate) + '</div>';
|
html += '<div class="tvProgramTimeSlotInner">' + LibraryBrowser.getDisplayTime(startDate) + '</div>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
cssClass = "tvProgramInfo";
|
cssClass = "tvProgramInfo";
|
||||||
|
@ -162,154 +162,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.LiveTvHelpers = {
|
$(document).on('pageinitdepends', "#liveTvChannelPage", function () {
|
||||||
|
|
||||||
getDaysOfWeek: function () {
|
|
||||||
|
|
||||||
var days = [
|
|
||||||
'Sunday',
|
|
||||||
'Monday',
|
|
||||||
'Tuesday',
|
|
||||||
'Wednesday',
|
|
||||||
'Thursday',
|
|
||||||
'Friday',
|
|
||||||
'Saturday'
|
|
||||||
];
|
|
||||||
|
|
||||||
return days.map(function (d) {
|
|
||||||
|
|
||||||
return {
|
|
||||||
name: d,
|
|
||||||
value: d
|
|
||||||
};
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
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 + ':';
|
|
||||||
|
|
||||||
if (minutes < 10) {
|
|
||||||
text += '0';
|
|
||||||
}
|
|
||||||
text += minutes;
|
|
||||||
}
|
|
||||||
|
|
||||||
return text;
|
|
||||||
},
|
|
||||||
|
|
||||||
renderMiscProgramInfo: function (elem, obj) {
|
|
||||||
|
|
||||||
var html = [];
|
|
||||||
|
|
||||||
if (obj.IsSeries && !obj.IsRepeat) {
|
|
||||||
|
|
||||||
html.push('<span class="newTvProgram">'+Globalize.translate('LabelNewProgram')+'</span>');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.IsLive) {
|
|
||||||
|
|
||||||
html.push('<span class="liveTvProgram">'+Globalize.translate('LabelLiveProgram')+'</span>');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.ChannelId) {
|
|
||||||
html.push('<a class="textlink" href="livetvchannel.html?id=' + obj.ChannelId + '">' + obj.ChannelName + '</a>');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.IsHD) {
|
|
||||||
|
|
||||||
html.push(Globalize.translate('LabelHDProgram'));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.Audio) {
|
|
||||||
|
|
||||||
html.push(obj.Audio);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
html = html.join(' ');
|
|
||||||
|
|
||||||
if (obj.SeriesTimerId) {
|
|
||||||
html += '<a href="livetvseriestimer.html?id=' + obj.SeriesTimerId + '" title="'+Globalize.translate('ButtonViewSeriesRecording')+'">';
|
|
||||||
html += '<div class="timerCircle seriesTimerCircle"></div>';
|
|
||||||
html += '<div class="timerCircle seriesTimerCircle"></div>';
|
|
||||||
html += '<div class="timerCircle seriesTimerCircle"></div>';
|
|
||||||
html += '</a>';
|
|
||||||
}
|
|
||||||
else if (obj.TimerId) {
|
|
||||||
|
|
||||||
html += '<a href="livetvtimer.html?id=' + obj.TimerId + '">';
|
|
||||||
html += '<div class="timerCircle"></div>';
|
|
||||||
html += '</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
elem.html(html).trigger('create');
|
|
||||||
},
|
|
||||||
|
|
||||||
renderOriginalAirDate: function (elem, item) {
|
|
||||||
|
|
||||||
var airDate = item.OriginalAirDate;
|
|
||||||
|
|
||||||
if (airDate && item.IsRepeat) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
airDate = parseISO8601Date(airDate, { toLocal: true }).toLocaleDateString();
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
console.log("Error parsing date: " + airDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
elem.html(Globalize.translate('ValueOriginalAirDate').replace('{0}', airDate)).show();
|
|
||||||
} else {
|
|
||||||
elem.hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
$(document).on('pageinit', "#liveTvChannelPage", function () {
|
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -323,7 +176,7 @@
|
||||||
Dashboard.navigate("edititemmetadata.html?channelid=" + currentItem.Id);
|
Dashboard.navigate("edititemmetadata.html?channelid=" + currentItem.Id);
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pageshow', "#liveTvChannelPage", function () {
|
}).on('pageshowready', "#liveTvChannelPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
|
291
dashboard-ui/scripts/livetvcomponents.js
Normal file
291
dashboard-ui/scripts/livetvcomponents.js
Normal file
|
@ -0,0 +1,291 @@
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
window.LiveTvHelpers = {
|
||||||
|
|
||||||
|
getDaysOfWeek: function () {
|
||||||
|
|
||||||
|
var days = [
|
||||||
|
'Sunday',
|
||||||
|
'Monday',
|
||||||
|
'Tuesday',
|
||||||
|
'Wednesday',
|
||||||
|
'Thursday',
|
||||||
|
'Friday',
|
||||||
|
'Saturday'
|
||||||
|
];
|
||||||
|
|
||||||
|
return days.map(function (d) {
|
||||||
|
|
||||||
|
return {
|
||||||
|
name: d,
|
||||||
|
value: d
|
||||||
|
};
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
renderMiscProgramInfo: function (elem, obj) {
|
||||||
|
|
||||||
|
var html = [];
|
||||||
|
|
||||||
|
if (obj.IsSeries && !obj.IsRepeat) {
|
||||||
|
|
||||||
|
html.push('<span class="newTvProgram">' + Globalize.translate('LabelNewProgram') + '</span>');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (obj.IsLive) {
|
||||||
|
|
||||||
|
html.push('<span class="liveTvProgram">' + Globalize.translate('LabelLiveProgram') + '</span>');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (obj.ChannelId) {
|
||||||
|
html.push('<a class="textlink" href="livetvchannel.html?id=' + obj.ChannelId + '">' + obj.ChannelName + '</a>');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (obj.IsHD) {
|
||||||
|
|
||||||
|
html.push(Globalize.translate('LabelHDProgram'));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (obj.Audio) {
|
||||||
|
|
||||||
|
html.push(obj.Audio);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
html = html.join(' ');
|
||||||
|
|
||||||
|
if (obj.SeriesTimerId) {
|
||||||
|
html += '<a href="livetvseriestimer.html?id=' + obj.SeriesTimerId + '" title="' + Globalize.translate('ButtonViewSeriesRecording') + '">';
|
||||||
|
html += '<div class="timerCircle seriesTimerCircle"></div>';
|
||||||
|
html += '<div class="timerCircle seriesTimerCircle"></div>';
|
||||||
|
html += '<div class="timerCircle seriesTimerCircle"></div>';
|
||||||
|
html += '</a>';
|
||||||
|
}
|
||||||
|
else if (obj.TimerId) {
|
||||||
|
|
||||||
|
html += '<a href="livetvtimer.html?id=' + obj.TimerId + '">';
|
||||||
|
html += '<div class="timerCircle"></div>';
|
||||||
|
html += '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
elem.html(html).trigger('create');
|
||||||
|
},
|
||||||
|
|
||||||
|
renderOriginalAirDate: function (elem, item) {
|
||||||
|
|
||||||
|
var airDate = item.OriginalAirDate;
|
||||||
|
|
||||||
|
if (airDate && item.IsRepeat) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
airDate = parseISO8601Date(airDate, { toLocal: true }).toLocaleDateString();
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log("Error parsing date: " + airDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
elem.html(Globalize.translate('ValueOriginalAirDate').replace('{0}', airDate)).show();
|
||||||
|
} else {
|
||||||
|
elem.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
|
(function ($, document, window) {
|
||||||
|
|
||||||
|
var showOverlayTimeout;
|
||||||
|
var hideOverlayTimeout;
|
||||||
|
var currentPosterItem;
|
||||||
|
|
||||||
|
function onOverlayMouseOver() {
|
||||||
|
|
||||||
|
if (hideOverlayTimeout) {
|
||||||
|
clearTimeout(hideOverlayTimeout);
|
||||||
|
hideOverlayTimeout = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onOverlayMouseOut() {
|
||||||
|
|
||||||
|
startHideOverlayTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
function getOverlayHtml(item) {
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
html += '<div class="itemOverlayContent">';
|
||||||
|
|
||||||
|
if (item.EpisodeTitle) {
|
||||||
|
html += '<p>';
|
||||||
|
html += item.EpisodeTitle;
|
||||||
|
html += '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<p class="itemMiscInfo miscTvProgramInfo"></p>';
|
||||||
|
|
||||||
|
html += '<p style="margin: 1.25em 0;">';
|
||||||
|
html += '<span class="itemCommunityRating">';
|
||||||
|
html += LibraryBrowser.getRatingHtml(item);
|
||||||
|
html += '</span>';
|
||||||
|
html += '<span class="userDataIcons">';
|
||||||
|
html += LibraryBrowser.getUserDataIconsHtml(item);
|
||||||
|
html += '</span>';
|
||||||
|
html += '</p>';
|
||||||
|
|
||||||
|
html += '<p class="itemGenres"></p>';
|
||||||
|
|
||||||
|
html += '<p class="itemOverlayHtml">';
|
||||||
|
html += (item.Overview || '');
|
||||||
|
html += '</p>';
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
function showOverlay(elem, item) {
|
||||||
|
|
||||||
|
$('.itemFlyout').popup('close').remove();
|
||||||
|
|
||||||
|
var html = '<div data-role="popup" class="itemFlyout" data-theme="b" data-arrow="true" data-history="false">';
|
||||||
|
|
||||||
|
html += '<div class="ui-bar-b" style="text-align:center;">';
|
||||||
|
html += '<h3 style="margin: .5em 0;padding:0 1em;font-weight:normal;">' + item.Name + '</h3>';
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
html += '<div style="padding: 0 1em;">';
|
||||||
|
html += getOverlayHtml(item);
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
$('.itemFlyout').popup('close').popup('destroy').remove();
|
||||||
|
|
||||||
|
$(document.body).append(html);
|
||||||
|
|
||||||
|
var popup = $('.itemFlyout').on('mouseenter', onOverlayMouseOver).on('mouseleave', onOverlayMouseOut).popup({
|
||||||
|
|
||||||
|
positionTo: elem
|
||||||
|
|
||||||
|
}).trigger('create').popup("open").on("popupafterclose", function () {
|
||||||
|
|
||||||
|
$(this).off("popupafterclose").off("mouseenter").off("mouseleave").remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
LibraryBrowser.renderGenres($('.itemGenres', popup), item, 'livetv', 3);
|
||||||
|
LiveTvHelpers.renderMiscProgramInfo($('.miscTvProgramInfo', popup), item);
|
||||||
|
|
||||||
|
popup.parents().prev('.ui-popup-screen').remove();
|
||||||
|
currentPosterItem = elem;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onProgramClicked() {
|
||||||
|
|
||||||
|
if (showOverlayTimeout) {
|
||||||
|
clearTimeout(showOverlayTimeout);
|
||||||
|
showOverlayTimeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hideOverlayTimeout) {
|
||||||
|
clearTimeout(hideOverlayTimeout);
|
||||||
|
hideOverlayTimeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
hideOverlay();
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideOverlay() {
|
||||||
|
|
||||||
|
$('.itemFlyout').popup('close').remove();
|
||||||
|
|
||||||
|
if (currentPosterItem) {
|
||||||
|
|
||||||
|
$(currentPosterItem).off('click.overlay');
|
||||||
|
currentPosterItem = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function startHideOverlayTimer() {
|
||||||
|
|
||||||
|
if (hideOverlayTimeout) {
|
||||||
|
clearTimeout(hideOverlayTimeout);
|
||||||
|
hideOverlayTimeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
hideOverlayTimeout = setTimeout(hideOverlay, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onHoverOut() {
|
||||||
|
|
||||||
|
if (showOverlayTimeout) {
|
||||||
|
clearTimeout(showOverlayTimeout);
|
||||||
|
showOverlayTimeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
startHideOverlayTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.createGuideHoverMenu = function (childSelector) {
|
||||||
|
|
||||||
|
function onShowTimerExpired(elem) {
|
||||||
|
|
||||||
|
var id = elem.getAttribute('data-programid');
|
||||||
|
|
||||||
|
ApiClient.getLiveTvProgram(id, Dashboard.getCurrentUserId()).done(function (item) {
|
||||||
|
|
||||||
|
showOverlay(elem, item);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onHoverIn() {
|
||||||
|
|
||||||
|
if (showOverlayTimeout) {
|
||||||
|
clearTimeout(showOverlayTimeout);
|
||||||
|
showOverlayTimeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hideOverlayTimeout) {
|
||||||
|
clearTimeout(hideOverlayTimeout);
|
||||||
|
hideOverlayTimeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var elem = this;
|
||||||
|
|
||||||
|
if (currentPosterItem) {
|
||||||
|
if (currentPosterItem && currentPosterItem == elem) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
hideOverlay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
showOverlayTimeout = setTimeout(function () {
|
||||||
|
|
||||||
|
onShowTimerExpired(elem);
|
||||||
|
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/
|
||||||
|
|
||||||
|
if (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)) {
|
||||||
|
/* browser with either Touch Events of Pointer Events
|
||||||
|
running on touch-capable device */
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.on('mouseenter', childSelector, onHoverIn)
|
||||||
|
.on('mouseleave', childSelector, onHoverOut)
|
||||||
|
.on('click', childSelector, onProgramClicked);
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery, document, window);
|
|
@ -7,12 +7,16 @@
|
||||||
|
|
||||||
var currentDate;
|
var currentDate;
|
||||||
|
|
||||||
|
var defaultChannels = 50;
|
||||||
|
var channelLimit = 1000;
|
||||||
|
|
||||||
var channelQuery = {
|
var channelQuery = {
|
||||||
|
|
||||||
StartIndex: 0,
|
StartIndex: 0,
|
||||||
Limit: 50,
|
Limit: defaultChannels,
|
||||||
EnableFavoriteSorting: true
|
EnableFavoriteSorting: true
|
||||||
};
|
};
|
||||||
|
|
||||||
var channelsPromise;
|
var channelsPromise;
|
||||||
|
|
||||||
function showLoadingMessage(page) {
|
function showLoadingMessage(page) {
|
||||||
|
@ -51,6 +55,8 @@
|
||||||
|
|
||||||
channelQuery.userId = Dashboard.getCurrentUserId();
|
channelQuery.userId = Dashboard.getCurrentUserId();
|
||||||
|
|
||||||
|
channelQuery.Limit = Math.min(channelQuery.Limit || defaultChannels, channelLimit);
|
||||||
|
|
||||||
channelsPromise = channelsPromise || ApiClient.getLiveTvChannels(channelQuery);
|
channelsPromise = channelsPromise || ApiClient.getLiveTvChannels(channelQuery);
|
||||||
|
|
||||||
var date = currentDate;
|
var date = currentDate;
|
||||||
|
@ -103,14 +109,14 @@
|
||||||
// clone
|
// clone
|
||||||
startDate = new Date(startDate.getTime());
|
startDate = new Date(startDate.getTime());
|
||||||
|
|
||||||
html += '<div class="timeslotHeadersInner">'
|
html += '<div class="timeslotHeadersInner">';
|
||||||
|
|
||||||
while (startDate.getTime() < endDateTime) {
|
while (startDate.getTime() < endDateTime) {
|
||||||
|
|
||||||
html += '<div class="timeslotHeader">';
|
html += '<div class="timeslotHeader">';
|
||||||
html += '<div class="timeslotHeaderInner">';
|
html += '<div class="timeslotHeaderInner">';
|
||||||
|
|
||||||
html += LiveTvHelpers.getDisplayTime(startDate);
|
html += LibraryBrowser.getDisplayTime(startDate);
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
|
@ -223,9 +229,9 @@
|
||||||
html += '<span class="newTvProgram">' + Globalize.translate('LabelNewProgram') + ' </span>';
|
html += '<span class="newTvProgram">' + Globalize.translate('LabelNewProgram') + ' </span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += LiveTvHelpers.getDisplayTime(program.StartDateLocal);
|
html += LibraryBrowser.getDisplayTime(program.StartDateLocal);
|
||||||
html += ' - ';
|
html += ' - ';
|
||||||
html += LiveTvHelpers.getDisplayTime(program.EndDateLocal);
|
html += LibraryBrowser.getDisplayTime(program.EndDateLocal);
|
||||||
|
|
||||||
if (program.SeriesTimerId) {
|
if (program.SeriesTimerId) {
|
||||||
html += '<div class="timerCircle seriesTimerCircle"></div>';
|
html += '<div class="timerCircle seriesTimerCircle"></div>';
|
||||||
|
@ -385,7 +391,7 @@
|
||||||
changeDate(page, date);
|
changeDate(page, date);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#liveTvGuidePage", function () {
|
$(document).on('pageinitdepends', "#liveTvGuidePage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -433,7 +439,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}).on('pageshow', "#liveTvGuidePage", function () {
|
}).on('pageshowready', "#liveTvGuidePage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -443,196 +449,4 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document);
|
})(jQuery, document);
|
||||||
|
|
||||||
(function ($, document, window) {
|
|
||||||
|
|
||||||
var showOverlayTimeout;
|
|
||||||
var hideOverlayTimeout;
|
|
||||||
var currentPosterItem;
|
|
||||||
|
|
||||||
function onOverlayMouseOver() {
|
|
||||||
|
|
||||||
if (hideOverlayTimeout) {
|
|
||||||
clearTimeout(hideOverlayTimeout);
|
|
||||||
hideOverlayTimeout = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onOverlayMouseOut() {
|
|
||||||
|
|
||||||
startHideOverlayTimer();
|
|
||||||
}
|
|
||||||
|
|
||||||
function getOverlayHtml(item) {
|
|
||||||
|
|
||||||
var html = '';
|
|
||||||
|
|
||||||
html += '<div class="itemOverlayContent">';
|
|
||||||
|
|
||||||
if (item.EpisodeTitle) {
|
|
||||||
html += '<p>';
|
|
||||||
html += item.EpisodeTitle;
|
|
||||||
html += '</p>';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '<p class="itemMiscInfo miscTvProgramInfo"></p>';
|
|
||||||
|
|
||||||
html += '<p style="margin: 1.25em 0;">';
|
|
||||||
html += '<span class="itemCommunityRating">';
|
|
||||||
html += LibraryBrowser.getRatingHtml(item);
|
|
||||||
html += '</span>';
|
|
||||||
html += '<span class="userDataIcons">';
|
|
||||||
html += LibraryBrowser.getUserDataIconsHtml(item);
|
|
||||||
html += '</span>';
|
|
||||||
html += '</p>';
|
|
||||||
|
|
||||||
html += '<p class="itemGenres"></p>';
|
|
||||||
|
|
||||||
html += '<p class="itemOverlayHtml">';
|
|
||||||
html += (item.Overview || '');
|
|
||||||
html += '</p>';
|
|
||||||
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
return html;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showOverlay(elem, item) {
|
|
||||||
|
|
||||||
$('.itemFlyout').popup('close').remove();
|
|
||||||
|
|
||||||
var html = '<div data-role="popup" class="itemFlyout" data-theme="b" data-arrow="true" data-history="false">';
|
|
||||||
|
|
||||||
html += '<div class="ui-bar-b" style="text-align:center;">';
|
|
||||||
html += '<h3 style="margin: .5em 0;padding:0 1em;font-weight:normal;">' + item.Name + '</h3>';
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
html += '<div style="padding: 0 1em;">';
|
|
||||||
html += getOverlayHtml(item);
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
$('.itemFlyout').popup('close').popup('destroy').remove();
|
|
||||||
|
|
||||||
$(document.body).append(html);
|
|
||||||
|
|
||||||
var popup = $('.itemFlyout').on('mouseenter', onOverlayMouseOver).on('mouseleave', onOverlayMouseOut).popup({
|
|
||||||
|
|
||||||
positionTo: elem
|
|
||||||
|
|
||||||
}).trigger('create').popup("open").on("popupafterclose", function () {
|
|
||||||
|
|
||||||
$(this).off("popupafterclose").off("mouseenter").off("mouseleave").remove();
|
|
||||||
});
|
|
||||||
|
|
||||||
LibraryBrowser.renderGenres($('.itemGenres', popup), item, 'livetv', 3);
|
|
||||||
LiveTvHelpers.renderMiscProgramInfo($('.miscTvProgramInfo', popup), item);
|
|
||||||
|
|
||||||
popup.parents().prev('.ui-popup-screen').remove();
|
|
||||||
currentPosterItem = elem;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onProgramClicked() {
|
|
||||||
|
|
||||||
if (showOverlayTimeout) {
|
|
||||||
clearTimeout(showOverlayTimeout);
|
|
||||||
showOverlayTimeout = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hideOverlayTimeout) {
|
|
||||||
clearTimeout(hideOverlayTimeout);
|
|
||||||
hideOverlayTimeout = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
hideOverlay();
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideOverlay() {
|
|
||||||
|
|
||||||
$('.itemFlyout').popup('close').remove();
|
|
||||||
|
|
||||||
if (currentPosterItem) {
|
|
||||||
|
|
||||||
$(currentPosterItem).off('click.overlay');
|
|
||||||
currentPosterItem = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function startHideOverlayTimer() {
|
|
||||||
|
|
||||||
if (hideOverlayTimeout) {
|
|
||||||
clearTimeout(hideOverlayTimeout);
|
|
||||||
hideOverlayTimeout = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
hideOverlayTimeout = setTimeout(hideOverlay, 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onHoverOut() {
|
|
||||||
|
|
||||||
if (showOverlayTimeout) {
|
|
||||||
clearTimeout(showOverlayTimeout);
|
|
||||||
showOverlayTimeout = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
startHideOverlayTimer();
|
|
||||||
}
|
|
||||||
|
|
||||||
$.fn.createGuideHoverMenu = function (childSelector) {
|
|
||||||
|
|
||||||
function onShowTimerExpired(elem) {
|
|
||||||
|
|
||||||
var id = elem.getAttribute('data-programid');
|
|
||||||
|
|
||||||
ApiClient.getLiveTvProgram(id, Dashboard.getCurrentUserId()).done(function (item) {
|
|
||||||
|
|
||||||
showOverlay(elem, item);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function onHoverIn() {
|
|
||||||
|
|
||||||
if (showOverlayTimeout) {
|
|
||||||
clearTimeout(showOverlayTimeout);
|
|
||||||
showOverlayTimeout = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hideOverlayTimeout) {
|
|
||||||
clearTimeout(hideOverlayTimeout);
|
|
||||||
hideOverlayTimeout = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var elem = this;
|
|
||||||
|
|
||||||
if (currentPosterItem) {
|
|
||||||
if (currentPosterItem && currentPosterItem == elem) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
hideOverlay();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
showOverlayTimeout = setTimeout(function () {
|
|
||||||
|
|
||||||
onShowTimerExpired(elem);
|
|
||||||
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/
|
|
||||||
|
|
||||||
if (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)) {
|
|
||||||
/* browser with either Touch Events of Pointer Events
|
|
||||||
running on touch-capable device */
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.on('mouseenter', childSelector, onHoverIn)
|
|
||||||
.on('mouseleave', childSelector, onHoverOut)
|
|
||||||
.on('click', childSelector, onProgramClicked);
|
|
||||||
};
|
|
||||||
|
|
||||||
})(jQuery, document, window);
|
|
|
@ -145,13 +145,7 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.LiveTvNewRecordingPage = {
|
$(document).on('pageinitdepends', "#liveTvNewRecordingPage", function () {
|
||||||
|
|
||||||
onSubmit: onSubmit
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
$(document).on('pageinit', "#liveTvNewRecordingPage", function () {
|
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -173,7 +167,9 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pagebeforeshow', "#liveTvNewRecordingPage", function () {
|
$('.liveTvNewRecordingForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||||
|
|
||||||
|
}).on('pagebeforeshowready', "#liveTvNewRecordingPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#liveTvProgramPage", function () {
|
$(document).on('pageinitdepends', "#liveTvProgramPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
deleteTimer(page, currentItem.TimerId);
|
deleteTimer(page, currentItem.TimerId);
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pageshow', "#liveTvProgramPage", function () {
|
}).on('pageshowready', "#liveTvProgramPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#liveTvRecordingPage", function () {
|
$(document).on('pageinitdepends', "#liveTvRecordingPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pagebeforeshow', "#liveTvRecordingPage", function () {
|
}).on('pagebeforeshowready', "#liveTvRecordingPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
|
|
@ -67,12 +67,12 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#liveTvRecordingListPage", function () {
|
$(document).on('pageinitdepends', "#liveTvRecordingListPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
|
||||||
}).on('pagebeforeshow', "#liveTvRecordingListPage", function () {
|
}).on('pageshowready', "#liveTvRecordingListPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -101,8 +101,6 @@
|
||||||
$('.listName', page).html(Globalize.translate('HeaderAllRecordings'));
|
$('.listName', page).html(Globalize.translate('HeaderAllRecordings'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}).on('pageshow', "#liveTvRecordingListPage", function () {
|
|
||||||
|
|
||||||
updateFilterControls(this);
|
updateFilterControls(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
$('.time', page).html(Globalize.translate('LabelAnytime')).trigger('create');
|
$('.time', page).html(Globalize.translate('LabelAnytime')).trigger('create');
|
||||||
}
|
}
|
||||||
else if (item.ChannelId) {
|
else if (item.ChannelId) {
|
||||||
$('.time', page).html(LiveTvHelpers.getDisplayTime(item.StartDate)).trigger('create');
|
$('.time', page).html(LibraryBrowser.getDisplayTime(item.StartDate)).trigger('create');
|
||||||
}
|
}
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
|
@ -198,8 +198,8 @@
|
||||||
html += '<span class="newTvProgram">' + Globalize.translate('LabelNewProgram') + ' </span>';
|
html += '<span class="newTvProgram">' + Globalize.translate('LabelNewProgram') + ' </span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += LiveTvHelpers.getDisplayTime(timer.StartDate);
|
html += LibraryBrowser.getDisplayTime(timer.StartDate);
|
||||||
html += ' - ' + LiveTvHelpers.getDisplayTime(timer.EndDate);
|
html += ' - ' + LibraryBrowser.getDisplayTime(timer.EndDate);
|
||||||
html += '</p>';
|
html += '</p>';
|
||||||
|
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#liveTvSeriesTimerPage", function () {
|
$(document).on('pageinitdepends', "#liveTvSeriesTimerPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pagebeforeshow', "#liveTvSeriesTimerPage", function () {
|
}).on('pagebeforeshowready', "#liveTvSeriesTimerPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
html += ' - ' + Globalize.translate('LabelAnytime');
|
html += ' - ' + Globalize.translate('LabelAnytime');
|
||||||
} else {
|
} else {
|
||||||
html += ' - ' + LiveTvHelpers.getDisplayTime(timer.StartDate);
|
html += ' - ' + LibraryBrowser.getDisplayTime(timer.StartDate);
|
||||||
}
|
}
|
||||||
html += '</p>';
|
html += '</p>';
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#liveTvTimerPage", function () {
|
$(document).on('pageinitdepends', "#liveTvTimerPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pagebeforeshow', "#liveTvTimerPage", function () {
|
}).on('pagebeforeshowready', "#liveTvTimerPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,8 @@
|
||||||
html += '</h3>';
|
html += '</h3>';
|
||||||
|
|
||||||
html += '<p>';
|
html += '<p>';
|
||||||
html += LiveTvHelpers.getDisplayTime(timer.StartDate);
|
html += LibraryBrowser.getDisplayTime(timer.StartDate);
|
||||||
html += ' - ' + LiveTvHelpers.getDisplayTime(timer.EndDate);
|
html += ' - ' + LibraryBrowser.getDisplayTime(timer.EndDate);
|
||||||
html += '</p>';
|
html += '</p>';
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
var text = date.toLocaleDateString();
|
var text = date.toLocaleDateString();
|
||||||
|
|
||||||
text += ' ' + LiveTvHelpers.getDisplayTime(date);
|
text += ' ' + LibraryBrowser.getDisplayTime(date);
|
||||||
|
|
||||||
logHtml += '<p>' + text + '</p>';
|
logHtml += '<p>' + text + '</p>';
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
function triggerPlayerChange(newPlayer, newTarget) {
|
function triggerPlayerChange(newPlayer, newTarget) {
|
||||||
|
|
||||||
$(self).trigger('playerchange', [newPlayer, newTarget]);
|
$(self).trigger('playerchange', [newPlayer, newTarget]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,8 +142,8 @@
|
||||||
throw new Error('null player');
|
throw new Error('null player');
|
||||||
}
|
}
|
||||||
|
|
||||||
player.tryPair(targetInfo).done(function() {
|
player.tryPair(targetInfo).done(function () {
|
||||||
|
|
||||||
currentPlayer = player;
|
currentPlayer = player;
|
||||||
currentTargetInfo = targetInfo;
|
currentTargetInfo = targetInfo;
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.getPlayers = function() {
|
self.getPlayers = function () {
|
||||||
return players;
|
return players;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -220,22 +220,35 @@
|
||||||
return deferred.promise();
|
return deferred.promise();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function doWithPlaybackValidation(fn) {
|
||||||
|
|
||||||
|
requirejs(["scripts/registrationservices"], function () {
|
||||||
|
RegistrationServices.validateFeature('playback').done(fn);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
self.play = function (options) {
|
self.play = function (options) {
|
||||||
|
|
||||||
if (typeof (options) === 'string') {
|
doWithPlaybackValidation(function() {
|
||||||
options = { ids: [options] };
|
if (typeof (options) === 'string') {
|
||||||
}
|
options = { ids: [options] };
|
||||||
|
}
|
||||||
|
|
||||||
currentPlayer.play(options);
|
currentPlayer.play(options);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.shuffle = function (id) {
|
self.shuffle = function (id) {
|
||||||
|
|
||||||
currentPlayer.shuffle(id);
|
doWithPlaybackValidation(function () {
|
||||||
|
currentPlayer.shuffle(id);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.instantMix = function (id) {
|
self.instantMix = function (id) {
|
||||||
currentPlayer.instantMix(id);
|
doWithPlaybackValidation(function () {
|
||||||
|
currentPlayer.instantMix(id);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.queue = function (options) {
|
self.queue = function (options) {
|
||||||
|
@ -370,10 +383,6 @@
|
||||||
currentPlayer.volumeUp();
|
currentPlayer.volumeUp();
|
||||||
};
|
};
|
||||||
|
|
||||||
self.shuffle = function (id) {
|
|
||||||
currentPlayer.shuffle(id);
|
|
||||||
};
|
|
||||||
|
|
||||||
self.playlist = function () {
|
self.playlist = function () {
|
||||||
return currentPlayer.playlist || [];
|
return currentPlayer.playlist || [];
|
||||||
};
|
};
|
||||||
|
@ -458,12 +467,12 @@
|
||||||
return bottomText ? topText + '<br/>' + bottomText : topText;
|
return bottomText ? topText + '<br/>' + bottomText : topText;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.showPlaybackInfoErrorMessage = function(errorCode) {
|
self.showPlaybackInfoErrorMessage = function (errorCode) {
|
||||||
|
|
||||||
// This timeout is messy, but if jqm is in the act of hiding a popup, it will not show a new one
|
// This timeout is messy, but if jqm is in the act of hiding a popup, it will not show a new one
|
||||||
// If we're coming from the popup play menu, this will be a problem
|
// If we're coming from the popup play menu, this will be a problem
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
Dashboard.alert({
|
Dashboard.alert({
|
||||||
message: Globalize.translate('MessagePlaybackError' + errorCode),
|
message: Globalize.translate('MessagePlaybackError' + errorCode),
|
||||||
title: Globalize.translate('HeaderPlaybackError')
|
title: Globalize.translate('HeaderPlaybackError')
|
||||||
|
|
|
@ -172,13 +172,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.TranscodingProfiles = [];
|
profile.TranscodingProfiles = [];
|
||||||
profile.TranscodingProfiles.push({
|
|
||||||
Container: 'mp3',
|
if ($.browser.safari) {
|
||||||
Type: 'Audio',
|
profile.TranscodingProfiles.push({
|
||||||
AudioCodec: 'mp3',
|
Container: 'aac',
|
||||||
Context: 'Streaming',
|
Type: 'Audio',
|
||||||
Protocol: 'http'
|
AudioCodec: 'aac',
|
||||||
});
|
Context: 'Streaming',
|
||||||
|
Protocol: 'http'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
profile.TranscodingProfiles.push({
|
||||||
|
Container: 'mp3',
|
||||||
|
Type: 'Audio',
|
||||||
|
AudioCodec: 'mp3',
|
||||||
|
Context: 'Streaming',
|
||||||
|
Protocol: 'http'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (self.canPlayHls()) {
|
if (self.canPlayHls()) {
|
||||||
profile.TranscodingProfiles.push({
|
profile.TranscodingProfiles.push({
|
||||||
|
@ -1670,6 +1681,27 @@
|
||||||
return $('.mediaPlayerAudio');
|
return $('.mediaPlayerAudio');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onTimeUpdate() {
|
||||||
|
|
||||||
|
var currentTicks = self.getCurrentTicks(this);
|
||||||
|
self.setCurrentTime(currentTicks);
|
||||||
|
|
||||||
|
if ($.browser.safari) {
|
||||||
|
|
||||||
|
if (self.currentDurationTicks) {
|
||||||
|
|
||||||
|
// Seeing transcoded audio looping in safari, going past the runtime but restarting the audio
|
||||||
|
if (currentTicks > self.currentDurationTicks) {
|
||||||
|
if (currentPlaylistIndex < self.playlist.length - 1) {
|
||||||
|
self.nextTrack();
|
||||||
|
} else {
|
||||||
|
self.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function playAudio(item, mediaSource, startPositionTicks) {
|
function playAudio(item, mediaSource, startPositionTicks) {
|
||||||
|
|
||||||
var streamInfo = self.createStreamInfo('Audio', item, mediaSource, startPositionTicks);
|
var streamInfo = self.createStreamInfo('Audio', item, mediaSource, startPositionTicks);
|
||||||
|
@ -1720,21 +1752,7 @@
|
||||||
// In the event timeupdate isn't firing, at least we can update when this happens
|
// In the event timeupdate isn't firing, at least we can update when this happens
|
||||||
self.setCurrentTime(self.getCurrentTicks());
|
self.setCurrentTime(self.getCurrentTicks());
|
||||||
|
|
||||||
}).on("timeupdate.mediaplayerevent", function () {
|
}).on("timeupdate.mediaplayerevent", onTimeUpdate)[0];
|
||||||
|
|
||||||
var currentTicks = self.getCurrentTicks(this);
|
|
||||||
// Seeing transcoded audio looping in safari, going past the runtime but restarting the audio
|
|
||||||
if ($.browser.safari && self.currentDurationTicks && (currentTicks > self.currentDurationTicks)) {
|
|
||||||
if (currentPlaylistIndex < self.playlist.length - 1) {
|
|
||||||
self.nextTrack();
|
|
||||||
} else {
|
|
||||||
self.stop();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
self.setCurrentTime(currentTicks);
|
|
||||||
}
|
|
||||||
|
|
||||||
})[0];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var getItemFields = "MediaSources,Chapters";
|
var getItemFields = "MediaSources,Chapters";
|
||||||
|
|
|
@ -114,5 +114,11 @@
|
||||||
|
|
||||||
$('.supporterForm', page).attr('action', 'https://www.paypal.com/cgi-bin/webscr');
|
$('.supporterForm', page).attr('action', 'https://www.paypal.com/cgi-bin/webscr');
|
||||||
$('.recurringSubscriptionCancellationHelp', page).html(Globalize.translate('LabelRecurringDonationCanBeCancelledHelp'));
|
$('.recurringSubscriptionCancellationHelp', page).html(Globalize.translate('LabelRecurringDonationCanBeCancelledHelp'));
|
||||||
|
},
|
||||||
|
|
||||||
|
validateFeature: function () {
|
||||||
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
deferred.resolve();
|
||||||
|
return deferred.promise();
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -62,7 +62,7 @@
|
||||||
|
|
||||||
var date = parseISO8601Date(item.DateCreated, { toLocal: true });
|
var date = parseISO8601Date(item.DateCreated, { toLocal: true });
|
||||||
|
|
||||||
html += date.toLocaleDateString() + ' ' + LiveTvHelpers.getDisplayTime(date);
|
html += date.toLocaleDateString() + ' ' + LibraryBrowser.getDisplayTime(date);
|
||||||
|
|
||||||
html += '</td>';
|
html += '</td>';
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,51 @@
|
||||||
window.RegistrationServices = {
|
(function () {
|
||||||
|
|
||||||
renderPluginInfo: function (page, pkg, pluginSecurityInfo) {
|
function validatePlayback(deferred) {
|
||||||
|
|
||||||
|
var platform = (device.platform || '').toLowerCase();
|
||||||
|
|
||||||
},
|
if (platform.indexOf('android') != -1) {
|
||||||
|
deferred.resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
addRecurringFields: function (page, period) {
|
deferred.resolve();
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
initSupporterForm: function (page) {
|
|
||||||
|
|
||||||
$('.recurringSubscriptionCancellationHelp', page).html('');
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
function validateLiveTV(deferred) {
|
||||||
|
|
||||||
|
deferred.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
|
window.RegistrationServices = {
|
||||||
|
|
||||||
|
renderPluginInfo: function (page, pkg, pluginSecurityInfo) {
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
addRecurringFields: function (page, period) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
initSupporterForm: function (page) {
|
||||||
|
|
||||||
|
$('.recurringSubscriptionCancellationHelp', page).html('');
|
||||||
|
},
|
||||||
|
|
||||||
|
validateFeature: function (name) {
|
||||||
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
|
if (name == 'playback') {
|
||||||
|
validatePlayback();
|
||||||
|
} else if (name == 'livetv') {
|
||||||
|
validateLiveTV();
|
||||||
|
} else {
|
||||||
|
deferred.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
|
return deferred.promise();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
Loading…
Add table
Add a link
Reference in a new issue